/* Packard Office — the Salto office system, Packard colors. Chrome stays quiet; red is for what matters. */
:root {
  --ink: #0F1013; --ink-2: #1A1C21; --ink-3: #24272D;
  --paper: #F4F4F1; --paper-2: #ECECE8; --card: #FFFFFF;
  --fog: #DCDDD9; --fog-2: #C8C9C4; --mute: #63666E; --text: #14151A;
  --red: #FF020A; --red-2: #D60008; --red-soft: #FFE3E4;
  --amber: #B86E00; --amber-soft: #FFF1D6;
  --green: #1F7A4D; --green-soft: #DDF3E6;
  --blue: #2150C4; --blue-soft: #E4EAFB;
  --disp: 'Barlow Condensed', 'Inter', sans-serif;
  --sans: 'Inter', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --r-sm: 8px; --r: 12px; --r-lg: 18px;
  --sh-1: 0 1px 2px rgba(15,16,19,.06), 0 1px 1px rgba(15,16,19,.04);
  --sh-2: 0 10px 30px -12px rgba(15,16,19,.28), 0 2px 6px rgba(15,16,19,.06);
  --sh-3: 0 24px 60px -20px rgba(15,16,19,.45), 0 4px 12px rgba(15,16,19,.08);
  --rail: 236px; --rail-min: 64px; --top: 60px;
  --ease: cubic-bezier(.2,.7,.2,1);
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body { font: 15px/1.5 var(--sans); background: var(--paper); color: var(--text); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
::selection { background: var(--red); color: #fff; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100vh; transition: grid-template-columns .22s var(--ease); }
.shell.rail-min { grid-template-columns: var(--rail-min) 1fr; }
.rail { position: sticky; top: 0; height: 100vh; background: linear-gradient(180deg, var(--ink) 0%, var(--ink-2) 100%); color: #E8EBF0; display: flex; flex-direction: column; overflow: hidden; }
.rail .brand { display: flex; align-items: center; gap: 12px; padding: 16px 14px; height: var(--top); }
.rail .brand img { width: 36px; height: 36px; border-radius: 10px; box-shadow: 0 0 0 2px rgba(255,255,255,.08); flex: none; }
.rail .brand b { font-family: var(--disp); font-size: 17px; letter-spacing: .04em; white-space: nowrap; }
.rail .brand small { display: block; font: 11px/1 var(--sans); color: #8B93A0; margin-top: 3px; }
.rail nav { display: flex; flex-direction: column; gap: 2px; padding: 8px; flex: 1; }
.rail nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #B9C0CB; text-decoration: none; white-space: nowrap; position: relative; transition: background .15s, color .15s; }
.rail nav a svg { width: 20px; height: 20px; flex: none; }
.rail nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.rail nav a.on { background: rgba(255,255,255,.1); color: #fff; }
.rail nav a.on::before { content: ""; position: absolute; left: -8px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--red); }
.rail nav a .n { margin-left: auto; font: 500 11px var(--mono); color: #8B93A0; }
.rail nav a .n.hot { color: #fff; background: var(--red); border-radius: 999px; padding: 0 6px; }
.rail .foot { padding: 10px 8px 14px; border-top: 1px solid rgba(255,255,255,.06); display: flex; flex-direction: column; gap: 2px; }
.rail .collapse { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; background: transparent; color: #8B93A0; border-radius: 10px; cursor: pointer; text-decoration: none; }
.rail .collapse:hover { background: rgba(255,255,255,.06); color: #fff; }
.rail .collapse svg { width: 18px; height: 18px; transition: transform .22s var(--ease); }
.rail-min .rail .brand b, .rail-min .rail .brand small, .rail-min .rail nav a span, .rail-min .rail .collapse span, .rail-min .rail nav a .n { opacity: 0; width: 0; overflow: hidden; }
.rail-min .rail .collapse svg { transform: rotate(180deg); }
.rail-min .rail nav a { justify-content: center; padding: 11px 0; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; height: var(--top); display: flex; align-items: center; gap: 12px; padding: 0 20px; background: rgba(244,244,241,.84); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); border-bottom: 1px solid rgba(220,221,217,.8); }
.top h1 { font-family: var(--disp); font-size: 22px; letter-spacing: .02em; margin-right: 6px; white-space: nowrap; text-transform: uppercase; }
.search { flex: 1; max-width: 520px; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; background: var(--card); border: 1px solid var(--fog); border-radius: 10px; box-shadow: var(--sh-1); }
.search svg { width: 16px; height: 16px; color: var(--mute); flex: none; }
.search input { flex: 1; border: 0; background: transparent; outline: 0; min-width: 0; }
.search kbd { font: 11px var(--mono); color: var(--mute); border: 1px solid var(--fog); border-radius: 5px; padding: 1px 5px; }
.top .spacer { flex: 1; }
.who { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--mute); }
.who i { width: 28px; height: 28px; border-radius: 999px; background: var(--ink); color: #fff; display: grid; place-items: center; font: 700 12px var(--sans); font-style: normal; }
.content { padding: 20px 20px 96px; max-width: 1360px; width: 100%; min-width: 0; overflow-x: hidden; }

/* ---------- primitives ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid transparent; background: var(--ink); color: #fff; cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap; transition: transform .08s, background .15s; box-shadow: var(--sh-1); text-decoration: none; }
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 16px; height: 16px; }
.btn.red { background: var(--red); } .btn.red:hover { background: var(--red-2); }
.btn.ghost { background: var(--card); color: var(--text); border-color: var(--fog); } .btn.ghost:hover { background: var(--paper-2); }
.btn.quiet { background: transparent; box-shadow: none; color: var(--mute); } .btn.quiet:hover { background: var(--paper-2); color: var(--text); }
.btn.sm { height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.icon { width: 38px; padding: 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--mute); }
.field input, .field select, .field textarea { height: 40px; padding: 0 12px; border: 1px solid var(--fog); border-radius: 10px; background: var(--card); }
.field textarea { height: auto; min-height: 92px; padding: 10px 12px; line-height: 1.45; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0,1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.row { display: flex; align-items: center; gap: 10px; } .between { justify-content: space-between; } .wrap { flex-wrap: wrap; }
.mute { color: var(--mute); } .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.money { font-family: var(--mono); font-weight: 600; font-variant-numeric: tabular-nums; }
h2.sec { font-family: var(--disp); font-size: 18px; letter-spacing: .03em; text-transform: uppercase; margin: 26px 0 12px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
h2.sec:first-child { margin-top: 0; }
h2.sec .aside { font: 500 13px var(--sans); color: var(--mute); text-transform: none; }
.sub { color: var(--mute); font-size: 13.5px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--paper-2); color: var(--text); white-space: nowrap; }
.chip.red { background: var(--red-soft); color: #B2000A; } .chip.amber { background: var(--amber-soft); color: var(--amber); } .chip.ok { background: var(--green-soft); color: var(--green); } .chip.blue { background: var(--blue-soft); color: var(--blue); } .chip.ink { background: var(--ink); color: #fff; }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--sh-1); border: 1px solid rgba(220,221,217,.7); }
.card.pad { padding: 16px; }
.empty { padding: 36px 20px; text-align: center; color: var(--mute); border: 1.5px dashed var(--fog-2); border-radius: var(--r); }
.skel { background: linear-gradient(90deg, var(--paper-2), #fff, var(--paper-2)); background-size: 200% 100%; animation: sk 1.1s linear infinite; border-radius: var(--r); height: 120px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- overview ---------- */
.work { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.work .card { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-height: 104px; cursor: pointer; }
.work .card h3 { font-size: 13px; color: var(--mute); font-weight: 600; }
.work .card b { font: 700 28px/1.1 var(--disp); }
.work .card .sub { margin-top: auto; }
.work .card.attn { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft), var(--sh-1); }
.work .card.attn b { color: var(--red); }
.panels { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
@media (min-width: 1240px) { .panels { grid-template-columns: repeat(3, minmax(0,1fr)); } }
.panel { padding: 14px 16px 8px; min-width: 0; }
.panel h2 { font-family: var(--disp); font-size: 18px; text-transform: uppercase; letter-spacing: .03em; display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.panel h2 .aside { font: 500 12.5px var(--sans); color: var(--mute); text-transform: none; }
.pli { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--paper-2); font-size: 14px; cursor: pointer; }
.pli:hover { background: var(--paper); margin: 0 -8px; padding-inline: 8px; border-radius: 8px; }
.pli .l { min-width: 0; flex: 1; } .pli .l b { font-weight: 600; } .pli .l span { color: var(--mute); display: block; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pli .r { flex-shrink: 0; text-align: right; font-family: var(--disp); font-weight: 700; font-size: 20px; line-height: 1; }
.pli .r small { display: block; font: 500 11px var(--sans); color: var(--mute); }
.pli .r.red { color: var(--red); } .pli .r.amber { color: var(--amber); } .pli .r.ok { color: var(--green); }

/* ---------- lists / rows ---------- */
.list { display: flex; flex-direction: column; gap: 8px; }
.lrow { display: flex; align-items: center; gap: 14px; padding: 12px 14px; cursor: pointer; }
.lrow:hover { box-shadow: var(--sh-2); }
.lrow .av { width: 40px; height: 40px; border-radius: 10px; background: var(--paper-2); color: var(--ink); display: grid; place-items: center; font: 700 12px var(--disp); flex: none; overflow: hidden; }
.lrow .av img { width: 100%; height: 100%; object-fit: cover; }
.lrow .body { flex: 1; min-width: 0; }
.lrow .body b { display: block; }
.lrow .body .sub { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow .right { text-align: right; flex: none; }
.lrow .right b { font-family: var(--disp); font-size: 20px; line-height: 1; display: block; }
.lrow .right small { color: var(--mute); font-size: 11.5px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.seg { display: inline-flex; background: var(--paper-2); border-radius: 10px; padding: 3px; }
.seg button { height: 32px; padding: 0 12px; border: 0; background: transparent; border-radius: 8px; color: var(--mute); font-weight: 600; font-size: 13px; cursor: pointer; }
.seg button.on { background: var(--card); color: var(--text); box-shadow: var(--sh-1); }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--mute); } .kv dd { margin: 0; }
.tl { position: relative; padding-left: 18px; }
.tl::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--fog); }
.tl .ev { position: relative; padding: 4px 0 10px; font-size: 13.5px; }
.tl .ev::before { content: ''; position: absolute; left: -17px; top: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.tl .ev .when { color: var(--mute); font-size: 12px; }
.msgs { display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 88%; padding: 9px 12px; border-radius: 14px; font-size: 14px; background: var(--paper-2); align-self: flex-start; }
.msg.customer { background: var(--blue-soft); }
.msg.agent { background: var(--ink); color: #fff; align-self: flex-end; }
.msg small { display: block; font-size: 11px; color: var(--mute); margin-top: 3px; }
.msg.agent small { color: #B9C0CB; }
.parts .pr { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--paper-2); font-size: 13.5px; }
.parts .pr img { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; background: var(--paper-2); }
.parts .pr .need { margin-left: auto; font-family: var(--disp); font-weight: 700; font-size: 18px; white-space: nowrap; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }

/* ---------- drawer ---------- */
.scrim { position: fixed; inset: 0; background: rgba(15,16,19,.35); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(600px, 100vw); background: var(--paper); box-shadow: var(--sh-3); transform: translateX(104%); transition: transform .26s var(--ease); z-index: 50; display: flex; flex-direction: column; }
.drawer.open { transform: none; } .scrim.open { opacity: 1; pointer-events: auto; }
.drawer .dhead { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--fog); background: var(--card); }
.drawer .dhead h2 { font-family: var(--disp); font-size: 22px; text-transform: uppercase; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer .dbody { padding: 16px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 14px; }
.drawer .dfoot { padding: 12px 16px; border-top: 1px solid var(--fog); background: var(--card); display: flex; gap: 8px; flex-wrap: wrap; }
.drawer .dfoot:empty { display: none; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; font-weight: 600; opacity: 0; transition: .25s; z-index: 60; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--red); }

/* ---------- login ---------- */
.login { position: fixed; inset: 0; background: var(--ink); display: grid; place-items: center; z-index: 100; }
.login[hidden] { display: none; }
.login .card { width: min(100% - 32px, 360px); text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; padding: 28px 24px; }
.login h1 { font-family: var(--disp); font-size: 30px; text-transform: uppercase; }
.login input { width: 100%; height: 52px; text-align: center; font: 700 28px var(--mono); letter-spacing: .3em; border: 1px solid var(--fog); border-radius: 12px; }
.login .btn { width: 100%; height: 46px; }

/* ---------- mobile ---------- */
.mobnav { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .rail { display: none; }
  .top { padding: 0 14px; gap: 8px; } .top h1 { font-size: 20px; }
  .search { max-width: none; } .search kbd { display: none; }
  #newtask span { display: none; } #newtask { width: 38px; padding: 0; }
  .who span { display: none; }
  .content { padding: 14px 14px 110px; }
  .work { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .panels { grid-template-columns: 1fr; }
  .g3, .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .kv { grid-template-columns: 1fr; gap: 2px 0; } .kv dt { margin-top: 6px; }
  .mobnav { display: flex; position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(12px + env(safe-area-inset-bottom)); width: min(100% - 24px, 420px); background: rgba(15,16,19,.92); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-radius: 999px; padding: 6px; z-index: 30; box-shadow: var(--sh-3); }
  .mobnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; border-radius: 999px; color: #B9C0CB; text-decoration: none; font-size: 10.5px; font-weight: 600; }
  .mobnav a svg { width: 20px; height: 20px; }
  .mobnav a.on { background: rgba(255,255,255,.12); color: #fff; }
}
.stat span { font-size: 12.5px; color: var(--mute); display: block; }
.stat b { display: block; margin-top: 4px; line-height: 1.1; }
.stat i { display: block; font-style: normal; font-size: 12px; color: var(--mute); margin-top: 3px; }
