/*
Theme Name: LeadHub Theme
Theme URI: https://analys.tech/
Author: LeadHub
Description: Fullscreen SaaS theme for LeadHub analytics dashboard.
Version: 0.2.2
Text Domain: leadhub-theme
*/

/* Base reset */
* { box-sizing: border-box; }
html { margin: 0 !important; }
body {
    margin: 0;
    background: #f4f7fb;
    color: #111827;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}
a { color: inherit; }
img { max-width: 100%; height: auto; }

:root {
    --lh-bg: #f4f7fb;
    --lh-panel: #ffffff;
    --lh-text: #111827;
    --lh-muted: #6b7280;
    --lh-border: #e5e7eb;
    --lh-blue: #2563eb;
    --lh-blue-dark: #1d4ed8;
    --lh-blue-soft: #eff6ff;
    --lh-yellow: #f59e0b;
    --lh-yellow-soft: #fffbeb;
    --lh-green: #10b981;
    --lh-green-soft: #ecfdf5;
    --lh-red: #ef4444;
    --lh-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    --lh-radius: 24px;
}

body.admin-bar .leadhub-sidebar { top: 32px; height: calc(100vh - 32px); }
body.admin-bar .leadhub-app { min-height: calc(100vh - 32px); }

/* Auth */
.leadhub-auth-page {
    min-height: 100vh;
    background: radial-gradient(circle at top left, #dbeafe, transparent 32%), var(--lh-bg);
    color: var(--lh-text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.leadhub-auth-card {
    width: min(440px, 100%);
    background: white;
    border-radius: 28px;
    padding: 44px;
    box-shadow: var(--lh-shadow);
    text-align: center;
    border: 1px solid var(--lh-border);
}
.leadhub-auth-card h1 { margin: 18px 0 8px; font-size: 30px; }
.leadhub-auth-card p { margin: 0 0 24px; color: var(--lh-muted); }
.leadhub-login-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 22px;
    border-radius: 14px;
    background: var(--lh-blue);
    color: #fff;
    text-decoration: none;
    font-weight: 800;
}

/* App */
.leadhub-app {
    min-height: 100vh;
    background: var(--lh-bg);
    color: var(--lh-text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
}
.leadhub-app * { box-sizing: border-box; }

.leadhub-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 28px 18px;
    background: linear-gradient(180deg, #020617 0%, #0f172a 100%);
    color: white;
}
.leadhub-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 900;
    margin-bottom: 34px;
    padding: 0 8px;
}
.leadhub-logo, .leadhub-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, #60a5fa, #2563eb);
    color: white;
    font-weight: 900;
    box-shadow: 0 14px 28px rgba(37, 99, 235, .35);
}
.leadhub-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.leadhub-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 14px;
    border-radius: 14px;
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 750;
}
.leadhub-menu a:hover, .leadhub-menu a.is-active {
    background: var(--lh-blue);
    color: #fff;
}
.leadhub-menu-spacer { flex: 1; }

.leadhub-main {
    min-width: 0;
    padding: 34px 40px 48px;
}
.leadhub-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 28px;
}
.leadhub-header h1,
.leadhub-page-title {
    margin: 0 0 8px;
    font-size: 34px;
    line-height: 1.1;
    letter-spacing: -0.04em;
}
.leadhub-header p,
.leadhub-page-subtitle {
    margin: 0;
    color: var(--lh-muted);
    font-size: 15px;
}
.leadhub-back-link {
    display: inline-flex;
    margin-bottom: 18px;
    color: var(--lh-blue);
    text-decoration: none;
    font-weight: 800;
}

.leadhub-card,
.las-card {
    background: var(--lh-panel);
    border: 1px solid var(--lh-border);
    border-radius: var(--lh-radius);
    box-shadow: var(--lh-shadow);
}
.leadhub-card { padding: 24px; }

.leadhub-kpi-grid,
.las-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}
.leadhub-kpi,
.las-kpi {
    background: white;
    border: 1px solid var(--lh-border);
    border-radius: 22px;
    padding: 22px;
    box-shadow: var(--lh-shadow);
}
.leadhub-kpi-label,
.las-kpi-label { color: var(--lh-muted); font-size: 14px; margin-bottom: 8px; }
.leadhub-kpi-value,
.las-kpi-value { font-size: 32px; font-weight: 900; letter-spacing: -0.04em; }
.leadhub-kpi-note,
.las-kpi-note { margin-top: 8px; color: var(--lh-muted); font-size: 13px; }

.leadhub-filters,
.las-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 12px;
    margin-bottom: 18px;
}
.leadhub-field,
.las-field { display: flex; flex-direction: column; gap: 7px; }
.leadhub-field label,
.las-field label { color: var(--lh-muted); font-size: 13px; font-weight: 750; }
.leadhub-input,
.leadhub-select,
.las-input,
.las-select,
input[type="date"],
input[type="search"],
select {
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--lh-border);
    border-radius: 14px;
    background: white;
    color: var(--lh-text);
    outline: none;
    font: inherit;
}
.leadhub-input:focus,
.leadhub-select:focus,
.las-input:focus,
.las-select:focus,
input[type="date"]:focus,
input[type="search"]:focus,
select:focus { border-color: var(--lh-blue); box-shadow: 0 0 0 4px var(--lh-blue-soft); }
.leadhub-button,
.las-button,
button[type="submit"] {
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 14px;
    background: var(--lh-blue);
    color: white;
    font: inherit;
    font-weight: 850;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.leadhub-button:hover,
.las-button:hover,
button[type="submit"]:hover { background: var(--lh-blue-dark); }
.leadhub-button-secondary,
.las-button-secondary { background: #0f172a; }

.leadhub-sites-grid,
.las-sites-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}
.leadhub-site-card,
.las-site-card {
    display: block;
    padding: 22px;
    background: white;
    border: 1px solid var(--lh-border);
    border-radius: 22px;
    box-shadow: var(--lh-shadow);
    text-decoration: none;
    color: var(--lh-text);
}
.leadhub-site-card:hover,
.las-site-card:hover { transform: translateY(-1px); border-color: #bfdbfe; }
.leadhub-site-title,
.las-site-title { font-size: 20px; font-weight: 900; margin-bottom: 8px; }
.leadhub-site-meta,
.las-site-meta { color: var(--lh-muted); font-size: 14px; }

.leadhub-chart-card,
.las-chart-card { padding: 22px; margin-bottom: 22px; }
.leadhub-mini-chart,
.las-mini-chart { display: flex; align-items: end; gap: 10px; height: 160px; }
.leadhub-mini-chart-item,
.las-mini-chart-item { flex: 1; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 8px; min-width: 38px; }
.leadhub-mini-chart-value,
.las-mini-chart-value { font-size: 12px; color: var(--lh-muted); }
.leadhub-mini-chart-bar-wrap,
.las-mini-chart-bar-wrap { width: 100%; height: 110px; display: flex; align-items: end; justify-content: center; background: #f8fafc; border-radius: 999px; overflow: hidden; }
.leadhub-mini-chart-bar,
.las-mini-chart-bar { width: 100%; min-height: 3px; background: linear-gradient(180deg, #60a5fa, #2563eb); border-radius: 999px; }
.leadhub-mini-chart-label,
.las-mini-chart-label { color: var(--lh-muted); font-size: 12px; }

.leadhub-table-card,
.las-table-card { overflow: hidden; }
.leadhub-table-toolbar,
.las-table-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding: 18px;
    border-bottom: 1px solid var(--lh-border);
}
.leadhub-search,
.las-search { width: min(420px, 100%); }
.leadhub-table-wrap,
.las-table-wrap { overflow-x: auto; }
.leadhub-table,
.las-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}
.leadhub-table th,
.las-table th {
    text-align: left;
    padding: 16px 18px;
    background: #f8fafc;
    color: #475569;
    font-size: 13px;
    font-weight: 900;
    border-bottom: 1px solid var(--lh-border);
    white-space: nowrap;
}
.leadhub-table td,
.las-table td {
    padding: 17px 18px;
    border-bottom: 1px solid var(--lh-border);
    vertical-align: top;
    font-size: 14px;
}
.leadhub-table tbody tr,
.las-table tbody tr { cursor: pointer; }
.leadhub-table tbody tr:hover td,
.las-table tbody tr:hover td { background: #f8fafc; }
.leadhub-row-duplicate td,
.las-row-duplicate td { background: var(--lh-yellow-soft); }
.leadhub-row-details,
.las-row-details { display: none; }
.leadhub-row-details.is-open,
.las-row-details.is-open { display: table-row; }
.leadhub-row-details td,
.las-row-details td { background: #f8fafc !important; }
.leadhub-details-grid,
.las-details-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.leadhub-detail-item,
.las-detail-item {
    background: white;
    border: 1px solid var(--lh-border);
    border-radius: 16px;
    padding: 14px;
}
.leadhub-detail-label,
.las-detail-label { color: var(--lh-muted); font-size: 12px; margin-bottom: 6px; font-weight: 800; }
.leadhub-detail-value,
.las-detail-value { font-weight: 800; word-break: break-word; }

.leadhub-number-badge,
.las-number-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 9px;
    border-radius: 999px;
    background: var(--lh-blue);
    color: white;
    font-weight: 900;
}
.leadhub-number-badge.is-duplicate,
.las-number-badge.is-duplicate { background: var(--lh-yellow); color: #111827; }
.leadhub-source-badge,
.las-source-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--lh-green-soft);
    color: #047857;
    font-weight: 900;
    font-size: 12px;
}
.leadhub-empty,
.las-empty {
    padding: 32px;
    text-align: center;
    color: var(--lh-muted);
}
.leadhub-course-cell,
.las-course-cell { max-width: 520px; }
.leadhub-course-title,
.las-course-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-weight: 800;
}
.leadhub-email-cell,
.las-email-cell { white-space: nowrap; }

/* Settings */
.leadhub-settings-grid,
.las-settings-grid {
    display: grid;
    grid-template-columns: 430px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}
.leadhub-form,
.las-form { display: grid; gap: 15px; }
.leadhub-form-row,
.las-form-row { display: grid; gap: 7px; }
.leadhub-form-row label,
.las-form-row label { font-weight: 900; }
.leadhub-checkbox-row,
.las-checkbox-row { display: flex; align-items: center; gap: 10px; font-weight: 900; }
.leadhub-actions,
.las-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.leadhub-danger,
.las-danger { background: var(--lh-red); }

@media (max-width: 1100px) {
    .leadhub-app { grid-template-columns: 1fr; }
    .leadhub-sidebar { position: static; height: auto; }
    .leadhub-menu { flex-direction: row; flex-wrap: wrap; }
    .leadhub-kpi-grid, .las-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .leadhub-sites-grid, .las-sites-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .leadhub-settings-grid, .las-settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
    .leadhub-main { padding: 24px 16px 36px; }
    .leadhub-header { display: block; }
    .leadhub-kpi-grid, .las-kpi-grid { grid-template-columns: 1fr; }
    .leadhub-sites-grid, .las-sites-grid { grid-template-columns: 1fr; }
    .leadhub-details-grid, .las-details-grid { grid-template-columns: 1fr; }
    .leadhub-table-toolbar, .las-table-toolbar { display: block; }
    .leadhub-search, .las-search { width: 100%; margin-top: 12px; }
}
