/*
 * DartCRM — Visual Refresh (design-refresh branch)
 * Drop this file to revert: remove the <link> from index.html
 * All rules use higher specificity or targeted overrides only.
 * No structure, JS, or IDs are changed.
 */

/* =========================================================
   1. DESIGN TOKENS — richer, more opinionated colour system
   ========================================================= */
:root {
    --primary:         #4f46e5;
    --primary-mid:     #6366f1;
    --primary-light:   #eef2ff;
    --primary-glow:    rgba(79,70,229,0.18);

    --success:         #059669;
    --success-light:   #d1fae5;
    --danger:          #dc2626;
    --danger-light:    #fee2e2;
    --warning:         #d97706;
    --warning-light:   #fef3c7;
    --orange:          #ea580c;

    /* Sidebar */
    --sidebar-bg:      #18181b;
    --sidebar-border:  rgba(255,255,255,0.07);
    --sidebar-item-hover: rgba(255,255,255,0.07);
    --sidebar-active-bg: rgba(99,102,241,0.22);
    --sidebar-active-border: #6366f1;

    /* Surface */
    --bg:              #f4f6fb;
    --surface:         #ffffff;
    --surface-2:       #f8fafc;
    --border:          #e5e9f0;

    /* Text */
    --text-main:       #0f172a;
    --text-sub:        #475569;
    --text-muted:      #94a3b8;

    /* Shadows */
    --card-shadow:       0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
    --card-shadow-hover: 0 8px 30px rgba(15,23,42,0.10);
    --modal-shadow:      0 32px 64px -12px rgba(15,23,42,0.28);

    /* Radius */
    --radius:     16px;
    --radius-sm:  8px;
    --radius-lg:  22px;
    --radius-pill:50px;

    /* Transition */
    --transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
}

/* =========================================================
   2. GLOBAL BODY & SCROLLBAR
   ========================================================= */
body {
    background: var(--bg);
    font-size: 13.5px;
    letter-spacing: 0.01em;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* =========================================================
   3. SIDEBAR / NAV-RAIL
   ========================================================= */
.nav-rail {
    width: 68px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    padding: 18px 0 18px 0;
    gap: 4px;
    box-shadow: 2px 0 12px rgba(0,0,0,0.18);
}

.nav-rail.expanded {
    width: 220px;
    padding-left: 14px;
}

/* Dart logo area at top of nav */
.nav-toggle-btn {
    color: #52525b;
    margin-bottom: 12px;
    padding: 0 10px;
}
.nav-toggle-btn:hover { color: white; }
.nav-rail.expanded .nav-toggle-btn { padding-right: 14px; }

/* Nav items */
.nav-item {
    width: 44px;
    height: 40px;
    border-radius: 10px;
    color: #71717a;
    font-size: 0.82rem;
    margin: 0 auto;
    position: relative;
}
.nav-rail.expanded .nav-item {
    width: calc(100% - 8px);
    margin: 0 4px;
    height: 38px;
    padding-left: 10px;
    border-radius: 9px;
}

.nav-item:hover {
    background: var(--sidebar-item-hover);
    color: #e4e4e7;
}

/* Active nav item — left accent bar + soft indigo glow */
.nav-item.active {
    background: var(--sidebar-active-bg);
    color: #a5b4fc;
    box-shadow: none;
}
.nav-item.active::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 6px;
    bottom: 6px;
    width: 3px;
    background: var(--primary-mid);
    border-radius: 0 3px 3px 0;
}
.nav-rail.expanded .nav-item.active::before {
    left: -14px;
}

/* Section divider: push settings to bottom */
#nav-settings {
    margin-top: auto !important;
    border-top: 1px solid var(--sidebar-border);
    padding-top: 12px;
    margin-left: auto;
    margin-right: auto;
}
.nav-rail.expanded #nav-settings {
    margin-left: 4px;
    margin-right: 4px;
}

.nav-text {
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0;
}

/* Nav icon sizing */
.nav-icon i { width: 18px; height: 18px; }

/* Subtle section labels between nav groups */
.nav-section-label {
    font-size: 0.6rem;
    font-weight: 700;
    color: #3f3f46;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 10px 14px 4px 14px;
    display: none;
}
.nav-rail.expanded .nav-section-label { display: block; }

/* =========================================================
   4. VIEWPORT & MAIN LAYOUT
   ========================================================= */
.viewport {
    padding: 24px 32px;
    background: var(--bg);
}

/* =========================================================
   5. DASHBOARD HEADER
   ========================================================= */
.dash-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.dash-logo { height: 44px; display: block; object-fit: contain; }

.dash-title {
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--text-main) 40%, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* User menu pill */
.user-profile-box {
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--card-shadow);
    padding: 5px 12px 5px 5px;
    gap: 8px;
}
.user-profile-box:hover {
    border-color: #c7d2fe;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.10);
    transform: none;
}

.user-avatar {
    width: 30px;
    height: 30px;
    font-size: 0.78rem;
    background: linear-gradient(135deg, #4f46e5, #818cf8);
}

.user-name { font-size: 0.8rem; font-weight: 700; }

.user-dropdown {
    border-radius: 12px;
    box-shadow: var(--modal-shadow);
    border: 1px solid var(--border);
    top: 44px;
    min-width: 170px;
    overflow: hidden;
}

.user-drop-item {
    font-size: 0.82rem;
    padding: 11px 15px;
    gap: 8px;
}

/* =========================================================
   6. METRIC CARDS (DASHBOARD KPIs)
   ========================================================= */
.metrics-row {
    gap: 14px;
    margin-bottom: 22px;
}

.metric-card {
    border-radius: var(--radius);
    padding: 20px 18px 18px;
    border: 1px solid var(--border);
    box-shadow: var(--card-shadow);
    text-align: left;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* Subtle tinted backgrounds per card */
.metric-card:nth-child(1) { background: #f5f3ff; border-color: #ddd6fe; }
.metric-card:nth-child(2) { background: #eff6ff; border-color: #bfdbfe; }
.metric-card:nth-child(3) { background: #fff7ed; border-color: #fed7aa; }
.metric-card:nth-child(4) { background: #faf5ff; border-color: #e9d5ff; }
.metric-card:nth-child(5) { background: #fff1f2; border-color: #fecdd3; }

.metric-card::before { display: none; }
.metric-card::after  { display: none; }

.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-shadow-hover);
    filter: brightness(0.98);
}

/* Coloured icon badge */
.metric-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}
.metric-card:nth-child(1) .metric-icon { background: #ede9fe; }
.metric-card:nth-child(2) .metric-icon { background: #dbeafe; }
.metric-card:nth-child(3) .metric-icon { background: #ffedd5; }
.metric-card:nth-child(4) .metric-icon { background: #f3e8ff; }
.metric-card:nth-child(5) .metric-icon { background: #ffe4e6; }

.metric-card:nth-child(1) .metric-icon i { color: #7c3aed; }
.metric-card:nth-child(2) .metric-icon i { color: #2563eb; }
.metric-card:nth-child(3) .metric-icon i { color: #ea580c; }
.metric-card:nth-child(4) .metric-icon i { color: #9333ea; }
.metric-card:nth-child(5) .metric-icon i { color: #e11d48; }
.metric-icon i { width: 18px; height: 18px; }

.metric-val {
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1;
    margin-bottom: 6px;
    margin-top: 0;
    color: var(--text-main);
    display: block;
    width: 100%;
    text-align: left;
}

.metric-card:nth-child(1) .metric-val { color: #6d28d9; }
.metric-card:nth-child(2) .metric-val { color: #1d4ed8; }
.metric-card:nth-child(3) .metric-val { color: #c2410c; }
.metric-card:nth-child(4) .metric-val { color: #7e22ce; }
.metric-card:nth-child(5) .metric-val { color: #be123c; }

.metric-label {
    font-size: 0.67rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: block;
    width: 100%;
    text-align: left;
    margin-top: auto;
    padding-top: 6px;
    min-height: 2.2em;
    line-height: 1.3;
}

/* =========================================================
   7. GENERIC CARDS
   ========================================================= */
.card {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--card-shadow);
    padding: 22px;
    background: var(--surface);
}

/* =========================================================
   8. SIDEBAR PANEL (Orders mini-list)
   ========================================================= */
.sidebar {
    width: 300px;
    border-right: 1px solid var(--border);
    background: var(--surface);
    padding: 20px;
}

/* =========================================================
   9. SEARCH BOXES
   ========================================================= */
.search-box input {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    height: 40px;
    font-size: 0.85rem;
    padding-left: 40px;
    transition: var(--transition);
}
.search-box input:focus {
    background: white;
    border-color: var(--primary-mid);
    box-shadow: 0 0 0 3px var(--primary-glow);
    outline: none;
}

/* Global inputs */
input:not([type=checkbox]):not([type=radio]):not([type=range]),
textarea,
select {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
    font-size: 0.88rem;
    transition: var(--transition);
}
input:not([type=checkbox]):not([type=radio]):not([type=range]):focus,
textarea:focus,
select:focus {
    background: white;
    border-color: var(--primary-mid);
    box-shadow: 0 0 0 3px var(--primary-glow);
    outline: none;
}

label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 5px;
}

/* =========================================================
   10. BUTTONS
   ========================================================= */
.btn-add-main {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 60%, #818cf8 100%);
    border-radius: var(--radius-sm);
    font-size: 0.87rem;
    padding: 12px 18px;
    box-shadow: 0 4px 14px rgba(79,70,229,0.28);
    letter-spacing: 0.01em;
    border: none;
}
.btn-add-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79,70,229,0.36);
}

.btn-sync {
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-sub);
}
.btn-sync:hover {
    background: var(--primary-light);
    border-color: #c7d2fe;
    color: var(--primary);
}

/* =========================================================
   11. TABS
   ========================================================= */
.tabs {
    gap: 4px;
    border-bottom: none;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 4px;
    display: inline-flex;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 7px 18px;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 600;
    border-bottom: none;
    color: var(--text-muted);
    transition: var(--transition);
}
.tab-btn:hover {
    color: var(--text-main);
    background: white;
}
.tab-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 1px 4px rgba(15,23,42,0.10);
    border-bottom: none;
}

/* Customer tab buttons (separate class) */
.customer-tab-btn {
    padding: 7px 14px;
    border-radius: var(--radius-pill);
    font-size: 0.77rem;
    font-weight: 600;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.customer-tab-btn:hover {
    background: white;
    color: var(--text-main);
}
.customer-tab-btn.active-tab {
    background: white;
    color: var(--primary);
    box-shadow: 0 1px 4px rgba(15,23,42,0.10);
}

/* =========================================================
   12. MODALS
   ========================================================= */
.modal {
    background: rgba(15,23,42,0.65);
    backdrop-filter: blur(8px);
}

.modal-box {
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--modal-shadow);
    animation: modalSlideUp 0.22s cubic-bezier(0.34,1.56,0.64,1);
    border: 1px solid var(--border);
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(22px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* =========================================================
   12b. ADD ORDER MODAL — polished layout
   ========================================================= */

/* Box sizing / width */
#addModal .modal-box {
    width: 420px;
    padding: 30px 32px 28px;
    box-sizing: border-box;
}

/* Strip browser default h2 margins inside the modal */
#addModal h2,
#addModal .m-step-title {
    margin: 0 0 4px !important;
    font-size: 1.2rem !important;
    font-weight: 800 !important;
    color: var(--text-main) !important;
    letter-spacing: -0.025em !important;
    line-height: 1.25 !important;
}

/* Subtitle on the choice screen */
#addModal #m-step-choice > p {
    margin: 0 0 20px !important;
    font-size: 0.83rem !important;
    color: var(--text-muted) !important;
    line-height: 1.5 !important;
}

/* Stack the choice buttons with clean gap */
#addModal #m-step-choice > div[style*="flex-direction:column"] {
    gap: 10px !important;
    margin-bottom: 18px !important;
}

/* Cancel link buttons */
#addModal #m-step-choice  > button:last-child,
#addModal #m-step-quick   > button:last-child {
    width: 100% !important;
    background: none !important;
    border: none !important;
    color: var(--text-muted) !important;
    font-family: inherit !important;
    font-size: 0.82rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    padding: 8px 0 0 !important;
    margin: 0 !important;
}
#addModal #m-step-choice  > button:last-child:hover,
#addModal #m-step-quick   > button:last-child:hover {
    color: var(--danger) !important;
}

/* All form inputs, textareas, selects inside the modal */
#addModal input:not([type=checkbox]):not([type=radio]):not([type=range]),
#addModal textarea,
#addModal select {
    display: block !important;
    width: 100% !important;
    padding: 11px 14px !important;
    border-radius: 10px !important;
    border: 1.5px solid var(--border) !important;
    background: var(--surface-2) !important;
    font-family: inherit !important;
    font-size: 0.88rem !important;
    color: var(--text-main) !important;
    margin: 0 0 11px !important;
    box-sizing: border-box !important;
    transition: var(--transition) !important;
}
#addModal input:focus,
#addModal textarea:focus,
#addModal select:focus {
    border-color: var(--primary-mid) !important;
    background: white !important;
    box-shadow: 0 0 0 3px var(--primary-glow) !important;
    outline: none !important;
}

/* Textarea — fixed height, no user resize */
#addModal textarea {
    height: 86px !important;
    resize: none !important;
    line-height: 1.5 !important;
}

/* Customer fields section — tighten the stack */
#addModal #m-customer-fields-section {
    margin-bottom: 6px;
}

/* Step header (back arrow + title row) */
#addModal .m-step-header {
    margin-bottom: 20px !important;
    gap: 10px !important;
}

/* Place Order button — flush to fields, no oversized bottom gap */
#addModal .btn-add-main {
    width: 100% !important;
    margin: 10px 0 0 !important;
    font-family: inherit !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
}

/* Billing display pill */
#addModal #m-billing-amount {
    display: inline-block;
    background: #d1fae5;
    color: #065f46;
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 0.82rem;
    font-weight: 700;
}

/* Search results dropdown */
#addModal #m-search-results {
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--card-shadow-hover);
    margin-top: -8px;
    overflow: hidden;
}

/* =========================================================
   13. PROGRESS STEPPER
   ========================================================= */
.progress-container {
    margin: 32px 0;
    padding: 0 6px;
}

.progress-line {
    height: 2px;
    background: var(--border);
    top: 17px;
}

.step {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-muted);
    width: 64px;
    gap: 0;
}
.step:hover { transform: translateY(-3px); }

.icon-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--surface);
    margin-bottom: 7px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: var(--transition);
}

/* Active step states */
.step.prio-low .icon-circle {
    border-color: var(--success);
    background: var(--success-light);
    color: var(--success);
    box-shadow: 0 2px 8px rgba(5,150,105,0.18);
}
.step.prio-med .icon-circle {
    border-color: var(--warning);
    background: var(--warning-light);
    color: var(--warning);
    box-shadow: 0 2px 8px rgba(217,119,6,0.18);
}
.step.prio-high .icon-circle {
    border-color: var(--danger);
    background: var(--danger-light);
    color: var(--danger);
    box-shadow: 0 2px 8px rgba(220,38,38,0.18);
}

/* =========================================================
   14. NOTES / ALERTS
   ========================================================= */
.note-entry {
    border-radius: 10px;
    border: 1px solid var(--border);
    border-left-width: 4px;
    padding: 13px 15px;
    font-size: 0.83rem;
    line-height: 1.5;
}
.note-high { border-left-color: var(--danger); background: #fff5f5; border-color: #fee2e2; border-left-color: var(--danger); }
.note-med  { border-left-color: var(--warning); background: #fffbeb; border-color: #fef3c7; }
.note-low  { border-left-color: var(--border); background: var(--surface-2); }

/* =========================================================
   15. ACTION ICONS
   ========================================================= */
.action-icon {
    border-radius: var(--radius-sm);
    padding: 7px;
    color: var(--text-muted);
}
.action-icon:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: #c7d2fe;
}

/* =========================================================
   16. MINI DASHBOARD CARDS (dash-mini)
   ========================================================= */
.dash-mini {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--card-shadow);
    padding: 15px 16px;
    gap: 12px;
    background: var(--surface);
}
.dash-mini:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-hover);
    border-color: #c7d2fe;
}
.dash-mini-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
}
.dash-mini-title { font-size: 0.82rem; font-weight: 700; }
.dash-mini-sub   { font-size: 0.7rem; }

/* =========================================================
   17. ORDER CARDS
   ========================================================= */
.order-list-card {
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 14px 16px;
    box-shadow: var(--card-shadow);
    margin-bottom: 10px;
    transition: var(--transition);
}
.order-list-card:hover {
    border-color: #c7d2fe;
    box-shadow: 0 6px 20px rgba(99,102,241,0.10);
    transform: translateY(-2px);
}

.pending-order-card {
    border-radius: 10px;
    border: 1px solid var(--border);
    height: 52px;
    padding: 0 14px;
    box-shadow: var(--card-shadow);
    margin-bottom: 6px;
    background: var(--surface);
}
.pending-order-card:hover {
    border-color: #c7d2fe;
    box-shadow: 0 4px 14px rgba(99,102,241,0.10);
    transform: translateX(3px);
}

.order-title { font-size: 0.87rem; }

/* Stage badges */
.stage-badge {
    border-radius: var(--radius-pill);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 4px 11px;
    min-width: 82px;
}

.stage-prio-low  { background: #d1fae5; color: #065f46; }
.stage-prio-med  { background: #fef3c7; color: #92400e; }
.stage-prio-high { background: #fee2e2; color: #991b1b; }

.date-box {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
    font-size: 0.72rem;
    font-weight: 700;
    height: 30px;
    min-width: 110px;
}

/* =========================================================
   18. TABLES (billing, activity log)
   ========================================================= */
.bill-table {
    border-radius: var(--radius-sm);
    overflow: hidden;
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}

.bill-table thead tr {
    background: var(--surface-2);
}

.bill-table th {
    padding: 11px 14px;
    font-size: 0.67rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    border-bottom: 2px solid var(--border);
    text-align: left;
}

.bill-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-main);
}

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

/* =========================================================
   19. TOTAL / SUMMARY BOX
   ========================================================= */
.total-box {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-radius: var(--radius);
    border: 1px solid #334155;
}

.summary-item {
    border-bottom-color: #334155;
    font-size: 0.87rem;
}

/* =========================================================
   20. CUSTOMER VIEW - HEADER & CONTROLS
   ========================================================= */
#view-customers header {
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    padding: 14px 22px;
}

#view-customers header h1 {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

/* Export / Import buttons */
#view-customers header button {
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
    font-weight: 700;
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid #c7d2fe;
    padding: 7px 14px;
}
#view-customers header button:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Search bar row */
#view-customers > div:nth-child(2) {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 14px 22px;
}

#customerSearchMain {
    border-radius: var(--radius-pill) !important;
    height: 40px !important;
    background: var(--surface-2) !important;
    border: 1px solid var(--border) !important;
    font-size: 0.87rem !important;
}
#customerSearchMain:focus {
    background: white !important;
    border-color: var(--primary-mid) !important;
    box-shadow: 0 0 0 3px var(--primary-glow) !important;
}

/* Quick Add button */
#view-customers > div:nth-child(2) button {
    height: 40px;
    border-radius: var(--radius-pill) !important;
    background: var(--primary) !important;
    color: white !important;
    border: none !important;
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    padding: 0 18px !important;
    box-shadow: 0 4px 12px rgba(79,70,229,0.25);
    transition: var(--transition);
}
#view-customers > div:nth-child(2) button:hover {
    background: #4338ca !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(79,70,229,0.32) !important;
}

/* =========================================================
   21. LOGIN SCREEN
   ========================================================= */
#login-screen {
    background: linear-gradient(140deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
}

.login-card label {
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    color: var(--text-muted) !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.login-card {
    border-radius: var(--radius-lg);
    padding: 44px;
    box-shadow: 0 40px 80px -12px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.08);
    background: white;
}

.login-card input {
    border-radius: var(--radius-sm);
    height: 44px;
    padding: 0 14px;
    font-size: 0.9rem;
}
.login-card input:focus {
    border-color: var(--primary-mid);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* =========================================================
   22. ACTIVITY LOG / FILTERS BAR
   ========================================================= */
.filters-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    gap: 12px;
    margin-bottom: 20px;
}

/* =========================================================
   23. SECTION TITLES & MICRO-TYPOGRAPHY
   ========================================================= */
.section-title {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--primary);
    border-left-color: var(--primary);
    padding-left: 10px;
    margin: 24px 0 12px;
}

/* =========================================================
   24. DETAIL PANE INPUTS
   ========================================================= */
.detail-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 3px;
}

.detail-input {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
    font-size: 0.88rem;
    padding: 9px 12px;
    transition: var(--transition);
}
.detail-input:focus {
    background: white;
    border-color: var(--primary-mid);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* =========================================================
   25. INVENTORY TABLE ROWS
   ========================================================= */
.inv-row {
    border-radius: 10px;
    transition: var(--transition);
}
.inv-row:hover { background: var(--primary-light); }

/* =========================================================
   26. BADGE UTILITIES (quick helpers)
   ========================================================= */
.badge-healthy {
    border-radius: var(--radius-pill);
    font-size: 0.67rem;
    font-weight: 700;
    background: var(--success-light);
    color: #065f46;
}

/* =========================================================
   27. FLOATING ADD BUTTON on small screens (aesthetic)
   ========================================================= */
@media (max-width: 768px) {
    .metrics-row { grid-template-columns: repeat(2,1fr); }
    .viewport { padding: 16px; }
    .nav-rail { width: 56px; }
}

/* =========================================================
   28. SMOOTH FADE-IN for all view transitions
   ========================================================= */
#view-home,
#view-customers,
#view-orders,
#view-billing,
#view-signup,
#view-inventory,
#view-activity,
#view-calendar,
#view-tasks,
#view-notes,
#view-archive,
#view-callers {
    animation: viewFadeIn 0.18s ease both;
}

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

/* =========================================================
   29. CUSTOMER LIST PANEL BACKGROUND
   ========================================================= */
#customer-list-panel {
    background: var(--bg);
}

.customer-list-container {
    padding: 14px 18px;
}

/* =========================================================
   30. ORDERS VIEW HEADER AREA
   ========================================================= */
#view-orders .dash-header,
#view-billing .dash-header,
#view-inventory .dash-header,
#view-activity .dash-header,
#view-tasks .dash-header,
#view-notes .dash-header,
#view-archive .dash-header,
#view-callers .dash-header,
#view-calendar .dash-header,
#view-signup .dash-header {
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 22px;
}

/* =========================================================
   30b. DASHBOARD WELCOME BAR
   ========================================================= */
.dash-welcome-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(105deg, #fafbff 0%, #ffffff 60%, #fdf8ff 100%);
    border: 1px solid var(--border);
    border-left: 3px solid #6366f1;
    border-radius: var(--radius);
    padding: 20px 28px;
    margin-bottom: 18px;
    box-shadow: var(--card-shadow);
    gap: 20px;
}

.dash-welcome-left {
    flex-shrink: 0;
    min-width: 160px;
    width: 160px;
}

.dash-welcome-right {
    flex-shrink: 0;
    min-width: 160px;
    width: 160px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.dash-welcome-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.dash-welcome-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

.dash-welcome-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.dash-welcome-divider {
    height: 1px;
    flex: 1;
    background: linear-gradient(90deg, transparent, #ddd6fe, transparent);
    max-width: 80px;
}

.dash-welcome-hebrew {
    font-family: 'Frank Ruhl Libre', serif;
    font-size: 1.55rem;
    font-weight: 900;
    color: #4338ca;
    letter-spacing: 0.06em;
    direction: rtl;
    text-align: center;
    line-height: 1.3;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(67,56,202,0.10);
}

.dash-quick-order-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    border: none;
    color: white;
    border-radius: var(--radius-pill);
    padding: 10px 20px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(79,70,229,0.25);
    flex-shrink: 0;
    white-space: nowrap;
}
.dash-quick-order-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(79,70,229,0.35);
    filter: brightness(1.06);
}

/* =========================================================
   31. BILLING — HEADER STAT BOX
   ========================================================= */
.header-stat-box {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    background: var(--success-light);
    border: 1px solid #a7f3d0;
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    gap: 2px;
}
.header-stat-num {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--success);
    line-height: 1;
}
.header-stat-label {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #065f46;
    opacity: 0.75;
}

/* =========================================================
   32. DASHBOARD — SNAP CARDS (Stock & Revenue)
   ========================================================= */
.dash-snap-card {
    border-radius: var(--radius) !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.10) !important;
    border: none !important;
    cursor: pointer;
    transition: var(--transition);
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
    padding: 20px !important;
    position: relative;
    overflow: hidden;
    color: white !important;
}
.dash-snap-card:hover {
    transform: translateY(-3px) !important;
    box-shadow: var(--card-shadow-hover) !important;
    filter: brightness(0.98);
}
.dash-snap-stock  {
    background: #fff7ed !important;
    border: 1px solid #fed7aa !important;
    color: var(--text-main) !important;
}
.dash-snap-revenue {
    background: #f0fdf4 !important;
    border: 1px solid #bbf7d0 !important;
    color: var(--text-main) !important;
}

.dash-snap-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.dash-snap-stock  .dash-snap-icon { background: #ffedd5; }
.dash-snap-revenue .dash-snap-icon { background: #dcfce7; }
.dash-snap-stock  .dash-snap-icon i { color: #ea580c; }
.dash-snap-revenue .dash-snap-icon i { color: #16a34a; }
.dash-snap-icon i { width: 22px; height: 22px; }

.dash-snap-body { flex: 1; min-width: 0; }
.dash-snap-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.dash-snap-val {
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    margin-bottom: 4px;
}
.dash-snap-stock  .dash-snap-val { color: #c2410c; }
.dash-snap-revenue .dash-snap-val { color: #15803d; }
.dash-snap-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}
.dash-snap-arrow {
    width: 18px; height: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.dash-snap-card::after { display: none; }

/* =========================================================
   33. DASHBOARD — PENDING ORDERS PANEL & CALENDAR WIDGET
   (Styling now handled by .dash-panel, .dash-sort-pill,
    .dash-cal-tab classes in section 47)
   ========================================================= */

/* =========================================================
   34. CALENDAR — MAIN VIEW TOGGLE BUTTONS
   ========================================================= */
#cal-overview-btn,
#cal-today-btn,
#cal-week-btn,
#cal-month-btn {
    border-radius: var(--radius-pill) !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    padding: 8px 18px !important;
    border: 1px solid var(--border) !important;
    background: var(--surface) !important;
    color: var(--text-muted) !important;
    transition: var(--transition) !important;
}
#cal-overview-btn:hover,
#cal-today-btn:hover,
#cal-week-btn:hover,
#cal-month-btn:hover {
    background: var(--primary-light) !important;
    color: var(--primary) !important;
    border-color: #c7d2fe !important;
}

/* Calendar nav prev/next buttons */
#view-calendar button[onclick*="previousMainCalendar"],
#view-calendar button[onclick*="nextMainCalendar"] {
    border-radius: var(--radius-sm) !important;
    background: var(--surface-2) !important;
    color: var(--text-sub) !important;
    border: 1px solid var(--border) !important;
    padding: 8px 12px !important;
    transition: var(--transition) !important;
}
#view-calendar button[onclick*="previousMainCalendar"]:hover,
#view-calendar button[onclick*="nextMainCalendar"]:hover {
    background: var(--primary-light) !important;
    color: var(--primary) !important;
    border-color: #c7d2fe !important;
}

/* Calendar toggle container pill */
#view-calendar > div:first-of-type {
    border-radius: var(--radius) !important;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--card-shadow) !important;
    padding: 12px 16px !important;
}

/* =========================================================
   35. TASKS — ENHANCED CARD HEADER
   ========================================================= */
#view-tasks .card h3,
#view-notes .card h3,
#view-archive .card h3 {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

/* =========================================================
   36. NOTES — MASONRY GRID CONTAINER
   ========================================================= */
#notes-list-container {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* =========================================================
   37. ARCHIVE — CARD SECTION HEADERS
   ========================================================= */
#view-archive .card {
    margin-bottom: 18px;
}

/* =========================================================
   38. INVENTORY — VIEW HEADER
   ========================================================= */
#view-inventory > div:first-child h1 {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-main);
    margin: 0;
}

#view-inventory > div:first-child {
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
    margin-bottom: 22px;
}

/* Inventory table thead */
#view-inventory table thead tr {
    background: var(--surface-2);
}
#view-inventory table th {
    font-size: 0.67rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    border-bottom: 2px solid var(--border);
    padding: 11px 14px !important;
    text-align: left !important;
}
#view-inventory table td {
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.87rem;
    color: var(--text-main);
}
#view-inventory table tbody tr:hover {
    background: var(--primary-light);
}

/* Inventory movement log search */
#inventory-log-search {
    border-radius: var(--radius-pill) !important;
    border: 1px solid var(--border) !important;
    background: var(--surface-2) !important;
    font-size: 0.85rem !important;
    height: 38px !important;
    padding: 0 14px !important;
    transition: var(--transition);
}
#inventory-log-search:focus {
    border-color: var(--primary-mid) !important;
    background: white !important;
    box-shadow: 0 0 0 3px var(--primary-glow) !important;
    outline: none !important;
}

/* =========================================================
   39. CALLERS — VIEW POLISH
   ========================================================= */
#view-callers .card input[type="text"] {
    border-radius: var(--radius-pill) !important;
    height: 40px !important;
    background: var(--surface-2) !important;
    border: 1px solid var(--border) !important;
    font-size: 0.87rem !important;
    padding: 0 16px !important;
}
#view-callers .card input[type="text"]:focus {
    border-color: var(--primary-mid) !important;
    background: white !important;
    box-shadow: 0 0 0 3px var(--primary-glow) !important;
}
#view-callers .card > div {
    gap: 10px;
}

/* =========================================================
   40. ORDERS — SEARCH BAR & QUICK ORDER BUTTON
   ========================================================= */
#orderSearchMain,
#orderSearch {
    border-radius: var(--radius-pill) !important;
    background: var(--surface-2) !important;
    border: 1px solid var(--border) !important;
    font-size: 0.87rem !important;
    padding-left: 42px !important;
    height: 40px !important;
}
#orderSearchMain:focus,
#orderSearch:focus {
    border-color: var(--primary-mid) !important;
    background: white !important;
    box-shadow: 0 0 0 3px var(--primary-glow) !important;
    outline: none !important;
}

/* Sidebar quick-order button layout */
#sidebar-orders .btn-add-main {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    margin-bottom: 16px !important;
    font-family: inherit !important;
}
#sidebar-orders .btn-add-main svg {
    width: 18px !important;
    height: 18px !important;
    flex-shrink: 0;
}

#orders-main-container > div:first-child {
    background: var(--bg) !important;
}

/* =========================================================
   41. SIGNUP FORM — POLISHED SECTIONS
   ========================================================= */
.signup-container {
    border-radius: var(--radius-lg) !important;
    padding: 36px !important;
}

/* signup h2 — keep original weight/size, just tighten border colour */
.signup-container h2 {
    border-bottom-color: var(--border) !important;
}

/* Restore natural casing for all labels & section titles inside signup */
.signup-container label,
.signup-container .checkbox-label {
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    color: #374151 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.signup-container .section-title {
    font-size: 14px !important;
    font-weight: 600 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.signup-container .input-group > label {
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    color: #475569 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

/* Radio cards enhancement */
.radio-card {
    border-radius: var(--radius-sm) !important;
    border: 1px solid var(--border) !important;
    background: var(--surface-2) !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    padding: 12px !important;
    transition: var(--transition) !important;
    gap: 8px;
}
.radio-card:hover {
    border-color: #c7d2fe !important;
    background: var(--primary-light) !important;
}

/* Logic panel */
.logic-panel {
    background: var(--primary-light) !important;
    border: 1px solid #c7d2fe !important;
    border-radius: var(--radius-sm) !important;
}

/* Discount panel */
.discount-panel {
    background: var(--warning-light) !important;
    border: 1px solid #fde68a !important;
    border-radius: var(--radius-sm) !important;
}

/* Terms box */
.terms-box {
    background: #fffbeb !important;
    border: 1px solid #fde68a !important;
    border-radius: var(--radius-sm) !important;
    font-size: 0.83rem !important;
}

/* =========================================================
   42. GLOBAL CARD H3 HEADINGS
   ========================================================= */
.card h3 {
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-main);
    margin: 0;
}

/* =========================================================
   43. ACTIVITY LOG TABLE IMPROVEMENTS
   ========================================================= */
#view-activity .card {
    padding: 0;
    overflow: hidden;
}
#view-activity .card > div {
    border-radius: var(--radius);
}

/* =========================================================
   44. ORDERS DETAIL PANEL
   ========================================================= */
#orders-detail-view {
    border-left: 1px solid var(--border) !important;
    background: var(--surface) !important;
}

/* =========================================================
   45. GENERAL POLISH — REMOVE INLINE OVERRIDE ARTIFACTS
   ========================================================= */
/* Ensure cards in all views get the radius token */
.card {
    border-radius: var(--radius);
}

/* Better empty-state styling for list containers */
#tasks-list-container:empty::after,
#notes-list-container:empty::after,
#callers-list-container:empty::after,
#archived-orders-container:empty::after,
#archived-tasks-container:empty::after {
    content: 'Nothing here yet';
    display: block;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 32px 0;
}

/* =========================================================
   46. QUICK-ADD CUSTOMER MODAL POLISH
   ========================================================= */
#quick-add-modal > div {
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--modal-shadow) !important;
    animation: modalSlideUp 0.22s cubic-bezier(0.34,1.56,0.64,1);
}
#quick-add-modal h2 {
    font-size: 1.2rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.03em !important;
}
#quick-add-modal label {
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: var(--text-muted) !important;
}
#quick-add-modal input {
    border-radius: var(--radius-sm) !important;
    border: 1px solid var(--border) !important;
    background: var(--surface-2) !important;
    margin-bottom: 0 !important;
}
#quick-add-modal input:focus {
    border-color: var(--primary-mid) !important;
    background: white !important;
    box-shadow: 0 0 0 3px var(--primary-glow) !important;
}

/* Cancel / Confirm buttons in quick-add */
#quick-add-modal button:first-of-type {
    border-radius: var(--radius-sm) !important;
    font-weight: 700 !important;
    font-size: 0.87rem !important;
    background: var(--surface-2) !important;
    color: var(--text-sub) !important;
    border: 1px solid var(--border) !important;
}
#quick-add-modal button:last-of-type {
    border-radius: var(--radius-sm) !important;
    font-weight: 700 !important;
    font-size: 0.87rem !important;
    background: linear-gradient(135deg, #059669, #10b981) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(5,150,105,0.25) !important;
    border: none !important;
}
#quick-add-modal button:last-of-type:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 16px rgba(5,150,105,0.32) !important;
}

/* =========================================================
   47. DASHBOARD PANELS — Pending Orders & Calendar
   ========================================================= */
.dash-panel {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dash-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    gap: 10px;
    flex-wrap: wrap;
}

.dash-panel-title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.dash-panel-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dash-panel-badge {
    font-size: 0.65rem;
    font-weight: 700;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-pill);
    padding: 3px 9px;
    letter-spacing: 0.03em;
}

.dash-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 420px;
}

/* ---- Sort pills ---- */
.dash-sort-pills {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.dash-sort-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 11px;
    border-radius: var(--radius-pill);
    font-size: 0.68rem;
    font-weight: 700;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.dash-sort-pill:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: #c7d2fe;
}
.dash-sort-pill--active {
    background: var(--primary-light);
    color: var(--primary);
    border-color: #c7d2fe;
}

/* ---- Calendar tabs ---- */
.dash-cal-tabs {
    display: flex;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 3px;
    gap: 2px;
}

.dash-cal-tab {
    padding: 4px 11px;
    border-radius: var(--radius-pill);
    font-size: 0.7rem;
    font-weight: 700;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.dash-cal-tab:hover {
    color: var(--text-main);
    background: rgba(255,255,255,0.7);
}
.dash-cal-tab--active {
    background: white;
    color: var(--primary);
    box-shadow: 0 1px 4px rgba(15,23,42,0.10);
}

/* Expand + Add buttons */
.dash-cal-link {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}
.dash-cal-link:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: #c7d2fe;
}

.dash-cal-add {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: none;
    background: #dcfce7;
    color: #16a34a;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 700;
}
/* =========================================================
   49. DRAFT EXTRAS — TO REVERT INSTANTLY, ADD:
       .dash-extras { display: none !important; }
   ========================================================= */

/* --- Global quick-search (icon-toggle) --- */
/* --- Global quick-search --- */
/* Single container: always 40px tall, flex row, matches user-profile-box height exactly */
.dash-search-container {
    position: relative;
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    height: 40px;
    gap: 0;
}
/* Toggle icon */
.dash-search-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
    flex-shrink: 0;
    user-select: none;
    box-sizing: border-box;
}
.dash-search-toggle:hover,
.dash-search-toggle--active {
    background: #ede9fe;
    color: #6366f1;
}
/* Input: hidden until container is open */
.dash-global-search-input,
#dash-global-search-input {
    width: 0 !important;
    height: 40px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-radius: var(--radius-pill);
    background: transparent !important;
    font-size: 0.82rem;
    color: var(--text-main);
    box-sizing: border-box !important;
    outline: none;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: width 0.2s ease, padding 0.2s ease, opacity 0.15s ease,
                border-color 0.2s, box-shadow 0.2s, background 0.2s;
    -webkit-appearance: none;
}
.dash-search-container--open .dash-global-search-input,
.dash-search-container--open #dash-global-search-input {
    width: 220px !important;
    padding: 0 14px !important;
    margin-right: 6px !important;
    margin-left: 0 !important;
    margin-bottom: 0 !important;
    border: 1.5px solid #a5b4fc !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 3px var(--primary-glow);
    opacity: 1;
    pointer-events: auto;
}
.dash-global-search-input::placeholder { color: #94a3b8; }
.dash-global-results {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: auto;
    min-width: 300px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--modal-shadow);
    z-index: 9000;
    overflow: hidden;
    animation: fadeIn 0.12s ease;
}
.dash-gs-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid #f1f5f9;
}
.dash-gs-row:last-child { border-bottom: none; }
.dash-gs-row:hover { background: #f5f3ff; }
.dash-gs-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #a78bfa);
    color: white;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.dash-gs-body { flex: 1; min-width: 0; }
.dash-gs-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dash-gs-meta {
    font-size: 0.73rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dash-gs-step {
    font-size: 0.7rem;
    font-weight: 700;
    background: #ede9fe;
    color: #6d28d9;
    padding: 2px 8px;
    border-radius: 20px;
    flex-shrink: 0;
    white-space: nowrap;
}
.dash-gs-empty {
    padding: 14px;
    text-align: center;
    font-size: 0.83rem;
    color: var(--text-muted);
}

/* --- Unpaid billing strip --- */
.dash-overdue-strip--unpaid {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    color: #075985;
}

/* --- Today's installs panel rows --- */
.dash-install-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: var(--transition);
    border-radius: 6px;
}
.dash-install-row:last-child { border-bottom: none; }
.dash-install-row:hover { background: #fafbff; padding-left: 4px; }
.dash-install-slot {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}
.dash-install-slot--am { background: #fef3c7; color: #92400e; }
.dash-install-slot--pm { background: #dbeafe; color: #1e40af; }
.dash-install-info { flex: 1; min-width: 0; }
.dash-install-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dash-install-addr {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dash-install-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    flex-shrink: 0;
}

/* Overdue alert strip */
.dash-overdue-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: var(--radius);
    margin-bottom: 14px;
    font-size: 0.83rem;
    font-weight: 500;
    animation: fadeIn 0.3s ease;
}
.dash-overdue-strip--danger {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
}
.dash-overdue-strip--today {
    background: #fefce8;
    border: 1px solid #fde68a;
    color: #92400e;
}
.dash-overdue-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
.dash-overdue-btn {
    margin-left: auto;
    flex-shrink: 0;
    background: none;
    border: 1px solid currentColor;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    color: inherit;
    transition: var(--transition);
}
.dash-overdue-btn:hover { opacity: 0.75; }

/* Active customers snap card */
.dash-snap-customers {
    background: #f8faff !important;
    border: 1px solid #c7d2fe !important;
    color: var(--text-main) !important;
}
.dash-snap-customers .dash-snap-icon { background: #e0e7ff; }
.dash-snap-customers .dash-snap-icon i { color: #4f46e5; }
.dash-snap-customers .dash-snap-val { color: #3730a3; }
.dash-customers-stats {
    display: flex;
    gap: 20px;
    flex-shrink: 0;
    margin-right: 8px;
}
.dash-cust-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}
.dash-cust-stat span {
    font-size: 1.1rem;
    font-weight: 800;
    color: #4f46e5;
    line-height: 1;
}
.dash-cust-stat small {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Activity feed rows */
.dash-feed-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid #f1f5f9;
}
.dash-feed-row:last-child { border-bottom: none; }
.dash-feed-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #6366f1;
    flex-shrink: 0;
    margin-top: 5px;
}
.dash-feed-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.dash-feed-action {
    font-size: 0.82rem;
    color: var(--text-main);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dash-feed-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* =========================================================
   MOBILE CHOICE BUTTONS
   ========================================================= */
.m-choice-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px 18px;
    border-radius: 12px;
    border: 1.5px solid var(--border);
    background: #fafbff;
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
    font-family: inherit;
    color: var(--text-main);
    line-height: 1.3;
}
.m-choice-btn:hover {
    border-color: #a5b4fc;
    background: #f5f3ff;
    box-shadow: 0 2px 12px rgba(99,102,241,0.08);
    transform: translateY(-1px);
}
.m-choice-btn--full .m-choice-icon {
    background: #ede9fe;
    color: #6d28d9;
}
.m-choice-btn--quick .m-choice-icon {
    background: #fef3c7;
    color: #d97706;
}
.m-choice-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.m-choice-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.m-choice-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-main);
}
.m-choice-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.m-step-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.m-back-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background: #f8fafc;
    color: #6366f1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition);
}
.m-back-btn:hover {
    background: #ede9fe;
    border-color: #a5b4fc;
    color: #4f46e5;
}

.m-step-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.dash-cal-add:hover {
    background: #16a34a;
    color: white;
    transform: scale(1.08);
}

.dash-cal-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px 14px;
    font-size: 0.84rem;
}

/* ── Softphone floating pill: hidden (accessible via Callers tab instead) ── */
#sph-widget { display: none !important; }

