/* ============================================================================
   Post Mini CRM — style.css  (v2 — coral/warm redesign)
   ============================================================================ */

/* ── CSS Variables ── */
:root {
    --primary:        #E8570A;
    --primary-dark:   #C4450A;
    --primary-light:  #FFF0E8;
    --primary-mid:    #FF7733;
    --success:        #16a34a;
    --success-light:  #DCFCE7;
    --warning:        #D97706;
    --warning-light:  #FEF9C3;
    --danger:         #DC2626;
    --danger-light:   #FEE2E2;
    --info:           #0284C7;
    --info-light:     #E0F2FE;
    --purple:         #7C3AED;
    --purple-light:   #EDE9FE;
    --dark:           #1C1714;
    --gray-50:        #FAF8F6;
    --gray-100:       #F2EFEB;
    --gray-200:       #E5E0D9;
    --gray-300:       #CFC9C0;
    --gray-400:       #A89E97;
    --gray-600:       #6B6560;
    --gray-700:       #4A4540;
    --gray-800:       #2D2820;
    --gray-900:       #1C1714;
    --white:          #FFFFFF;
    --shadow-sm:      0 1px 2px rgba(0,0,0,.05);
    --shadow:         0 2px 8px rgba(0,0,0,.07);
    --shadow-md:      0 4px 16px rgba(0,0,0,.09);
    --shadow-lg:      0 8px 30px rgba(0,0,0,.12);
    --shadow-xl:      0 20px 50px rgba(0,0,0,.14);
    --radius:         14px;
    --radius-sm:      8px;
    --radius-lg:      20px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #F4F1EE;
    min-height: 100vh;
    color: var(--gray-900);
    line-height: 1.6;
}

/* ── Layout ── */
.crm-container { width: 100%; padding: 0 2rem 2rem; }
.crm-main      { padding: 1rem 0 3rem; }

/* ══════════════════════════════════════════════════════════════
   Top Nav Header  —  v4 (dark branded, premium)
   ══════════════════════════════════════════════════════════════ */
.nh-header {
    position: sticky;
    top: 0;
    z-index: 800;
    background: #1C1714;
    padding: 0 2rem;
    margin: 0 -2rem 0;
    border-bottom: 1px solid rgba(255,255,255,.07);
    box-shadow: 0 1px 0 rgba(255,255,255,.04), 0 6px 24px rgba(0,0,0,.28);
    display: flex;
    align-items: stretch;
    height: 60px;
}

/* ── Brand ── */
.nh-brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: .7rem;
    padding-right: 1.75rem;
    border-right: 1px solid rgba(255,255,255,.09);
}
.nh-brand-logo {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--primary) 0%, #FF6B2B 100%);
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: .68rem; font-weight: 800;
    letter-spacing: -.02em; flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(232,87,10,.5), 0 0 0 1px rgba(255,255,255,.1);
}
.nh-brand-text {
    font-size: .9375rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    letter-spacing: -.02em;
}

/* ── Tab navigation ── */
.nh-tabs {
    display: flex;
    align-items: stretch;
    height: 100%;
    flex: 1;
    padding: 0 .75rem;
    gap: .1rem;
}
.nh-tab {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: 0 1rem;
    height: 100%;
    font-size: .8375rem;
    font-weight: 500;
    color: rgba(255,255,255,.52);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    border-top: 2px solid transparent;
    transition: color .18s, border-color .18s, background .18s;
    white-space: nowrap;
    position: relative;
}
.nh-tab svg { flex-shrink: 0; transition: opacity .18s; opacity: .6; }
.nh-tab:hover {
    color: rgba(255,255,255,.88);
    background: rgba(255,255,255,.05);
    border-radius: 0;
}
.nh-tab:hover svg { opacity: .9; }
.nh-tab--active {
    color: #fff;
    font-weight: 600;
    border-bottom-color: var(--primary);
    background: rgba(232,87,10,.08);
}
.nh-tab--active svg { opacity: 1; }

/* ── Right actions area ── */
.nh-actions {
    display: flex;
    align-items: center;
    gap: .55rem;
    flex-shrink: 0;
    margin-left: auto;
    padding-left: 1.25rem;
    border-left: 1px solid rgba(255,255,255,.09);
}

/* ── Domain select ── */
.nh-domain-form { display: flex; align-items: center; }
.nh-domain-select {
    font-family: inherit;
    font-size: .78rem;
    font-weight: 600;
    padding: .32rem .8rem;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 999px;
    background: rgba(255,255,255,.07);
    cursor: pointer;
    outline: none;
    transition: border-color .15s, background .15s, box-shadow .15s;
    color: rgba(255,255,255,.85);
    max-width: 175px;
    appearance: auto;
}
.nh-domain-select option { background: #2a201c; color: #fff; }
.nh-domain-select:hover  { border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.11); }
.nh-domain-select:focus  {
    border-color: var(--primary);
    background: rgba(232,87,10,.12);
    box-shadow: 0 0 0 3px rgba(232,87,10,.2);
}

/* ── User badge ── */
.nh-user-badge {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .28rem .7rem .28rem .28rem;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.13);
    background: rgba(255,255,255,.07);
    font-size: .8rem;
    font-weight: 600;
    color: rgba(255,255,255,.82);
    white-space: nowrap;
    transition: border-color .15s, background .15s;
    cursor: default;
}
.nh-user-badge:hover { background: rgba(255,255,255,.11); border-color: rgba(255,255,255,.22); }
.nh-user-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #FF6B2B 100%);
    color: #fff;
    font-size: .68rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(232,87,10,.4), 0 2px 6px rgba(0,0,0,.3);
}

/* ── Icon buttons (logout etc.) ── */
.nh-icon-btn {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.13);
    background: rgba(255,255,255,.06);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,.55);
    text-decoration: none;
    transition: background .15s, border-color .15s, color .15s;
    flex-shrink: 0;
}
.nh-icon-btn:hover {
    background: rgba(255,255,255,.13);
    border-color: rgba(255,255,255,.25);
    color: #fff;
}
.nh-icon-btn--logout:hover {
    background: rgba(220,38,38,.25);
    border-color: rgba(220,38,38,.45);
    color: #fca5a5;
}

/* ── Hamburger (mobile only) ── */
.nh-hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.06);
    cursor: pointer;
    color: rgba(255,255,255,.8);
    border-radius: 9px;
    transition: background .15s, border-color .15s;
    flex-shrink: 0;
}
.nh-hamburger:hover { background: rgba(255,255,255,.13); border-color: rgba(255,255,255,.25); }

/* ══════════════════════════════════════════════════════════════
   Mobile Drawer  —  v4
   ══════════════════════════════════════════════════════════════ */
.nh-mob-drawer { display: none; position: fixed; inset: 0; z-index: 9999; }
.nh-mob-drawer.is-open { display: block; }
.nh-mob-drawer-backdrop {
    position: absolute; inset: 0;
    background: rgba(10,6,4,.6);
    backdrop-filter: blur(4px);
    animation: nhFadeIn .2s ease;
}
.nh-mob-drawer-panel {
    position: absolute; left: 0; top: 0; bottom: 0; width: 272px;
    background: #1C1714;
    border-right: 1px solid rgba(255,255,255,.08);
    box-shadow: 12px 0 48px rgba(0,0,0,.5);
    display: flex; flex-direction: column; overflow-y: auto;
    animation: nhSlideIn .27s cubic-bezier(.22,.68,0,1.1);
}
@keyframes nhFadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes nhSlideIn { from { transform: translateX(-100%); } to { transform: translateX(0); } }

/* Drawer header strip */
.nh-mob-drawer-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.03);
    flex-shrink: 0;
}
.nh-mob-drawer-logo {
    font-size: .9375rem; font-weight: 800; color: #fff;
    letter-spacing: -.02em;
    display: flex; align-items: center; gap: .55rem;
}
.nh-mob-drawer-logo::before {
    content: 'CRM';
    width: 30px; height: 30px;
    background: linear-gradient(135deg, var(--primary) 0%, #FF6B2B 100%);
    border-radius: 8px;
    color: #fff; font-size: .62rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(232,87,10,.45);
    flex-shrink: 0;
}
.nh-mob-drawer-close {
    width: 30px; height: 30px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.06);
    cursor: pointer;
    border-radius: 7px; color: rgba(255,255,255,.65);
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, border-color .15s, color .15s;
}
.nh-mob-drawer-close:hover {
    background: rgba(255,255,255,.14);
    border-color: rgba(255,255,255,.28);
    color: #fff;
}

/* Drawer nav */
.nh-mob-drawer-nav { padding: .85rem .75rem; flex: 1; }
.nh-mob-nav-label {
    font-size: .62rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .1em; color: rgba(255,255,255,.28);
    padding: .25rem .6rem .55rem; display: block;
}
.nh-mob-nav-link {
    display: flex; align-items: center; gap: .65rem;
    padding: .72rem .9rem;
    border-radius: 10px;
    font-size: .875rem; font-weight: 500;
    color: rgba(255,255,255,.62);
    text-decoration: none;
    transition: background .15s, color .15s, border-color .15s;
    margin-bottom: .15rem;
    border: 1px solid transparent;
}
.nh-mob-nav-link:hover {
    background: rgba(255,255,255,.07);
    color: rgba(255,255,255,.92);
    border-color: rgba(255,255,255,.08);
}
.nh-mob-nav-link.is-active {
    background: rgba(232,87,10,.15);
    color: #FF9060;
    font-weight: 700;
    border-color: rgba(232,87,10,.3);
}

/* Drawer footer */
.nh-mob-drawer-foot {
    padding: .85rem 1.1rem 1rem;
    border-top: 1px solid rgba(255,255,255,.07);
    background: rgba(0,0,0,.12);
    flex-shrink: 0;
}
.nh-mob-logout {
    display: flex; align-items: center; gap: .65rem;
    padding: .7rem .9rem;
    border-radius: 10px;
    font-size: .875rem; font-weight: 600;
    color: rgba(248,113,113,.85);
    text-decoration: none;
    transition: background .15s, border-color .15s, color .15s;
    border: 1px solid transparent;
}
.nh-mob-logout:hover {
    background: rgba(220,38,38,.18);
    border-color: rgba(220,38,38,.3);
    color: #fca5a5;
}

/* ── Login page ── */
.login-body {
    background:
        radial-gradient(ellipse 60% 55% at 0% 0%,   rgba(232,87,10,.10) 0%, transparent 65%),
        radial-gradient(ellipse 55% 50% at 100% 100%, rgba(232,87,10,.07) 0%, transparent 65%),
        #F4F1EE;
    display: flex; align-items: center; justify-content: center; min-height: 100vh;
}
.ln-wrap { width: 100%; max-width: 420px; padding: 1.5rem; }
.ln-card {
    background: var(--white); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl); padding: 2.5rem 2rem;
    border: 1px solid var(--gray-200);
}
.ln-brand { display: flex; align-items: center; gap: .85rem; margin-bottom: 2rem; }
.ln-brand-icon {
    width: 46px; height: 46px; border-radius: 12px;
    background: var(--primary); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: .8rem; font-weight: 800; letter-spacing: -.02em; flex-shrink: 0;
}
.ln-brand-name { font-size: 1.1rem; font-weight: 700; color: var(--gray-900); }
.ln-brand-sub  { font-size: .78rem; color: var(--gray-600); }
.ln-title { font-size: 1.5rem; font-weight: 700; color: var(--gray-900); margin-bottom: .25rem; }
.ln-desc  { font-size: .875rem; color: var(--gray-600); margin-bottom: 1.75rem; }

/* ── Page header ── */
.page-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 1.75rem; gap: 1rem; flex-wrap: wrap;
}
.page-title { font-size: 1.5rem; font-weight: 700; color: var(--gray-900); letter-spacing: -.02em; }
.page-sub   { font-size: .875rem; color: var(--gray-600); margin-top: .2rem; }
.page-actions { display: flex; gap: .6rem; align-items: center; flex-shrink: 0; }

/* ── Stats Grid ── */
.stats-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 1rem;
}
.stat-box {
    background: var(--white);
    padding: 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
    min-width: 0;
}
.stat-box:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-box-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: .85rem;
}
.stat-icon {
    width: 38px; height: 38px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.stat-icon--primary  { background: var(--primary-light); color: var(--primary); }
.stat-icon--success  { background: var(--success-light); color: var(--success); }
.stat-icon--warning  { background: var(--warning-light); color: var(--warning); }
.stat-icon--danger   { background: var(--danger-light);  color: var(--danger); }
.stat-icon--info     { background: var(--info-light);    color: var(--info); }
.stat-icon--purple   { background: var(--purple-light);  color: var(--purple); }
.stat-number {
    font-size: clamp(1.25rem, 1.8vw, 1.85rem);
    font-weight: 700; color: var(--gray-900);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stat-label {
    color: var(--gray-600); font-size: .72rem; font-weight: 500;
    text-transform: uppercase; letter-spacing: .06em; margin-top: .25rem;
}
.stat-footer {
    margin-top: .85rem; padding-top: .7rem;
    border-top: 1px solid var(--gray-100);
    display: flex; align-items: center; gap: .4rem;
}
.stat-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.stat-sub { font-size: .72rem; color: var(--gray-600); }

/* ── Charts ── */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-top: 0;
}
.chart-card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow);
    padding: 1.25rem 1.5rem 1rem;
}
.chart-card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: .9rem;
    padding-bottom: .7rem;
    border-bottom: 1px solid var(--gray-100);
}
.chart-card-title { font-size: .875rem; font-weight: 600; color: var(--gray-800); }
.chart-card-sub   { font-size: .75rem; color: var(--gray-600); margin-top: .1rem; }

/* ── Table ── */
.table-container {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.table-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: .85rem 1.5rem; border-bottom: 1px solid var(--gray-100);
}
.table-count { font-size: .8125rem; font-weight: 500; color: var(--gray-600); }
.table-wrap  { overflow-x: auto; }
.data-table  { width: 100%; border-collapse: collapse; font-size: .8125rem; }
.data-table thead tr { background: var(--gray-50); border-bottom: 1px solid var(--gray-200); }
.data-table th {
    padding: .75rem 1rem; text-align: left; font-size: .7rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .06em; color: var(--gray-600);
    white-space: nowrap;
}
.data-table td { padding: .85rem 1rem; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background .1s; }
.data-table tbody tr:hover { background: var(--gray-50); cursor: pointer; }
.table-empty { text-align: center; color: var(--gray-600); padding: 3rem !important; cursor: default !important; }
.td-mono   { font-family: 'Courier New', monospace; font-size: .78rem; color: var(--primary); font-weight: 600; }
.td-email  { color: var(--gray-600); font-size: .8rem; }
.td-amount { font-weight: 700; color: var(--gray-900); }
.td-date   { color: var(--gray-600); font-size: .78rem; white-space: nowrap; }

/* ── User / Customer Avatar ── */
.user-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .7rem; font-weight: 700; flex-shrink: 0; color: #fff;
    vertical-align: middle;
}
.td-customer { display: flex; align-items: center; gap: .6rem; }
.av-0 { background: #E8570A; }
.av-1 { background: #0284C7; }
.av-2 { background: #16a34a; }
.av-3 { background: #7C3AED; }
.av-4 { background: #D97706; }
.av-5 { background: #DC2626; }
.av-6 { background: #0891b2; }
.av-7 { background: #65a30d; }

/* ── Action dots button ── */
.btn-action {
    width: 30px; height: 30px;
    border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
    background: none; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--gray-600); transition: background .15s, border-color .15s;
    vertical-align: middle;
}
.btn-action:hover { background: var(--gray-100); border-color: var(--gray-300); color: var(--gray-900); }

/* ── Badges ── */
.badge {
    display: inline-block; padding: .22rem .6rem; border-radius: 999px;
    font-size: .7rem; font-weight: 600; text-transform: capitalize;
}
.badge-pending    { background: var(--warning-light); color: #92400e; }
.badge-processing { background: var(--info-light);    color: #0369a1; }
.badge-completed  { background: var(--success-light); color: #15803d; }
.badge-cancelled  { background: var(--danger-light);  color: #991b1b; }
.badge-pay-succeeded { background: var(--success-light); color: #15803d; }
.badge-pay-pending   { background: var(--warning-light); color: #92400e; }
.badge-pay-failed    { background: var(--danger-light);  color: #991b1b; }
.badge-pay-refunded  { background: var(--purple-light);  color: #5b21b6; }
.badge-role-superadmin { background: var(--primary-light); color: var(--primary-dark); }
.badge-role-user       { background: var(--gray-100); color: var(--gray-700); }
.badge-active   { background: var(--success-light); color: #15803d; }
.badge-inactive { background: var(--gray-100); color: var(--gray-600); }

/* ── Domain Tags ── */
.domain-tag {
    display: inline-block; padding: .15rem .5rem; border-radius: 6px;
    font-size: .7rem; font-weight: 500; background: var(--info-light); color: var(--info);
    margin: .1rem .1rem .1rem 0; white-space: nowrap;
}

/* ── Pagination ── */
.pagination {
    display: flex; align-items: center; justify-content: center; gap: 1rem;
    padding: 1rem; border-top: 1px solid var(--gray-100);
}
.page-btn {
    display: inline-flex; align-items: center; padding: .45rem .9rem;
    border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm); font-size: .8125rem;
    font-weight: 500; color: var(--gray-700); text-decoration: none;
    transition: background .15s, border-color .15s, color .15s;
}
.page-btn:hover { background: var(--gray-50); border-color: var(--primary); color: var(--primary); }
.page-info { font-size: .8125rem; color: var(--gray-600); }

/* ── Filter card ── */
.filter-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}
.filter-row {
    display: flex; flex-wrap: wrap; gap: .65rem; align-items: center;
}
.filter-input { max-width: 180px; }

/* ── Orders unified toolbar ── */
.orders-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: .875rem 1.25rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.orders-toolbar__title {
    display: flex; align-items: center; gap: .75rem;
    flex-shrink: 0;
    padding-right: 1.25rem;
    border-right: 1.5px solid var(--gray-100);
}
.orders-toolbar__icon {
    width: 38px; height: 38px; border-radius: 10px;
    background: var(--primary-light); color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.orders-toolbar__heading {
    font-size: 1.05rem; font-weight: 700; color: var(--gray-900); line-height: 1.2;
    letter-spacing: -.02em;
}
.orders-toolbar__sub {
    font-size: .75rem; color: var(--gray-500); margin-top: .1rem;
}
.orders-toolbar__filters {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .55rem;
    flex: 0 1 auto;
    width: auto;
    margin-left: auto;
    flex-wrap: wrap;
}
/* Search with icon */
.otb-search {
    position: relative; display: flex; align-items: center;
}
.otb-search__icon {
    position: absolute; left: .65rem; color: var(--gray-400); pointer-events: none; flex-shrink: 0;
}
/* Shared input base */
.otb-input {
    height: 36px;
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    font-size: .8125rem;
    color: var(--gray-800);
    background: var(--gray-50);
    transition: border-color .15s, box-shadow .15s;
    outline: none;
    padding: 0 .75rem;
}
.otb-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(232,87,10,.1);
    background: var(--white);
}
.otb-input--search { padding-left: 2rem; min-width: 200px; }
.otb-input--select { padding-right: 1.5rem; min-width: 130px; cursor: pointer; }
.otb-input--date   { min-width: 130px; cursor: pointer; }
/* Date range pill */
.otb-daterange {
    display: flex; align-items: center; gap: .35rem;
    background: var(--gray-50);
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    padding: 0 .65rem;
    height: 36px;
    transition: border-color .15s, box-shadow .15s;
}
.otb-daterange:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(232,87,10,.1);
    background: var(--white);
}
.otb-daterange svg { color: var(--gray-400); flex-shrink: 0; }
.otb-daterange__sep { font-size: .75rem; color: var(--gray-400); flex-shrink: 0; }
.otb-daterange .otb-input--date {
    border: none; background: transparent; padding: 0; height: auto;
    min-width: 110px; font-size: .8rem;
    box-shadow: none !important;
}
.otb-daterange .otb-input--date:focus { box-shadow: none !important; }
/* Toolbar buttons */
.otb-btn {
    display: inline-flex; align-items: center; gap: .4rem;
    height: 36px; padding: 0 .9rem;
    border-radius: 8px; border: none;
    font-size: .8125rem; font-weight: 600;
    cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: background .15s, box-shadow .15s, transform .1s;
    flex-shrink: 0;
}
.otb-btn:active { transform: scale(.97); }
.otb-btn--primary {
    background: var(--primary); color: #fff;
}
.otb-btn--primary:hover {
    background: var(--primary-dark); box-shadow: 0 3px 10px rgba(232,87,10,.28);
}
.otb-btn--ghost {
    background: var(--white); color: var(--gray-600);
    border: 1.5px solid var(--gray-200);
    padding: 0 .65rem;
}
.otb-btn--ghost:hover { background: var(--gray-50); border-color: var(--gray-300); }

/* ── Buttons ── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .55rem 1.1rem; border-radius: var(--radius-sm); font-size: .875rem; font-weight: 500;
    border: none; cursor: pointer; text-decoration: none;
    transition: background .15s, box-shadow .15s, transform .1s;
    white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover  { background: var(--primary-dark); box-shadow: 0 4px 12px rgba(232,87,10,.30); color: #fff; }
.btn-secondary { background: var(--white); color: var(--gray-700); border: 1.5px solid var(--gray-200); }
.btn-secondary:hover { background: var(--gray-50); border-color: var(--gray-300); }
.btn-ghost { background: none; color: var(--gray-700); border: 1.5px solid var(--gray-200); }
.btn-ghost:hover { background: var(--gray-100); }
.btn-full { width: 100%; }
.btn-sm { padding: .35rem .75rem; font-size: .8125rem; }
.btn-link { background: none; border: none; cursor: pointer; font-size: .8rem; color: var(--primary); font-weight: 500; padding: 0 .25rem; text-decoration: none; }
.btn-link:hover { text-decoration: underline; }
.btn-link--danger { color: var(--danger); }

/* ── Forms ── */
.form-group  { display: flex; flex-direction: column; gap: .4rem; margin-bottom: .9rem; }
.form-row    { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.form-label  { font-size: .8125rem; font-weight: 500; color: var(--gray-700); }
.form-input  {
    font-family: inherit; font-size: .875rem; padding: .55rem .85rem;
    border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
    background: var(--white); color: var(--gray-900); outline: none;
    transition: border-color .15s, box-shadow .15s; width: 100%;
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(232,87,10,.10); }
.input-wrap { position: relative; }
.input-wrap .form-input { padding-right: 2.5rem; }
.input-eye {
    position: absolute; right: .6rem; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; color: var(--gray-600);
    display: flex; align-items: center;
}
.domain-checkboxes { display: flex; flex-direction: column; gap: .45rem; }
.checkbox-label { display: flex; align-items: center; gap: .5rem; font-size: .8125rem; font-weight: 400; cursor: pointer; }

/* ── Alerts ── */
.alert {
    display: flex; align-items: center; gap: .6rem; padding: .8rem 1rem;
    border-radius: var(--radius-sm); font-size: .875rem; font-weight: 400;
}
.alert-error   { background: var(--danger-light);  color: #991b1b; border: 1px solid #fca5a5; }
.alert-warning { background: var(--warning-light); color: #92400e; border: 1px solid #fcd34d; }
.alert-success { background: var(--success-light); color: #166534; border: 1px solid #86efac; }

/* ── Modal ── */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(28,23,20,.55);
    backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center;
    z-index: 10000; padding: 1rem;
    animation: modalFadeIn .18s ease;
}
@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
    background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-xl);
    width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto;
    border: 1px solid var(--gray-200);
    animation: modalSlideUp .22s cubic-bezier(.22,.68,0,1.1);
    /* Custom scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(232,87,10,.35) transparent;
}
.modal-box::-webkit-scrollbar {
    width: 5px;
}
.modal-box::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 99px;
}
.modal-box::-webkit-scrollbar-thumb {
    background: rgba(232,87,10,.3);
    border-radius: 99px;
    transition: background .2s;
}
.modal-box::-webkit-scrollbar-thumb:hover {
    background: rgba(232,87,10,.65);
}
@keyframes modalSlideUp { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }

/* ── Modal Hero Header ── */
.modal-hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 1.5rem 1.5rem 1.25rem;
    position: relative;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    overflow: hidden;
}
.modal-hero::before {
    content: ''; position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='30'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
    pointer-events: none;
}
.modal-hero-top {
    display: flex; align-items: center; justify-content: flex-start; gap: 1rem;
}
.modal-hero-id {
    font-size: .7rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
    color: rgba(255,255,255,.65); margin-bottom: .3rem;
}
.modal-hero-name {
    font-size: 1.2rem; font-weight: 700; color: #fff; line-height: 1.3;
}
.modal-hero-email {
    font-size: .8125rem; color: rgba(255,255,255,.75); margin-top: .2rem;
}
.modal-hero-avatar {
    width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; font-weight: 700; color: #fff;
    border: 2.5px solid rgba(255,255,255,.35);
    box-shadow: 0 2px 10px rgba(0,0,0,.18);
}
.modal-hero-badges {
    display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .9rem;
}
.modal-hero-badge {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .25rem .65rem; border-radius: 999px; font-size: .72rem; font-weight: 600;
    background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.25);
    backdrop-filter: blur(4px);
}
.modal-close {
    width: 34px; height: 34px; border: 1.5px solid rgba(255,255,255,.3); background: rgba(255,255,255,.12);
    border-radius: 50%; cursor: pointer; flex-shrink: 0; margin-top: -2px;
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,.85); transition: background .15s, border-color .15s;
}
.modal-close:hover { background: rgba(255,255,255,.25); border-color: rgba(255,255,255,.5); color: #fff; }

/* ── Modal Body ── */
.modal-body { padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }

/* ── Info Section Cards ── */
.modal-section {
    border: 1px solid var(--gray-200); border-radius: var(--radius);
    overflow: hidden;
}
.modal-section-title {
    font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
    color: var(--gray-600); padding: .6rem 1rem; background: var(--gray-50);
    border-bottom: 1px solid var(--gray-100); display: flex; align-items: center; gap: .45rem;
}
.modal-section-title svg { color: var(--primary); flex-shrink: 0; }
.modal-info-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0;
}
.modal-info-item {
    padding: .75rem 1rem; border-right: 1px solid var(--gray-100); border-bottom: 1px solid var(--gray-100);
}
.modal-info-item:nth-child(2n) { border-right: none; }
.modal-info-item:nth-last-child(-n+2) { border-bottom: none; }
.modal-info-item:last-child:nth-child(odd) { grid-column: span 2; border-right: none; }
.modal-info-label {
    font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
    color: var(--gray-400); margin-bottom: .2rem;
}
.modal-info-value {
    font-size: .875rem; font-weight: 500; color: var(--gray-900); word-break: break-word;
}

/* ── Address Arrow ── */
.modal-address-row {
    display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; flex-wrap: wrap;
}
.modal-address-row + .modal-address-row { border-top: 1px solid var(--gray-100); }
.modal-addr-label {
    font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
    padding: .2rem .5rem; border-radius: 4px; flex-shrink: 0; min-width: 42px; text-align: center;
}
.modal-addr-label--from { background: var(--primary-light); color: var(--primary); }
.modal-addr-label--to   { background: var(--success-light);  color: var(--success); }
.modal-addr-value { font-size: .875rem; color: var(--gray-800); line-height: 1.4; font-weight: 400; }

/* ── Amount highlight ── */
.modal-amount-highlight {
    font-size: 1.25rem; font-weight: 800; color: var(--primary);
}

/* Legacy fallback (not used in new modal) */
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--gray-100);
    position: sticky; top: 0; background: var(--white); z-index: 1;
}
.modal-title { font-size: 1rem; font-weight: 700; color: var(--gray-900); }
.detail-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.detail-table th { text-align: left; font-weight: 500; color: var(--gray-600); padding: .5rem 0; width: 40%; white-space: nowrap; }
.detail-table td { padding: .5rem 0; color: var(--gray-900); border-bottom: 1px solid var(--gray-100); }
.detail-table tr:last-child td { border-bottom: none; }

/* ── Modal action footer ── */
.modal-footer {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-100);
    background: var(--white);
    border-radius: 0 0 var(--radius) var(--radius);
    position: sticky;
    bottom: 0;
    z-index: 2;
    flex-wrap: wrap;
}
.btn-modal-success,
.btn-modal-danger {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .55rem 1.1rem;
    border-radius: 8px;
    border: none;
    font-size: .8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, opacity .15s;
    white-space: nowrap;
}
.btn-modal-success {
    background: #16a34a;
    color: #fff;
}
.btn-modal-success:hover { background: #15803d; }
.btn-modal-success:disabled { opacity: .55; cursor: not-allowed; }
.btn-modal-danger {
    background: #dc2626;
    color: #fff;
}
.btn-modal-danger:hover { background: #b91c1c; }
.btn-modal-danger:disabled { opacity: .55; cursor: not-allowed; }
.btn-spinner {
    display: inline-block;
    width: 12px; height: 12px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin .6s linear infinite;
    flex-shrink: 0;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* ── CRM toast notification ── */
.crm-toast {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    left: auto;
    transform: none;
    z-index: 99999;
    padding: .75rem 1.25rem;
    border-radius: 10px;
    font-size: .875rem;
    font-weight: 600;
    color: #fff;
    box-shadow: 0 6px 24px rgba(0,0,0,.22);
    pointer-events: none;
    max-width: calc(100vw - 2.5rem);
    animation: toastIn .2s ease;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.crm-toast--success { background: #16a34a; }
.crm-toast--error   { background: #dc2626; }

/* ── Confirm dialog ── */
.crm-confirm-backdrop {
    position: fixed; inset: 0; z-index: 99998;
    background: rgba(0,0,0,.45);
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
}
.crm-confirm-box {
    background: var(--white);
    border-radius: 14px;
    box-shadow: 0 8px 40px rgba(0,0,0,.22);
    padding: 2rem 1.75rem 1.5rem;
    max-width: 380px;
    width: 100%;
    text-align: center;
}
.crm-confirm-icon {
    width: 52px; height: 52px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1rem;
}
.crm-confirm-icon--warn  { background: #fef3c7; color: #d97706; }
.crm-confirm-icon--danger { background: #fee2e2; color: #dc2626; }
.crm-confirm-title {
    font-size: 1rem; font-weight: 700; color: var(--gray-900);
    margin-bottom: .4rem;
}
.crm-confirm-text {
    font-size: .8125rem; color: var(--gray-500);
    margin-bottom: 1.5rem; line-height: 1.55;
}
.crm-confirm-actions {
    display: flex; gap: .625rem; justify-content: center;
}
.crm-confirm-actions .btn-cancel-confirm {
    flex: 1; padding: .6rem 1rem;
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    background: var(--white);
    color: var(--gray-700);
    font-size: .8125rem; font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.crm-confirm-actions .btn-cancel-confirm:hover { background: var(--gray-50); }
.crm-confirm-actions .btn-confirm-ok {
    flex: 1; padding: .6rem 1rem;
    border: none; border-radius: 8px;
    font-size: .8125rem; font-weight: 600;
    color: #fff; cursor: pointer;
    transition: filter .15s;
}
.crm-confirm-actions .btn-confirm-ok:hover { filter: brightness(1.08); }
.crm-confirm-actions .btn-confirm-ok--warn  { background: #d97706; }
.crm-confirm-actions .btn-confirm-ok--danger { background: #dc2626; }

/* ── Modal responsive ── */
@media (max-width: 600px) {
    .modal-info-grid { grid-template-columns: 1fr; }
    .modal-info-item { border-right: none !important; }
    .modal-info-item:last-child { border-bottom: none !important; }
    .modal-info-item:nth-last-child(-n+2) { border-bottom: 1px solid var(--gray-100); }
    .modal-info-item:last-child { border-bottom: none; }
    .modal-box { max-height: 100vh; border-radius: var(--radius) var(--radius) 0 0; }
    .modal-backdrop { align-items: flex-end; padding: 0; }
}

/* ── Misc helpers ── */
.text-muted { color: var(--gray-400); font-size: .8125rem; }

/* ── Responsive ── */
@media (max-width: 1024px) {
    .charts-grid { grid-template-columns: 1fr; }
}
/* ── Header responsive — tablet ≤900px ── */
@media (max-width: 900px) {
    .nh-header {
        height: 56px;
        padding: 0 1.25rem;
        margin-left: -1.25rem;
        margin-right: -1.25rem;
        overflow: visible;
    }
    .nh-hamburger  { display: flex; }
    .nh-tabs       { display: none !important; }
    .nh-brand      { padding-right: 1rem; border-right: none; }
    .nh-actions    { padding-left: .5rem; border-left: none; gap: .35rem; }
    /*
     * Username is a raw text node (not a <span>), so display:none on spans won't work.
     * Setting font-size:0 on the badge collapses the text node to zero width.
     * We then restore the avatar's own font-size so initials stay visible.
     */
    .nh-user-badge {
        font-size: 0;           /* hides the raw text node */
        padding: .15rem;
        border-radius: 50%;
        gap: 0;
        background: transparent;
        border-color: transparent;
    }
    .nh-user-avatar { font-size: .68rem; }   /* restore initials inside avatar */
    .crm-container { padding: 0 1.25rem; }
    .crm-main      { padding: 0.5rem 0 2rem; }
    .stats-grid    { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
    .form-row      { grid-template-columns: 1fr; }
}

/* ── Header responsive — mobile ≤480px (small phones) ── */
@media (max-width: 480px) {
    .nh-header        { padding: 0 1rem; margin-left: -1rem; margin-right: -1rem; }
    .crm-container    { padding: 0 1rem; }
    .nh-brand-text    { display: none; }              /* hide "Post CRM" text, keep logo square */
    .nh-brand         { padding-right: .75rem; }
    .nh-domain-select { max-width: 140px; font-size: .74rem; }
    .nh-actions       { gap: .25rem; }
}

/* ── Other page responsiveness — ≤600px ── */
@media (max-width: 600px) {
    .nh-header        { padding: 0 1rem; margin-left: -1rem; margin-right: -1rem; }
    .crm-container    { padding: 0 1rem; }
    .nh-domain-select { max-width: 130px; font-size: .74rem; }
    .stats-grid       { grid-template-columns: 1fr; }
    .filter-row       { flex-direction: column; align-items: stretch; }
    .filter-input     { max-width: 100%; }
    .page-header      { flex-direction: column; }
    .page-actions     { width: 100%; }
}

/* ══════════════════════════════════════════════════════════════
   Orders Page — Mobile Responsive
   ══════════════════════════════════════════════════════════════ */

/* ────────────────────────────────────────────────────────────
   ≤1024px  Tablet landscape — let filters wrap within one row
   ──────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .orders-toolbar__filters { flex-wrap: wrap; }
    .otb-input--search       { min-width: 160px; }
}

/* ────────────────────────────────────────────────────────────
   ≤900px  Tablet portrait — title above filters
   ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .orders-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: .85rem;
        padding: 1rem;
    }
    .orders-toolbar__title {
        border-right: none;
        padding-right: 0;
        border-bottom: 1.5px solid var(--gray-100);
        padding-bottom: .85rem;
    }
    .orders-toolbar__filters {
        width: 100%;
        flex-wrap: wrap;
        gap: .5rem;
        justify-content: flex-end;
        margin-left: auto;
    }
    .otb-search               { flex: 1 1 180px; }
    .otb-input--search        { width: 100%; min-width: 0; }
    .otb-input--select        { flex: 1 1 130px; min-width: 0; }
    .otb-daterange            { flex: 1 1 220px; }
    /* Table: hide Email col */
    .data-table thead th:nth-child(3),
    .data-table tbody td:nth-child(3) { display: none; }
}

/* ────────────────────────────────────────────────────────────
   ≤768px  Small tablet — date range goes full-width row
   ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .orders-toolbar { padding: .9rem; }
    .otb-daterange  { flex: 1 1 100%; }
    /* Table: hide Created col */
    .data-table thead th:nth-child(7),
    .data-table tbody td:nth-child(7) { display: none; }
    .data-table th { padding: .6rem .75rem; font-size: .64rem; }
    .data-table td { padding: .7rem .75rem; }
    .table-header  { padding: .75rem 1rem; }
    .modal-footer  { gap: .5rem; }
}

/* ────────────────────────────────────────────────────────────
   ≤600px  Phone — grid-based full-column layout
   Filter form switches to a 2-column grid so search/select/date
   each span full width and Filter+Reset sit on the same row.
   ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    /* Safe-area container */
    .crm-container { padding: 0 .875rem; }
    .crm-main      { padding: .5rem 0 env(safe-area-inset-bottom, 2rem); }

    /* Toolbar card */
    .orders-toolbar         { padding: .875rem; gap: .75rem; border-radius: 12px; }
    .orders-toolbar__title  { padding-bottom: .7rem; gap: .6rem; }
    .orders-toolbar__icon   { width: 34px; height: 34px; border-radius: 9px; }
    .orders-toolbar__heading{ font-size: .95rem; }
    .orders-toolbar__sub    { font-size: .7rem; }

    /* Filter form → 2-col grid: [1fr] [auto]
       Row 1: search   (spans both cols)
       Row 2: status   (spans both cols)
       Row 3: daterange(spans both cols)
       Row 4: [Filter btn] [Reset btn]           */
    .orders-toolbar__filters {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: .5rem;
        width: 100%;
        align-items: center;
        justify-content: end;
    }
    /* All non-button children span both columns */
    .orders-toolbar__filters .otb-search    { grid-column: 1 / -1; }
    .orders-toolbar__filters .otb-input--select { grid-column: 1 / -1; min-width: 0; width: 100%; }
    .orders-toolbar__filters .otb-daterange { grid-column: 1 / -1; min-width: 0; width: 100%; box-sizing: border-box; }
    /* Primary button takes col 1 (stretches) */
    .orders-toolbar__filters .otb-btn--primary {
        grid-column: 1; width: 100%; justify-content: center;
        height: 40px; font-size: .875rem;
    }
    /* Ghost/reset button takes col 2 (fixed 42px) */
    .orders-toolbar__filters .otb-btn--ghost {
        grid-column: 2; width: 42px; height: 40px;
        justify-content: center; padding: 0; flex-shrink: 0;
    }
    /* Ensure search input fills its container */
    .otb-search     { position: relative; width: 100%; }
    .otb-input--search { width: 100%; min-width: 0; height: 40px; box-sizing: border-box; }
    .otb-input--select { height: 40px; }
    /* Date range pill — fix inner input min-width that overflows */
    .otb-daterange  {
        height: auto;
        min-height: 40px;
        padding: .45rem .6rem;
        flex-wrap: wrap;
        gap: .4rem;
        align-items: stretch;
    }
    .otb-daterange svg { margin-top: .05rem; }
    .otb-daterange__sep { display: none; }
    .otb-daterange .otb-input--date {
        min-width: 0 !important;
        width: 100%;
        flex: 1 1 100%;
        height: 40px;
        padding: 0 .65rem;
        font-size: .75rem;
    }

    /* Table adjustments */
    .data-table thead th:nth-child(5),
    .data-table tbody td:nth-child(5) { display: none; } /* Payment */
    .data-table th    { padding: .5rem .55rem; font-size: .6rem; letter-spacing: .02em; }
    .data-table td    { padding: .6rem .55rem; font-size: .8125rem; }
    .td-mono          { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; font-size: .7rem; }
    .td-customer      { max-width: 100px; white-space: nowrap; overflow: hidden; }
    .btn-action       { width: 28px; height: 28px; }
    .table-count      { font-size: .75rem; }
    .table-header     { padding: .65rem .875rem; }

    /* Pagination */
    .pagination { gap: .5rem; padding: .65rem; flex-wrap: wrap; justify-content: center; }
    .page-btn   { padding: .4rem .75rem; font-size: .78rem; }
    .page-info  { font-size: .75rem; flex-basis: 100%; text-align: center; }

    /* Modal → bottom sheet */
    .modal-backdrop  { padding: 0; align-items: flex-end; }
    .modal-box       { max-height: 92vh; border-radius: 20px 20px 0 0; width: 100%; max-width: 100%; }
    .modal-hero      { border-radius: 20px 20px 0 0; padding: 1.25rem 1.1rem 1rem; }
    .modal-hero-name { font-size: 1.05rem; }
    .modal-hero-id   { font-size: .65rem; }
    .modal-body      { padding: .875rem; gap: .65rem; }
    .modal-info-grid { grid-template-columns: 1fr; }
    .modal-info-item { border-right: none !important; }
    .modal-info-item:nth-last-child(-n+2) { border-bottom: 1px solid var(--gray-100); }
    .modal-info-item:last-child { border-bottom: none !important; }
    .modal-hero-badges      { gap: .3rem; }
    .modal-hero-badge       { font-size: .67rem; padding: .18rem .48rem; }
    .modal-amount-highlight { font-size: 1.05rem; }
    .modal-section          { padding: 0 0 .5rem; }
    .modal-footer           { padding: .875rem; border-radius: 0; gap: .5rem; flex-wrap: nowrap; }
    .btn-modal-success,
    .btn-modal-danger       { flex: 1; justify-content: center; font-size: .8125rem; padding: .6rem .5rem; }

    /* Confirm dialog */
    .crm-confirm-box   { padding: 1.5rem 1.25rem 1.25rem; }
    .crm-confirm-title { font-size: .9375rem; }
    .crm-confirm-text  { font-size: .78rem; }

    /* Toast → full-width bottom bar */
    .crm-toast { top: auto; bottom: 0; left: 0; right: 0; transform: none;
                 border-radius: 0; text-align: center; padding: .875rem 1rem;
                 max-width: 100%; font-size: .8125rem; }
}

/* ────────────────────────────────────────────────────────────
   ≤380px  Extra-small phones
   ──────────────────────────────────────────────────────────── */
@media (max-width: 380px) {
    .crm-container  { padding: 0 .75rem; }
    .orders-toolbar { padding: .75rem; }
    /* Hide Amount col — leaves Order#, Customer, Status, Action */
    .data-table thead th:nth-child(6),
    .data-table tbody td:nth-child(6) { display: none; }
    .td-mono        { max-width: 80px; }
    .td-customer    { max-width: 80px; }
    /* Shrink modal hero */
    .modal-hero-name   { font-size: .95rem; }
    .modal-hero-avatar { width: 42px; height: 42px; font-size: .95rem; }
}

/* ══════════════════════════════════════════════════════════════
   Dashboard — Responsive Layout Helpers
   ══════════════════════════════════════════════════════════════ */

/* ── Two-column responsive grid ── */
.dash-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

/* ── Three-column responsive grid ── */
.dash-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
    align-items: stretch;
}

.chart-card--stretch {
    display: flex;
    flex-direction: column;
}

.chart-card-fill {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chart-card-fill-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* ── Dashboard Hero card ── */
.dash-hero {
    background: linear-gradient(135deg, #0f0b2d 0%, #1e1b4b 45%, #2d1b69 100%);
    border-radius: 16px;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.25rem;
    position: relative;
    overflow: hidden;
}

.dash-hero-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.dash-hero-left {
    flex: 1;
    min-width: 220px;
}

/* ── Hero stat tiles panel ── */
.hero-stats-panel {
    display: flex;
    align-items: stretch;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.11);
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.hero-stat-tile {
    padding: 1rem 1.4rem;
    text-align: center;
    min-width: 105px;
    border-right: 1px solid rgba(255,255,255,.09);
}
.hero-stat-tile:last-child { border-right: none; }

/* ── AI recommendation strip ── */
.ai-rec-strip {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #fff;
    border: 1px solid #e9d5ff;
    border-left: 4px solid #7c3aed;
    border-radius: 12px;
    padding: .9rem 1.25rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

/* ── Chart card enhanced hover ── */
.chart-card {
    transition: box-shadow .2s, transform .15s;
}
.chart-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

/* Row 4 bottom spacing */
.charts-grid {
    margin-bottom: 1.5rem;
}

/* ── AI sidebar mobile ── */
@media (max-width: 480px) {
    #ai-sidebar { width: 100vw !important; }
}

/* ── Dashboard ≤1024px: 3-col → 2-col (3rd card spans full row)
       Also keep charts-grid at 2-col (overrides the global 1-col rule above) ── */
@media (max-width: 1024px) {
    .dash-grid-3                 { grid-template-columns: 1fr 1fr; }
    .dash-grid-3 > :nth-child(3) { grid-column: 1 / -1; }
    .charts-grid                 { grid-template-columns: 1fr 1fr; }
}

/* ── Dashboard ≤900px: hero stacks ── */
@media (max-width: 900px) {
    .dash-hero         { padding: 1.25rem; }
    .dash-hero-left    { min-width: 0; width: 100%; }
    .hero-stats-panel  { flex-shrink: 1; width: 100%; border-radius: 10px; }
    .hero-stat-tile    { flex: 1; min-width: 0; padding: .8rem .75rem; }
}

/* ── Dashboard ≤768px: charts-grid collapses to 1-col ── */
@media (max-width: 768px) {
    .charts-grid                 { grid-template-columns: 1fr; }
    .dash-grid-3                 { grid-template-columns: 1fr; }
    .dash-grid-3 > :nth-child(3) { grid-column: unset; }
    .chart-card--stretch         { min-height: auto; }
}

/* ── Dashboard ≤600px: everything single-column ── */
@media (max-width: 600px) {
    .dash-grid-2   { grid-template-columns: 1fr; }
    .dash-hero     { padding: 1rem; border-radius: 12px; }
    .hero-stat-tile { padding: .65rem .5rem; }
    .ai-rec-strip  { padding: .75rem 1rem; gap: .75rem; }
}
