  :root {
    /* ──────────────────────────────────────────
       PRIMLY TRAVELS — LIGHT THEME
       Palette:
         #faf6ef  warm cream      → page background
         #ffffff  pure white      → elevated surfaces
         #023e58  deep teal       → text, structure, deep accents
         #219ebc  bright teal     → brand, CTAs, focus, active state
       ────────────────────────────────────────── */

    /* Surfaces — variable names kept for back-compat; values flipped to light */
    --navy-deep:   #faf6ef;           /* page background */
    --navy-mid:    #ffffff;           /* secondary surface (inputs, subtle wells) */
    --navy-card:   #ffffff;           /* cards, sidebar, topbar */
    --navy-border: rgba(2, 62, 88, 0.10);
    --navy-hover:  rgba(33, 158, 188, 0.08);

    /* Subtle tinted surfaces — used for section wells / hover backgrounds */
    --surface-soft:   #f4ede0;        /* warmer cream for nested sections */
    --surface-tinted: rgba(33, 158, 188, 0.06);

    /* Brand: bright teal */
    --gold:       #219ebc;            /* legacy name, now bright teal */
    --gold-light: #4cb5cf;
    --gold-dim:   #1a7d99;
    --gold-rgb:   33, 158, 188;

    /* Deep teal — used for headings and structural emphasis */
    --deep:    #023e58;
    --deep-rgb: 2, 62, 88;

    /* Text — variable names kept; values inverted for light theme */
    --cream:     #023e58;             /* primary text */
    --cream-dim: rgba(2, 62, 88, 0.62);
    --cream-faint: rgba(2, 62, 88, 0.42);
    --white:     #ffffff;

    /* Warm accent — sunset (kept for variety, used sparingly) */
    --amber: #d4a942;
    --amber-light: #ecc97a;
    --amber-bg: rgba(212, 169, 66, 0.14);

    /* Semantic colors — re-tuned for light backgrounds (deeper saturation
       so badges read clearly on white/cream) */
    --green:    #0f9f6e;
    --green-bg: rgba(15, 159, 110, 0.12);
    --red:      #d63838;
    --red-bg:   rgba(214, 56, 56, 0.10);
    --orange:   #d97026;
    --orange-bg: rgba(217, 112, 38, 0.12);
    --blue:     #2570c8;
    --blue-bg:  rgba(37, 112, 200, 0.10);

    /* Layout */
    --sidebar-w: 260px;
    --topbar-h:  64px;
    --radius:    14px;
    --radius-sm: 8px;

    /* Soft, elegant shadows — light theme needs depth via deep-teal tinted shadow */
    --shadow:    0 14px 40px rgba(2, 62, 88, 0.10), 0 2px 6px rgba(2, 62, 88, 0.04);
    --shadow-sm: 0 2px 10px rgba(2, 62, 88, 0.06);
    --shadow-lg: 0 24px 70px rgba(2, 62, 88, 0.14), 0 4px 10px rgba(2, 62, 88, 0.05);
    --glow-brand: 0 0 0 4px rgba(33, 158, 188, 0.18);

    --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.45s cubic-bezier(0.4, 0, 0.2, 1);

    /* Fluid type scale */
    --fs-display: clamp(22px, 4vw, 28px);
    --fs-h1: clamp(20px, 3.2vw, 24px);
    --fs-h2: clamp(18px, 2.6vw, 22px);
    --fs-body: clamp(13px, 1.4vw, 14px);
    --fs-sm: clamp(11px, 1.2vw, 12px);

    /* Safe-area for notched devices */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
  }

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

  img, video, canvas, picture { max-width: 100%; height: auto; }

  html, body { max-width: 100vw; overflow-x: hidden; }

  body {
    font-family: 'DM Sans', sans-serif;
    background: var(--navy-deep);
    background-image:
      radial-gradient(ellipse 1200px 600px at 20% -10%, rgba(33,158,188,0.06), transparent 60%),
      radial-gradient(ellipse 800px 500px at 110% 110%, rgba(212,169,66,0.05), transparent 60%);
    background-attachment: fixed;
    color: var(--cream);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  /* ─── SCROLLBAR ─── */
  ::-webkit-scrollbar { width: 8px; height: 8px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb {
    background: rgba(2, 62, 88, 0.15);
    border-radius: 99px;
    transition: background var(--transition);
  }
  ::-webkit-scrollbar-thumb:hover { background: rgba(2, 62, 88, 0.30); }

  /* ─── TEXT SELECTION ─── */
  ::selection { background: rgba(33, 158, 188, 0.25); color: var(--deep); }

  /* ─── GLOBAL FOCUS RING ─── */
  :focus-visible { outline: none; }
  button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
    box-shadow: var(--glow-brand);
  }

  /* ─── KEYFRAMES — UX BOOSTERS ─── */
  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  @keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
  }

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

  @keyframes modalIn {
    from { opacity: 0; transform: scale(0.94) translateY(12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
  }

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

  @keyframes toastOut {
    to { opacity: 0; transform: translateX(20px); }
  }

  /* Soft heartbeat — for online dots, notification indicators */
  @keyframes pulseSoft {
    0%, 100% { box-shadow: 0 0 0 0 rgba(15, 159, 110, 0.45); }
    70%      { box-shadow: 0 0 0 8px rgba(15, 159, 110, 0); }
  }
  @keyframes pulseRed {
    0%, 100% { box-shadow: 0 0 0 0 rgba(214, 56, 56, 0.55); }
    70%      { box-shadow: 0 0 0 7px rgba(214, 56, 56, 0); }
  }
  @keyframes pulseBrand {
    0%, 100% { box-shadow: 0 0 0 0 rgba(33, 158, 188, 0.40); }
    70%      { box-shadow: 0 0 0 9px rgba(33, 158, 188, 0); }
  }

  /* Slow ambient drift for hero login glow */
  @keyframes drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(20px, -10px) scale(1.05); }
  }

  /* Chat message pop-in */
  @keyframes msgPop {
    from { opacity: 0; transform: translateY(8px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
  }

  /* Shimmer — for skeleton states */
  @keyframes shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position: 400px 0; }
  }

  /* Subtle gradient sweep on hover for stat cards */
  @keyframes sheen {
    0%   { transform: translateX(-120%) skewX(-20deg); }
    100% { transform: translateX(220%) skewX(-20deg); }
  }

  /* Light wobble for icon emojis (hover) */
  @keyframes wobble {
    0%, 100% { transform: rotate(0deg); }
    25%      { transform: rotate(-8deg); }
    75%      { transform: rotate(8deg); }
  }

  /* ─── LOGIN ─── */
  #login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--navy-deep);
    position: relative;
    overflow: hidden;
  }

  .login-bg {
    position: absolute; inset: 0;
    overflow: hidden;
    pointer-events: none;
  }
  .login-bg::before, .login-bg::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    will-change: transform;
  }
  .login-bg::before {
    width: 520px; height: 520px;
    top: -120px; right: -120px;
    /* background: radial-gradient(circle, rgba(33,158,188,0.32) 0%, transparent 70%); */
    animation: drift 14s ease-in-out infinite;
  }
  .login-bg::after {
    width: 460px; height: 460px;
    bottom: -140px; left: -100px;
    background: radial-gradient(circle, rgba(212,169,66,0.20) 0%, transparent 70%);
    animation: drift 18s ease-in-out infinite reverse;
  }

  .login-grid {
    position: absolute; inset: 0;
    background-image:
      linear-gradient(rgba(2,62,88,0.05) 1px, transparent 1px),
      linear-gradient(90deg, rgba(2,62,88,0.05) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black, transparent);
    -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black, transparent);
    pointer-events: none;
  }

  .login-card {
    position: relative;
    width: 420px;
    max-width: calc(100vw - 32px);
    background: var(--navy-card);
    border: 1px solid var(--navy-border);
    border-radius: 22px;
    padding: 48px 40px;
    box-shadow: var(--shadow-lg);
    animation: fadeUp 0.6s cubic-bezier(0.4,0,0.2,1);
  }
  /* Decorative accent line at top of login card */
  .login-card::before {
    content: '';
    position: absolute;
    top: -1px; left: 22%; right: 22%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    border-radius: 99px;
  }

  .login-logo {
    text-align: center;
    margin-bottom: 36px;
  }

  .login-logo .logo-mark {
    width: 52px; height: 52px;
    /* background: linear-gradient(135deg, var(--gold), var(--gold-light)); */
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    font-size: 22px;
    box-shadow: 0 4px 20px rgba(33,158,188,0.3);
  }

  .login-logo h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--cream);
  }

  .login-logo p {
    font-size: 12px;
    color: var(--cream-dim);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-top: 4px;
  }

  .login-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--cream-dim);
    margin-bottom: 8px;
    display: block;
  }

  .login-input {
    width: 100%;
    background: var(--navy-mid);
    border: 1px solid var(--navy-border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--cream);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    margin-bottom: 18px;
  }

  .login-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(33,158,188,0.15);
  }

  .login-input::placeholder { color: var(--cream-dim); opacity: 0.5; }

  .login-hint {
    font-size: 11px;
    color: var(--cream-dim);
    opacity: 0.55;
    margin-top: -12px;
    margin-bottom: 18px;
    padding-left: 2px;
  }

  .login-error {
    font-size: 12px;
    color: var(--red);
    background: var(--red-bg);
    border: 1px solid rgba(224,90,90,0.2);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-bottom: 14px;
    display: none;
  }

  .btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    padding: 14px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
    box-shadow: 0 6px 20px rgba(33,158,188,0.30);
    position: relative;
    overflow: hidden;
  }
  .btn-primary::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 40%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    transform: translateX(-150%) skewX(-20deg);
    pointer-events: none;
  }
  .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(33,158,188,0.40);
  }
  .btn-primary:hover::before { animation: sheen 0.8s ease-out; }
  .btn-primary:active { transform: translateY(0); transition-duration: 60ms; }

  /* ─── APP SHELL ─── */
  #app {
    /*display: none;*/
    min-height: 100vh;
  }

  #app.visible { display: flex; }

  /* ─── SIDEBAR ─── */
  .sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--navy-card);
    border-right: 1px solid var(--navy-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 200;
    transition: transform var(--transition);
  }

  .sidebar-logo {
    padding: 24px 24px 20px;
    border-bottom: 1px solid var(--navy-border);
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .sidebar-logo .logo-icon {
    width: 38px; height: 38px;
    /*background: linear-gradient(135deg, var(--gold), var(--gold-light));*/
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(33,158,188,0.30);
    transition: transform var(--transition);
  }
  .sidebar-logo:hover .logo-icon { transform: rotate(-4deg) scale(1.06); }

  .sidebar-logo span {
    font-family: 'Cormorant Garamond', serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--cream);
  }

  .sidebar-nav {
    padding: 20px 14px;
    flex: 1;
    overflow-y: auto;
  }

  .nav-section-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--cream-dim);
    opacity: 0.5;
    padding: 0 10px;
    margin-bottom: 8px;
    margin-top: 16px;
  }

  .nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition), padding-left var(--transition);
    color: var(--cream-dim);
    font-size: 13.5px;
    font-weight: 500;
    position: relative;
    margin-bottom: 2px;
    border: 1px solid transparent;
    overflow: hidden;
  }
  .nav-item::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    width: 3px; height: 0;
    background: var(--gold);
    border-radius: 0 3px 3px 0;
    transform: translateY(-50%);
    transition: height var(--transition);
  }

  .nav-item:hover {
    background: var(--navy-hover);
    color: var(--cream);
  }

  .nav-item.active {
    background: rgba(33,158,188,0.10);
    color: var(--gold);
    border-color: rgba(33,158,188,0.20);
    font-weight: 600;
    padding-left: 18px;
  }
  .nav-item.active::before { height: 60%; }

  .nav-item .nav-icon { font-size: 16px; width: 20px; text-align: center; transition: transform var(--transition); }
  .nav-item:hover .nav-icon { transform: scale(1.12); }

  .nav-badge {
    margin-left: auto;
    background: var(--red);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 99px;
    min-width: 20px;
    text-align: center;
  }

  .nav-badge.gold { background: var(--gold); color: var(--white); }
  .nav-badge.orange { background: var(--orange); color: var(--white); }
  .nav-badge.green { background: var(--green); color: var(--white); }

  .sidebar-footer {
    padding: 16px 14px;
    border-top: 1px solid var(--navy-border);
  }

  .agent-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition);
  }

  .agent-profile:hover { background: var(--navy-hover); }

  .agent-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
  }

  .agent-info { flex: 1; overflow: hidden; }
  .agent-info .name { font-size: 13px; font-weight: 600; color: var(--cream); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .agent-info .role { font-size: 11px; color: var(--cream-dim); }

  .status-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--green);
    flex-shrink: 0;
    animation: pulseSoft 2.4s ease-in-out infinite;
  }

  .logout-btn {
    background: none;
    border: none;
    color: var(--cream-dim);
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    border-radius: 4px;
    transition: color var(--transition);
    flex-shrink: 0;
  }

  .logout-btn:hover { color: var(--red); }

  /* ─── MAIN CONTENT ─── */
  .main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-width: 0; /* prevent flex-blowout from wide descendants */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }

  .topbar {
    height: var(--topbar-h);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--navy-border);
    display: flex;
    align-items: center;
    padding: 0 28px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--cream);
    cursor: pointer;
    font-size: 20px;
    padding: 4px;
  }

  .topbar-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 22px;
    font-weight: 600;
    color: var(--cream);
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topbar-subtitle {
    font-size: 12px;
    color: var(--cream-dim);
    margin-left: 4px;
  }

  .topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 14px;
  }

  .topbar-search {
    background: var(--navy-mid);
    border: 1px solid var(--navy-border);
    border-radius: 8px;
    padding: 8px 14px;
    color: var(--cream);
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    outline: none;
    width: 200px;
    transition: all var(--transition);
  }

  .topbar-search:focus {
    border-color: var(--gold);
    width: 240px;
  }

  .topbar-search::placeholder { color: var(--cream-dim); opacity: 0.5; }

  .icon-btn {
    width: 36px; height: 36px;
    background: var(--navy-mid);
    border: 1px solid var(--navy-border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    color: var(--cream-dim);
    font-size: 16px;
    position: relative;
  }

  .icon-btn:hover { background: var(--navy-hover); color: var(--cream); }

  .icon-btn .notif-dot {
    position: absolute;
    top: 6px; right: 6px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--red);
    animation: pulseRed 2s ease-in-out infinite;
  }

  .page { /*display: none;*/ padding: 28px; flex: 1; animation: pageIn 0.3s ease; }
  /*.page.active { display: block; }*/

  /* ─── DASHBOARD ─── */
  .stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 28px;
  }

  .stat-card {
    background: var(--navy-card);
    border: 1px solid var(--navy-border);
    border-radius: var(--radius);
    padding: 22px;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    animation: fadeUp 0.5s cubic-bezier(0.4,0,0.2,1) backwards;
  }

  .stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: rgba(33, 158, 188, 0.25);
  }

  /* Sheen — runs once on hover */
  .stat-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(33,158,188,0.10), transparent);
    transform: translateX(-120%) skewX(-20deg);
    pointer-events: none;
  }
  .stat-card:hover::after { animation: sheen 0.9s ease-out; }

  .stat-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 90px; height: 90px;
    border-radius: 50%;
    opacity: 0.16;
    transform: translate(28px, -28px);
    transition: transform var(--transition);
  }
  .stat-card:hover::before { transform: translate(20px, -22px) scale(1.1); }

  .stat-card.payments::before { background: var(--orange); }
  .stat-card.disputes::before { background: var(--red); }
  .stat-card.refunds::before { background: var(--blue); }
  .stat-card.assigned::before { background: var(--green); }

  .stat-icon {
    font-size: 24px;
    margin-bottom: 14px;
    display: inline-block;
    transition: transform var(--transition);
  }
  .stat-card:hover .stat-icon { animation: wobble 0.6s ease-in-out; }

  .stat-value {
    font-family: 'Cormorant Garamond', serif;
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
    color: var(--cream);
    margin-bottom: 6px;
  }

  .stat-label {
    font-size: 12px;
    color: var(--cream-dim);
    font-weight: 500;
    letter-spacing: 0.3px;
  }

  .stat-trend {
    margin-top: 10px;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .stat-trend.up { color: var(--red); }
  .stat-trend.down { color: var(--green); }

  .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
  }

  .section-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--cream);
  }

  .section-link {
    font-size: 12px;
    color: var(--gold);
    cursor: pointer;
    text-decoration: none;
    transition: color var(--transition);
  }

  .section-link:hover { color: var(--gold-light); }

  .dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
  }

  /* ─── CUSTOMER LIST ─── */
  .filter-tabs {
    display: flex;
    gap: 6px;
    background: var(--navy-card);
    border: 1px solid var(--navy-border);
    border-radius: var(--radius-sm);
    padding: 5px;
    margin-bottom: 20px;
    overflow-x: auto;
  }

  .filter-tab {
    padding: 9px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--cream-dim);
    transition: background var(--transition), color var(--transition), transform var(--transition);
    white-space: nowrap;
    border: none;
    background: none;
    font-family: 'DM Sans', sans-serif;
  }

  .filter-tab.active {
    background: linear-gradient(135deg, rgba(33,158,188,0.18), rgba(33,158,188,0.10));
    color: var(--gold);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(33,158,188,0.12);
  }

  .filter-tab:hover:not(.active) {
    color: var(--cream);
    background: var(--surface-tinted);
  }
  .filter-tab:active { transform: scale(0.97); }

  .customer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
    gap: 16px;
  }

  .customer-card {
    background: var(--navy-card);
    border: 1px solid var(--navy-border);
    border-radius: var(--radius);
    padding: 20px;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    position: relative;
    overflow: hidden;
    min-width: 0;
    animation: fadeUp 0.4s cubic-bezier(0.4,0,0.2,1) backwards;
  }

  .customer-card:hover {
    border-color: rgba(33, 158, 188, 0.30);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
  }
  .customer-card:active { transform: translateY(-1px); }

  .customer-card-top {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
  }

  .cust-avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
  }

  .cust-info { flex: 1; min-width: 0; }
  .cust-name { font-size: 15px; font-weight: 600; color: var(--cream); margin-bottom: 3px; }
  .cust-id { font-size: 11px; color: var(--cream-dim); }

  .cust-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 14px;
  }

  .badge {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 3px 10px;
    border-radius: 99px;
    text-transform: uppercase;
  }

  .badge.payment { background: var(--orange-bg); color: var(--orange); border: 1px solid rgba(232,151,90,0.2); }
  .badge.dispute { background: var(--red-bg); color: var(--red); border: 1px solid rgba(224,90,90,0.2); }
  .badge.refund { background: var(--blue-bg); color: var(--blue); border: 1px solid rgba(90,157,232,0.2); }
  .badge.resolved { background: var(--green-bg); color: var(--green); border: 1px solid rgba(61,186,140,0.2); }
  .badge.assigned-to { background: rgba(33,158,188,0.1); color: var(--gold); border: 1px solid rgba(33,158,188,0.2); }

  .cust-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: var(--cream-dim);
    border-top: 1px solid var(--navy-border);
    padding-top: 12px;
  }

  .cust-meta > div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: auto;
  }

  .assign-btn {
    padding: 6px 14px;
    border-radius: 6px;
    border: 1.5px solid var(--gold-dim);
    background: transparent;
    color: var(--gold);
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
  }

  .assign-btn:hover {
    background: rgba(33,158,188,0.12);
  }

  .assign-btn.unassign {
    border-color: rgba(224,90,90,0.4);
    color: var(--red);
  }

  .assign-btn.unassign:hover {
    background: rgba(224,90,90,0.1);
  }

  /* ─── ACTIVITY FEED (DASHBOARD) ─── */
  .activity-panel {
    background: var(--navy-card);
    border: 1px solid var(--navy-border);
    border-radius: var(--radius);
    padding: 20px;
    height: fit-content;
    max-height: 480px;
    overflow-y: auto;
  }

  .activity-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--navy-border);
  }

  .activity-item:last-child { border-bottom: none; }

  .activity-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
  }

  .activity-text {
    font-size: 12.5px;
    color: var(--cream-dim);
    line-height: 1.5;
  }

  .activity-text strong { color: var(--cream); font-weight: 600; }

  .activity-time {
    font-size: 11px;
    color: var(--cream-dim);
    opacity: 0.5;
    margin-top: 3px;
  }

  /* ─── RECENT TABLE ─── */
  .table-wrap {
    background: var(--navy-card);
    border: 1px solid var(--navy-border);
    border-radius: var(--radius);
    overflow: hidden;
  }

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

  .data-table th {
    background: var(--navy-mid);
    padding: 12px 18px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--cream-dim);
    opacity: 0.7;
    border-bottom: 1px solid var(--navy-border);
  }

  .data-table td {
    padding: 14px 18px;
    font-size: 13px;
    color: var(--cream-dim);
    border-bottom: 1px solid var(--navy-border);
    vertical-align: middle;
  }

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

  .data-table tr:hover td { background: rgba(33,158,188,0.05); }

  .data-table .cust-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .data-table .name-text { font-weight: 500; color: var(--cream); font-size: 13px; }

  /* ─── CHAT VIEW ─── */
  .chat-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    height: calc(100dvh - var(--topbar-h));
    overflow: hidden;
  }

  .chat-list-panel {
    border-right: 1px solid var(--navy-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--navy-card);
  }

  .chat-list-header {
    padding: 16px 18px;
    border-bottom: 1px solid var(--navy-border);
    font-family: 'Cormorant Garamond', serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--cream);
  }

  .chat-search {
    padding: 12px 14px;
    border-bottom: 1px solid var(--navy-border);
  }

  .chat-search input {
    width: 100%;
    background: var(--navy-mid);
    border: 1px solid var(--navy-border);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--cream);
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    outline: none;
  }

  .chat-search input::placeholder { color: var(--cream-dim); opacity: 0.5; }
  .chat-search input:focus { border-color: var(--gold); }

  .chat-list-scroll { overflow-y: auto; flex: 1; }

  .chat-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    cursor: pointer;
    transition: background var(--transition);
    border-bottom: 1px solid rgba(31,46,74,0.5);
  }

  .chat-list-item:hover { background: var(--navy-hover); }
  .chat-list-item.active { background: rgba(33,158,188,0.08); }

  .chat-list-item .chat-av {
    width: 42px; height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
    position: relative;
  }

  .unread-dot {
    position: absolute;
    top: 0; right: 0;
    width: 11px; height: 11px;
    border-radius: 50%;
    background: var(--gold);
    border: 2px solid var(--navy-card);
    animation: pulseBrand 2s ease-in-out infinite;
  }

  .chat-list-item .cl-info { flex: 1; min-width: 0; }
  .chat-list-item .cl-name { font-size: 13.5px; font-weight: 600; color: var(--cream); margin-bottom: 3px; }
  .chat-list-item .cl-preview { font-size: 12px; color: var(--cream-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .chat-list-item .cl-time { font-size: 11px; color: var(--cream-dim); opacity: 0.5; flex-shrink: 0; }

  /* ─── CHAT WINDOW ─── */
  .chat-window {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--navy-deep);
    background-image:
      radial-gradient(ellipse 60% 40% at 50% 100%, rgba(33,158,188,0.03) 0%, transparent 70%);
  }

  .chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--cream-dim);
  }

  .chat-empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.3; }
  .chat-empty p { font-size: 14px; opacity: 0.5; }

  .chat-header {
    padding: 14px 20px;
    background: var(--navy-card);
    border-bottom: 1px solid var(--navy-border);
    display: flex;
    align-items: center;
    gap: 14px;
  }

  .chat-header .ch-av {
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
  }

  .chat-header .ch-info { flex: 1; }
  .chat-header .ch-name { font-size: 15px; font-weight: 600; color: var(--cream); }
  .chat-header .ch-status { font-size: 12px; color: var(--green); display: flex; align-items: center; gap: 5px; }

  .chat-header .ch-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }

  .chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .msg-group { display: flex; flex-direction: column; }

  .msg-bubble {
    max-width: 65%;
    padding: 11px 16px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.5;
    position: relative;
    animation: msgPop 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
  }

  .msg-bubble.agent {
    background: rgba(33,158,188,0.15);
    border: 1px solid rgba(33,158,188,0.2);
    border-bottom-right-radius: 4px;
    align-self: flex-end;
    color: var(--cream);
  }

  .msg-bubble.customer {
    background: var(--navy-card);
    border: 1px solid var(--navy-border);
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    color: var(--cream);
  }

  .msg-bubble.system-msg {
    background: transparent;
    border: 1px dashed var(--navy-border);
    border-radius: 8px;
    align-self: center;
    color: var(--cream-dim);
    font-size: 12px;
    text-align: center;
    padding: 8px 16px;
    max-width: 80%;
    font-style: italic;
  }

  .msg-meta {
    font-size: 10.5px;
    color: var(--cream-dim);
    opacity: 0.5;
    margin-top: 5px;
  }

  .msg-meta.right { text-align: right; }

  /* ─── STATUS UPDATE MESSAGES ─── */
  .status-update-msg {
    align-self: center;
    background: var(--navy-card);
    border: 1px solid var(--navy-border);
    border-radius: 10px;
    padding: 12px 18px;
    max-width: 80%;
    text-align: center;
  }

  .status-update-msg .su-icon { font-size: 20px; margin-bottom: 4px; }
  .status-update-msg .su-title { font-size: 12px; font-weight: 700; margin-bottom: 2px; }
  .status-update-msg .su-desc { font-size: 11px; color: var(--cream-dim); }

  /* ─── CHAT INPUT ─── */
  .chat-input-area {
    padding: 14px 18px;
    background: var(--navy-card);
    border-top: 1px solid var(--navy-border);
  }

  .agent-action-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .action-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 99px;
    border: 1.5px solid;
    background: transparent;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    transition: all var(--transition);
  }

  .action-chip.payment { border-color: rgba(232,151,90,0.4); color: var(--orange); }
  .action-chip.payment:hover { background: var(--orange-bg); }
  .action-chip.dispute { border-color: rgba(224,90,90,0.4); color: var(--red); }
  .action-chip.dispute:hover { background: var(--red-bg); }
  .action-chip.refund { border-color: rgba(90,157,232,0.4); color: var(--blue); }
  .action-chip.refund:hover { background: var(--blue-bg); }

  .action-chip.done { border-color: rgba(61,186,140,0.4); color: var(--green); }
  .action-chip.done:hover { background: var(--green-bg); }
  .action-chip:disabled { opacity: 0.35; cursor: not-allowed; }

  .chat-input-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
  }

  .chat-textarea {
    flex: 1;
    background: var(--navy-mid);
    border: 1px solid var(--navy-border);
    border-radius: 10px;
    padding: 11px 14px;
    color: var(--cream);
    font-family: 'DM Sans', sans-serif;
    font-size: 13.5px;
    outline: none;
    resize: none;
    max-height: 120px;
    transition: border-color var(--transition);
    line-height: 1.5;
  }

  .chat-textarea:focus { border-color: var(--gold); }
  .chat-textarea::placeholder { color: var(--cream-dim); opacity: 0.4; }

  .send-btn {
    width: 42px; height: 42px;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--white);
    transition: transform var(--transition), box-shadow var(--transition);
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(33,158,188,0.35);
  }

  .send-btn:hover { transform: scale(1.08) rotate(-3deg); box-shadow: 0 6px 20px rgba(33,158,188,0.45); }
  .send-btn:active { transform: scale(0.95); transition-duration: 80ms; }

  /* ─── DATE DIVIDER ─── */
  .date-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--cream-dim);
    font-size: 11px;
    opacity: 0.5;
    margin: 4px 0;
  }

  .date-divider::before, .date-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--navy-border);
  }

  /* ─── HANDOFF DIVIDER ─── */
  .handoff-divider {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin: 12px 0;
    position: relative;
  }

  .handoff-line {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(33,158,188,0.3), transparent);
  }

  .handoff-badge {
    background: rgba(33,158,188,0.08);
    border: 1px solid rgba(33,158,188,0.25);
    border-radius: 99px;
    padding: 5px 14px;
    font-size: 11px;
    color: var(--gold-dim);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
  }

  .handoff-badge strong { color: var(--gold); font-weight: 600; }

  .prev-session-label {
    font-size: 10px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--cream-dim);
    opacity: 0.35;
    margin: 6px 0 2px;
    align-self: flex-start;
  }

  /* ─── STATUS MODALS ─── */
  .modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(2,62,88,0.7);
    backdrop-filter: blur(4px);
    z-index: 999;
    align-items: center;
    justify-content: center;
  }

  .modal-overlay.open { display: flex; }

  .modal {
    background: var(--navy-card);
    border: 1px solid var(--navy-border);
    border-radius: 18px;
    padding: 32px;
    width: 400px;
    max-width: calc(100vw - 32px);
    box-shadow: var(--shadow);
    animation: modalIn 0.25s cubic-bezier(0.4,0,0.2,1);
  }

  .modal-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--cream);
    margin-bottom: 6px;
  }

  .modal-sub {
    font-size: 13px;
    color: var(--cream-dim);
    margin-bottom: 22px;
  }

  .modal-select {
    width: 100%;
    background: var(--navy-mid);
    border: 1px solid var(--navy-border);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    color: var(--cream);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    outline: none;
    margin-bottom: 14px;
    cursor: pointer;
  }

  .modal-select:focus { border-color: var(--gold); }
  .modal-select option { background: var(--navy-card); }

  .modal-textarea {
    width: 100%;
    background: var(--navy-mid);
    border: 1px solid var(--navy-border);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    color: var(--cream);
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    outline: none;
    resize: vertical;
    min-height: 80px;
    margin-bottom: 20px;
    transition: border-color var(--transition);
  }

  .modal-textarea:focus { border-color: var(--gold); }
  .modal-textarea::placeholder { color: var(--cream-dim); opacity: 0.5; }

  .modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

  .btn-ghost {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--navy-border);
    border-radius: var(--radius-sm);
    color: var(--cream-dim);
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition);
  }

  .btn-ghost:hover { background: var(--navy-hover); color: var(--cream); }

  .btn-confirm {
    padding: 10px 22px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
  }

  .btn-confirm.orange { background: linear-gradient(135deg, var(--orange), #f0aa6a); color: white; }
  .btn-confirm.red { background: linear-gradient(135deg, var(--red), #ee7070); color: white; }
  .btn-confirm.blue { background: linear-gradient(135deg, var(--blue), #70aaee); color: white; }
  .btn-confirm.green { background: linear-gradient(135deg, var(--green), #5dd4a5); color: white; }
  .btn-confirm:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,0.3); }

  /* ─── TOAST ─── */
  .toast-container {
    position: fixed;
    bottom: 24px; right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
  }

  .toast {
    background: var(--navy-card);
    border: 1px solid var(--navy-border);
    border-radius: 10px;
    padding: 12px 18px;
    font-size: 13px;
    color: var(--cream);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.3s ease;
    pointer-events: all;
    max-width: 320px;
  }

  .toast.fadeout {
    animation: toastOut 0.3s ease forwards;
  }

  /* ─── MOBILE OVERLAY ─── */
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(2,62,88,0.6);
    z-index: 199;
  }

  /* ─── MOBILE CHAT BACK BUTTON ─── */
  .chat-back-btn {
    display: none;
    width: 38px; height: 38px;
    background: var(--navy-mid);
    border: 1px solid var(--navy-border);
    border-radius: var(--radius-sm);
    color: var(--cream);
    font-size: 18px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition);
  }
  .chat-back-btn:hover { background: var(--navy-hover); }

  /* ─── RESPONSIVE — MOBILE-FIRST DESIGN SYSTEM ───
     Breakpoints follow content needs, not devices:
       ≥1280px  XL desktop  — full luxury layout
       ≥1024px  L  desktop  — standard
       ≥768px   M  tablet   — sidebar + condensed grid
       ≥640px   S  large phone — 2-col cards
       <640px   XS phone    — single column, drawer nav
  */

  /* ─── XS (default / phone, < 640px) ─── */
  @media (max-width: 1023px) {
    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .hamburger { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: var(--radius-sm); }
    .hamburger:hover { background: var(--navy-hover); }
    .sidebar-overlay.open { display: block; }
  }

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

  /* ─── Tablet & below (≤ 900px) ─── */
  @media (max-width: 900px) {
    .topbar { padding: 0 16px; gap: 10px; }
    .topbar-search { width: 160px; font-size: 12.5px; }
    .topbar-search:focus { width: 180px; }
    .page { padding: 22px 18px; }

    /* Chat — mobile uses single-pane navigation */
    .chat-layout {
      grid-template-columns: 1fr;
      height: calc(100dvh - var(--topbar-h));
    }
    .chat-list-panel { width: 100%; }
    .chat-window { display: none; }
    .chat-layout.has-active-chat .chat-list-panel { display: none; }
    .chat-layout.has-active-chat .chat-window { display: flex; }
    .chat-back-btn { display: flex; }
  }

  /* ─── Large phone (≤ 640px) ─── */
  @media (max-width: 640px) {
    :root { --topbar-h: 58px; }
    .topbar { padding: 0 14px; gap: 8px; height: var(--topbar-h); }
    .topbar-title { font-size: 18px; }
    .topbar-search { display: none; }
    .icon-btn { width: 34px; height: 34px; font-size: 15px; }
    .page { padding: 18px 14px; }

    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 22px; }
    .stat-card { padding: 16px; border-radius: 12px; }
    .stat-value { font-size: 28px; }
    .stat-icon { font-size: 18px; margin-bottom: 10px; }
    .stat-card::before { width: 60px; height: 60px; }

    .section-title { font-size: 17px; }
    .section-header { margin-bottom: 14px; }

    .customer-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .customer-card { padding: 16px; }
    .cust-meta { gap: 8px; }
    .cust-meta > div { width: 100%; margin-left: 0; }
    .cust-meta > div .assign-btn { flex: 1; min-width: 0; padding: 8px 12px; text-align: center; justify-content: center; }
    .filter-tabs { gap: 4px; padding: 4px; margin-bottom: 16px; }
    .filter-tab { padding: 7px 14px; font-size: 12.5px; }

    /* Data table → card-ish list on mobile */
    .data-table thead { display: none; }
    .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
    .data-table tr { padding: 14px 16px; border-bottom: 1px solid var(--navy-border); }
    .data-table tr:last-child { border-bottom: none; }
    .data-table td {
      padding: 4px 0;
      border: none;
      font-size: 12.5px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
    }
    .data-table td::before {
      content: attr(data-label);
      font-size: 10.5px;
      letter-spacing: 0.8px;
      text-transform: uppercase;
      color: var(--cream-dim);
      opacity: 0.6;
      font-weight: 600;
      flex-shrink: 0;
    }
    .data-table td:first-child::before { display: none; }
    .data-table .cust-name-cell { width: 100%; }

    .modal { padding: 22px 18px; border-radius: 14px; }
    .modal-title { font-size: 19px; }
    .modal-actions { flex-direction: column-reverse; gap: 8px; }
    .modal-actions button { width: 100%; }

    .chat-header { padding: 12px 14px; gap: 10px; }
    .chat-header .ch-av { width: 36px; height: 36px; font-size: 13px; }
    .chat-header .ch-name { font-size: 14px; }
    .chat-messages { padding: 14px; gap: 10px; }
    .msg-bubble { max-width: 82%; font-size: 13px; padding: 10px 14px; }
    .chat-input-area { padding: 12px 14px calc(12px + var(--safe-bottom)); }
    .send-btn { width: 40px; height: 40px; }

    .toast-container { left: 12px; right: 12px; bottom: calc(16px + var(--safe-bottom)); }
    .toast { max-width: none; }

    .login-card { padding: 36px 26px; border-radius: 16px; }
    .login-logo h1 { font-size: 24px; }

    /* Sidebar narrower on phone, snappier */
    .sidebar { width: min(85vw, 280px); }
  }

  /* ─── Small phone (≤ 400px) ─── */
  @media (max-width: 400px) {
    .stats-grid { grid-template-columns: 1fr; }
    .topbar-title { font-size: 17px; letter-spacing: 0.3px; }
    .filter-tab { padding: 6px 12px; font-size: 12px; }
    .cust-badges .badge { font-size: 9.5px; padding: 3px 8px; }
    .msg-bubble { max-width: 88%; }
  }

  /* ─── Touch-only optimizations (no hover) ─── */
  @media (hover: none) and (pointer: coarse) {
    .nav-item, .filter-tab, .assign-btn, .icon-btn, .chat-back-btn,
    .action-chip, .btn-ghost, .btn-confirm, .send-btn, .hamburger {
      min-height: 40px;
    }
    .stat-card:hover { transform: none; }
    .customer-card:hover { transform: none; }
  }

  /* ─── Landscape phone — keep chat usable ─── */
  @media (max-height: 500px) and (orientation: landscape) {
    .login-card { padding: 24px 28px; }
    .login-logo { margin-bottom: 20px; }
    .login-logo .logo-mark { width: 44px; height: 44px; margin-bottom: 8px; }
    .login-input { margin-bottom: 12px; padding: 10px 14px; }
  }

  /* ─── Motion preferences ─── */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }

