/* ============================================================
   JUARA BEAUTY — CRM & Marketing System
   Aesthetic: Professional Modern SaaS (Attio / Linear / HubSpot)
   ============================================================ */

:root {
    /* Surfaces */
    --bg:            #F7F8FA;
    --surface:       #FFFFFF;
    --surface-2:     #F3F4F6;
    --surface-hover: #F9FAFB;
    --border:        #E5E7EB;
    --border-strong: #D1D5DB;
    --border-soft:   #EEF0F3;

    /* Text */
    --text:          #0F172A;
    --text-2:        #475569;
    --text-muted:    #94A3B8;
    --text-subtle:   #64748B;

    /* Accent — refined rose (beauty hint, not traditional) */
    --primary:       #E11D48;
    --primary-hover: #BE123C;
    --primary-dark:  #9F1239;
    --primary-soft:  #FFF1F2;
    --primary-soft-2:#FFE4E6;

    /* Semantic */
    --success:       #16A34A;
    --success-soft:  #DCFCE7;
    --success-dark:  #15803D;
    --warning:       #D97706;
    --warning-soft:  #FEF3C7;
    --warning-dark:  #B45309;
    --danger:        #DC2626;
    --danger-soft:   #FEE2E2;
    --danger-dark:   #B91C1C;
    --info:          #0284C7;
    --info-soft:     #E0F2FE;
    --info-dark:     #0369A1;

    /* Charts / accent variants */
    --c1: #E11D48; /* rose */
    --c2: #0284C7; /* sky */
    --c3: #7C3AED; /* violet */
    --c4: #D97706; /* amber */
    --c5: #16A34A; /* green */

    /* Typography */
    --font-sans: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

    /* Radius */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius:    8px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-pill: 999px;

    /* Elevation */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.04);
    --shadow:    0 2px 4px rgba(15, 23, 42, 0.04), 0 4px 8px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 4px 12px rgba(15, 23, 42, 0.06), 0 12px 24px -12px rgba(15, 23, 42, 0.08);
    --shadow-xl: 0 20px 40px -12px rgba(15, 23, 42, 0.12);

    /* Transitions */
    --t-fast: 120ms ease;
    --t-base: 180ms ease;

    /* ---- Back-compat aliases (old editorial palette → new professional) ---- */
    --cream:         var(--bg);
    --cream-soft:    var(--surface);
    --cream-deep:    var(--surface-2);
    --ivory:         var(--surface);
    --blush:         var(--primary-soft);
    --blush-deep:    var(--primary-soft-2);
    --rose:          var(--primary);
    --burgundy:      var(--text);
    --burgundy-deep: var(--text);
    --gold:          var(--primary);
    --gold-soft:     var(--primary-soft);
    --charcoal:      var(--text);
    --charcoal-soft: var(--text-2);
    --muted:         var(--text-muted);
    --line:          var(--border);
    --line-soft:     var(--border-soft);
    --font-display:  var(--font-sans);
    --font-body:     var(--font-sans);
    --radius-lg:     12px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.55;
    font-feature-settings: 'cv11', 'ss01';
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.003em;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans);
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.25;
    margin: 0;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--t-fast);
}

a:hover { color: var(--primary-hover); }

code, pre, .mono { font-family: var(--font-mono); }

/* ============================================================
   LAYOUT
   ============================================================ */
.app-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}

/* ============================================================
   SIDEBAR — light, modern
   ============================================================ */
.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 20px 14px 20px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px 20px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.sidebar-brand-logo {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: white;
    font-weight: 700;
    flex-shrink: 0;
}

.sidebar-brand-text {
    line-height: 1.15;
}

.sidebar-brand-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}

.sidebar-brand-tag {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 1px;
    font-weight: 500;
}

.sidebar-section-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 16px 10px 6px;
    letter-spacing: 0.02em;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.sidebar-nav-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-size: 13px;
    font-weight: 500;
    transition: background var(--t-fast), color var(--t-fast);
}

.sidebar-nav-item a:hover {
    background: var(--surface-2);
    color: var(--text);
}

.sidebar-nav-item.active a {
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 600;
}

.sidebar-nav-icon {
    width: 16px;
    height: 16px;
    stroke-width: 1.75;
    flex-shrink: 0;
    color: var(--text-muted);
}

.sidebar-nav-item a:hover .sidebar-nav-icon { color: var(--text-2); }
.sidebar-nav-item.active .sidebar-nav-icon { color: var(--primary); }

.sidebar-nav-badge {
    margin-left: auto;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: var(--radius-xs);
    background: var(--surface-2);
    color: var(--text-2);
    letter-spacing: 0.01em;
}

.sidebar-nav-item.active .sidebar-nav-badge {
    background: var(--primary);
    color: white;
}

.sidebar-footer {
    margin-top: auto;
    padding: 10px 0 0;
    border-top: 1px solid var(--border);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--t-fast);
}

.sidebar-user:hover { background: var(--surface-2); }

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

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

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

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

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 10px 28px;
    display: flex;
    align-items: center;
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    height: 56px;
}

.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.topbar-breadcrumb a { color: var(--text-muted); font-weight: 500; }
.topbar-breadcrumb a:hover { color: var(--text); }
.topbar-breadcrumb-current { color: var(--text); font-weight: 600; }
.topbar-breadcrumb-sep { color: var(--border-strong); }

.topbar-search {
    margin-left: auto;
    position: relative;
    width: 280px;
}

.topbar-search input {
    width: 100%;
    padding: 7px 12px 7px 32px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    color: var(--text);
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

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

.topbar-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

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

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.topbar-btn-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-2);
    transition: all var(--t-fast);
    position: relative;
}

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

.topbar-btn-icon .badge-dot {
    position: absolute;
    top: 6px;
    right: 7px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--surface);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    padding: 24px 28px 48px;
    max-width: 1440px;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.page-header-eyebrow {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.page-title {
    font-family: var(--font-sans);
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.page-title em {
    font-style: normal;
    color: var(--text);
    font-weight: 700;
}

.page-subtitle {
    font-size: 13.5px;
    color: var(--text-2);
    margin-top: 6px;
    max-width: 72ch;
}

.page-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-juara {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--t-fast);
    white-space: nowrap;
    letter-spacing: -0.005em;
    line-height: 1.2;
}

.btn-juara.btn-primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: var(--shadow-xs), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn-juara.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-juara.btn-gold {
    background: var(--text);
    color: white;
    border-color: var(--text);
}

.btn-juara.btn-gold:hover {
    background: #1E293B;
    border-color: #1E293B;
}

.btn-juara.btn-outline {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
}

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

.btn-juara.btn-ghost {
    background: transparent;
    color: var(--text-2);
    border-color: transparent;
}

.btn-juara.btn-ghost:hover {
    background: var(--surface-2);
    color: var(--text);
}

.btn-juara.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
    gap: 5px;
}

.btn-juara.btn-lg {
    padding: 10px 18px;
    font-size: 14px;
}

.btn-icon-only {
    padding: 7px;
    width: 32px;
    height: 32px;
}

/* ============================================================
   CARDS
   ============================================================ */
.card-juara {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: box-shadow var(--t-base);
}

.card-juara.elevated {
    box-shadow: var(--shadow-sm);
}

.card-juara.elevated:hover {
    box-shadow: var(--shadow);
}

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

.card-juara-title {
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.card-juara-subtitle {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 2px;
    font-weight: 500;
}

/* ============================================================
   METRIC CARDS — dense, professional
   ============================================================ */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.metric-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    position: relative;
    transition: border-color var(--t-base), box-shadow var(--t-base);
}

.metric-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
}

.metric-card.featured {
    background: var(--text);
    color: white;
    border: none;
}

.metric-card.featured .metric-label,
.metric-card.featured .metric-sublabel { color: rgba(255, 255, 255, 0.65); }
.metric-card.featured .metric-value { color: white; }

.metric-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.metric-label-icon {
    width: 13px;
    height: 13px;
    color: var(--text-muted);
    stroke-width: 1.75;
}

.metric-value {
    font-family: var(--font-sans);
    font-size: 26px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text);
    letter-spacing: -0.025em;
    font-variant-numeric: tabular-nums;
}

.metric-value .currency {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 600;
    margin-right: 2px;
    vertical-align: top;
    margin-top: 4px;
    display: inline-block;
}

.metric-value .suffix {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
    margin-left: 3px;
}

.metric-sublabel {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.metric-delta {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: var(--radius-xs);
}

.metric-delta.up { background: var(--success-soft); color: var(--success-dark); }
.metric-delta.down { background: var(--danger-soft); color: var(--danger-dark); }

.metric-card.featured .metric-delta.up { background: rgba(34, 197, 94, 0.2); color: #86EFAC; }
.metric-card.featured .metric-delta.down { background: rgba(239, 68, 68, 0.2); color: #FCA5A5; }

/* ============================================================
   TABLES
   ============================================================ */
.table-juara {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

.table-juara thead th {
    text-align: left;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    position: sticky;
    top: 0;
}

.table-juara tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border-soft);
    color: var(--text);
    vertical-align: middle;
}

.table-juara tbody tr {
    transition: background var(--t-fast);
}

.table-juara tbody tr:hover {
    background: var(--surface-hover);
    cursor: pointer;
}

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

.table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

/* ============================================================
   CUSTOMER CELL
   ============================================================ */
.customer-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.customer-avatar.sm { width: 26px; height: 26px; font-size: 10.5px; }
.customer-avatar.lg { width: 44px; height: 44px; font-size: 16px; }
.customer-avatar.xl { width: 72px; height: 72px; font-size: 22px; }

/* Flat color avatars — no gradients */
.customer-avatar.gradient-rose    { background: #FEE2E2; color: #9F1239; border-color: #FECDD3; }
.customer-avatar.gradient-gold    { background: #FEF3C7; color: #92400E; border-color: #FDE68A; }
.customer-avatar.gradient-burgundy{ background: #F3E8FF; color: #6B21A8; border-color: #E9D5FF; }
.customer-avatar.gradient-olive   { background: #DBEAFE; color: #1E40AF; border-color: #BFDBFE; }

.customer-info .customer-name {
    font-weight: 600;
    color: var(--text);
    line-height: 1.25;
    font-size: 13px;
}

.customer-info .customer-meta {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 1px;
    font-weight: 500;
}

/* ============================================================
   BADGES / CHIPS
   ============================================================ */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-xs);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid transparent;
    height: 20px;
}

.chip.chip-vip     { background: #FEF3C7; color: #92400E; }
.chip.chip-loyal   { background: var(--success-soft); color: var(--success-dark); }
.chip.chip-active  { background: var(--success-soft); color: var(--success-dark); }
.chip.chip-new     { background: var(--info-soft); color: var(--info-dark); }
.chip.chip-risk    { background: var(--warning-soft); color: var(--warning-dark); }
.chip.chip-dormant { background: var(--warning-soft); color: var(--warning-dark); }
.chip.chip-lost    { background: var(--danger-soft); color: var(--danger-dark); }
.chip.chip-churn   { background: var(--danger-soft); color: var(--danger-dark); }
.chip.chip-neutral { background: var(--surface-2); color: var(--text-2); }
.chip.chip-dark    { background: var(--text); color: white; }

.chip.chip-dot::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
}

.chip-wa    { background: #DCFCE7; color: #166534; }
.chip-email { background: var(--info-soft); color: var(--info-dark); }

.chip-channel {
    padding: 2px 7px;
    border-radius: var(--radius-xs);
    font-size: 10.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    letter-spacing: 0.01em;
    text-transform: capitalize;
}

.chip-channel.shopee    { background: #FFE4D6; color: #C2410C; }
.chip-channel.tokopedia { background: var(--success-soft); color: var(--success-dark); }
.chip-channel.instagram { background: #FCE7F3; color: #BE185D; }
.chip-channel.tiktok    { background: #F1F5F9; color: #334155; }
.chip-channel.website   { background: var(--info-soft); color: var(--info-dark); }

/* ============================================================
   FORM CONTROLS
   ============================================================ */
.form-group-juara {
    margin-bottom: 16px;
}

.form-label-juara {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.form-label-juara .required { color: var(--primary); margin-left: 2px; }

.form-input-juara,
.form-select-juara,
.form-textarea-juara {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    color: var(--text);
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
    line-height: 1.4;
}

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

.form-textarea-juara { resize: vertical; min-height: 80px; font-family: inherit; }

.form-hint {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 5px;
}

.form-hint code {
    background: var(--surface-2);
    padding: 1px 5px;
    border-radius: var(--radius-xs);
    font-size: 11px;
    color: var(--text-2);
}

.checkbox-juara {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
}

.checkbox-juara input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* ============================================================
   TABS
   ============================================================ */
.tabs-juara {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
    overflow-x: auto;
}

.tab-item {
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all var(--t-fast);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.tab-item.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab-item .count {
    background: var(--surface-2);
    color: var(--text-muted);
    padding: 0 6px;
    border-radius: var(--radius-xs);
    font-size: 10.5px;
    font-weight: 600;
    height: 17px;
    display: inline-flex;
    align-items: center;
}

.tab-item.active .count {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    margin-bottom: 16px;
}

.filter-search {
    position: relative;
    flex: 1;
    min-width: 220px;
}

.filter-search input {
    width: 100%;
    padding: 7px 12px 7px 30px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-family: inherit;
    font-size: 13px;
    color: var(--text);
}

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

.filter-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

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

.filter-select {
    padding: 7px 28px 7px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-family: inherit;
    font-size: 12.5px;
    color: var(--text);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 9px center;
    font-weight: 500;
}

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

/* ============================================================
   SEGMENT CARDS
   ============================================================ */
.segment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.segment-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px;
    cursor: pointer;
    transition: all var(--t-base);
    position: relative;
}

.segment-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
}

.segment-card.vip   { --segment-accent: #D97706; }
.segment-card.loyal { --segment-accent: var(--success); }
.segment-card.new   { --segment-accent: var(--info); }
.segment-card.risk  { --segment-accent: var(--warning); }
.segment-card.lost  { --segment-accent: var(--danger); }

.segment-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    background: color-mix(in srgb, var(--segment-accent) 12%, transparent);
    color: var(--segment-accent);
}

.segment-icon svg { width: 18px; height: 18px; stroke-width: 1.75; }

.segment-name {
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}

.segment-desc {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.45;
    font-weight: 500;
}

.segment-count {
    display: flex;
    align-items: baseline;
    gap: 5px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border-soft);
}

.segment-count-num {
    font-family: var(--font-sans);
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.segment-count-unit {
    font-size: 11.5px;
    color: var(--text-muted);
    font-weight: 500;
}

.segment-footer {
    display: flex;
    gap: 12px;
    margin-top: 10px;
    font-size: 11.5px;
    color: var(--text-muted);
}

.segment-footer-item {
    font-weight: 500;
}

.segment-footer-item strong {
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    display: block;
    margin-top: 1px;
}

/* ============================================================
   PROGRESS
   ============================================================ */
.progress-juara {
    width: 100%;
    height: 5px;
    background: var(--surface-2);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.progress-juara-bar {
    height: 100%;
    background: var(--primary);
    border-radius: var(--radius-pill);
    transition: width 0.6s ease;
}

.progress-juara-bar.success { background: var(--success); }
.progress-juara-bar.warning { background: var(--warning); }
.progress-juara-bar.danger  { background: var(--danger); }

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline-juara {
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
}

.timeline-juara::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 10px;
    bottom: 10px;
    width: 1px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-left: 36px;
    padding-bottom: 18px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
    position: absolute;
    left: 6px;
    top: 4px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--text-muted);
}

.timeline-item.purchase .timeline-dot { border-color: var(--success); }
.timeline-item.campaign .timeline-dot { border-color: var(--info); }
.timeline-item.event    .timeline-dot { border-color: var(--primary); }

.timeline-date {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 2px;
}

.timeline-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.timeline-desc {
    font-size: 12px;
    color: var(--text-2);
    line-height: 1.45;
}

/* ============================================================
   CHARTS
   ============================================================ */
.chart-container {
    position: relative;
    height: 260px;
}

.donut-wrap {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto;
}

.donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.donut-center-value {
    font-family: var(--font-sans);
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
    letter-spacing: -0.02em;
}

.donut-center-label {
    font-size: 10.5px;
    color: var(--text-muted);
    margin-top: 3px;
    font-weight: 500;
}

/* ============================================================
   WHATSAPP PHONE MOCKUP
   ============================================================ */
.phone-mockup {
    max-width: 300px;
    margin: 0 auto;
    background: #1F2937;
    border-radius: 28px;
    padding: 10px;
    box-shadow: var(--shadow-xl);
}

.phone-screen {
    background: #E5DDD5;
    border-radius: 20px;
    min-height: 460px;
    overflow: hidden;
    position: relative;
}

.phone-wa-header {
    background: #075E54;
    color: white;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.phone-wa-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
    font-weight: 700;
}

.phone-wa-name {
    font-weight: 600;
    font-size: 13px;
}

.phone-wa-status {
    font-size: 10.5px;
    color: rgba(255, 255, 255, 0.7);
}

.phone-chat {
    padding: 12px;
    min-height: 380px;
}

.phone-bubble {
    background: #DCF8C6;
    padding: 8px 10px;
    border-radius: 8px 8px 0 8px;
    font-size: 12.5px;
    color: #222;
    line-height: 1.4;
    max-width: 90%;
    margin-left: auto;
    margin-bottom: 8px;
}

.phone-bubble.in {
    background: white;
    border-radius: 8px 8px 8px 0;
    margin-left: 0;
}

.phone-bubble-time {
    font-size: 9.5px;
    color: #667;
    text-align: right;
    margin-top: 3px;
    display: block;
}

/* ============================================================
   EVENT CARD
   ============================================================ */
.event-card {
    display: grid;
    grid-template-columns: 88px 1fr auto;
    gap: 20px;
    align-items: center;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--t-base);
}

.event-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
}

.event-date-block {
    text-align: center;
    padding: 10px 8px;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.event-date-month {
    font-size: 10px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 2px;
}

.event-date-day {
    font-family: var(--font-sans);
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
    letter-spacing: -0.02em;
}

.event-date-year {
    font-size: 10.5px;
    color: var(--text-muted);
    margin-top: 2px;
    font-weight: 500;
}

.event-title {
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
    margin-bottom: 4px;
    line-height: 1.3;
}

.event-meta {
    display: flex;
    gap: 14px;
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 6px;
    font-weight: 500;
}

.event-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.event-meta-item svg {
    width: 12px;
    height: 12px;
}

.event-attendees {
    display: flex;
    align-items: center;
    margin-top: 8px;
}

.avatar-stack {
    display: flex;
}

.avatar-stack .customer-avatar {
    margin-left: -8px;
    border: 2px solid var(--surface);
    width: 24px;
    height: 24px;
    font-size: 9.5px;
}

.avatar-stack .customer-avatar:first-child { margin-left: 0; }

.avatar-stack-more {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-left: -8px;
    background: var(--surface-2);
    border: 2px solid var(--surface);
    border-radius: 50%;
    font-size: 9.5px;
    font-weight: 600;
    color: var(--text-2);
}

/* ============================================================
   CAMPAIGN ROW
   ============================================================ */
.campaign-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.campaign-row {
    display: grid;
    grid-template-columns: 1fr repeat(4, 100px) 100px;
    gap: 16px;
    align-items: center;
    padding: 14px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--t-base);
}

.campaign-row:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
}

.campaign-name {
    font-weight: 600;
    color: var(--text);
    font-size: 13.5px;
    margin-bottom: 3px;
}

.campaign-meta {
    font-size: 11.5px;
    color: var(--text-muted);
    display: flex;
    gap: 6px;
    align-items: center;
    font-weight: 500;
    flex-wrap: wrap;
}

.campaign-metric {
    text-align: center;
}

.campaign-metric-val {
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
    letter-spacing: -0.015em;
    font-variant-numeric: tabular-nums;
}

.campaign-metric-label {
    font-size: 10.5px;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
}

/* ============================================================
   QUICK ACTIONS
   ============================================================ */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--t-fast);
    text-align: left;
    color: var(--text);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
}

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

.quick-action-btn .qa-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: var(--primary-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.quick-action-btn .qa-icon svg { width: 14px; height: 14px; stroke-width: 1.75; }

/* ============================================================
   UTILITY
   ============================================================ */
.text-muted-juara { color: var(--text-muted); }
.text-burgundy    { color: var(--text); font-weight: 600; }
.text-gold        { color: var(--primary); }
.text-rose        { color: var(--primary); }

.d-flex          { display: flex; }
.align-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 6px; }
.gap-3 { gap: 10px; }
.gap-4 { gap: 14px; }
.mb-0  { margin-bottom: 0 !important; }
.mb-2  { margin-bottom: 6px; }
.mb-3  { margin-bottom: 12px; }
.mb-4  { margin-bottom: 20px; }
.mt-3  { margin-top: 12px; }
.mt-4  { margin-top: 20px; }
.w-100 { width: 100%; }
.text-center { text-align: center; }
.text-right  { text-align: right; }

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

.divider-ornament {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0 14px;
    color: var(--text-muted);
}

.divider-ornament::before {
    content: '';
    flex: 0 0 auto;
    width: 3px;
    height: 14px;
    background: var(--primary);
    border-radius: 2px;
}

.divider-ornament span {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
}

/* Layouts */
.two-col {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
}

.two-col.wide-right {
    grid-template-columns: 1fr 2fr;
}

.three-col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-state-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 14px;
    color: var(--text-muted);
}

.empty-state-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.empty-state-desc {
    color: var(--text-muted);
    font-size: 13px;
    max-width: 40ch;
    margin: 0 auto 16px;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.fade-up {
    animation: fadeUp 0.35s ease backwards;
}

.stagger-1 { animation-delay: 0.04s; }
.stagger-2 { animation-delay: 0.08s; }
.stagger-3 { animation-delay: 0.12s; }
.stagger-4 { animation-delay: 0.16s; }
.stagger-5 { animation-delay: 0.20s; }
.stagger-6 { animation-delay: 0.24s; }

/* ============================================================
   BOOTSTRAP OVERRIDES
   ============================================================ */
.dropdown-menu {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 4px;
    font-family: inherit;
    font-size: 13px;
    background: var(--surface);
    min-width: 180px;
}

.dropdown-item {
    border-radius: var(--radius-sm);
    padding: 7px 10px;
    color: var(--text);
    font-weight: 500;
    font-size: 12.5px;
}

.dropdown-item:hover {
    background: var(--surface-2);
    color: var(--text);
}

.dropdown-item.danger {
    color: var(--danger);
}

.dropdown-item.danger:hover {
    background: var(--danger-soft);
}

/* ============================================================
   MODALS
   ============================================================ */
.juara-modal .modal-content {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    background: var(--surface);
    overflow: hidden;
}

.juara-modal .modal-header {
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    background: var(--surface);
    align-items: flex-start;
}

.juara-modal .modal-title {
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.015em;
    line-height: 1.3;
    margin: 0;
}

.juara-modal .modal-eyebrow {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 3px;
}

.juara-modal .btn-close {
    padding: 8px;
    margin: 0;
    opacity: 0.55;
    transition: opacity var(--t-fast);
    background-size: 11px;
}

.juara-modal .btn-close:hover {
    opacity: 1;
}

.juara-modal .modal-body {
    padding: 18px 20px;
    font-size: 13px;
    color: var(--text);
}

.juara-modal .modal-footer {
    border-top: 1px solid var(--border);
    padding: 12px 20px;
    gap: 8px;
    background: var(--surface);
}

.juara-modal .confirm-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--warning-soft);
    color: var(--warning-dark);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Criteria rows (segment builder) */
.criteria-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.criteria-row {
    display: grid;
    grid-template-columns: 1.3fr 0.6fr 1fr auto;
    gap: 6px;
    align-items: center;
}

/* Template grid */
.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
}
.template-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    transition: all var(--t-base);
}
.template-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
}

/* Notifications / messages list */
.notif-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-soft);
    transition: background var(--t-fast);
}
.notif-item:hover { background: var(--surface-hover); }
.notif-item:last-child { border-bottom: none; }

.notif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}
.notif-dot.primary { background: var(--primary); }
.notif-dot.success { background: var(--success); }
.notif-dot.warning { background: var(--warning); }
.notif-dot.info    { background: var(--info); }
.notif-dot.danger  { background: var(--danger); }

.notif-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
    line-height: 1.35;
}
.notif-desc {
    font-size: 12px;
    color: var(--text-2);
    line-height: 1.4;
}
.notif-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
}

/* Search modal */
.juara-search-modal .modal-content {
    padding: 0;
}
.search-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
}
.search-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-family: inherit;
    font-size: 14.5px;
    color: var(--text);
    padding: 0;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input-wrap kbd {
    font-family: var(--font-mono);
    font-size: 10.5px;
    padding: 2px 6px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text-muted);
}
.search-body {
    padding: 10px 8px;
    max-height: 420px;
    overflow-y: auto;
}
.search-section-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 10px 10px 4px;
}
.search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    transition: background var(--t-fast);
}
.search-item:hover {
    background: var(--surface-2);
    color: var(--text);
}
.search-item svg { color: var(--text-muted); flex-shrink: 0; }

/* Help grid */
.help-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}
.help-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    color: var(--text);
    font-size: 13px;
    transition: all var(--t-base);
}
.help-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
    color: var(--text);
}
.help-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}
.help-desc {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 3px;
    font-weight: 500;
}

/* Switch toggle */
.switch-juara {
    display: inline-block;
    position: relative;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
    cursor: pointer;
}
.switch-juara input { display: none; }
.switch-slider {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 11px;
    background: var(--border-strong);
    position: relative;
    transition: background var(--t-fast);
}
.switch-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    transition: transform var(--t-fast);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.switch-juara input:checked + .switch-slider { background: var(--success); }
.switch-juara input:checked + .switch-slider::after { transform: translateX(18px); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 992px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        left: -260px;
        width: 240px;
        transition: left var(--t-base);
        z-index: 200;
    }
    .sidebar.open { left: 0; }
    .two-col, .two-col.wide-right, .three-col { grid-template-columns: 1fr; }
    .main-content { padding: 20px 16px 40px; }
    .topbar { padding: 10px 16px; }
    .topbar-search { display: none; }
    .page-title { font-size: 20px; }
    .campaign-row { grid-template-columns: 1fr 1fr; }
}
