/* =============================================================================
   GEMS BY SJ — OPS PLATFORM — global.css
   Single source of truth. Edit tokens in :root to change anything.
   ============================================================================= */

:root {
  --bg:           #0c0b0a;
  --bg2:          #141210;
  --bg3:          #1c1916;
  --bg4:          #242018;
  --border:       rgba(255,255,255,0.07);
  --border2:      rgba(255,255,255,0.13);
  --text:         #f0ebe3;
  --text2:        #9a9187;
  --text3:        #5a5449;
  --accent:       #c9956a;
  --accent2:      #e8c4a0;
  --accent-dim:   rgba(201,149,106,0.13);
  --accent-dim2:  rgba(201,149,106,0.06);
  --rose:         #c97d8a;
  --rose-dim:     rgba(201,125,138,0.12);
  --green:        #7aaa7a;
  --green-dim:    rgba(122,170,122,0.10);
  --green-bdr:    rgba(122,170,122,0.20);
  --red:          #c97a7a;
  --red-dim:      rgba(201,122,122,0.12);
  --red-bdr:      rgba(201,122,122,0.20);
  --amber:        #c9aa6a;
  --amber-dim:    rgba(201,170,106,0.10);
  --amber-bdr:    rgba(201,170,106,0.20);
  --blue:         #6a95c9;
  --blue-dim:     rgba(106,149,201,0.10);
  --blue-bdr:     rgba(106,149,201,0.20);
  --fd: 'Cormorant Garamond', Georgia, serif;
  --fb: 'Instrument Sans', system-ui, sans-serif;
  --fm: 'DM Mono', monospace;
  --nav-h: 54px;
  --radius: 12px;
  --radius-sm: 7px;
  --radius-pill: 20px;
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; }
body { background: var(--bg); color: var(--text); font-family: var(--fb); font-size: 13px; line-height: 1.5; min-height: 100vh; }
button { font-family: var(--fb); cursor: pointer; }
input, select, textarea { font-family: var(--fb); }
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 2px; }

/* NAV */
.topnav { background: var(--bg2); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 24px; height: var(--nav-h); position: sticky; top: 0; z-index: 50; gap: 0; }
.brand { display: flex; align-items: center; gap: 9px; margin-right: 28px; flex-shrink: 0; }
.brand-gem { width: 28px; height: 28px; background: linear-gradient(135deg,var(--accent),var(--rose)); border-radius: 7px; display: flex; align-items: center; justify-content: center; }
.brand-gem svg { width: 13px; height: 13px; fill: rgba(0,0,0,0.55); }
.brand-name { font-family: var(--fd); font-size: 18px; font-weight: 500; color: var(--text); white-space: nowrap; }
.brand-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--text3); margin: 0 4px; }
.brand-sub { font-family: var(--fm); font-size: 10px; color: var(--text3); letter-spacing: 0.1em; }
.nav-links { display: flex; gap: 2px; flex: 1; }
.nav-link { display: flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: var(--radius-sm); cursor: pointer; color: var(--text2); font-size: 13px; border: 1px solid transparent; transition: all 0.15s; white-space: nowrap; user-select: none; }
.nav-link:hover { background: var(--bg3); color: var(--text); }
.nav-link.active { background: var(--accent-dim); color: var(--accent2); border-color: rgba(201,149,106,0.15); }
.nav-badge { background: var(--red); color: #fff; font-size: 9px; font-weight: 600; padding: 1px 5px; border-radius: var(--radius-pill); font-family: var(--fm); line-height: 1.4; }
.topnav-right { display: flex; gap: 8px; align-items: center; margin-left: auto; flex-shrink: 0; }
.user-avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg,var(--rose),var(--accent)); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: rgba(0,0,0,0.55); flex-shrink: 0; }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500; cursor: pointer; border: 1px solid transparent; transition: all 0.15s; white-space: nowrap; line-height: 1; }
.btn-sm { padding: 5px 10px; font-size: 11px; }
.btn-full { width: 100%; justify-content: center; }
.btn-ghost { background: var(--bg3); color: var(--text2); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg4); color: var(--text); border-color: var(--border2); }
.btn-accent { background: var(--accent); color: #1a0f06; border-color: var(--accent); font-weight: 600; }
.btn-accent:hover { background: var(--accent2); border-color: var(--accent2); }
.btn-danger { background: var(--red-dim); color: var(--red); border-color: var(--red-bdr); }
.btn-danger:hover { background: rgba(201,122,122,0.2); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* PAGE */
.page { display: none; padding: 24px; animation: fadeIn 0.18s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }

/* GRIDS */
.g2    { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.g3    { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.g6040 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; margin-bottom: 16px; }
.mb16  { margin-bottom: 16px; }

/* METRICS */
.metrics { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 20px; }
.mcard { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; position: relative; overflow: hidden; transition: border-color 0.2s; }
.mcard:hover { border-color: var(--border2); }
.mcard::after { content:''; position:absolute; top:0; left:0; right:0; height:1px; background:linear-gradient(90deg,transparent,rgba(201,149,106,0.25),transparent); }
.mlabel { font-family: var(--fm); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text3); margin-bottom: 10px; }
.mval { font-family: var(--fd); font-size: 40px; font-weight: 300; line-height: 1; color: var(--text); margin-bottom: 8px; }
.mval.alert { color: var(--red); } .mval.acc { color: var(--accent); }
.msub { font-size: 11px; color: var(--text3); display: flex; align-items: center; gap: 5px; }
.dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.dg { background: var(--green); } .da { background: var(--amber); } .dr { background: var(--red); } .dac { background: var(--accent); } .dro { background: var(--rose); }

/* CARDS */
.card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.card-head { padding: 13px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-family: var(--fm); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text3); }
.card-meta { font-family: var(--fm); font-size: 10px; color: var(--text3); }

/* TABLES */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { padding: 9px 18px; text-align: left; font-family: var(--fm); font-size: 9px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text3); border-bottom: 1px solid var(--border); background: var(--bg3); }
.tbl td { padding: 12px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: rgba(255,255,255,0.015); }
.cn { font-weight: 500; color: var(--text); font-size: 13px; }
.cs { font-family: var(--fm); font-size: 10px; color: var(--text3); margin-top: 1px; }
.cm { font-family: var(--fm); font-size: 12px; }

/* PILLS */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: var(--radius-pill); font-size: 10px; font-weight: 500; font-family: var(--fm); border: 1px solid transparent; white-space: nowrap; }
.pg { background: var(--green-dim); color: var(--green); border-color: var(--green-bdr); }
.pa { background: var(--amber-dim); color: var(--amber); border-color: var(--amber-bdr); }
.pr { background: var(--red-dim); color: var(--red); border-color: var(--red-bdr); }
.pgy { background: rgba(255,255,255,0.04); color: var(--text3); border-color: var(--border); }
.pac { background: var(--accent-dim); color: var(--accent); border-color: rgba(201,149,106,0.2); }

/* ATTENTION ITEMS */
.ai { display: flex; align-items: flex-start; gap: 13px; padding: 13px 20px; border-bottom: 1px solid var(--border); transition: background 0.15s; }
.ai:last-child { border-bottom: none; }
.ai:hover { background: rgba(255,255,255,0.015); }
.ai-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }
.ic-r { background: var(--red-dim); border: 1px solid var(--red-bdr); }
.ic-a { background: var(--amber-dim); border: 1px solid var(--amber-bdr); }
.ic-b { background: var(--blue-dim); border: 1px solid var(--blue-bdr); }
.ic-g { background: var(--green-dim); border: 1px solid var(--green-bdr); }
.ai-body { flex: 1; min-width: 0; }
.ai-name { font-weight: 500; color: var(--text); font-size: 13px; }
.ai-detail { font-size: 11px; color: var(--text3); margin-top: 3px; line-height: 1.4; }
.ai-actions { display: flex; gap: 6px; flex-shrink: 0; align-items: center; }

/* SKU ROWS */
.sku { display: flex; align-items: center; gap: 14px; padding: 10px 20px; border-bottom: 1px solid var(--border); }
.sku:last-child { border-bottom: none; }
.sku-info { flex: 1; }
.sku-name { font-size: 13px; font-weight: 500; color: var(--text); }
.sku-meta { font-family: var(--fm); font-size: 10px; color: var(--text3); margin-top: 2px; }
.sku-bar { width: 80px; height: 3px; background: rgba(255,255,255,0.06); border-radius: 2px; overflow: hidden; }
.sku-fill { height: 100%; background: linear-gradient(90deg,var(--accent),var(--rose)); border-radius: 2px; transition: width 0.4s ease; }
.sku-n { font-family: var(--fd); font-size: 22px; font-weight: 300; color: var(--text2); width: 28px; text-align: right; }

/* REP CARDS */
.rcard { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; transition: border-color 0.2s; }
.rcard:hover { border-color: var(--border2); }
.rhead { display: flex; align-items: center; gap: 11px; margin-bottom: 13px; }
.ravatar { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.ra-g { background: rgba(122,170,122,0.15); color: var(--green); border: 1px solid rgba(122,170,122,0.25); }
.ra-b { background: rgba(106,149,201,0.15); color: var(--blue); border: 1px solid rgba(106,149,201,0.25); }
.ra-a { background: var(--amber-dim); color: var(--amber); border: 1px solid var(--amber-bdr); }
.ra-r { background: var(--rose-dim); color: var(--rose); border: 1px solid rgba(201,125,138,0.25); }
.rname { font-weight: 500; color: var(--text); font-size: 14px; }
.rarea { font-family: var(--fm); font-size: 10px; color: var(--text3); margin-top: 2px; }
.revent { background: var(--accent-dim2); border: 1px solid rgba(201,149,106,0.1); border-radius: var(--radius-sm); padding: 7px 10px; font-size: 11px; color: var(--text2); margin-bottom: 11px; display: flex; align-items: center; gap: 7px; }
.revent::before { content:''; width:5px; height:5px; border-radius:50%; background:var(--accent); flex-shrink:0; }
.rstats { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 11px; }
.rstat { background: var(--bg3); border-radius: var(--radius-sm); padding: 8px 10px; }
.rstat-l { font-family: var(--fm); font-size: 9px; color: var(--text3); letter-spacing: 0.08em; text-transform: uppercase; }
.rstat-v { font-family: var(--fd); font-size: 20px; font-weight: 300; color: var(--text); margin-top: 2px; line-height: 1; }
.rstat-v.ac { color: var(--accent); }
.ractions { display: flex; gap: 6px; }
.ractions .btn { flex: 1; justify-content: center; }
.add-rep-card { background: var(--bg2); border: 1px dashed rgba(201,149,106,0.2); border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; cursor: pointer; min-height: 220px; transition: all 0.15s; }
.add-rep-card:hover { border-color: rgba(201,149,106,0.4); background: var(--accent-dim2); }
.add-rep-icon { width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(201,149,106,0.25); display: flex; align-items: center; justify-content: center; color: var(--accent); font-size: 20px; margin-bottom: 3px; }

/* PIPELINE */
.pflow { display: grid; grid-template-columns: repeat(5,1fr); background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; }
.pstate { padding: 18px 16px; border-right: 1px solid var(--border); transition: background 0.15s; }
.pstate:last-child { border-right: none; }
.pstate:hover { background: rgba(255,255,255,0.02); }
.ps-label { font-family: var(--fm); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text3); margin-bottom: 10px; }
.ps-count { font-family: var(--fd); font-size: 44px; font-weight: 300; line-height: 1; margin-bottom: 5px; }
.ps-sub { font-size: 10px; color: var(--text3); }

/* TIMELINE */
.tl { padding: 16px 20px; }
.tli { display: flex; gap: 13px; padding-bottom: 16px; }
.tli:last-child { padding-bottom: 0; }
.tl-left { display: flex; flex-direction: column; align-items: center; width: 18px; flex-shrink: 0; }
.tl-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; margin-top: 4px; }
.tl-dot.r { background: var(--red); } .tl-dot.a { background: var(--amber); } .tl-dot.g { background: var(--green); }
.tl-line { flex: 1; width: 1px; background: var(--border); margin-top: 3px; }
.tli:last-child .tl-line { display: none; }
.tl-body { flex: 1; }
.tl-trigger { font-family: var(--fm); font-size: 10px; color: var(--accent); margin-bottom: 3px; }
.tl-trigger.r { color: var(--red); } .tl-trigger.a { color: var(--amber); } .tl-trigger.g { color: var(--green); }
.tl-desc { font-size: 12px; color: var(--text2); line-height: 1.5; }

/* CALL LOG */
.cli { display: flex; gap: 11px; padding: 12px 20px; border-bottom: 1px solid var(--border); align-items: flex-start; }
.cli:last-child { border-bottom: none; }
.cli-icon { width: 26px; height: 26px; border-radius: var(--radius-sm); background: var(--bg3); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cli-info { flex: 1; }
.cli-name { font-size: 12px; font-weight: 500; color: var(--text); }
.cli-note { font-size: 11px; color: var(--text3); margin-top: 2px; line-height: 1.4; }
.cli-date { font-family: var(--fm); font-size: 10px; color: var(--text3); white-space: nowrap; }

/* SELL-THROUGH */
.str { display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; border-bottom: 1px solid var(--border); }
.str:last-child { border-bottom: none; }
.str-name { font-size: 13px; font-weight: 500; color: var(--text); }
.str-meta { font-family: var(--fm); font-size: 10px; color: var(--text3); margin-top: 2px; }

/* FORMS */
.ff { margin-bottom: 14px; }
.fl { display: block; font-family: var(--fm); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text3); margin-bottom: 6px; }
.fi,.fs,.fta { width: 100%; background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 11px; font-size: 13px; color: var(--text); font-family: var(--fb); outline: none; transition: all 0.15s; appearance: none; }
.fi:focus,.fs:focus,.fta:focus { border-color: rgba(201,149,106,0.4); background: var(--bg4); }
.fi::placeholder,.fta::placeholder { color: var(--text3); }
.fta { height: 76px; resize: none; line-height: 1.5; }
.frow { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.frow3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 11px; }

/* MODALS */
.overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.72); backdrop-filter: blur(5px); z-index: 200; align-items: center; justify-content: center; }
.overlay.open { display: flex; }
.modal { background: var(--bg2); border: 1px solid var(--border2); border-radius: 14px; width: 460px; max-width: 94vw; max-height: 88vh; overflow-y: auto; animation: mu 0.2s ease; }
@keyframes mu { from { transform:translateY(14px); opacity:0; } to { transform:translateY(0); opacity:1; } }
.modal-head { padding: 20px 22px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; justify-content: space-between; }
.modal-title { font-family: var(--fd); font-size: 24px; font-weight: 400; color: var(--text); line-height: 1.1; }
.modal-sub { font-family: var(--fm); font-size: 10px; color: var(--text3); margin-top: 4px; }
.modal-x { background: none; border: 1px solid var(--border); color: var(--text3); border-radius: 6px; width: 26px; height: 26px; cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; transition: all 0.15s; flex-shrink: 0; margin-top: 2px; }
.modal-x:hover { border-color: var(--border2); color: var(--text); }
.modal-body { padding: 18px 22px; }
.modal-foot { padding: 14px 22px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* DETAIL STATS (inside modals) */
.dstats { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; margin-bottom: 16px; }
.dstat { background: var(--bg3); border-radius: var(--radius-sm); padding: 11px 13px; text-align: center; }
.dstat-v { font-family: var(--fd); font-size: 28px; font-weight: 300; color: var(--text); line-height: 1; }
.dstat-v.al { color: var(--red); }
.dstat-l { font-family: var(--fm); font-size: 9px; color: var(--text3); margin-top: 4px; letter-spacing: 0.08em; }
.inv-line { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.inv-line:last-child { border-bottom: none; }
.inv-sku { color: var(--text); font-weight: 500; }
.inv-d { color: var(--text3); font-family: var(--fm); font-size: 10px; }
.inset { background: var(--bg3); border-radius: var(--radius-sm); padding: 4px 12px; margin-bottom: 15px; }
.smini { font-family: var(--fm); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text3); margin-bottom: 7px; }

/* CHIPS */
.chips { display: flex; gap: 6px; margin-bottom: 13px; flex-wrap: wrap; }
.chip { padding: 4px 12px; border-radius: var(--radius-pill); font-family: var(--fm); font-size: 11px; cursor: pointer; border: 1px solid var(--border); background: var(--bg2); color: var(--text3); transition: all 0.15s; user-select: none; }
.chip:hover { border-color: var(--border2); color: var(--text2); }
.chip.active { background: var(--accent-dim); color: var(--accent); border-color: rgba(201,149,106,0.3); }

/* TOAST */
#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(70px); background: var(--bg3); border: 1px solid var(--border2); color: var(--text); padding: 9px 18px; border-radius: var(--radius-sm); font-family: var(--fm); font-size: 12px; transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1); z-index: 999; white-space: nowrap; display: flex; align-items: center; gap: 7px; }
#toast.show { transform: translateX(-50%) translateY(0); }
#toast::before { content:''; width:5px; height:5px; border-radius:50%; background:var(--green); flex-shrink:0; }
#toast.error::before { background: var(--red); }

/* LOADING STATE */
.loading { display: flex; align-items: center; justify-content: center; padding: 40px; color: var(--text3); font-family: var(--fm); font-size: 12px; gap: 10px; }
.spinner { width: 16px; height: 16px; border: 1.5px solid var(--border2); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* EMPTY STATE */
.empty { text-align: center; padding: 40px 20px; color: var(--text3); font-size: 13px; }
.empty-icon { font-size: 28px; margin-bottom: 8px; }

/* SECTION HEAD */
.shead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.slabel { font-family: var(--fm); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text3); }

/* UTILS */
.ml-auto { margin-left: auto; }
.flex { display: flex; }
.gap2 { gap: 8px; }
.gap3 { gap: 12px; }
.w-full { width: 100%; }
.justify-center { justify-content: center; }

/* =============================================================================
   MOBILE RESPONSIVE — 768px and below
   ============================================================================= */

@media (max-width: 768px) {

  /* Nav — horizontal scroll, smaller text */
  .topnav {
    padding: 0 12px;
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .brand {
    margin-right: 16px;
    flex-shrink: 0;
  }

  .brand-dot,
  .brand-sub { display: none; }

  .brand-name { font-size: 15px; }

  .nav-links {
    gap: 1px;
    flex-shrink: 0;
  }

  .nav-link {
    padding: 5px 10px;
    font-size: 12px;
    flex-shrink: 0;
  }

  .nav-badge { font-size: 8px; padding: 1px 4px; }

  .topnav-right { gap: 6px; flex-shrink: 0; }

  .topnav-right .btn-ghost { display: none; } /* hide Log call on mobile, access via Automation */

  .user-avatar { width: 26px; height: 26px; font-size: 10px; }

  /* Pages */
  .page { padding: 14px 12px; }

  /* Metrics — 2x2 on mobile */
  .metrics {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
  }

  .mval { font-size: 32px; }
  .mcard { padding: 14px; }

  /* All multi-column grids collapse to single column */
  .g2, .g3, .g6040 {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 12px;
  }

  /* Pipeline flow — 2 columns on mobile, scroll */
  .pflow {
    grid-template-columns: 1fr 1fr;
    margin-bottom: 14px;
  }

  .pstate { padding: 14px 12px; }
  .ps-count { font-size: 32px; }

  /* Pipeline tables — scroll horizontally */
  .card { overflow-x: auto; }

  /* Attention items — stack vertically */
  .ai {
    flex-direction: column;
    gap: 10px;
    padding: 14px;
  }

  .ai-icon { margin-top: 0; }

  .ai-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .ai-actions .btn { flex: 1; justify-content: center; }

  /* SKU rows */
  .sku { padding: 10px 14px; gap: 10px; }
  .sku-bar { width: 50px; }

  /* Rep cards — single col already via g3 collapse */
  .rcard { padding: 14px; }
  .rname { font-size: 13px; }

  /* Add rep card */
  .add-rep-card { min-height: 120px; }

  /* Tables — make readable */
  .tbl th, .tbl td { padding: 10px 12px; font-size: 12px; }

  /* Hide less critical table columns on mobile */
  .tbl .hide-mobile { display: none; }

  /* Modals — full width */
  .modal {
    width: 96vw;
    max-height: 92vh;
    border-radius: 12px;
  }

  .modal-head { padding: 16px 16px 12px; }
  .modal-body { padding: 14px 16px; }
  .modal-foot { padding: 12px 16px 16px; }
  .modal-title { font-size: 20px; }

  .frow { grid-template-columns: 1fr; }

  /* Detail stats in modal */
  .dstats { gap: 6px; }
  .dstat-v { font-size: 22px; }

  /* Chips */
  .chips { gap: 5px; }
  .chip { padding: 4px 10px; font-size: 10px; }

  /* Section heads */
  .shead { margin-bottom: 8px; }

  /* Timeline */
  .tl { padding: 12px 14px; }

  /* Call log */
  .cli { padding: 10px 14px; }

  /* Card heads */
  .card-head { padding: 12px 14px; }

  /* Rep stats grid */
  .rstats { gap: 6px; }
  .rstat { padding: 7px 9px; }
  .rstat-v { font-size: 17px; }

  /* Rep event strip */
  .revent { font-size: 11px; padding: 6px 9px; }

  /* Rep actions */
  .ractions { gap: 5px; }
  .ractions .btn { font-size: 11px; padding: 5px 8px; }

  /* Toast */
  #toast { font-size: 11px; padding: 8px 14px; max-width: 90vw; white-space: normal; text-align: center; }

  /* Pipeline three-col inside pipeline page */
  #page-pipeline > div:last-child {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  /* Extra small — pipeline flow single col */
  .pflow { grid-template-columns: 1fr 1fr; }
  .ps-count { font-size: 28px; }
  .mval { font-size: 28px; }
  .nav-link { padding: 5px 8px; font-size: 11px; }
}
