/* ============================================================
   LeadEX - Premium SaaS Design System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #071A52;
    --primary-light: #0d2b7a;
    --primary-dark: #040f33;
    --secondary: #67C44C;
    --secondary-light: #7ed466;
    --secondary-dark: #52a33b;
    --accent: #ffffff;

    /* Dark Theme (Default) */
    --bg-primary: #0a0f1a;
    --bg-secondary: #0f1623;
    --bg-tertiary: #151d2e;
    --card-bg: #111827;
    --card-bg-hover: #1a2338;
    --sidebar-bg: #0c1220;
    --border-color: rgba(255,255,255,0.06);
    --border-color-strong: rgba(255,255,255,0.1);
    --text-primary: #f0f4f8;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --hover-bg: rgba(255,255,255,0.04);
    --input-bg: #0f1623;
    --input-border: rgba(255,255,255,0.08);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.2), 0 0 0 1px rgba(255,255,255,0.04);
    --overlay: rgba(0,0,0,0.7);
    --green-glow: rgba(103,196,76,0.15);

    /* Aliases used by dashboard layout */
    --color-secondary: #67C44C;
    --color-danger: #EF4444;
    --body-bg: #0a0f1a;
}

[data-theme="light"] {
    --bg-primary: #f5f7fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f0f2f5;
    --card-bg: #ffffff;
    --card-bg-hover: #f8f9fb;
    --sidebar-bg: #0f1623;
    --border-color: rgba(0,0,0,0.06);
    --border-color-strong: rgba(0,0,0,0.1);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --hover-bg: rgba(0,0,0,0.03);
    --input-bg: #f8f9fb;
    --input-border: rgba(0,0,0,0.1);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.04);
    --overlay: rgba(0,0,0,0.5);
    --green-glow: rgba(103,196,76,0.1);
    --body-bg: #f5f7fa;
}

/* ============ BASE ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', 'DM Sans', sans-serif;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

a { color: var(--secondary); text-decoration: none; transition: all 0.2s ease; }
a:hover { opacity: 0.85; }

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); }

/* ============ LAYOUT ============ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--overlay);
    z-index: 40;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content-area {
    flex: 1;
    padding: 24px 32px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* ============ SIDEBAR STYLES ============ */
.sidebar-brand {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand-icon {
    width: 36px;
    height: 36px;
    background: var(--secondary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
    font-family: 'Outfit', sans-serif;
}

.sidebar-brand-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.sidebar-section {
    margin-bottom: 8px;
}

.sidebar-section-title {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 8px 12px 6px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 450;
    transition: all 0.15s ease;
    position: relative;
    margin-bottom: 1px;
}

.sidebar-link:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
    opacity: 1;
}

.sidebar-link.active {
    background: var(--secondary);
    color: white;
    font-weight: 500;
}

.sidebar-link.active svg { stroke: white; }

.sidebar-link svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    flex-shrink: 0;
    opacity: 0.7;
}

.sidebar-link.active svg { opacity: 1; }

.sidebar-badge {
    margin-left: auto;
    background: var(--secondary);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 10px;
    line-height: 1.6;
}

.sidebar-link.active .sidebar-badge {
    background: rgba(255,255,255,0.25);
}

/* Sidebar User */
.sidebar-user {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* ============ TOP BAR ============ */
.topbar {
    height: 64px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(12px);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-title {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 600;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}

.topbar-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
    border-color: var(--border-color-strong);
}

.topbar-btn svg { width: 18px; height: 18px; }

.notif-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--secondary);
    border-radius: 50%;
    border: 2px solid var(--card-bg);
}

.mobile-toggle {
    display: none;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-secondary);
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.mobile-toggle svg { width: 20px; height: 20px; }

/* ============ SEARCH BAR ============ */
.search-wrapper {
    position: relative;
    width: 280px;
}

.search-input {
    width: 100%;
    height: 38px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 10px;
    padding: 0 12px 0 36px;
    font-size: 13px;
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px var(--green-glow);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.search-kbd {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-family: monospace;
}

/* ============ CARDS ============ */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: var(--shadow-card);
    transition: all 0.2s ease;
}

.card:hover {
    border-color: var(--border-color-strong);
}

.card-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body { padding: 22px; }
.card-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--border-color);
}

/* Stat Cards */
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 22px;
    box-shadow: var(--shadow-card);
    transition: all 0.25s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-color-strong);
}

.stat-card-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.stat-card-icon svg { width: 20px; height: 20px; }

.stat-card-value {
    font-family: 'Outfit', sans-serif;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 400;
}

.stat-card-change {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    font-weight: 500;
    margin-top: 8px;
    padding: 2px 8px;
    border-radius: 6px;
}

.stat-up { color: #34d399; background: rgba(52,211,153,0.1); }
.stat-down { color: #f87171; background: rgba(248,113,113,0.1); }

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
@media (max-width: 1024px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .stats-grid { grid-template-columns: 1fr; } }

/* Card Title */
.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.badge-success { background: rgba(52,211,153,0.1); color: #34d399; }
.badge-warning { background: rgba(245,158,11,0.1); color: #f59e0b; }
.badge-danger { background: rgba(239,68,68,0.1); color: #ef4444; }
.badge-info { background: rgba(59,130,246,0.1); color: #3b82f6; }
.badge-default { background: var(--hover-bg); color: var(--text-secondary); }

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Alert Danger Alias */
.alert-danger { background: rgba(239,68,68,0.08); color: #ef4444; border: 1px solid rgba(239,68,68,0.15); }

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 500;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
}

.btn svg { width: 16px; height: 16px; }
.btn:hover { opacity: 1; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--secondary);
    color: white;
    border-color: var(--secondary);
}

.btn-primary:hover {
    background: var(--secondary-dark);
    box-shadow: 0 4px 12px rgba(103,196,76,0.25);
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-primary);
    border-color: var(--border-color-strong);
}

.btn-secondary:hover {
    background: var(--card-bg-hover);
}

.btn-danger {
    background: rgba(239,68,68,0.1);
    color: #ef4444;
    border-color: rgba(239,68,68,0.2);
}

.btn-danger:hover {
    background: rgba(239,68,68,0.2);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-ghost:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-icon { width: 36px; height: 36px; padding: 0; }
.btn-icon.btn-sm { width: 30px; height: 30px; }

/* ============ FORM ELEMENTS ============ */
.form-group { margin-bottom: 18px; }

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 13.5px;
    font-family: 'DM Sans', sans-serif;
    transition: all 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px var(--green-glow);
}

.form-textarea { min-height: 100px; resize: vertical; }

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-error {
    font-size: 12px;
    color: #ef4444;
    margin-top: 4px;
}

.form-help {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============ TABLE ============ */
.table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 12px 18px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 14px 18px;
    font-size: 13.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr {
    transition: background 0.15s;
}

.data-table tbody tr:hover {
    background: var(--hover-bg);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ============ MODAL ============ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.2s;
}

.modal-overlay.show {
    display: flex;
    opacity: 1;
}

.modal {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 100%;
    max-width: 540px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95);
    transition: transform 0.2s;
}

.modal-overlay.show .modal {
    transform: scale(1);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-family: 'Outfit', sans-serif;
    font-size: 17px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: var(--hover-bg);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.modal-close:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.modal-close svg { width: 18px; height: 18px; }
.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ============ DROPDOWN ============ */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color-strong);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    padding: 6px;
    z-index: 60;
    display: none;
    opacity: 0;
    transform: translateY(-8px);
    transition: all 0.15s;
}

.dropdown-menu.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.12s;
}

.dropdown-item:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
    opacity: 1;
}

.dropdown-item svg { width: 15px; height: 15px; opacity: 0.6; }
.dropdown-divider { height: 1px; background: var(--border-color); margin: 4px 0; }

/* ============ NOTIFICATION DROPDOWN ============ */
.notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 380px;
    background: var(--card-bg);
    border: 1px solid var(--border-color-strong);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    z-index: 60;
    display: none;
    max-height: 480px;
    overflow: hidden;
}

.notif-dropdown.show { display: block; }

.notif-header {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notif-header h4 {
    font-size: 14px;
    font-weight: 600;
}

.notif-list {
    max-height: 360px;
    overflow-y: auto;
}

.notif-item {
    display: flex;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.12s;
}

.notif-item:hover { background: var(--hover-bg); }
.notif-item.unread { background: rgba(103,196,76,0.03); }

.notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notif-icon svg { width: 16px; height: 16px; color: var(--text-muted); }
.notif-item.unread .notif-icon { background: var(--green-glow); }
.notif-item.unread .notif-icon svg { color: var(--secondary); }

.notif-content { flex: 1; min-width: 0; }
.notif-title { font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.notif-text { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ============ TOAST ============ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: var(--card-bg);
    border: 1px solid var(--border-color-strong);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    min-width: 320px;
    max-width: 420px;
    font-size: 13.5px;
    animation: slideIn 0.3s ease;
}

.toast.success { border-left: 3px solid var(--secondary); }
.toast.error { border-left: 3px solid #ef4444; }
.toast.warning { border-left: 3px solid #f59e0b; }
.toast.info { border-left: 3px solid #3b82f6; }

.toast-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ============ TABS ============ */
.tabs {
    display: flex;
    gap: 2px;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.tab {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    border: none;
    background: none;
    font-family: inherit;
}

.tab:hover { color: var(--text-primary); }
.tab.active {
    background: var(--card-bg);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

/* ============ EMPTY STATE ============ */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.empty-state p { font-size: 13px; max-width: 320px; margin: 0 auto; }

/* ============ LOADING ============ */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--secondary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--hover-bg) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease infinite;
    border-radius: 8px;
}

@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ============ CHATBOT ============ */
.chatbot-trigger {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 52px;
    height: 52px;
    background: var(--secondary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 80;
    box-shadow: 0 4px 16px rgba(103,196,76,0.3);
    transition: all 0.2s;
    border: none;
    color: white;
}

.chatbot-trigger:hover { transform: scale(1.05); box-shadow: 0 6px 20px rgba(103,196,76,0.4); }
.chatbot-trigger svg { width: 22px; height: 22px; }

.chatbot-window {
    position: fixed;
    bottom: 88px;
    right: 24px;
    width: 380px;
    height: 520px;
    background: var(--card-bg);
    border: 1px solid var(--border-color-strong);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    z-index: 80;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.chatbot-window.show { display: flex; }

.chatbot-header {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
}

.chat-msg.bot {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.chat-msg.user {
    background: var(--secondary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chatbot-input {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
}

.chatbot-input input {
    flex: 1;
    padding: 9px 14px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'DM Sans', sans-serif;
}

.chatbot-input input:focus { outline: none; border-color: var(--secondary); }

.chatbot-input button {
    width: 38px;
    height: 38px;
    background: var(--secondary);
    border: none;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

/* ============ LEAD CARD ============ */
.lead-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 20px;
    box-shadow: var(--shadow-card);
    transition: all 0.2s;
}

.lead-card:hover {
    border-color: var(--border-color-strong);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.lead-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.lead-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.lead-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.lead-card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.lead-card-meta svg { width: 13px; height: 13px; }

.lead-card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lead-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

.lead-price {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--secondary);
}

.lead-score {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.score-bar {
    width: 48px;
    height: 5px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.score-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* ============ ALERTS ============ */
.alert {
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 13.5px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.alert svg { width: 18px; height: 18px; flex-shrink: 0; }

.alert-success { background: rgba(52,211,153,0.08); color: #34d399; border: 1px solid rgba(52,211,153,0.15); }
.alert-error { background: rgba(239,68,68,0.08); color: #ef4444; border: 1px solid rgba(239,68,68,0.15); }
.alert-warning { background: rgba(245,158,11,0.08); color: #f59e0b; border: 1px solid rgba(245,158,11,0.15); }
.alert-info { background: rgba(59,130,246,0.08); color: #3b82f6; border: 1px solid rgba(59,130,246,0.15); }

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.show { display: block; }
    .main-content { margin-left: 0; }
    .mobile-toggle { display: flex; }
    .content-area { padding: 16px; }
    .topbar { padding: 0 16px; }
    .search-wrapper { display: none; }
}

@media (max-width: 768px) {
    .notif-dropdown { width: calc(100vw - 32px); right: -60px; }
    .chatbot-window { width: calc(100vw - 32px); right: 16px; bottom: 80px; height: 70vh; }
    .stat-card-value { font-size: 22px; }
}

@media (max-width: 480px) {
    .content-area { padding: 12px; }
    .topbar-title { font-size: 16px; }
}

/* ============ ANIMATIONS ============ */
.fade-in {
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-up {
    animation: slideUp 0.35s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============ CHART CONTAINER ============ */
.chart-container {
    position: relative;
    height: 280px;
    width: 100%;
}

/* ============ QUALITY SCORE CIRCLE ============ */
.quality-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    position: relative;
}

.quality-circle::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid var(--bg-tertiary);
}

/* ============ LEADS GRID ============ */
.leads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.lead-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lead-card:hover {
    border-color: var(--color-secondary);
    box-shadow: 0 4px 20px rgba(103, 196, 76, 0.1);
    transform: translateY(-2px);
}

.lead-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.lead-type-badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lead-type-badge.exclusive {
    background: rgba(168, 85, 247, 0.12);
    color: #A855F7;
}

.lead-type-badge.shared {
    background: rgba(59, 130, 246, 0.12);
    color: #3B82F6;
}

.lead-score {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
}

.lead-score-bar {
    width: 50px;
    height: 4px;
    background: var(--hover-bg);
    border-radius: 2px;
    overflow: hidden;
}

.lead-score-fill {
    height: 100%;
    background: var(--color-secondary);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.lead-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.3;
}

.lead-card-meta {
    display: flex;
    gap: 14px;
    font-size: 0.78rem;
    opacity: 0.5;
    margin-bottom: 10px;
}

.lead-card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.lead-card-desc {
    font-size: 0.82rem;
    opacity: 0.6;
    line-height: 1.5;
    margin-bottom: 16px;
}

.lead-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

.lead-price {
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    color: var(--color-secondary);
}

/* ============ DATA LIST ============ */
.data-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
}

.data-list-item:last-child { border-bottom: none; }
.data-list-item:hover { background: var(--hover-bg); }

.data-list-main { flex: 1; min-width: 0; }

.data-list-title {
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.data-list-sub {
    font-size: 0.75rem;
    opacity: 0.45;
    margin-top: 2px;
}

.price-tag {
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    color: var(--color-secondary);
}

/* ============ DETAIL ITEMS ============ */
.detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.45;
}

.detail-value {
    font-size: 0.88rem;
    font-weight: 500;
    margin-top: 4px;
}

/* ============ PERFORMANCE LIST ============ */
.performance-list { display: flex; flex-direction: column; gap: 18px; }

.performance-item {}

.performance-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.performance-value {
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
}

/* ============ GRID LAYOUTS ============ */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .grid-2 { grid-template-columns: 1fr; }
    .leads-grid { grid-template-columns: 1fr; }
}

/* ============ TABLE ============ */
.table-responsive { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.45;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.data-table tbody tr:hover { background: var(--hover-bg); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ============ ALERT ============ */
.alert {
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 0.85rem;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #EF4444;
}

.alert-success {
    background: rgba(103, 196, 76, 0.1);
    border: 1px solid rgba(103, 196, 76, 0.2);
    color: var(--color-secondary);
}

/* ============ PAGE HEADER ============ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
}

.page-subtitle {
    font-size: 0.85rem;
    opacity: 0.5;
    margin-top: 4px;
}

/* ============ TABS ============ */
.tabs {
    display: flex;
    gap: 2px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 4px;
    overflow-x: auto;
}

.tab {
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab.active {
    background: var(--color-secondary);
    color: #fff;
}

.tab:hover:not(.active) {
    background: var(--hover-bg);
}

/* ============ PAGINATION ============ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
}

/* ============ SIDEBAR SEARCH ============ */
.sidebar-search {
    padding: 0 16px;
    margin-bottom: 8px;
    position: relative;
}

/* ============ NOTIFICATION ITEMS ============ */
.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
}

.notification-item:hover { background: var(--hover-bg); }
.notification-item.unread { background: rgba(103, 196, 76, 0.04); }

.notification-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--hover-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-content { flex: 1; min-width: 0; }
.notification-title { font-size: 0.82rem; font-weight: 500; }
.notification-text { font-size: 0.78rem; opacity: 0.5; margin-top: 2px; }
.notification-time { font-size: 0.7rem; opacity: 0.35; margin-top: 4px; }

.dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-body { max-height: 360px; overflow-y: auto; }

.dropdown-footer {
    padding: 10px 16px;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.dropdown-footer a {
    font-size: 0.78rem;
    color: var(--color-secondary);
    text-decoration: none;
}

.notification-menu {
    right: 0;
    min-width: 360px;
}

/* Print Styles */
@media print {
    .sidebar, .topbar, .chatbot-trigger, .chatbot-window, .btn, .mobile-toggle { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .card { box-shadow: none; border: 1px solid #ddd; }
    body { background: white; color: black; }
}
