 :root {
    /* SURFACES */
    --bg-base: #000000;
    --bg-surface: #0E0E10;
    --bg-surface-2: #161618;
    --bg-surface-3: #1F1F22;
    /* BORDERS */
    --border: #26262A;
    --border-strong: #34343A;
    /* TEXT */
    --text-primary: #F4F4F5;
    --text-secondary: #A1A1A6;
    --text-tertiary: #6B6B70;
    /* BRAND */
    --accent: #F4F4F5;
    --accent-muted: rgba(255,255,255,0.06);
    --brand: #4361EE;
    --brand-deep: #2C3FBF;
    --brand-tint: rgba(67, 97, 238, 0.08);
    --brand-tint-strong: rgba(67, 97, 238, 0.15);
    --brand-glow: rgba(67, 97, 238, 0.22);
    /* SEMANTIC */
    --success: #4ADE80;
    --success-bg: rgba(74,222,128,0.08);
    --warning: #FBBF24;
    --warning-bg: rgba(251,191,36,0.08);
    --danger: #F87171;
    --danger-bg: rgba(248,113,113,0.08);
    --danger-border: rgba(248,113,113,0.25);
    --info: #60A5FA;
    --info-bg: rgba(96,165,250,0.08);
    --info-border: rgba(96,165,250,0.2);
    /* TIERS */
    --tier-bronze: #C9883B;
    --tier-bronze-bg: rgba(201,136,59,0.08);
    --tier-silver: #C2C5CC;
    --tier-gold: #E8C15A;
    --tier-platinum: #A78BFA;
    --tier-platinum-bg: rgba(167,139,250,0.08);
    /* RADII */
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --r-md: 10px;
    --r-lg: 14px;
    /* TYPOGRAPHY */
    --font-sans: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

*, *::before, *::after {
    box-sizing: border-box;
}
  
html, body {
    margin: 0;
    padding: 0;
    background: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    height: 100%;
}
  
h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 600;
    letter-spacing: -0.03em;
}

h1 {
    font-size: 24px;
}

h2 {
    font-size: 19px;
}

h3 {
    font-size: 16px;
}

p {
    margin: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

.text-sm {
    font-size: 13px;
}

.text-xs {
    font-size: 12px;
}

.text-2xs {
    font-size: 11px;
}

.muted {
    color: var(--text-secondary);
}

.dim {
    color: var(--text-tertiary);
}

.mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

.flex1 {
    flex: 1;
    min-width: 0;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
 
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}
 
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 999px;
    border: 2px solid var(--bg-base);
    background-clip: padding-box;
}

    ::-webkit-scrollbar-thumb:hover {
        background: var(--text-tertiary);
        background-clip: padding-box;
    }

::-webkit-scrollbar-corner {
    background: transparent;
}

/* Hide number input arrows */ 
/* Chrome, Edge, Safari */
.input[type="number"]::-webkit-outer-spin-button,
.input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox */
.input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* ============================================================
   APP SHELL
   ============================================================ */

.app-shell {
    display: flex;
    height: 100%;
    overflow: hidden;
}

/* ============================================================
   SIDEBAR
   ============================================================ */

.sidebar {
    width: 232px;
    flex-shrink: 0;
    background: var(--bg-base);
    border-right: 1px solid #17171A;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-brand {
    height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 11px;
    margin-bottom: 6px;
    color: #F3F3F4;
    font-size: 15px;
    font-weight: 600;
}

.sidebar-brand-icon {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--brand), var(--brand-deep));
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.35);
    flex-shrink: 0;
}

.sidebar-brand-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: white;
    opacity: 0.95;
    animation: brandDotPulse 2.5s ease-in-out infinite;
}

@keyframes brandDotPulse {
    0%, 100% { opacity: 0.95; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

.sidebar-brand-accent {
    color: var(--brand);
    margin-left: 1px;
    font-weight: 700;
}

.sidebar-section {
    padding: 16px 11px 5px;
    color: #66666B;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

    .sidebar-nav a {
        height: 34px;
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 0 11px;
        border-radius: 10px;
        border: 1px solid transparent;
        color: #9A9AA1;
        font-size: 13px;
        font-weight: 500;
        cursor: pointer;
        transition: background 0.12s, color 0.12s, border-color 0.12s;
        user-select: none;
    }

        .sidebar-nav a i {
            font-size: 15px;
            flex-shrink: 0;
        }

        .sidebar-nav a:hover {
            background: #111113;
            color: #F5F5F5;
        }

        .sidebar-nav a.active {
            background: var(--brand-tint);
            border-color: transparent;
            color: #ffffff;
            position: relative;
            overflow: visible;
        }
        
        .sidebar-nav a.active::before {
            content: "";
            position: absolute;
            left: -8px;
            top: 6px;
            bottom: 6px;
            width: 3px;
            border-radius: 0 3px 3px 0;
            background: var(--brand);
            box-shadow: 0 0 8px var(--brand-glow);
            pointer-events: none;
        }
        
        .sidebar-nav a.active i {
            color: var(--brand);
        }

.sidebar-spacer {
    flex: 1;
}

.sidebar-user {
    padding: 8px 11px;
}

.sidebar-user-name {
    font-weight: 500;
    color: var(--text-primary);
}

.sidebar-user-action {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    background: none;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.12s, color 0.12s;
}

    .sidebar-user-action:hover {
        background: var(--bg-surface-2);
        color: var(--text-primary);
    }

.sidebar-nav a.nav-soon {
    pointer-events: none;
    cursor: default;
    opacity: 0.38; 
    background: transparent !important;
    border-color: transparent !important;
    color: var(--text-tertiary) !important;
    position: relative;
}
 
.nav-soon-pill {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    height: 16px;
    padding: 0 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.04em;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-tertiary); 
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */

.main-content {
    animation: fadeIn 0.15s ease;
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.page-content {
    transition: opacity 0.12s ease;
    padding: 32px;
    min-height: 100%;
    animation: fadeIn 0.18s ease;
}

    .page-content.swift-loading {
        opacity: 0.45;
        pointer-events: none;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   TOPBAR (page-level, inside page-content)
   ============================================================ */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
 
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    transition: border-color 0.15s;
}

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

.card-tight {
    padding: 12px 14px;
}

.surface-2 {
    background: var(--bg-surface-2);
    border-radius: var(--r-md);
}

/* ============================================================
   Metri c
   ============================================================ */

.metric {
    background: var(--bg-surface);
    border: 1px solid #222225;
    border-radius: 14px;
    padding: 16px;
    transition: border-color 0.15s;
}

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

.metric-label {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-bottom: 10px;
}

.metric-value {
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -0.04em;
    margin-bottom: 6px;
}

.metric-trend {
    font-size: 11px;
    color: var(--text-secondary);
}

/* ============================================================
   CUSTOM DROPDOWN
   ============================================================ */

.custom-select-source {
    display: none;
}

.custom-select {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    height: 36px;
    width: 100%;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-surface-2);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

    .custom-select-trigger:hover,
    .custom-select.open .custom-select-trigger {
        border-color: var(--border-strong);
        box-shadow: 0 0 0 1px rgba(255,255,255,0.03);
    }

.custom-select-value {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.custom-select-chevron {
    color: var(--text-tertiary);
    font-size: 16px;
    transition: transform 0.15s ease;
}

.custom-select.open .custom-select-chevron {
    transform: rotate(180deg);
}

.custom-select-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 50;
    padding: 6px;
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    background: var(--bg-surface);
    box-shadow: 0 18px 40px rgba(0,0,0,0.42);
    display: none;
    max-height: 220px;
    overflow-y: auto;
}

.custom-select.open .custom-select-menu {
    display: block;
    animation: dropdownIn 0.12s ease;
}

.custom-select-option {
    min-height: 32px;
    padding: 7px 9px;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background 0.12s ease, color 0.12s ease;
}

    .custom-select-option:hover {
        background: var(--bg-surface-2);
        color: var(--text-primary);
    }

    .custom-select-option.selected {
        background: var(--accent-muted);
        color: var(--text-primary);
    }

@keyframes dropdownIn {
    from {
        opacity: 0;
        transform: translateY(-4px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.custom-select.open-up .custom-select-menu {
    top: auto;
    bottom: calc(100% + 6px);
    animation: dropdownInUp 0.12s ease;
}

@keyframes dropdownInUp {
    from {
        opacity: 0;
        transform: translateY(4px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================================
   Form group
   ============================================================ */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

    .form-group label {
        font-size: 12px;
        color: var(--text-secondary);
        font-weight: 500;
    }

.form-section {
    margin-bottom: 20px;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-hint {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
 
/* ============================================================
   PROGRESS
   ============================================================ */

.progress {
    height: 6px;
    border-radius: 999px;
    background: var(--bg-surface-3);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--text-primary);
    border-radius: inherit;
    transition: width 0.4s ease;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
    height: 34px;
    padding: 0 13px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-surface-2);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

    .btn:hover {
        background: var(--bg-surface-3);
        border-color: var(--border-strong);
    }

.btn-sm {
    height: 28px;
    padding: 0 10px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(180deg, var(--brand), var(--brand-deep));
    color: white;
    border: none;
    box-shadow: 0 4px 12px -4px var(--brand-glow);
    transition: all 0.18s ease;
}

.btn-primary:hover {
    background: linear-gradient(180deg, #5271FF, var(--brand));
    transform: translateY(-1px);
    box-shadow: 0 6px 16px -4px rgba(67, 97, 238, 0.4);
    opacity: 1;
}

    .btn-primary:hover {
        opacity: 0.9;
    }

/* ============================================================
   LOADING BUTTON 
   ============================================================ */

.loading-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

    .loading-btn:disabled {
        opacity: 0.7;
        cursor: not-allowed;
    }

.loading-btn-spinner {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(128, 128, 128, 0.3);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: loadingBtnSpin 0.6s linear infinite;
    flex-shrink: 0;
}

.loading-btn.is-loading .loading-btn-spinner {
    display: inline-block;
}

.loading-btn.is-loading .loading-btn-label {
    opacity: 0.85;
}

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

/* ============================================================
   BADGES
   ============================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid var(--border);
    background: var(--bg-surface-2);
    white-space: nowrap;
}

.badge-silver {
    color: var(--tier-silver);
}

.badge-gold {
    color: var(--tier-gold);
}

.badge-bronze {
    color: var(--tier-bronze);
}

.badge-platinum {
    color: var(--tier-platinum);
}

.badge-info {
    background: var(--info-bg);
    border-color: var(--info-border);
    color: var(--info);
}

.badge-success {
    background: var(--success-bg);
    border-color: rgba(74,222,128,0.2);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-bg);
    border-color: rgba(251,191,36,0.2);
    color: var(--warning);
}

.badge-accent {
    background: var(--accent-muted);
    border-color: rgba(255,255,255,0.12);
    color: var(--text-primary);
}

/* ============================================================
   TAG
   ============================================================ */

.tag {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    background: var(--bg-surface-3);
    color: var(--text-secondary);
}

/* ============================================================
   AVATAR
   ============================================================ */

.avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-surface-3);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
    color: var(--text-secondary);
}

/* ============================================================
   MISC COMPONENTS
   ============================================================ */

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--info);
}

.divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

.pill-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 5px 10px;
    font-size: 12px;
}
  
.tool-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 16px;
    cursor: pointer;
    transition: border-color 0.13s, background 0.13s;
}

    .tool-card:hover {
        border-color: var(--border-strong);
        background: var(--bg-surface-3);
    }

.tool-ic {
    width: 38px;
    height: 38px;
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
}

.lead-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    background: var(--bg-surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    transition: border-color 0.12s;
}

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

.pipe {
    background: var(--bg-surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 11px;
    text-align: center;
}

.post {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--bg-surface);
} 

.set-tab {
    padding: 7px 13px;
    border-radius: var(--r-md);
    font-size: 13px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: background 0.12s, color 0.12s;
}

    .set-tab:hover {
        color: var(--text-primary);
    }

    .set-tab.active {
        background: var(--bg-surface-3);
        color: var(--text-primary);
    }

.tl-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */

.input,
.select {
    height: 36px;
    width: 100%;
    background: var(--bg-surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color 0.12s;
}

    .input:focus,
    .select:focus {
        border-color: var(--border-strong);
    }

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

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

.checkbox-circle {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border-strong);
    background: var(--bg-surface-2);
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: border-color 0.15s;
}

    .checkbox-circle:hover {
        border-color: var(--text-secondary);
    }

    .checkbox-circle:checked {
        border-color: var(--text-primary);
    }

        .checkbox-circle:checked::after {
            content: "";
            position: absolute;
            top: 50%;
            left: 50%;
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--text-primary);
            transform: translate(-50%, -50%);
        }

    .checkbox-circle:focus-visible {
        outline: 2px solid var(--info);
        outline-offset: 2px;
    }

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */

.row {
    display: flex;
    align-items: center;
}

.between {
    justify-content: space-between;
}

.wrap {
    flex-wrap: wrap;
}

.gap1 {
    gap: 4px;
}

.gap2 {
    gap: 8px;
}

.gap3 {
    gap: 12px;
}

.gap4 {
    gap: 16px;
}
 
.cond {
    cursor: pointer;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.cond.active {
    background: linear-gradient(180deg, var(--brand), var(--brand-deep));
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px -2px var(--brand-glow);
}
 
     
/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1100px) {
    /*
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    */
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    } 

    .page-content {
        padding: 20px;
    }
}
