/* ================================================================
   BOS — Complete Responsive CSS
   Breakpoints: 960px | 680px | 480px | 360px
   Strategy: mobile-first where it matters, desktop-first elsewhere
   ================================================================ */

/* ── Variables ──────────────────────────────────────────────────── */
:root {
  /* ── NEXO Brand — Gold Design System ── */

  /* Backgrounds */
  --bg:           #0A0D14;
  --bg-elevated:  #0E1119;
  --surface:      #141824;
  --surface2:     #1A2030;
  --surface3:     #202840;

  /* Borders */
  --border:       #252D42;
  --border-soft:  rgba(37,45,66,.55);
  --border-focus: #C9A84C;

  /* Text */
  --text:         #EAEDF5;
  --text-2:       #CDD2E4;
  --muted:        #7A85A3;
  --muted-2:      #4A5270;

  /* Accent — NEXO Gold */
  --accent:          #C9A84C;
  --accent-h:        #B8953A;
  --accent-light:    #E8C87A;
  --accent-subtle:   rgba(201,168,76,.12);
  --accent-glow:     rgba(201,168,76,.30);

  /* Semantic */
  --success:         #2EB07E;
  --success-subtle:  rgba(46,176,126,.13);
  --warning:         #EF9F27;
  --warning-subtle:  rgba(239,159,39,.13);
  --danger:          #EF405A;
  --danger-subtle:   rgba(239,64,90,.13);
  --info:            #6FA8FF;
  --info-subtle:     rgba(111,168,255,.13);

  /* Typography */
  --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;

  /* Radius */
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  /* Shadows */
  --shadow-sm:     0 1px 4px rgba(0,0,0,.4);
  --shadow:        0 4px 24px rgba(0,0,0,.5);
  --shadow-lg:     0 8px 40px rgba(0,0,0,.65);
  --shadow-accent: 0 4px 24px var(--accent-glow);

  /* Transitions */
  --t-fast: 100ms ease;
  --t-base: 150ms ease;
  --t-slow: 250ms ease;

  /* Layout */
  --sidebar-w:         220px;
  --sidebar-collapsed: 60px;
  --topbar-h:          52px;
  --mobile-tabs-h:     60px;
  --touch-min:         48px;
  --pad:               16px;
}

/* ── Reset ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text);
       min-height: 100vh; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
button { cursor: pointer; font-family: inherit; -webkit-tap-highlight-color: transparent; }
input, select, textarea { font-family: inherit; }
ul { list-style: none; }
img { max-width: 100%; }

/* ── Login — NEXO Brand ─────────────────────────────────────────── */
#login-page {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 40% 30%, rgba(201,168,76,.08) 0%, var(--bg) 65%);
  padding: 24px 20px;
}
.login-card {
  background: transparent; width: 100%; max-width: 360px;
  display: flex; flex-direction: column; align-items: center;
}
/* App icon — gold rounded square */
.nexo-app-icon {
  width: 88px; height: 88px; border-radius: 22px;
  background: linear-gradient(145deg, #C9A84C 0%, #E8C87A 60%, #C9A84C 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.6rem; font-weight: 800; color: #0A0D14; font-family: var(--font);
  margin-bottom: 20px; box-shadow: 0 8px 32px rgba(201,168,76,.35), 0 2px 8px rgba(0,0,0,.5);
  flex-shrink: 0;
}
.nexo-brand {
  font-size: 2.1rem; font-weight: 800; letter-spacing: .18em; color: var(--accent);
  text-align: center; line-height: 1; margin-bottom: 4px;
}
.nexo-sub {
  font-size: .6rem; font-weight: 700; letter-spacing: .28em; color: var(--muted);
  text-align: center; margin-bottom: 36px; text-transform: uppercase;
}
/* Form fields with gold uppercase labels */
.login-card .form-group { width: 100%; }
.login-card label {
  font-size: .62rem; font-weight: 700; letter-spacing: .14em;
  color: var(--accent); text-transform: uppercase; margin-bottom: 6px;
}
.login-card .form-control {
  background: var(--surface); border-color: var(--border);
  border-radius: 10px; padding: 13px 14px; font-size: .95rem;
}
.login-card .form-control:focus { border-color: var(--accent); }
.btn-login {
  width: 100%; padding: 14px; font-size: 1rem; font-weight: 800;
  background: var(--accent); color: #0A0D14; border-radius: 10px; border: none;
  margin-top: 8px; cursor: pointer; transition: background var(--t-base);
  min-height: 50px; letter-spacing: .02em;
}
.btn-login:hover { background: var(--accent-light); }
.login-help {
  text-align: center; font-size: .8rem; color: var(--muted); margin-top: 20px;
}
.login-help a { color: var(--accent); font-weight: 600; text-decoration: none; }
.login-version {
  text-align: center; font-size: .68rem; color: var(--muted-2); margin-top: 32px;
}
/* Legacy aliases */
.login-logo { font-size: 2rem; font-weight: 800; color: var(--accent); margin-bottom: 4px; }
.login-sub  { color: var(--muted); font-size: .88rem; margin-bottom: 24px; }

/* ── App Shell ──────────────────────────────────────────────────── */
#app { display: flex; min-height: 100vh; }

/* ── Sidebar ────────────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w); background: var(--surface);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; height: 100vh;
  z-index: 300; transition: transform .25s ease; overflow-y: auto;
}
.sidebar-header {
  padding: 16px 14px; border-bottom: 1px solid var(--border);
  font-size: 1rem; font-weight: 800; color: var(--accent);
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.sidebar-header .logo-sub { font-size: .68rem; color: var(--muted); font-weight: 400; display: block; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 0; }
.nav-section { padding: 10px 14px 4px; font-size: .65rem; font-weight: 700;
  letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  color: var(--muted); font-size: .88rem; border-left: 3px solid transparent;
  transition: all .15s; cursor: pointer; min-height: var(--touch-min);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.nav-item:hover  { color: var(--text); background: var(--surface2); }
.nav-item.active { color: var(--accent); border-left-color: var(--accent); background: rgba(201,168,76,.1); }
.nav-item .nav-icon { width: 18px; text-align: center; font-size: .95rem; flex-shrink: 0; }
.sidebar-footer { padding: 12px 14px; border-top: 1px solid var(--border); flex-shrink: 0; }
.user-badge { display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .82rem; flex-shrink: 0; color: #fff; }
.user-name { font-size: .85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: .72rem; color: var(--muted); text-transform: capitalize; }
.btn-logout { margin-top: 8px; width: 100%; padding: 8px; background: transparent;
  border: 1px solid var(--border); color: var(--muted); border-radius: 6px;
  font-size: .82rem; transition: all .15s; min-height: var(--touch-min); }
.btn-logout:hover { border-color: var(--danger); color: var(--danger); }

/* Overlay */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 299; }
.sidebar-overlay.open { display: block; }

/* ── Main ───────────────────────────────────────────────────────── */
#main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* ── Topbar ─────────────────────────────────────────────────────── */
#topbar {
  height: 52px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 16px; gap: 8px;
  position: sticky; top: 0; z-index: 100; flex-shrink: 0; overflow: hidden;
}
#topbar h1 { font-size: 1rem; font-weight: 700; flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.topbar-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; overflow: hidden; }
.topbar-actions .btn { flex-shrink: 0; }
#menu-toggle { display: none; background: transparent; border: none; color: var(--text);
  font-size: 1.4rem; padding: 4px; min-height: var(--touch-min); min-width: var(--touch-min); flex-shrink: 0; }

/* ── Content ────────────────────────────────────────────────────── */
#content { padding: var(--pad); flex: 1; min-width: 0; }

/* ── Grid ───────────────────────────────────────────────────────── */
.grid-4    { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.grid-3    { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.grid-2    { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 12px; }

/* ── Card ───────────────────────────────────────────────────────── */
.card { background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border); padding: 16px; }
.card-title { font-size: .75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--muted); margin-bottom: 12px; }

/* ── Stat Cards ─────────────────────────────────────────────────── */
.stat-card { position: relative; overflow: hidden; }
.stat-value { font-size: 1.7rem; font-weight: 800; line-height: 1.1; }
.stat-label { font-size: .78rem; color: var(--muted); margin-top: 4px; }
.stat-change { font-size: .76rem; margin-top: 6px; }
.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }
.stat-icon { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 2.2rem; opacity: .1; }
.stat-card.accent  { border-left: 4px solid var(--accent); }
.stat-card.success { border-left: 4px solid var(--success); }
.stat-card.warning { border-left: 4px solid var(--warning); }
.stat-card.danger  { border-left: 4px solid var(--danger); }

/* ── Tables ─────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
thead th { background: var(--surface2); padding: 9px 12px; text-align: left;
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); white-space: nowrap; }
tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
tbody tr:hover { background: var(--surface2); }
tbody td { padding: 9px 12px; vertical-align: middle; }
tbody tr:last-child { border-bottom: none; }

/* ── Badges ─────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 3px 8px;
  border-radius: 20px; font-size: .7rem; font-weight: 600; white-space: nowrap; }
.badge-new          { background: rgba(111,168,255,.18); color: #6FA8FF; }
.badge-in_production{ background: rgba(239,159,39,.18); color: #EF9F27; }
.badge-ready        { background: rgba(46,176,126,.18); color: #2EB07E; }
.badge-at_store     { background: rgba(201,168,76,.15); color: #E8C87A; }
.badge-completed    { background: rgba(46,176,126,.15); color: #2EB07E; }
.badge-cancelled    { background: rgba(239,64,90,.18);  color: #EF405A; }
.badge-paid         { background: rgba(46,176,126,.18); color: #2EB07E; }
.badge-partial      { background: rgba(239,159,39,.18); color: #EF9F27; }
.badge-pending      { background: rgba(239,64,90,.15);  color: #EF405A; }
.badge-vip          { background: rgba(201,168,76,.2);  color: #E8C87A; }
.badge-repeat       { background: rgba(111,168,255,.15);color: #6FA8FF; }
.badge-inactive     { background: rgba(122,133,163,.15);color: #7A85A3; }
.badge-info         { background: rgba(111,168,255,.15);color: var(--info); }
.badge-success      { background: rgba(46,176,126,.15); color: var(--success); }
.badge-warning      { background: rgba(239,159,39,.15); color: var(--warning); }
.badge-danger       { background: rgba(239,64,90,.15);  color: var(--danger); }
.badge-no_issue     { background: rgba(46,176,126,.18); color: #2EB07E; }
.badge-minor_issue  { background: rgba(239,159,39,.2);  color: #EF9F27; }
.badge-major_issue  { background: rgba(239,64,90,.2);   color: #EF405A; }
.badge-rejected     { background: rgba(239,64,90,.35);  color: #EF405A; font-weight: 700; }

/* ── Forms ──────────────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 5px; font-weight: 500; }
.form-control {
  width: 100%; padding: 10px 12px; background: var(--bg);
  border: 1.5px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: .9rem; outline: none;
  transition: border-color .15s; min-height: var(--touch-min);
}
.form-control:focus { border-color: var(--accent); }
textarea.form-control { resize: vertical; min-height: 72px; }
select.form-control option { background: var(--surface); }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.form-section { font-size: .65rem; font-weight: 700; letter-spacing: .1em;
  color: var(--accent); text-transform: uppercase;
  margin: 18px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 8px; border: none;
  font-size: .86rem; font-weight: 600; transition: all .15s;
  white-space: nowrap; min-height: var(--touch-min); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:not(:disabled):hover { background: var(--accent-h); }
.btn-success { background: #16a34a; color: #fff; }
.btn-success:not(:disabled):hover { background: #15803d; }
.btn-danger  { background: #dc2626; color: #fff; }
.btn-danger:not(:disabled):hover  { background: #b91c1c; }
.btn-warning { background: var(--warning); color: #000; }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:not(:disabled):hover { border-color: var(--accent); color: var(--accent); }
.btn-sm  { padding: 6px 12px; font-size: .78rem; min-height: 36px; }
.btn-xs  { padding: 4px 9px; font-size: .72rem; min-height: 28px; border-radius: 6px; }
.btn-icon { padding: 7px; border-radius: 6px; background: var(--surface2);
  color: var(--muted); border: 1px solid var(--border); min-height: 36px; min-width: 36px; }
.btn-icon:hover { color: var(--accent); border-color: var(--accent); }
.btn-block { width: 100%; }
.btn-close { background: transparent; border: none; color: var(--muted);
  font-size: 1.3rem; line-height: 1; padding: 4px 8px; border-radius: 4px;
  min-height: var(--touch-min); }
.btn-close:hover { color: var(--text); }
.btn-start-prod  { background: rgba(245,158,11,.15); color: #fcd34d; border: 1px solid rgba(245,158,11,.3); }
.btn-mark-ready  { background: rgba(34,197,94,.15);  color: #86efac; border: 1px solid rgba(34,197,94,.3); }
.btn-send-store  { background: rgba(99,102,241,.15); color: #a5b4fc; border: 1px solid rgba(99,102,241,.3); }
.btn-complete    { background: rgba(34,197,94,.25);  color: #4ade80; border: 1px solid rgba(34,197,94,.4); font-weight: 700; }

/* ── Modal — center on desktop, sheet on mobile ─────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 500;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface); border-radius: var(--radius-lg);
  width: 100%; max-width: 640px; max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: 0 8px 48px rgba(0,0,0,.6);
  transform: scale(.97) translateY(6px); transition: transform .2s;
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.modal-title { font-size: 1rem; font-weight: 700; }
.modal-body  { padding: 20px; overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px; flex-shrink: 0; flex-wrap: wrap; }

/* ── Search ─────────────────────────────────────────────────────── */
.filters-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.search-input { padding: 9px 12px 9px 34px; background: var(--surface);
  border: 1.5px solid var(--border); border-radius: 8px; color: var(--text);
  font-size: .86rem; outline: none; width: 100%; max-width: 260px;
  transition: border-color .15s; min-height: var(--touch-min); }
.search-input:focus { border-color: var(--accent); }
.search-wrap { position: relative; }
.search-wrap .search-icon { position: absolute; left: 10px; top: 50%;
  transform: translateY(-50%); color: var(--muted); font-size: .85rem; pointer-events: none; }

/* ── Pagination ─────────────────────────────────────────────────── */
.pagination { display: flex; align-items: center; gap: 6px; margin-top: 12px;
  justify-content: center; flex-wrap: wrap; }
.page-btn { padding: 6px 12px; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 6px; color: var(--muted); font-size: .82rem; transition: all .15s; min-height: 36px; }
.page-btn:hover, .page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Tabs ───────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border);
  margin-bottom: 16px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab-btn { padding: 8px 14px; background: transparent; border: none;
  color: var(--muted); font-size: .84rem; font-weight: 600;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: all .15s; white-space: nowrap; min-height: 40px; cursor: pointer; }
.tab-btn:hover  { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Alerts ─────────────────────────────────────────────────────── */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px;
  border-radius: 8px; margin-bottom: 8px; font-size: .85rem; cursor: pointer; }
.alert-danger  { background: rgba(239,68,68,.1);  border-left: 3px solid var(--danger);  color: #fca5a5; }
.alert-warning { background: rgba(245,158,11,.1); border-left: 3px solid var(--warning); color: #fcd34d; }
.alert-success { background: rgba(34,197,94,.1);  border-left: 3px solid var(--success); color: #86efac; }
.alert-info    { background: rgba(56,189,248,.1); border-left: 3px solid var(--info);    color: #7dd3fc; }

/* ── Insights ───────────────────────────────────────────────────── */
.insight-card { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface2); margin-bottom: 8px; }
.insight-icon { font-size: 1.3rem; flex-shrink: 0; }
.insight-text { font-size: .85rem; line-height: 1.5; }
.insight-card.warning { border-left: 3px solid var(--warning); }
.insight-card.success { border-left: 3px solid var(--success); }
.insight-card.info    { border-left: 3px solid var(--info); }
.insight-card.danger  { border-left: 3px solid var(--danger); }

/* ── Stage tracker ──────────────────────────────────────────────── */
.stage-tracker { display: flex; flex-direction: column; gap: 8px; }
.stage-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: var(--surface2); border-radius: 8px; border: 1px solid var(--border); }
.stage-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.stage-dot.completed   { background: var(--success); box-shadow: 0 0 8px rgba(34,197,94,.5); }
.stage-dot.in_progress { background: var(--accent); animation: pulse 1.5s infinite; }
.stage-dot.pending     { background: var(--border); }
.stage-dot.failed      { background: var(--danger); }
.stage-name { font-weight: 600; font-size: .88rem; flex: 1; text-transform: capitalize; }
.stage-time { font-size: .73rem; color: var(--muted); }

/* ── Defect dots ────────────────────────────────────────────────── */
.defect-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.defect-dot.no_issue    { background: #22c55e; }
.defect-dot.minor_issue { background: #f59e0b; }
.defect-dot.major_issue { background: #ef4444; }
.defect-dot.rejected    { background: #dc2626; box-shadow: 0 0 6px rgba(239,68,68,.6); }

/* ── Chart, Toast, Loader ───────────────────────────────────────── */
.chart-wrap { position: relative; height: 200px; }
#toast-container { position: fixed; bottom: 16px; right: 16px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
  max-width: min(400px, calc(100vw - 32px)); }
.toast { padding: 12px 16px; border-radius: 10px; font-size: .85rem;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 8px;
  animation: slideIn .25s ease; }
.toast.success { background: #14532d; color: #86efac; border-left: 4px solid var(--success); }
.toast.error   { background: #450a0a; color: #fca5a5; border-left: 4px solid var(--danger); }
.toast.info    { background: #0c2340; color: #7dd3fc; border-left: 4px solid var(--info); }
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state .icon { font-size: 2.5rem; margin-bottom: 10px; opacity: .5; }
.empty-state p { font-size: .88rem; }
.loader  { display: flex; align-items: center; justify-content: center; padding: 32px; }
.spinner { width: 32px; height: 32px; border: 3px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }

/* ── Public Tracker ─────────────────────────────────────────────── */
#tracker-page { min-height: 100vh; display: flex; align-items: center;
  justify-content: center; padding: 16px; background: var(--bg); }
.tracker-card { background: var(--surface); border-radius: var(--radius-lg);
  padding: 28px; width: 100%; max-width: 540px; }

/* ── Animations ─────────────────────────────────────────────────── */
@keyframes pulse   { 0%,100%{opacity:1} 50%{opacity:.4} }
@keyframes spin    { to{transform:rotate(360deg)} }
@keyframes slideIn { from{transform:translateX(40px);opacity:0} to{transform:translateX(0);opacity:1} }


/* ================================================================
   RESPONSIVE — Tablet  ≤ 960px
   ================================================================ */
@media (max-width: 960px) {
  :root { --pad: 14px; }

  /* Sidebar becomes overlay */
  #sidebar { transform: translateX(-100%); z-index: 300; }
  #sidebar.open { transform: translateX(0); box-shadow: 4px 0 32px rgba(0,0,0,.6); }
  .sidebar-overlay.open { display: block; }
  #main  { margin-left: 0; }
  #menu-toggle { display: flex; align-items: center; justify-content: center; }

  /* Grids compress to 2 cols */
  .grid-4 { grid-template-columns: repeat(2,1fr); }
  .grid-3 { grid-template-columns: repeat(2,1fr); }

  /* Modal becomes bottom sheet */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal {
    max-width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 92vh; transform: translateY(30px);
  }
  .modal-overlay.open .modal { transform: translateY(0); }
}


/* ================================================================
   RESPONSIVE — Mobile  ≤ 680px
   ================================================================ */
@media (max-width: 680px) {
  :root { --pad: 10px; }
  html { font-size: 14px; }

  /* Topbar: compact, no overflow */
  #topbar { padding: 0 10px; gap: 5px; height: 48px; }
  #topbar h1 { font-size: .88rem; }
  .topbar-actions { gap: 4px; }

  /* Hide "Quick Order" text label, keep ⚡ icon */
  .qo-label { display: none; }

  /* Icon-only buttons stay square */
  .topbar-actions .btn-icon { min-width: 34px; min-height: 34px; padding: 6px; }
  .topbar-actions .btn-primary { padding: 6px 10px; font-size: .82rem; }

  /* Content */
  #content { padding: var(--pad); }
  .card    { padding: 12px; border-radius: var(--radius); }

  /* All class-based grids → 1 col */
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }

  /* Form rows → 1 col */
  .form-row, .form-row-3 { grid-template-columns: 1fr; gap: 0; }

  /* Inline-style grids from JS → override to 2-col max or 1-col */
  /* 4-col inline grids */
  [style*="repeat(4,1fr)"], [style*="repeat(4, 1fr)"],
  [style*="grid-template-columns:repeat(4"] {
    grid-template-columns: repeat(2,1fr) !important;
  }
  /* 3-col inline grids */
  [style*="repeat(3,1fr)"], [style*="repeat(3, 1fr)"],
  [style*="grid-template-columns:repeat(3"] {
    grid-template-columns: repeat(2,1fr) !important;
  }
  /* Explicit "1fr 1fr 1fr" */
  [style*="grid-template-columns:1fr 1fr 1fr"] {
    grid-template-columns: 1fr 1fr !important;
  }

  /* Stat text */
  .stat-value { font-size: 1.4rem; }

  /* Tables → card layout */
  thead { display: none; }
  tbody tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--border); }
  tbody td {
    display: flex; justify-content: space-between; align-items: center;
    padding: 5px 12px; font-size: .82rem; min-height: 30px; gap: 6px; flex-wrap: wrap;
  }
  tbody td::before {
    content: attr(data-label); color: var(--muted); font-size: .7rem;
    font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    flex-shrink: 0; margin-right: 4px;
  }
  /* Action cells with no label */
  tbody td:not([data-label])::before,
  tbody td[data-label=""]::before { display: none; }
  tbody td:not([data-label]),
  tbody td[data-label=""] { justify-content: flex-end; }

  /* Buttons */
  .btn    { padding: 9px 13px; font-size: .84rem; }
  .btn-sm { padding: 7px 11px; font-size: .78rem; }

  /* Login */
  .login-card { padding: 22px 16px; }

  /* Modal */
  .modal-header { padding: 13px 14px; }
  .modal-body   { padding: 14px; }
  .modal-footer { padding: 12px 14px; flex-direction: column; }
  .modal-footer .btn { width: 100%; justify-content: center; }

  /* Toast */
  #toast-container { left: 10px; right: 10px; bottom: 10px; max-width: 100%; }

  /* Filters */
  .filters-bar { flex-direction: column; align-items: stretch; }
  .filters-bar > * { width: 100%; max-width: 100%; }
  .search-input { max-width: 100%; }

  /* Kanban — horizontal scroll on phone */
  #kanban-board { overflow-x: auto !important; padding-bottom: 12px; }
  #kanban-board > div { min-width: 250px !important; flex-shrink: 0; }
}


/* ================================================================
   RESPONSIVE — Small  ≤ 480px
   ================================================================ */
@media (max-width: 480px) {
  html { font-size: 13.5px; }

  /* 3-col and 4-col inline grids → 1 col */
  [style*="repeat(4,1fr)"], [style*="repeat(4, 1fr)"],
  [style*="grid-template-columns:repeat(4"],
  [style*="repeat(3,1fr)"], [style*="repeat(3, 1fr)"],
  [style*="grid-template-columns:repeat(3"],
  [style*="grid-template-columns:1fr 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* 2-col inline grids stay as 2-col unless they're finance KPIs */
  #fin-kpis { grid-template-columns: 1fr 1fr !important; }

  /* S22 summary cards: 2 col on small */
  #s22-pan-orders .grid-2,
  #s22-pan-collected [style*="repeat(3"] { grid-template-columns: 1fr 1fr !important; }

  .stat-value { font-size: 1.2rem; }
  #topbar h1  { font-size: .82rem; }
}


/* ================================================================
   RESPONSIVE — Tiny  ≤ 360px
   ================================================================ */
@media (max-width: 360px) {
  :root { --sidebar-w: 200px; }
  html  { font-size: 13px; }
  .stat-value { font-size: 1.1rem; }
  .grid-2 { grid-template-columns: 1fr; }
}


/* ================================================================
   LARGE SCREEN  ≥ 1400px
   ================================================================ */
@media (min-width: 1400px) {
  :root { --sidebar-w: 240px; --pad: 24px; }
  html  { font-size: 15.5px; }
  .grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); }
}


/* ================================================================
   TOUCH DEVICES — no sticky hover, bigger targets
   ================================================================ */
@media (hover: none) and (pointer: coarse) {
  .nav-item:hover  { background: transparent; color: var(--muted); }
  tbody tr:hover   { background: transparent; }
  .btn-outline:hover { border-color: var(--border); color: var(--text); }
  input[type="checkbox"],
  input[type="radio"] { width: 18px; height: 18px; }
  /* Ensure all interactive things are tappable */
  .tab-btn, .page-btn, select.form-control { min-height: var(--touch-min); }
}


/* ================================================================
   SAFE AREA — iPhone notch / home bar
   ================================================================ */
@supports (padding: env(safe-area-inset-bottom)) {
  #topbar {
    padding-left:  max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
  #sidebar { padding-bottom: env(safe-area-inset-bottom); }
  #content { padding-bottom: max(var(--pad), env(safe-area-inset-bottom)); }
  #toast-container { bottom: max(16px, env(safe-area-inset-bottom)); }
}


/* ================================================================
   PRINT
   ================================================================ */
@media print {
  #sidebar, #topbar, .topbar-actions,
  .btn, .filters-bar, .pagination,
  .modal-overlay { display: none !important; }
  #main { margin-left: 0; }
  body  { background: #fff; color: #000; font-size: 12px; }
  .card { border: 1px solid #ccc; box-shadow: none; break-inside: avoid; }
  table { font-size: 11px; }
  thead th { background: #f0f0f0; color: #000; }
  .badge { border: 1px solid #999; color: #000 !important; background: #eee !important; }
}


/* ================================================================
   DESIGN SYSTEM v2 — NEW COMPONENTS
   ================================================================ */

/* ── Mono / data font ────────────────────────────────────────────── */
.font-mono     { font-family: var(--mono); }
.order-num-text{ font-family: var(--mono); font-size: .82rem; letter-spacing: .03em; font-weight: 700; color: var(--text-2); }

/* ── Sidebar Collapse ────────────────────────────────────────────── */
.sidebar-collapse-btn {
  background: transparent; border: none; color: var(--muted);
  padding: 4px; border-radius: var(--radius-sm); cursor: pointer;
  transition: color var(--t-base); line-height: 1; font-size: .95rem;
  min-width: 28px; min-height: 28px; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0;
}
.sidebar-collapse-btn:hover { color: var(--text); }

@media (min-width: 961px) {
  #sidebar.collapsed { width: var(--sidebar-collapsed); overflow: visible; }
  #sidebar.collapsed .logo-sub,
  #sidebar.collapsed .nav-item > :not(.nav-icon),
  #sidebar.collapsed .nav-section,
  #sidebar.collapsed .user-name,
  #sidebar.collapsed .user-role,
  #sidebar.collapsed .btn-logout { display: none !important; }
  #sidebar.collapsed .sidebar-header { justify-content: center; padding: 14px 8px; }
  #sidebar.collapsed .nav-item { justify-content: center; padding: 10px 0; }
  #sidebar.collapsed .nav-icon { width: 100%; text-align: center; font-size: 1.1rem; }
  #sidebar.collapsed .user-badge { justify-content: center; }
  #sidebar.collapsed .sidebar-collapse-btn { margin: 0 auto; }
  #main.sidebar-collapsed { margin-left: var(--sidebar-collapsed); }
}

/* ── Mobile Bottom Tab Bar ───────────────────────────────────────── */
#mobile-tab-bar {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--mobile-tabs-h); background: var(--surface);
  border-top: 1px solid var(--border); z-index: 200;
  flex-direction: row; align-items: stretch;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.mtab {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; background: transparent; border: none;
  color: var(--muted); cursor: pointer; font-size: .55rem; font-weight: 700;
  letter-spacing: .02em; text-transform: capitalize;
  transition: color var(--t-base); padding: 6px 2px;
  -webkit-tap-highlight-color: transparent; user-select: none;
  border-top: 2px solid transparent;
  position: relative;
}
.mtab .mtab-icon { font-size: 1.15rem; line-height: 1; transition: transform var(--t-fast); }
.mtab.active { color: var(--accent); border-top-color: var(--accent); }
.mtab.active .mtab-icon { transform: scale(1.08); }
.mtab:not(.active):hover { color: var(--text); }
@media (max-width: 960px) {
  #mobile-tab-bar { display: flex; }
  #content { padding-bottom: calc(var(--pad) + var(--mobile-tabs-h) + env(safe-area-inset-bottom, 0px)); }
}

/* ── Bottom Sheet ────────────────────────────────────────────────── */
.bs-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 600;
  opacity: 0; pointer-events: none; transition: opacity var(--t-slow);
  display: flex; align-items: flex-end;
}
.bs-overlay.open { opacity: 1; pointer-events: all; }
.bottom-sheet {
  background: var(--surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%; max-height: 90vh; overflow-y: auto;
  transform: translateY(100%); transition: transform var(--t-slow);
  -webkit-overflow-scrolling: touch;
}
.bs-overlay.open .bottom-sheet { transform: translateY(0); }
.bs-handle {
  width: 40px; height: 4px; background: var(--border);
  border-radius: 2px; margin: 12px auto 16px; display: block;
}
.bs-header {
  padding: 0 20px 16px; display: flex; align-items: center;
  justify-content: space-between; border-bottom: 1px solid var(--border);
}
.bs-title { font-size: 1rem; font-weight: 700; }
.bs-body  { padding: 20px; }

/* ── Command Palette ─────────────────────────────────────────────── */
#cmd-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.72);
  z-index: 900; display: flex; align-items: flex-start; justify-content: center;
  padding-top: max(10vh, 60px);
  opacity: 0; pointer-events: none; transition: opacity .15s;
}
#cmd-overlay.open { opacity: 1; pointer-events: all; }
.cmd-palette {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); width: 100%; max-width: 580px; margin: 0 16px;
  overflow: hidden; box-shadow: var(--shadow-lg);
  transform: scale(.97) translateY(-8px); transition: transform .15s;
}
#cmd-overlay.open .cmd-palette { transform: scale(1) translateY(0); }
.cmd-input-wrap {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.cmd-input-icon { font-size: 1.1rem; color: var(--muted); flex-shrink: 0; }
.cmd-input {
  flex: 1; background: transparent; border: none; outline: none;
  font-size: 1rem; color: var(--text); font-family: var(--font);
}
.cmd-input::placeholder { color: var(--muted); }
.cmd-kbd {
  font-size: .68rem; color: var(--muted-2); background: var(--surface2);
  border: 1px solid var(--border); border-radius: 4px; padding: 2px 6px; flex-shrink: 0;
}
.cmd-results { max-height: 380px; overflow-y: auto; }
.cmd-section { padding: 8px 16px 4px; font-size: .65rem; font-weight: 700;
  letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.cmd-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px; cursor: pointer;
  transition: background var(--t-fast);
}
.cmd-item:hover, .cmd-item.focused { background: var(--surface2); }
.cmd-item-icon  { font-size: 1rem; width: 22px; text-align: center; flex-shrink: 0; }
.cmd-item-label { font-size: .88rem; font-weight: 500; flex: 1; min-width: 0; }
.cmd-item-meta  { font-size: .72rem; color: var(--muted); flex-shrink: 0; }
.cmd-empty { text-align: center; padding: 32px 20px; color: var(--muted); font-size: .88rem; }
.cmd-footer {
  padding: 10px 16px; border-top: 1px solid var(--border);
  display: flex; gap: 16px; font-size: .7rem; color: var(--muted-2);
}
.cmd-footer span { display: flex; align-items: center; gap: 4px; }

/* ── Skeleton Loaders ────────────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}
.skeleton {
  background: linear-gradient(90deg,
    var(--surface2) 25%, var(--surface3) 50%, var(--surface2) 75%);
  background-size: 1200px 100%;
  animation: shimmer 1.6s infinite linear;
  border-radius: var(--radius-sm);
}
.sk-line           { height: 11px; margin-bottom: 8px; }
.sk-line.sm        { height: 9px; width: 55%; }
.sk-line.lg        { height: 20px; }
.sk-block          { height: 72px; }
.sk-circle         { width: 36px; height: 36px; border-radius: 50%; }
.sk-card           { padding: 16px; }
.sk-stat-card      { padding: 20px; min-height: 90px; }

/* ── Status Chips (icon-forward upgrade over .badge) ─────────────── */
.status-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px; border: 1px solid transparent;
  font-size: .70rem; font-weight: 700; white-space: nowrap; line-height: 1.4;
}
.chip-new             { background: rgba(111,168,255,.14); color: #6FA8FF; border-color: rgba(111,168,255,.3); }
.chip-waiting_design  { background: rgba(239,159,39,.14); color: #EF9F27; border-color: rgba(239,159,39,.3); }
.chip-design_sent     { background: rgba(46,176,126,.14); color: #2EB07E; border-color: rgba(46,176,126,.3); }
.chip-needs_revision  { background: rgba(239,64,90,.14);  color: #EF405A; border-color: rgba(239,64,90,.3); }
.chip-waiting_payment { background: rgba(239,159,39,.14); color: #EF9F27; border-color: rgba(239,159,39,.3); }
.chip-in_production   { background: rgba(239,159,39,.14); color: #EF9F27; border-color: rgba(239,159,39,.3); }
.chip-ready           { background: rgba(46,176,126,.14); color: #2EB07E; border-color: rgba(46,176,126,.3); }
.chip-at_store        { background: rgba(201,168,76,.12); color: #E8C87A; border-color: rgba(201,168,76,.3); }
.chip-out_for_delivery{ background: rgba(111,168,255,.12);color: #6FA8FF; border-color: rgba(111,168,255,.3); }
.chip-completed       { background: rgba(46,176,126,.1);  color: #2EB07E; border-color: rgba(46,176,126,.2); }
.chip-cancelled       { background: rgba(239,64,90,.1);   color: #EF405A; border-color: rgba(239,64,90,.2); }
.chip-paid            { background: rgba(46,176,126,.14); color: #2EB07E; border-color: rgba(46,176,126,.3); }
.chip-partial         { background: rgba(239,159,39,.14); color: #EF9F27; border-color: rgba(239,159,39,.3); }
.chip-unpaid          { background: rgba(239,64,90,.12);  color: #EF405A; border-color: rgba(239,64,90,.25); }
.chip-pending-pay     { background: rgba(239,64,90,.1);   color: #EF405A; border-color: rgba(239,64,90,.2); }

/* ── Expandable Table Row ────────────────────────────────────────── */
.row-expandable { cursor: pointer; }
.expand-caret {
  display: inline-block; color: var(--muted-2); font-size: .85rem;
  margin-right: 6px; transition: transform var(--t-base); line-height: 1;
}
.row-expandable.expanded .expand-caret { transform: rotate(90deg); color: var(--accent); }
.row-detail-wrap { display: none; background: var(--bg-elevated); }
.row-detail-wrap.open { display: table-row; }
.row-detail-inner {
  padding: 14px 16px 16px;
  border-bottom: 2px solid var(--accent-subtle);
}
.row-detail-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr));
  gap: 10px 18px;
}
.rd-label { font-size: .63rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted); margin-bottom: 3px; }
.rd-value { font-size: .85rem; color: var(--text-2); line-height: 1.4; }

/* ── Bulk Actions Bar ────────────────────────────────────────────── */
#bulk-bar {
  position: fixed; bottom: calc(var(--mobile-tabs-h) + 10px); left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 10px 16px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-lg); z-index: 150;
  opacity: 0; pointer-events: none;
  transition: opacity var(--t-slow), transform var(--t-slow);
  white-space: nowrap;
}
#bulk-bar.visible { opacity: 1; pointer-events: all; transform: translateX(-50%) translateY(0); }
@media (min-width: 961px) { #bulk-bar { bottom: 20px; } }
.bulk-count   { font-weight: 700; font-size: .88rem; color: var(--accent); }
.bulk-actions { display: flex; gap: 8px; }

/* ── Pipeline / Flow Widget ──────────────────────────────────────── */
.pipeline-widget {
  display: flex; align-items: center; overflow-x: auto;
  padding: 4px 0 8px; scrollbar-width: none; gap: 0;
}
.pipeline-widget::-webkit-scrollbar { display: none; }
.pipe-step {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  cursor: pointer; min-width: 80px; padding: 8px 6px;
  border-radius: var(--radius); transition: background var(--t-base); flex-shrink: 0;
}
.pipe-step:hover { background: var(--surface2); }
.pipe-step-circle {
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-family: var(--mono); font-size: .95rem;
  border: 2px solid; transition: all var(--t-base);
}
.pipe-step-label {
  font-size: .6rem; font-weight: 600; text-align: center;
  color: var(--muted); line-height: 1.3; text-transform: uppercase; letter-spacing: .03em;
  max-width: 72px;
}
.pipe-connector {
  height: 2px; flex: 1; min-width: 12px; max-width: 36px;
  background: var(--border); margin-top: 23px; flex-shrink: 0;
}
/* Circle colour variants by step key */
.pipe-new           .pipe-step-circle { background: rgba(99,102,241,.12);  border-color: #6366f1; color: #a5b4fc; }
.pipe-production    .pipe-step-circle { background: rgba(245,158,11,.12);  border-color: #f59e0b; color: #fcd34d; }
.pipe-ready         .pipe-step-circle { background: rgba(34,197,94,.12);   border-color: #22c55e; color: #86efac; }
.pipe-store         .pipe-step-circle { background: rgba(201,168,76,.09);  border-color: #c9a84c; color: #e8c87a; }
.pipe-done          .pipe-step-circle { background: rgba(34,197,94,.07);   border-color: rgba(34,197,94,.35); color: #4ade80; }

/* ── KPI Sparkline container ─────────────────────────────────────── */
.kpi-sparkline     { height: 34px; overflow: hidden; margin-top: 8px; opacity: .65; }
.kpi-sparkline svg { width: 100%; height: 100%; }
.stat-trend        { display: inline-flex; align-items: center; gap: 3px; font-size: .72rem; font-weight: 600; }
.stat-trend.up     { color: var(--success); }
.stat-trend.down   { color: var(--danger); }
.stat-trend.flat   { color: var(--muted); }

/* ── Overdue row glow ────────────────────────────────────────────── */
@keyframes overdueGlow {
  0%,100% { background-color: transparent; }
  50%     { background-color: rgba(239,68,68,.05); }
}
.overdue-row { animation: overdueGlow 2.5s ease-in-out infinite; }
.overdue-row td:first-child { border-left: 3px solid var(--danger); }

/* ── Additional keyframes ────────────────────────────────────────── */
@keyframes fadeIn    { from{opacity:0}            to{opacity:1} }
@keyframes slideUp   { from{opacity:0;transform:translateY(16px)} to{opacity:1;transform:translateY(0)} }
@keyframes pageEnter { from{opacity:0;transform:translateY(8px)}  to{opacity:1;transform:translateY(0)} }
@keyframes toastIn   { from{transform:translateX(40px);opacity:0} to{transform:translateX(0);opacity:1} }

/* Content enter animation */
#content > * { animation: pageEnter .2s ease both; }

/* ── Quick action row ────────────────────────────────────────────── */
.quick-action-row { display: flex; gap: 8px; flex-wrap: wrap; }
.quick-action-row .btn { flex: 1; min-width: 120px; justify-content: flex-start; }

/* ── Kanban drag states ───────────────────────────────────────────── */
.kanban-col { transition: outline .12s, filter .12s; border-radius: 14px; }
.kanban-col.drop-over { outline: 2px solid var(--accent); outline-offset: -2px; filter: brightness(1.12); }
.kanban-card { transition: box-shadow var(--t-fast), opacity var(--t-fast); }
.kanban-card.dragging { opacity: .5; box-shadow: var(--shadow-lg); cursor: grabbing; }
body.kb-dragging #kanban-board .kanban-col { cursor: copy; }

/* ================================================================
   UTILITIES
   ================================================================ */
.hide-mobile { }
.show-mobile { display: none !important; }
@media (max-width: 680px) {
  .hide-mobile { display: none !important; }
  .show-mobile { display: block !important; }
}
.text-right   { text-align: right; }
.text-center  { text-align: center; }
.text-muted   { color: var(--muted); }
.text-accent  { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.fw-700 { font-weight: 700; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full   { width: 100%; }


/* ================================================================
   NEXO MOBILE UI — Phone-first components
   ================================================================ */

/* ── Morning War Room — Dashboard ────────────────────────────────── */
.dash-header {
  margin-bottom: 16px;
}
.dash-shift {
  font-size: .62rem; font-weight: 700; letter-spacing: .14em;
  color: var(--accent); text-transform: uppercase; margin-bottom: 2px;
}
.dash-date {
  font-size: 1.6rem; font-weight: 800; color: var(--text); line-height: 1.1;
}
.kpi-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px;
}
.kpi-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px 14px 12px;
  position: relative; overflow: hidden;
}
.kpi-label {
  font-size: .6rem; font-weight: 700; letter-spacing: .1em;
  color: var(--muted); text-transform: uppercase; margin-bottom: 6px;
}
.kpi-value {
  font-size: 1.45rem; font-weight: 800; line-height: 1.1; color: var(--text);
}
.kpi-trend {
  font-size: .68rem; font-weight: 700; margin-top: 4px;
  display: flex; align-items: center; gap: 3px;
}
.kpi-trend.up   { color: var(--success); }
.kpi-trend.down { color: var(--danger); }
.kpi-sparkline  { height: 28px; margin-top: 6px; opacity: .7; }

/* ── Action Inbox ─────────────────────────────────────────────────── */
.inbox-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); margin-bottom: 12px; overflow: hidden;
}
.inbox-header {
  padding: 12px 14px 10px; display: flex; align-items: center;
  justify-content: space-between; border-bottom: 1px solid var(--border);
}
.inbox-title {
  font-size: .62rem; font-weight: 700; letter-spacing: .12em;
  color: var(--muted); text-transform: uppercase;
}
.inbox-row {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px;
  border-bottom: 1px solid var(--border); cursor: pointer;
  transition: background var(--t-fast); min-height: 52px;
  text-decoration: none; color: inherit;
}
.inbox-row:last-child { border-bottom: none; }
.inbox-row:hover { background: var(--surface2); }
.inbox-row-icon { font-size: 1rem; flex-shrink: 0; width: 20px; text-align: center; }
.inbox-row-label { flex: 1; font-size: .88rem; font-weight: 500; color: var(--text); }
.inbox-row-count {
  background: var(--danger); color: #fff; border-radius: 20px;
  font-size: .65rem; font-weight: 800; padding: 2px 7px; min-width: 22px;
  text-align: center; flex-shrink: 0;
}
.inbox-row-count.warn { background: var(--warning); color: #0A0D14; }
.inbox-row-count.ok   { background: var(--success); color: #fff; }
.inbox-row-count.info { background: var(--info); color: #0A0D14; }
.inbox-row-arrow { color: var(--muted-2); font-size: .75rem; flex-shrink: 0; }

/* ── Pipeline Strip ──────────────────────────────────────────────── */
.pipeline-strip {
  display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 6px;
  scrollbar-width: none;
}
.pipeline-strip::-webkit-scrollbar { display: none; }
.pipe-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 20px; font-size: .7rem; font-weight: 700;
  white-space: nowrap; border: 1px solid transparent; cursor: pointer;
  flex-shrink: 0; transition: opacity var(--t-fast);
}
.pipe-chip-count {
  background: rgba(255,255,255,.15); border-radius: 10px;
  padding: 0 5px; font-size: .62rem; font-weight: 800;
}

/* ── Order Cards ─────────────────────────────────────────────────── */
.order-list { display: flex; flex-direction: column; gap: 8px; }
.order-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px; cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
  display: flex; gap: 12px; align-items: flex-start;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; user-select: none;
  will-change: border-color;
}
.order-card:hover, .order-card:active { border-color: var(--accent); background: var(--surface2); }
.order-card.overdue { border-left: 3px solid var(--danger); }
.order-avatar {
  width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1rem; font-family: var(--font);
  color: #0A0D14;
}
.order-card-body { flex: 1; min-width: 0; }
.order-card-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 6px; margin-bottom: 2px;
}
.order-card-num {
  font-family: var(--mono); font-size: .72rem; font-weight: 700;
  color: var(--muted); letter-spacing: .04em;
}
.order-card-date { font-size: .7rem; color: var(--muted); flex-shrink: 0; }
.order-card-name { font-size: .92rem; font-weight: 700; color: var(--text); line-height: 1.2; }
.order-card-product { font-size: .78rem; color: var(--muted); margin-top: 1px; }
.order-card-chips {
  display: flex; gap: 5px; margin-top: 8px; flex-wrap: wrap;
}
.order-card-due { font-size: .68rem; color: var(--danger); font-weight: 700; margin-top: 3px; }

/* ── Search + Filter Bar (mobile) ────────────────────────────────── */
.mobile-search-bar {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
.mobile-search-input {
  flex: 1; background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 11px 14px 11px 38px; color: var(--text);
  font-size: .9rem; outline: none; transition: border-color var(--t-base);
  min-height: var(--touch-min);
}
.mobile-search-input:focus { border-color: var(--accent); }
.mobile-search-wrap { flex: 1; position: relative; }
.mobile-search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: .9rem; pointer-events: none;
}
.filter-btn {
  width: 44px; height: 44px; background: var(--surface);
  border: 1.5px solid var(--border); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; cursor: pointer; position: relative; color: var(--muted);
  transition: border-color var(--t-base);
}
.filter-btn.active { border-color: var(--accent); color: var(--accent); }
.filter-badge {
  position: absolute; top: -5px; right: -5px;
  background: var(--accent); color: #0A0D14;
  border-radius: 10px; font-size: .55rem; font-weight: 800;
  padding: 1px 5px; min-width: 16px; text-align: center;
}
.filter-chips {
  display: flex; gap: 6px; overflow-x: auto; padding: 0 0 8px;
  scrollbar-width: none;
}
.filter-chips::-webkit-scrollbar { display: none; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 20px; padding: 5px 10px;
  font-size: .72rem; font-weight: 600; color: var(--text);
  white-space: nowrap; cursor: pointer; flex-shrink: 0;
  transition: background var(--t-fast);
}
.filter-chip.active { background: var(--accent-subtle); border-color: var(--accent); color: var(--accent); }
.filter-chip-remove { color: var(--muted); font-size: .65rem; margin-left: 2px; }

/* ── Order Detail — Full Screen ──────────────────────────────────── */
.detail-page { animation: pageEnter .2s ease both; }
.detail-back-bar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
}
.detail-back-btn {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px; color: var(--text);
  font-size: .82rem; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
  min-height: 38px; transition: border-color var(--t-base);
}
.detail-back-btn:hover { border-color: var(--accent); }
.detail-order-num { font-family: var(--mono); font-size: .78rem; color: var(--muted); flex: 1; }
.detail-menu-btn {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; width: 44px; height: 44px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--muted); font-size: 1.1rem;
  transition: border-color var(--t-base), background var(--t-base);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.detail-menu-btn:hover,
.detail-menu-btn:active { border-color: var(--accent); color: var(--accent); background: var(--accent-subtle); }

.detail-header {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px; margin-bottom: 10px;
}
.detail-avatar {
  width: 52px; height: 52px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.1rem; color: #0A0D14;
}
.detail-header-info { flex: 1; min-width: 0; }
.detail-header-num  { font-family: var(--mono); font-size: .72rem; color: var(--muted); margin-bottom: 2px; }
.detail-header-name { font-size: 1.05rem; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.detail-header-prod { font-size: .82rem; color: var(--muted); }
.detail-chips       { display: flex; gap: 5px; margin-top: 8px; flex-wrap: wrap; }

.contact-bar {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 10px;
}
.contact-btn {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 6px; display: flex; flex-direction: column;
  align-items: center; gap: 4px; cursor: pointer; font-size: .68rem;
  font-weight: 700; color: var(--muted); transition: all var(--t-base);
  min-height: 52px;
}
.contact-btn .cb-icon { font-size: 1.1rem; }
.contact-btn.whatsapp { border-color: rgba(37,211,102,.3); color: #25D366; }
.contact-btn.whatsapp:hover { background: rgba(37,211,102,.1); }
.contact-btn.telegram { border-color: rgba(42,171,238,.3); color: #2AABEE; }
.contact-btn.telegram:hover { background: rgba(42,171,238,.1); }
.contact-btn.call { border-color: var(--border); }
.contact-btn.call:hover { border-color: var(--accent); color: var(--accent); }
.contact-btn.sms { border-color: rgba(37,99,235,.3); color: #2563eb; background: none; cursor: pointer; }
.contact-btn.sms:hover { background: rgba(37,99,235,.1); }

.detail-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px 16px; margin-bottom: 10px;
}
.detail-section-title {
  font-size: .6rem; font-weight: 700; letter-spacing: .12em;
  color: var(--muted); text-transform: uppercase; margin-bottom: 12px;
}
.detail-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 0; border-bottom: 1px solid var(--border);
}
.detail-row:last-child { border-bottom: none; }
.detail-row-label { font-size: .8rem; color: var(--muted); }
.detail-row-value { font-size: .88rem; font-weight: 600; color: var(--text); text-align: right; }
.detail-row-value.big { font-size: 1.1rem; font-weight: 800; color: var(--accent); }
.detail-row-value.success { color: var(--success); }
.detail-row-value.danger  { color: var(--danger); }
.detail-row-value.overdue { color: var(--danger); font-weight: 700; }
.detail-row-value.warning { color: var(--warning); }

/* ── Production Stage Dots (in-line) ─────────────────────────────── */
.prod-stages-row {
  display: flex; align-items: center; gap: 0; overflow-x: auto;
  scrollbar-width: none; padding: 4px 0;
}
.prod-stages-row::-webkit-scrollbar { display: none; }
.prod-stage-dot {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  flex-shrink: 0; min-width: 56px;
}
.prod-stage-circle {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 800; border: 2px solid;
  transition: all var(--t-base);
}
.prod-stage-circle.done    { background: rgba(46,176,126,.2);  border-color: #2EB07E; color: #2EB07E; }
.prod-stage-circle.active  { background: rgba(239,159,39,.2);  border-color: #EF9F27; color: #EF9F27; }
.prod-stage-circle.pending { background: transparent; border-color: var(--border); color: var(--muted); }
.prod-stage-circle.failed  { background: rgba(239,64,90,.2);   border-color: #EF405A; color: #EF405A; }
.prod-stage-name {
  font-size: .55rem; font-weight: 700; color: var(--muted);
  text-align: center; text-transform: uppercase; letter-spacing: .04em; max-width: 56px;
}
.prod-stage-connector {
  width: 20px; height: 2px; background: var(--border); flex-shrink: 0;
  margin-top: -18px; /* align with center of circles */
}
.prod-stage-connector.done { background: #2EB07E; }

/* ── Production Stage Management view ───────────────────────────── */
.stage-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px 16px; margin-bottom: 8px;
}
.stage-card.active-stage {
  border-color: var(--accent); background: rgba(201,168,76,.04);
}
.stage-card-header {
  display: flex; align-items: center; gap: 10px;
}
.stage-card-num {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 800; border: 2px solid;
}
.stage-card-num.done    { background: rgba(46,176,126,.15);  border-color: #2EB07E; color: #2EB07E; }
.stage-card-num.active  { background: rgba(239,159,39,.15);  border-color: #EF9F27; color: #EF9F27; }
.stage-card-num.pending { background: transparent; border-color: var(--border); color: var(--muted); }
.stage-card-title { flex: 1; font-size: .9rem; font-weight: 700; color: var(--text); }
.stage-card-status-text { font-size: .7rem; font-weight: 700; flex-shrink: 0; }
.stage-card-status-text.done { color: var(--success); }
.stage-card-notes {
  margin-top: 12px;
  width: 100%; background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px; color: var(--text); font-size: .85rem;
  font-family: var(--font); outline: none; resize: none; min-height: 60px;
}
.stage-card-notes:focus { border-color: var(--accent); }
.stage-action-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px;
}
.btn-mark-failed {
  background: rgba(239,64,90,.12); color: #EF405A;
  border: 1.5px solid rgba(239,64,90,.3); border-radius: 10px;
  padding: 11px; font-size: .85rem; font-weight: 700; cursor: pointer;
  transition: background var(--t-base); min-height: 44px;
}
.btn-mark-failed:hover { background: rgba(239,64,90,.2); }
.btn-mark-complete {
  background: rgba(46,176,126,.15); color: #2EB07E;
  border: 1.5px solid rgba(46,176,126,.3); border-radius: 10px;
  padding: 11px; font-size: .85rem; font-weight: 700; cursor: pointer;
  transition: background var(--t-base); min-height: 44px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-mark-complete:hover { background: rgba(46,176,126,.25); }

/* ── Production List cards ───────────────────────────────────────── */
.prod-stat-bar {
  display: grid; grid-template-columns: repeat(4,1fr);
  gap: 8px; margin-bottom: 14px;
}
.prod-stat-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 8px; text-align: center;
}
.prod-stat-num  { font-size: 1.3rem; font-weight: 800; color: var(--text); line-height: 1; }
.prod-stat-num.danger  { color: var(--danger); }
.prod-stat-num.success { color: var(--success); }
.prod-stat-num.warning { color: var(--warning); }
.prod-stat-lbl  { font-size: .55rem; font-weight: 700; letter-spacing: .08em;
  color: var(--muted); text-transform: uppercase; margin-top: 2px; }
.prod-order-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px; cursor: pointer;
  margin-bottom: 8px; transition: border-color var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}
.prod-order-card:hover { border-color: var(--accent); }
.prod-order-top {
  display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px;
}
.prod-order-name { font-size: .92rem; font-weight: 700; color: var(--text); }
.prod-order-customer { font-size: .75rem; color: var(--muted); margin-top: 1px; }
.prod-order-due { font-size: .7rem; font-weight: 700; }
.prod-order-due.today   { color: var(--danger); }
.prod-order-due.soon    { color: var(--warning); }
.prod-order-due.normal  { color: var(--muted); }

/* ── Store 22 Pickup ─────────────────────────────────────────────── */
.s22-search-bar {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 12px 14px 12px 42px;
  color: var(--text); font-size: .95rem; outline: none; width: 100%;
  transition: border-color var(--t-base); min-height: 50px;
}
.s22-search-bar:focus { border-color: var(--accent); }
.s22-result-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px; margin-bottom: 14px;
}
.s22-result-num  { font-family: var(--mono); font-size: .72rem; color: var(--muted); margin-bottom: 4px; }
.s22-result-name { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.s22-result-prod { font-size: .8rem; color: var(--muted); }
.s22-payment-row { display: flex; justify-content: space-between; padding: 6px 0;
  border-bottom: 1px solid var(--border); font-size: .85rem; }
.s22-payment-row:last-of-type { border-bottom: none; }
.s22-remaining-big { font-size: 1.5rem; font-weight: 800; color: var(--success); }
.btn-complete-pickup {
  width: 100%; background: var(--accent); color: #0A0D14;
  border: none; border-radius: 10px; padding: 13px; font-size: .95rem;
  font-weight: 800; cursor: pointer; margin-top: 14px; min-height: 48px;
  transition: background var(--t-base); display: flex; align-items: center;
  justify-content: center; gap: 8px;
}
.btn-complete-pickup:hover { background: var(--accent-light); }

/* ── Customer CRM ────────────────────────────────────────────────── */
.crm-stats-bar {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-bottom: 14px;
}
.crm-stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 8px; text-align: center;
}
.crm-stat-num  { font-size: 1.2rem; font-weight: 800; color: var(--text); line-height: 1; }
.crm-stat-lbl  { font-size: .55rem; font-weight: 700; letter-spacing: .08em;
  color: var(--muted); text-transform: uppercase; margin-top: 2px; }
.customer-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px; cursor: pointer;
  margin-bottom: 8px; display: flex; gap: 12px; align-items: center;
  transition: border-color var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}
.customer-card:hover { border-color: var(--accent); }
.cust-avatar {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .95rem; color: #0A0D14;
}
.cust-name  { font-size: .9rem; font-weight: 700; color: var(--text); }
.cust-phone { font-size: .75rem; color: var(--muted); margin-top: 1px; }
.cust-spend { font-size: .82rem; font-weight: 700; color: var(--accent); flex-shrink: 0; text-align: right; }
.cust-orders{ font-size: .65rem; color: var(--muted); text-align: right; }
.cust-vip-star { color: var(--accent); font-size: .75rem; margin-left: 3px; }

/* Customer Profile */
.profile-avatar {
  width: 72px; height: 72px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.6rem; color: #0A0D14;
  margin: 0 auto 12px;
}
.profile-name {
  font-size: 1.2rem; font-weight: 800; color: var(--text); text-align: center;
}
.profile-vip {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(201,168,76,.15); border: 1px solid rgba(201,168,76,.3);
  color: var(--accent); border-radius: 20px; font-size: .68rem; font-weight: 700;
  padding: 3px 10px; margin: 6px auto; letter-spacing: .04em;
}
.rating-stars { display: flex; gap: 2px; }
.star { color: var(--accent); font-size: 1rem; }
.star.empty { color: var(--border); }

/* ── Finance Dashboard ───────────────────────────────────────────── */
.cash-balance-card {
  background: linear-gradient(135deg, var(--surface) 0%, rgba(201,168,76,.08) 100%);
  border: 1px solid rgba(201,168,76,.25); border-radius: var(--radius-lg);
  padding: 18px; margin-bottom: 12px;
}
.cash-balance-label { font-size: .6rem; font-weight: 700; letter-spacing: .14em;
  color: var(--accent); text-transform: uppercase; margin-bottom: 6px; }
.cash-balance-value { font-size: 1.8rem; font-weight: 800; color: var(--text); }
.cash-balance-trend { font-size: .72rem; color: var(--muted); margin-top: 4px; }
.cash-balance-trend.down { color: var(--danger); }

/* Cash Register */
.cash-register-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px; margin-bottom: 12px;
}
.cr-balance-header {
  background: var(--surface2); border-radius: 10px; padding: 12px 14px;
  margin-bottom: 14px;
}
.cr-balance-label { font-size: .58rem; font-weight: 700; letter-spacing: .14em;
  color: var(--muted); text-transform: uppercase; margin-bottom: 4px; }
.cr-balance-value { font-size: 1.6rem; font-weight: 800; color: var(--text); }
.cr-toggle {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  background: var(--bg); border-radius: 10px; padding: 3px;
  margin-bottom: 14px; border: 1px solid var(--border);
}
.cr-toggle-btn {
  padding: 9px; border-radius: 8px; border: none; font-size: .82rem;
  font-weight: 700; cursor: pointer; transition: all var(--t-base);
  background: transparent; color: var(--muted); display: flex;
  align-items: center; justify-content: center; gap: 5px;
}
.cr-toggle-btn.active {
  background: var(--surface2); color: var(--text); box-shadow: var(--shadow-sm);
}
.cr-toggle-btn.cash-in.active  { color: var(--success); }
.cr-toggle-btn.cash-out.active { color: var(--danger); }
.cr-amount-wrap {
  background: var(--bg-elevated); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.cr-amount-label { font-size: .8rem; font-weight: 700; color: var(--muted); flex-shrink: 0; }
.cr-amount-input {
  flex: 1; background: transparent; border: none; outline: none;
  font-size: 1.5rem; font-weight: 800; color: var(--text); font-family: var(--font);
  text-align: right;
}
.cr-amount-input::placeholder { color: var(--muted-2); }
.cr-category-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px;
}
.cr-cat-btn {
  background: var(--surface2); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 10px; font-size: .82rem; font-weight: 600;
  color: var(--text); cursor: pointer; transition: all var(--t-base);
  min-height: 44px;
}
.cr-cat-btn.active { background: var(--accent-subtle); border-color: var(--accent); color: var(--accent); }
.cr-cat-btn:hover  { border-color: var(--accent); }
.btn-record {
  width: 100%; background: var(--accent); color: #0A0D14;
  border: none; border-radius: 10px; padding: 14px; font-size: .95rem;
  font-weight: 800; cursor: pointer; margin-top: 4px; min-height: 50px;
  transition: background var(--t-base);
}
.btn-record:hover { background: var(--accent-light); }

/* ── New Order Wizard ─────────────────────────────────────────────── */
.wizard-step-bar {
  display: flex; align-items: center; gap: 0; margin-bottom: 20px;
}
.wizard-step {
  flex: 1; height: 3px; background: var(--border); border-radius: 2px;
  transition: background var(--t-base);
}
.wizard-step.done   { background: var(--accent); }
.wizard-step.active { background: var(--accent); }
.wizard-step-label {
  font-size: .62rem; font-weight: 700; letter-spacing: .08em;
  color: var(--muted); text-transform: uppercase; text-align: right;
  margin-bottom: 16px;
}
.wizard-step-label span { color: var(--text); font-weight: 800; }
.product-type-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px;
}
.product-type-btn {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 14px 10px; font-size: .85rem; font-weight: 700;
  color: var(--text); cursor: pointer; transition: all var(--t-base);
  min-height: 52px; display: flex; align-items: center; justify-content: center;
}
.product-type-btn:hover  { border-color: var(--accent); }
.product-type-btn.active {
  background: var(--accent-subtle); border-color: var(--accent); color: var(--accent);
}
.subtotal-box {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px; margin-top: 12px;
  display: flex; align-items: center; justify-content: space-between;
}
.subtotal-label { font-size: .78rem; font-weight: 600; color: var(--muted); }
.subtotal-value { font-size: 1.25rem; font-weight: 800; color: var(--accent); }
.wizard-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px;
}

/* ── Finance Revenue Chart ───────────────────────────────────────── */
.fin-period-select {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px; color: var(--text); font-size: .78rem;
  font-family: var(--font); outline: none; cursor: pointer;
}

/* ── Misc mobile tweaks ──────────────────────────────────────────── */
@media (max-width: 680px) {
  .prod-stat-bar { grid-template-columns: repeat(4,1fr); gap: 6px; }
  .prod-stat-num { font-size: 1.1rem; }
  .crm-stats-bar { grid-template-columns: repeat(4,1fr); gap: 6px; }
}
@media (max-width: 400px) {
  .prod-stat-bar, .crm-stats-bar { grid-template-columns: repeat(2,1fr); }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .contact-bar { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .prod-stage-circle { width: 32px; height: 32px; }
  .prod-stage-dot { min-width: 48px; }
  .prod-stage-connector { width: 14px; }
}

/* ═══════════════════════════════════════════════════════════
   DESKTOP LAYOUT  ≥ 900px
═══════════════════════════════════════════════════════════ */

/* Orders: mobile cards by default, table on desktop */
.orders-desk  { display: none; }

@media (min-width: 900px) {
  .orders-desk  { display: block !important; }
  .orders-cards { display: none  !important; }

  /* 4-col KPI row on dashboard */
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }

  /* Dashboard: Action Inbox + Pipeline side-by-side */
  .dash-two-col {
    display: grid; grid-template-columns: 3fr 2fr;
    gap: 14px; align-items: start;
  }

  /* Finance: balance hero + 2×2 KPI grid side-by-side */
  .fin-hero-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .fin-kpi-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

  /* Desktop filter bar — always visible, horizontal */
  #ord-filter-panel {
    display: flex !important; flex-direction: row;
    flex-wrap: wrap; gap: 10px; align-items: flex-end;
    padding: 10px 14px; margin-bottom: 10px;
    border-radius: var(--radius-lg);
  }
  #ord-filter-panel > div { flex: 1; min-width: 130px; }
  #ord-filter-btn { display: none !important; }
}

/* ── Desktop orders table ───────────────────────────────── */
.ord-tbl { width: 100%; border-collapse: collapse; font-size: .84rem; }
.ord-tbl th {
  font-size: .63rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted); padding: 9px 14px;
  border-bottom: 1px solid var(--border); background: var(--surface2);
  text-align: left; white-space: nowrap;
}
.ord-tbl td { padding: 10px 14px; border-bottom: .5px solid var(--border); vertical-align: middle; }
.ord-tr:hover td { background: rgba(201,168,76,.03); cursor: pointer; }
.ord-tr.expanded td { background: rgba(201,168,76,.05); border-bottom: none; }
.ord-tr td:first-child { width: 36px; }

/* Expandable detail row */
.ord-det-row { display: none; }
.ord-det-row.open { display: table-row; }
.ord-det-cell {
  padding: 0 !important;
  border-bottom: 2px solid rgba(201,168,76,.4) !important;
}
.ord-det-inner {
  padding: 16px 22px; background: var(--surface2);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px;
  animation: det-slide .15s ease;
}
@keyframes det-slide { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.ord-det-sec {
  font-size: .59rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--accent); margin-bottom: 9px;
}

/* Design thumbnail / colored initials */
.ord-thumb {
  width: 38px; height: 38px; border-radius: 8px; flex-shrink: 0;
  object-fit: cover; border: 1px solid var(--border);
}
.ord-init {
  width: 38px; height: 38px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .73rem; font-weight: 800; color: #0A0D14; letter-spacing: .02em;
}

/* ── Finance balance hero ───────────────────────────────── */
.fin-hero-row { margin-bottom: 16px; }   /* block on mobile */
.fin-bal-hero {
  background: linear-gradient(135deg, var(--surface) 0%, rgba(201,168,76,.1) 100%);
  border: 1px solid rgba(201,168,76,.25); border-radius: var(--radius-lg);
  padding: 28px 24px; display: flex; flex-direction: column; min-height: 180px;
}
.fin-bal-label  { font-size: .65rem; font-weight: 700; letter-spacing: .12em; color: var(--accent); text-transform: uppercase; margin-bottom: 10px; }
.fin-bal-amount { font-size: 2.6rem; font-weight: 800; color: var(--accent); line-height: 1; margin-bottom: 6px; }
.fin-bal-trend  { font-size: .8rem; color: var(--muted); margin-bottom: 20px; }
.fin-bal-trend.down { color: var(--danger); }
.fin-bal-trend.up   { color: var(--success); }
.fin-bal-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.fin-bal-btn {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 16px; font-size: .82rem; font-weight: 600; color: var(--text);
  cursor: pointer; font-family: var(--font); transition: all var(--t-base);
}
.fin-bal-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Pipeline segmented bar (dashboard desktop) ─────────── */
.pipe-seg-bar {
  display: flex; height: 44px; border-radius: 9px; overflow: hidden;
  gap: 2px; margin-bottom: 12px;
}
.pipe-seg {
  flex: 1; display: flex; align-items: center; justify-content: center;
  flex-direction: column; cursor: pointer; min-width: 28px; transition: filter .15s;
}
.pipe-seg:hover { filter: brightness(1.18); }
.pipe-seg-n   { font-size: 1rem; font-weight: 800; color: #fff; line-height: 1; }
.pipe-seg-lbl { font-size: .48rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: rgba(255,255,255,.85); margin-top: 2px; }

/* Pipeline metric mini-cards below the bar */
.pipe-metrics { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.pipe-metric  { background: var(--surface2); border-radius: 10px; padding: 10px 12px; border: 1px solid var(--border); }
.pipe-metric-l { font-size: .58rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; }
.pipe-metric-v { font-size: 1.25rem; font-weight: 800; color: var(--text); line-height: 1.1; }
.pipe-metric-s { font-size: .7rem; margin-top: 3px; }
.pipe-metric-s.up   { color: var(--success); }
.pipe-metric-s.down { color: var(--danger); }

/* ═══════════════════════════════════════════════════════════
   PRODUCTION KANBAN — Responsive: mobile list · tablet grid · desktop scroll
═══════════════════════════════════════════════════════════ */

/* Page header row */
.kb-page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; flex-wrap: wrap; gap: 8px;
}
.kb-sub-text { font-size: .76rem; color: var(--muted); flex: 1; }

/* Stats bar — shown above the board */
.kb-stats {
  display: flex; overflow-x: auto;
  background: var(--surface2); border-radius: 12px;
  border: 1px solid var(--border); margin-bottom: 14px;
  scroll-snap-type: x mandatory;
}
.kb-stats:empty { display: none; margin: 0; }
.kb-stats::-webkit-scrollbar { height: 3px; }
.kb-stats::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.kb-stat-cell {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; flex-shrink: 0;
  border-right: 1px solid var(--border);
  scroll-snap-align: start;
}
.kb-stat-cell:last-child { border-right: none; }
.kb-sc-icon { font-size: 1.2rem; opacity: .7; }
.kb-sc-val  { font-size: 1rem; font-weight: 800; line-height: 1.2; }
.kb-sc-lbl  { font-size: .59rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.kb-sc-sub  { font-size: .65rem; margin-top: 1px; }
.kb-sc-sub.up { color: var(--success); }
.kb-sc-sub.dn { color: var(--danger); }

/* ── Board container ──────────────────────────────────────── */
.kb-board {
  display: flex; gap: 12px;
  align-items: flex-start;
  overflow-x: auto; overflow-y: visible;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  margin: 0 -16px; padding: 4px 16px 28px;
}
.kb-board::-webkit-scrollbar { height: 5px; }
.kb-board::-webkit-scrollbar-track { background: transparent; }
.kb-board::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Column ──────────────────────────────────────────────── */
.kb-col {
  flex-shrink: 0;
  width: min(calc(100vw - 56px), 280px);
  display: flex; flex-direction: column;
  scroll-snap-align: start;
}

/* Collapsed state */
.kb-col--collapsed .kb-col-body { display: none; }
.kb-col--collapsed .kb-col-hd   { border-radius: 12px; border-bottom: 1px solid var(--border); }
.kb-col-arrow {
  font-size: .9rem; color: var(--muted-2); flex-shrink: 0;
  transition: transform .2s; transform: rotate(90deg); /* › pointing down = open */
  line-height: 1;
}
.kb-col--collapsed .kb-col-arrow { transform: rotate(0deg); } /* › pointing right = collapsed */

/* ── Column header ──────────────────────────────────────── */
.kb-col-hd {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-bottom: none; border-radius: 12px 12px 0 0;
  border-top: 3px solid var(--kbcol, var(--border));
  cursor: pointer; user-select: none;
  transition: background .15s;
}
.kb-col-hd:hover { background: var(--surface2); }
.kb-col-title {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; flex: 1;
}
.kb-col-cnt {
  font-size: .72rem; font-weight: 800; min-width: 22px; height: 22px;
  border-radius: 11px; display: flex; align-items: center; justify-content: center;
  background: var(--kbcol, var(--border)); color: #0A0D14; padding: 0 6px;
}

/* ── Column body ─────────────────────────────────────────── */
.kb-col-body {
  background: var(--surface); border: 1px solid var(--border);
  border-top: none; border-radius: 0 0 12px 12px;
  padding: 8px; min-height: 120px;
  display: flex; flex-direction: column; gap: 8px;
}

/* ── Production card ──────────────────────────────────────── */
.kb-card {
  border-radius: 12px; overflow: hidden; cursor: pointer;
  background: var(--bg); border: 1px solid var(--border);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
  position: relative; will-change: transform;
  display: flex; flex-direction: column;
}
.kb-card:hover  { transform: translateY(-3px); box-shadow: 0 10px 32px rgba(0,0,0,.5); border-color: rgba(255,255,255,.1); }
.kb-card:active { transform: scale(.97); transition-duration: .06s; }
.kb-card.is-overdue { border-color: rgba(239,64,90,.35); }
.kb-card.has-approval::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--warning); z-index: 3;
}

/* Image zone — explicit height ensures it always shows even with no image */
.kb-img-wrap {
  position: relative; overflow: hidden; height: 148px;
  background: var(--surface2);
  flex-shrink: 0; display: block;
  /* Force layout so the zone never collapses */
  min-height: 148px;
}
.kb-img-wrap img {
  width: 100%; height: 100%; object-fit: cover;
  display: block; transition: transform .35s ease;
}
.kb-card:hover .kb-img-wrap img { transform: scale(1.07); }

/* Placeholder when no image — must always be clearly visible */
.kb-img-ph {
  width: 100%; height: 100%; min-height: 100%;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 6px;
  background: var(--surface2);
}
.kb-ph-icon { font-size: 2.8rem; opacity: .35; }
.kb-ph-ini  { font-size: 1.4rem; font-weight: 800; color: rgba(255,255,255,.35); letter-spacing: .05em; }

/* Overlay: time pill (top-left) + pay pill (top-right) */
.kb-img-overlay {
  position: absolute; inset: 0; pointer-events: none; padding: 8px;
  display: flex; align-items: flex-start; justify-content: space-between;
  background: linear-gradient(180deg, rgba(0,0,0,.38) 0%, transparent 45%, rgba(0,0,0,.42) 100%);
}
.kb-time-pill {
  font-size: .59rem; font-weight: 700; padding: 3px 8px; border-radius: 20px;
  background: rgba(0,0,0,.6); color: rgba(255,255,255,.85);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.kb-pay-pill {
  font-size: .58rem; font-weight: 800; padding: 3px 8px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: .04em;
}
.kb-pay-pill.paid    { background: rgba(46,176,126,.92); color: #fff; }
.kb-pay-pill.partial { background: rgba(239,159,39,.92); color: #fff; }
.kb-pay-pill.unpaid  { background: rgba(239,64,90,.92);  color: #fff; }

/* Urgency strip */
.kb-urgency { position: absolute; bottom: 0; left: 0; right: 0; height: 3px; }
.kb-urgency.overdue {
  background: linear-gradient(90deg, var(--danger) 40%, rgba(239,64,90,0));
  animation: kb-urg 1.5s ease-in-out infinite;
}
.kb-urgency.soon { background: var(--warning); }
@keyframes kb-urg { 0%,100%{opacity:1} 50%{opacity:.25} }

/* Card body */
.kb-card-body { padding: 10px 12px 11px; flex: 1; }
.kb-card-top  { display: flex; align-items: center; justify-content: space-between; margin-bottom: 3px; }
.kb-ord-num   { font-size: .59rem; font-family: monospace; color: var(--accent); font-weight: 700; opacity: .75; }
.kb-qty       { font-size: .6rem; font-weight: 800; padding: 1px 6px; border-radius: 10px; background: var(--surface); color: var(--muted); }
.kb-prod-name { font-size: .85rem; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.kb-cust-line { font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 8px; }

/* Stage progress bar */
.kb-stage-bar { display: flex; gap: 3px; margin-bottom: 8px; }
.kb-s-seg     { height: 3px; flex: 1; border-radius: 2px; background: var(--border); transition: background .2s; }
.kb-s-seg.done   { background: var(--success); }
.kb-s-seg.active { background: var(--accent); box-shadow: 0 0 5px rgba(201,168,76,.7); }
.kb-s-seg.failed { background: var(--danger); }

/* Card footer */
.kb-card-foot    { display: flex; align-items: center; gap: 5px; min-height: 22px; flex-wrap: wrap; }
.kb-due-chip     { font-size: .61rem; font-weight: 700; padding: 2px 7px; border-radius: 20px; flex-shrink: 0; }
.kb-due-chip.overdue { background: rgba(239,64,90,.14);  color: var(--danger);  border: 1px solid rgba(239,64,90,.3); }
.kb-due-chip.soon    { background: rgba(239,159,39,.14); color: var(--warning); border: 1px solid rgba(239,159,39,.3); }
.kb-due-chip.ok      { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.kb-assignee-chip { font-size: .61rem; color: var(--muted); padding: 2px 7px; background: var(--surface); border-radius: 20px; border: 1px solid var(--border); white-space: nowrap; max-width: 72px; overflow: hidden; text-overflow: ellipsis; }
.kb-price         { margin-left: auto; font-size: .77rem; font-weight: 800; color: var(--accent); font-family: monospace; white-space: nowrap; }
.kb-empty         { display: flex; align-items: center; justify-content: center; padding: 24px 0; color: var(--muted); font-size: .78rem; flex: 1; }

/* ═══ RESPONSIVE BREAKPOINTS ════════════════════════════════ */

/* TABLET (768–1100px): 2-column grid */
@media (min-width: 768px) and (max-width: 1100px) {
  .kb-board {
    display: grid; grid-template-columns: 1fr 1fr;
    overflow-x: visible; scroll-snap-type: none;
    margin: 0; padding: 4px 0 28px; gap: 10px;
  }
  .kb-col { width: auto; scroll-snap-align: none; }
  .kb-img-wrap { height: 128px; }
}

/* DESKTOP (≥ 1100px): wider columns, no negative margin */
@media (min-width: 1100px) {
  .kb-col { width: 272px; min-width: 240px; }
  .kb-board { margin: 0; padding: 4px 0 28px; }
}

/* On tablet + desktop: prevent accidental collapse, hide toggle arrow */
@media (min-width: 768px) {
  .kb-col--collapsed .kb-col-body { display: flex; }
  .kb-col--collapsed .kb-col-hd   { border-radius: 12px 12px 0 0; border-bottom: none; }
  .kb-col-arrow { display: none; }
}

/* MOBILE (< 768px): vertical stacked accordion */
@media (max-width: 767px) {
  .kb-board {
    display: flex; flex-direction: column;
    overflow-x: visible; scroll-snap-type: none;
    margin: 0; padding: 0 0 28px; gap: 8px;
  }
  .kb-col { width: 100%; scroll-snap-align: none; }

  /* Horizontal card: thumbnail left, info right */
  .kb-card { flex-direction: row; border-radius: 10px; }
  .kb-img-wrap {
    width: 88px; height: 88px; flex-shrink: 0;
    border-radius: 10px 0 0 10px;
  }
  /* Overlay: stack badges vertically on left side of thumb */
  .kb-img-overlay {
    flex-direction: column; align-items: flex-start;
    gap: 3px; padding: 5px;
    background: linear-gradient(90deg, rgba(0,0,0,.42) 0%, transparent 100%);
  }
  .kb-time-pill { font-size: .5rem; padding: 2px 5px; }
  .kb-pay-pill  { font-size: .5rem; padding: 2px 5px; }
  /* Urgency: right edge strip instead of bottom */
  .kb-urgency { width: 3px; height: 100%; top: 0; left: auto; right: 0; bottom: 0; }
  .kb-urgency.overdue { background: var(--danger) !important; animation: none; }
  .kb-urgency.soon    { background: var(--warning) !important; }
  .kb-ph-icon { font-size: 1.8rem; }
  .kb-ph-ini  { font-size: .9rem; }
  /* Card info section */
  .kb-card-body {
    padding: 8px 10px; flex: 1; min-width: 0;
    display: flex; flex-direction: column; justify-content: center;
  }
  .kb-card-top  { margin-bottom: 2px; }
  .kb-prod-name { font-size: .8rem; margin-bottom: 1px; }
  .kb-cust-line { font-size: .68rem; margin-bottom: 5px; }
  .kb-stage-bar { margin-bottom: 5px; }
  .kb-card-foot { min-height: 18px; gap: 4px; }
  .kb-due-chip  { font-size: .56rem; padding: 1px 5px; }
  .kb-price     { font-size: .67rem; }
  .kb-qty       { font-size: .56rem; }
  .kb-ord-num   { font-size: .55rem; }
  .kb-assignee-chip { display: none; }
  /* Stats bar: compact on mobile */
  .kb-stat-cell { padding: 10px 14px; gap: 8px; }
  .kb-sc-val    { font-size: .88rem; }
}

/* ═══════════════════════════════════════════════════════════
   PRODUCTION CENTER — NEXO-style (nxp-*)
═══════════════════════════════════════════════════════════ */

/* ── Page topbar ──────────────────────────────────────────── */
.nxp-topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; gap: 10px; flex-wrap: wrap;
}
.nxp-sub { font-size: .76rem; color: var(--muted); flex: 1; min-width: 0; }

/* Global search in topbar */
.nxp-gsearch {
  display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--muted); cursor: text;
}
.nxp-gsearch input {
  background: none; border: 0; outline: 0; color: var(--text);
  font-family: var(--font); font-size: .8rem; width: 200px;
}
.nxp-gsearch input::placeholder { color: var(--muted); }

/* ── Stat cards row ───────────────────────────────────────── */
.nxp-stat-row {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 12px; margin-bottom: 14px;
}
.nxp-stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px 15px 12px;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, transform .15s;
}
.nxp-stat-card:hover { border-color: var(--border-focus); transform: translateY(-2px); }
.nxp-sc-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.nxp-sc-lbl { font-size: .68rem; font-weight: 700; color: var(--muted); letter-spacing: .03em; text-transform: uppercase; }
.nxp-sc-dot { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; flex-shrink: 0; }
.nxp-sc-val { font-size: 2rem; font-weight: 800; line-height: 1; }
.nxp-sc-sub { font-size: .68rem; color: var(--muted); margin-top: 6px; font-weight: 600; }

/* ── Main content grid ────────────────────────────────────── */
.nxp-content {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 14px;
  min-height: 0;
  height: calc(100vh - var(--topbar-h, 52px) - 200px);
}
.nxp-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); display: flex; flex-direction: column;
  min-height: 0; box-shadow: var(--shadow-sm);
}

/* ── Table panel toolbar ──────────────────────────────────── */
.nxp-tbar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  flex: 0 0 auto; flex-wrap: wrap;
}
.nxp-tbar-title { font-size: .92rem; font-weight: 700; color: var(--text); margin-right: 2px; }
.nxp-count {
  font-size: .7rem; font-weight: 700; color: var(--muted);
  background: var(--surface2); border: 1px solid var(--border);
  padding: 2px 9px; border-radius: 20px;
}
.nxp-tsearch-wrap {
  display: flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 10px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--muted); cursor: text;
}
.nxp-tsearch {
  background: none; border: 0; outline: 0; color: var(--text);
  font-family: var(--font); font-size: .78rem; width: 140px;
}
.nxp-tsearch::placeholder { color: var(--muted); }
.nxp-filters { display: flex; gap: 6px; }
.nxp-fbtn {
  display: inline-flex; align-items: center; gap: 5px;
  height: 32px; padding: 0 11px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--muted);
  font-family: var(--font); font-size: .76rem; font-weight: 600;
  cursor: pointer; transition: .14s; white-space: nowrap;
}
.nxp-fbtn:hover { color: var(--text); border-color: var(--border-focus); }
.nxp-fbtn.on { background: var(--accent-subtle); border-color: var(--accent-glow); color: var(--accent); }
.nxp-fbtn-urgent.on { background: rgba(239,64,90,.1); border-color: rgba(239,64,90,.35); color: var(--danger); }
.nxp-fbtn-prod.on   { background: rgba(201,168,76,.1); border-color: rgba(201,168,76,.35); color: var(--accent); }
.nxp-mini {
  font-size: .65rem; font-weight: 800; padding: 1px 5px;
  border-radius: 5px; background: rgba(255,255,255,.08);
}

/* ── Scrollable table ─────────────────────────────────────── */
.nxp-tscroll { overflow-y: auto; overflow-x: auto; flex: 1 1 auto; min-height: 0; }
.nxp-tscroll::-webkit-scrollbar { width: 5px; height: 5px; }
.nxp-tscroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.nxp-table { width: 100%; border-collapse: collapse; }
.nxp-table thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface2);
  text-align: left; font-size: .65rem; font-weight: 700;
  color: var(--muted); letter-spacing: .06em; text-transform: uppercase;
  padding: 9px 11px; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.nxp-table thead th:first-child { padding-left: 14px; }
.nxp-table thead th.ta-r { text-align: right; padding-right: 14px; }
.nxp-table tbody .nxp-tr {
  cursor: pointer; border-bottom: 1px solid rgba(255,255,255,.04);
  transition: background .1s;
}
.nxp-table tbody .nxp-tr:hover { background: rgba(255,255,255,.025); }
.nxp-table tbody .nxp-tr-sel  { background: var(--accent-subtle) !important; box-shadow: inset 3px 0 0 var(--accent); }
.nxp-table tbody .nxp-tr-overdue { border-left: 2px solid rgba(239,64,90,.4); }
.nxp-table td { padding: 8px 11px; font-size: .78rem; vertical-align: middle; color: var(--muted); }
.nxp-table td:first-child { padding-left: 14px; }
.nxp-table td.ta-r { text-align: right; padding-right: 14px; }
.nxp-loading-row { text-align: center; padding: 32px; color: var(--muted); font-size: .82rem; }

.nxp-oid  { font-family: var(--mono); font-weight: 700; color: var(--accent); font-size: .72rem; }
.nxp-cust b { color: var(--text); font-weight: 600; font-size: .78rem; }
.nxp-prod { color: var(--text-2); font-weight: 500; }
.nxp-qty  { font-weight: 700; color: var(--text); font-size: .75rem; }

.nxp-staff { display: flex; align-items: center; gap: 7px; }
.nxp-av {
  width: 24px; height: 24px; border-radius: 50%; display: grid;
  place-items: center; font-size: .62rem; font-weight: 800; color: #0A0D14;
  flex-shrink: 0;
}
.nxp-av-sm {
  width: 18px; height: 18px; border-radius: 50%; display: inline-grid;
  place-items: center; font-size: .52rem; font-weight: 800; color: #0A0D14;
  flex-shrink: 0;
}
.nxp-staff span { font-size: .76rem; font-weight: 600; color: var(--text-2); }

.nxp-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px 3px 7px; border-radius: 6px; border: 1px solid;
  font-size: .68rem; font-weight: 700; white-space: nowrap;
}
.nxp-badge-dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.nxp-pay-badge {
  display: inline-flex; align-items: center; padding: 2px 8px;
  border-radius: 6px; border: 1px solid; font-size: .68rem; font-weight: 700;
}

.nxp-due { display: flex; flex-direction: column; gap: 1px; }
.nxp-due b { font-weight: 700; color: var(--text); font-size: .76rem; }
.nxp-due span { font-size: .62rem; font-weight: 600; color: var(--muted); }
.nxp-due-late b { color: var(--danger); }
.nxp-due-late span { color: var(--danger); }

.nxp-actions { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.nxp-act {
  width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center;
  color: var(--muted); background: transparent; border: 1px solid transparent;
  cursor: pointer; transition: .12s;
}
.nxp-tr:hover .nxp-act { color: var(--text-2); border-color: var(--border); }
.nxp-act:hover { background: var(--surface2); color: var(--text) !important; border-color: var(--border) !important; }

/* ── Insights panel ───────────────────────────────────────── */
.nxp-insights { overflow: hidden; }
.nxp-ins-scroll {
  overflow-y: auto; overflow-x: hidden;
  padding: 14px 13px 20px; display: flex; flex-direction: column; gap: 12px;
  height: 100%;
}
.nxp-ins-scroll::-webkit-scrollbar { width: 4px; }
.nxp-ins-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.nxp-ins-hd {
  display: flex; align-items: center; gap: 7px;
  font-size: .88rem; font-weight: 700; color: var(--text);
}
.nxp-ins-hd svg { color: var(--accent); }

/* KPI 2×2 grid */
.nxp-kgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.nxp-kpi {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 11px;
}
.nxp-kpi-accent { background: var(--accent-subtle); border-color: var(--accent-glow); }
.nxp-kpi-danger { background: rgba(239,64,90,.08); border-color: rgba(239,64,90,.22); }
.nxp-kl { font-size: .62rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.nxp-kv { font-size: 1.5rem; font-weight: 800; color: var(--text); margin-top: 5px; line-height: 1; }
.nxp-kv-success { color: var(--success) !important; }
.nxp-kbar { height: 3px; background: rgba(255,255,255,.07); border-radius: 20px; margin-top: 8px; overflow: hidden; }
.nxp-kbar i { display: block; height: 100%; border-radius: 20px; }

/* Insight cards */
.nxp-ins-card {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 11px 12px;
}
.nxp-ins-card-h { font-size: .76rem; font-weight: 700; color: var(--text-2); margin-bottom: 10px; }

/* Workload / bar rows */
.nxp-wl-list { display: flex; flex-direction: column; gap: 9px; }
.nxp-wl-row { display: grid; grid-template-columns: 70px 1fr 22px; align-items: center; gap: 8px; }
.nxp-wl-nm {
  display: flex; align-items: center; gap: 5px;
  font-size: .68rem; font-weight: 600; color: var(--muted);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.nxp-wl-track { height: 6px; background: rgba(255,255,255,.06); border-radius: 20px; overflow: hidden; }
.nxp-wl-track i { display: block; height: 100%; border-radius: 20px; }
.nxp-wl-cnt { font-size: .68rem; font-weight: 700; color: var(--text); text-align: right; }

/* ── Drawer overlay ───────────────────────────────────────── */
.nxp-scrim {
  position: fixed; inset: 0;
  background: rgba(4,5,10,.6); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 9998;
}
.nxp-scrim.open { opacity: 1; pointer-events: auto; }

.nxp-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 420px;
  background: var(--bg-elevated); border-left: 1px solid var(--border);
  z-index: 9999; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .3s cubic-bezier(.4,.01,.2,1);
  box-shadow: -20px 0 50px -10px rgba(0,0,0,.7);
}
.nxp-drawer.open { transform: translateX(0); }

.nxp-dh {
  padding: 16px 18px 14px; border-bottom: 1px solid var(--border); flex: 0 0 auto;
  background: linear-gradient(135deg, var(--accent-subtle) 0%, transparent 60%);
}
.nxp-dh-top { display: flex; align-items: flex-start; justify-content: space-between; }
.nxp-doid {
  font-family: var(--mono); font-size: .76rem; font-weight: 700;
  color: var(--accent); background: var(--accent-subtle);
  border: 1px solid var(--accent-glow); padding: 3px 10px; border-radius: 7px;
}
.nxp-dclose {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--muted); cursor: pointer; transition: .14s;
}
.nxp-dclose:hover { color: var(--text); background: var(--surface3, var(--surface2)); }
.nxp-dprod { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-top: 12px; }
.nxp-dmeta { display: flex; align-items: center; gap: 7px; margin-top: 9px; flex-wrap: wrap; }

.nxp-dbody { overflow-y: auto; flex: 1 1 auto; padding: 15px 18px 20px; display: flex; flex-direction: column; gap: 16px; }
.nxp-dbody::-webkit-scrollbar { width: 4px; }
.nxp-dbody::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.nxp-d-img { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.nxp-d-img img { width: 100%; height: 180px; object-fit: cover; display: block; }

.nxp-d-section {}
.nxp-d-sec-t {
  font-size: .65rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .07em;
  margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}
.nxp-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.nxp-info {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 10px;
}
.nxp-il { font-size: .6rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.nxp-iv { font-size: .8rem; font-weight: 600; color: var(--text); margin-top: 3px; }
.nxp-iv-danger { color: var(--danger) !important; }

/* Production timeline */
.nxp-timeline { display: flex; flex-direction: column; }
.nxp-tl-step {
  display: grid; grid-template-columns: 24px 1fr; gap: 10px;
  position: relative; padding-bottom: 13px;
}
.nxp-tl-step:last-child { padding-bottom: 0; }
.nxp-tl-step::before {
  content: ''; position: absolute; left: 11.5px; top: 24px; bottom: 0;
  width: 1px; background: var(--border);
}
.nxp-tl-step:last-child::before { display: none; }
.nxp-tl-node {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface2); border: 1.5px solid var(--border); flex-shrink: 0;
  color: var(--muted); font-size: .65rem;
}
.nxp-tl-step.done .nxp-tl-node { background: rgba(46,176,126,.16); border-color: rgba(46,176,126,.5); color: var(--success); }
.nxp-tl-step.done::before { background: rgba(46,176,126,.35); }
.nxp-tl-step.cur  .nxp-tl-node { background: var(--accent); border-color: var(--accent); color: #0A0D14; box-shadow: 0 0 0 3px var(--accent-subtle); }
.nxp-tl-step.cur  .nxp-tl-info b { color: var(--accent); }
.nxp-tl-step.up   .nxp-tl-info b { color: var(--muted); }
.nxp-tl-info { padding-top: 3px; }
.nxp-tl-info b { font-size: .78rem; font-weight: 700; color: var(--text); display: block; }
.nxp-tl-info span { font-size: .66rem; font-weight: 600; color: var(--muted); }

.nxp-note {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
  font-size: .76rem; color: var(--text-2); line-height: 1.55;
}

/* Drawer footer */
.nxp-dfoot {
  flex: 0 0 auto; border-top: 1px solid var(--border);
  padding: 11px 18px; display: flex; gap: 9px; background: var(--surface);
}
.nxp-pbtn {
  height: 40px; border-radius: var(--radius); border: 0; cursor: pointer;
  font-family: var(--font); font-weight: 700; font-size: .82rem;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: .15s;
}
.nxp-pbtn-primary {
  flex: 1; color: #0A0D14;
  background: linear-gradient(150deg, var(--accent), var(--accent-h));
  box-shadow: 0 4px 14px -4px var(--accent-glow);
}
.nxp-pbtn-primary:hover { filter: brightness(1.08); }
.nxp-pbtn-ghost {
  width: 44px; flex-shrink: 0;
  background: var(--surface2); border: 1px solid var(--border); color: var(--danger);
}
.nxp-pbtn-ghost:hover { background: rgba(239,64,90,.1); border-color: rgba(239,64,90,.3); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1100px) {
  .nxp-stat-row { grid-template-columns: repeat(3, 1fr); }
  .nxp-content  { grid-template-columns: 1fr; }
  .nxp-insights { display: none; }
}
@media (max-width: 768px) {
  .nxp-stat-row { grid-template-columns: repeat(2, 1fr); }
  .nxp-gsearch  { display: none; }
  .nxp-drawer   { width: 100%; }
  .nxp-tsearch  { width: 90px; }
}

/* ═══════════════════════════════════════════════════════════
   DELIVERY CENTER — NEXO-style (dlv-*)
═══════════════════════════════════════════════════════════ */

/* ── Page topbar ──────────────────────────────────────────── */
.dlv-topbar {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 14px; gap: 10px; flex-wrap: wrap;
}
.dlv-sub-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin-bottom: 3px; }
.dlv-sub { font-size: .76rem; color: var(--muted); }

/* ── Content grid (table + control panel) ──────────────────── */
.dlv-content {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 14px;
  min-height: 0;
  height: calc(100vh - var(--topbar-h, 52px) - 210px);
}
.dlv-table-panel { /* inherits nxp-panel */ }
.dlv-ctrl-panel  { overflow: hidden; }
.dlv-ctrl-scroll {
  overflow-y: auto; overflow-x: hidden;
  padding: 14px 13px 20px; display: flex; flex-direction: column; gap: 12px;
  height: 100%;
}
.dlv-ctrl-scroll::-webkit-scrollbar { width: 4px; }
.dlv-ctrl-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.dlv-ctrl-hd {
  display: flex; align-items: center; gap: 7px;
  font-size: .88rem; font-weight: 700; color: var(--text);
}
.dlv-ctrl-hd svg { color: var(--accent); }

/* ── Table cells specific to delivery ─────────────────────── */
.dlv-addr {
  display: flex; align-items: flex-start; gap: 5px;
  font-size: .76rem; color: var(--text-2); max-width: 160px;
}
.dlv-addr svg { color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.dlv-addr span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dlv-disp-time { display: flex; flex-direction: column; gap: 1px; }
.dlv-disp-time b { font-size: .76rem; font-weight: 700; color: var(--text); }
.dlv-disp-time span { font-size: .62rem; color: var(--muted); }
.dlv-badge-pulse .nxp-badge-dot { animation: dlv-pulse 1.8s infinite; }
@keyframes dlv-pulse { 0%{box-shadow:0 0 0 0 currentColor}70%{box-shadow:0 0 0 5px transparent}100%{box-shadow:0 0 0 0 transparent} }

/* Telegram send button accent */
.dlv-tg-btn { color: #2AABEE !important; border-color: rgba(42,171,238,.4) !important; }
.dlv-tg-btn:hover { background: rgba(42,171,238,.12) !important; }

/* ── Activity feed ─────────────────────────────────────────── */
.dlv-feed { display: flex; flex-direction: column; gap: 9px; }
.dlv-feed-item { display: flex; align-items: center; gap: 9px; padding: 5px 0; }
.dlv-feed-icon { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: .82rem; flex-shrink: 0; }
.dlv-feed-body { flex: 1; min-width: 0; }
.dlv-feed-body b { font-size: .72rem; font-weight: 700; color: var(--text); }
.dlv-feed-body span { font-size: .68rem; color: var(--muted); }
.dlv-feed-body div { font-size: .65rem; }
.dlv-feed-time { font-size: .62rem; color: var(--muted); font-family: var(--mono); flex-shrink: 0; }

/* ── Drawer — financials ───────────────────────────────────── */
.dlv-totals {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 13px;
}
.dlv-tot-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .78rem; color: var(--muted); font-weight: 600;
  padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,.04);
}
.dlv-tot-row:last-child { border-bottom: none; }
.dlv-tot-row b { color: var(--text); font-family: var(--mono); font-weight: 700; }
.dlv-tot-grand { margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--border) !important; font-size: .84rem; color: var(--text); font-weight: 700; }
.dlv-tot-grand b { font-size: 1rem; color: #fff; }

/* ════════════════════════════════════════════════════════════
   DISPATCH MODAL
════════════════════════════════════════════════════════════ */
.dlv-mscrim {
  position: fixed; inset: 0;
  background: rgba(3,4,8,.72); backdrop-filter: blur(4px);
  z-index: 10000; display: none; align-items: center; justify-content: center;
}
.dlv-mscrim.open { display: flex; }

.dlv-modal {
  width: min(880px, 96vw); max-height: 90vh;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); box-shadow: 0 40px 80px -20px rgba(0,0,0,.85);
  display: grid; grid-template-columns: 1fr 300px;
  overflow: hidden; animation: dlv-modal-in .22s ease;
}
@keyframes dlv-modal-in { from { opacity:0; transform:translateY(12px) scale(.97); } to { opacity:1; transform:none; } }

/* Left column — form */
.dlv-mleft { padding: 20px 22px; display: flex; flex-direction: column; overflow: hidden; }
.dlv-mhead { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; flex-shrink: 0; }
.dlv-mt {
  font-size: 1rem; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.dlv-mi {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--accent-subtle); border: 1px solid var(--accent-glow);
  display: grid; place-items: center; color: var(--accent);
}
.dlv-ms { font-size: .76rem; color: var(--muted); margin-top: 3px; }

.dlv-mform { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding-right: 4px; }
.dlv-mform::-webkit-scrollbar { width: 3px; }
.dlv-mform::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.dlv-frow { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dlv-fld { display: flex; flex-direction: column; gap: 6px; }
.dlv-fld label { font-size: .68rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.dlv-req  { color: var(--danger); }
.dlv-def  { color: var(--muted); font-weight: 600; text-transform: none; letter-spacing: 0; }
.dlv-inp {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 11px; color: var(--text);
  font-family: var(--font); font-size: .82rem; font-weight: 500; outline: 0;
  transition: border-color .15s, box-shadow .15s;
}
.dlv-inp:focus { border-color: var(--accent-glow); box-shadow: 0 0 0 3px var(--accent-subtle); }
.dlv-inp::placeholder { color: var(--muted); }
textarea.dlv-inp { resize: none; line-height: 1.5; }
.dlv-inp-pre { display: flex; align-items: center; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.dlv-inp-pre:focus-within { border-color: var(--accent-glow); box-shadow: 0 0 0 3px var(--accent-subtle); }
.dlv-pre { padding: 0 0 0 11px; color: var(--muted); font-family: var(--mono); font-weight: 600; font-size: .82rem; white-space: nowrap; }
.dlv-inp-pre input { flex: 1; background: none; border: 0; outline: 0; padding: 9px 11px; color: var(--text); font-family: var(--mono); font-size: .85rem; font-weight: 600; }

/* Telegram group ID setting box */
.dlv-tg-setting {
  background: linear-gradient(150deg,rgba(42,171,238,.08),rgba(42,171,238,.02));
  border: 1px solid rgba(42,171,238,.25); border-radius: var(--radius); padding: 11px 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.dlv-tg-setting-h {
  display: flex; align-items: center; gap: 7px;
  font-size: .68rem; font-weight: 700; color: #bfe3f7; text-transform: uppercase; letter-spacing: .04em;
}
.dlv-tg-badge {
  margin-left: auto; font-size: .6rem; font-weight: 700; color: #2AABEE;
  background: rgba(42,171,238,.14); border: 1px solid rgba(42,171,238,.28);
  padding: 2px 8px; border-radius: 20px; text-transform: none; letter-spacing: 0;
}
.dlv-tg-note { font-size: .68rem; color: var(--muted); line-height: 1.5; }
.dlv-tg-note code { background: rgba(255,255,255,.08); padding: 0 4px; border-radius: 3px; font-family: var(--mono); }

.dlv-mfoot {
  display: flex; gap: 10px; padding-top: 14px; flex-shrink: 0;
  border-top: 1px solid var(--border); margin-top: 12px;
}
.dlv-mbtn {
  height: 42px; border-radius: var(--radius); border: 0; cursor: pointer;
  font-family: var(--font); font-weight: 700; font-size: .82rem;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: .15s;
}
.dlv-mbtn-go {
  flex: 1; color: #fff;
  background: linear-gradient(150deg, #37b3ee, #1c92d6);
  box-shadow: 0 6px 16px -6px rgba(42,171,238,.6);
}
.dlv-mbtn-go:hover { filter: brightness(1.08); }
.dlv-mbtn-go:disabled { opacity: .6; cursor: not-allowed; }
.dlv-mbtn-cancel { padding: 0 18px; background: var(--surface2); color: var(--muted); border: 1px solid var(--border); }
.dlv-mbtn-cancel:hover { color: var(--text); border-color: var(--border-focus); }

/* Right column — Telegram preview */
.dlv-mright {
  background: linear-gradient(180deg, #0c1116, #0a0d11);
  border-left: 1px solid var(--border); display: flex; flex-direction: column;
}
.dlv-tg-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 14px; border-bottom: 1px solid var(--border); background: #11151b;
}
.dlv-tg-ic {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(160deg, #37b3ee, #1c92d6);
  display: grid; place-items: center; flex-shrink: 0;
  box-shadow: 0 4px 10px -4px rgba(42,171,238,.5);
}
.dlv-tg-head-info { min-width: 0; }
.dlv-tg-head-info b { font-size: .8rem; font-weight: 700; color: #fff; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dlv-tg-head-info span { font-size: .68rem; color: #2AABEE; font-weight: 600; }

.dlv-tg-chat {
  flex: 1; padding: 14px 12px; overflow-y: auto; display: flex; flex-direction: column;
  gap: 8px; justify-content: flex-end;
  background-image: radial-gradient(circle at 20% 10%, rgba(42,171,238,.04), transparent 40%);
}
.dlv-tg-date {
  align-self: center; font-size: .62rem; font-weight: 700; color: var(--muted);
  background: rgba(255,255,255,.05); padding: 2px 9px; border-radius: 20px;
}
.dlv-bubble {
  align-self: flex-end; max-width: 260px;
  background: linear-gradient(160deg, #2b5278, #23425f);
  border-radius: 14px 14px 4px 14px;
  box-shadow: 0 4px 10px -4px rgba(0,0,0,.5);
  overflow: hidden;
}
.dlv-bubble-img {
  height: 120px; background: #0e1116; overflow: hidden;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.dlv-bubble-text {
  padding: 10px 11px 4px;
  font-size: .72rem; line-height: 1.6; color: #e9f3fb;
  white-space: pre-wrap; font-weight: 400;
}
.dlv-tg-k { color: #8fc7ee; font-weight: 700; }
.dlv-bubble-meta {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 4px; padding: 2px 10px 8px;
}
.dlv-bubble-meta span { font-size: .62rem; color: #9dc4e0; font-weight: 600; }
.dlv-bubble-meta svg { color: #5fd3f0; }

.dlv-tg-input-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-top: 1px solid var(--border); background: #11151b;
}
.dlv-tg-input-f {
  flex: 1; height: 32px; border-radius: 16px;
  background: var(--surface2); border: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 12px;
  font-size: .72rem; color: var(--muted);
}
.dlv-tg-send-ic {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(160deg, #37b3ee, #1c92d6);
  display: grid; place-items: center; color: #fff; flex-shrink: 0;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .dlv-content  { grid-template-columns: 1fr; }
  .dlv-ctrl-panel { display: none; }
  .dlv-modal    { grid-template-columns: 1fr; }
  .dlv-mright   { display: none; }
}
@media (max-width: 768px) {
  .dlv-modal { width: 100%; border-radius: 0; max-height: 100vh; }
  .dlv-frow  { grid-template-columns: 1fr; }
}
