/* Studio — design system.
   Implements the Claude Design handoff (design_handoff_studio_crm).
   Every value here is from that spec. Do not invent new ones.

   Supersedes kiln.css: the neutral ramp was shifted cool (navy-derived) so the
   UI doesn't read as beige. Taupe survives as a deliberate accent, not the base. */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,700&family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@24,400,0,0&display=swap');

:root {
  /* surfaces */
  --canvas:         #E2E3E5;
  --canvas-header:  rgba(226,227,229,.88);
  --surface:        #FFFFFD;
  --surface-sunken: #F3F4F6;
  --surface-alt:    #F1F2F4;
  --surface-muted:  #EDEFF2;
  --board-column:   #BCBEC4;

  /* lines */
  --border:        #D3D4D8;
  --border-hover:  #A89587;
  --border-strong: #BCBEC4;
  --hairline:      #ECEDEF;
  --hairline-2:    #E3E4E7;

  /* ink */
  --ink:     #1A1A1A;
  --ink-2:   #2C3038;
  --ink-3:   #3E434B;
  --muted:   #5B6068;
  --muted-2: #7B8089;
  --muted-3: #6E737B;
  --muted-4: #8D9199;

  /* navy */
  --navy:             #252A37;
  --navy-deep:        #171B25;
  --navy-panel-line:  #343A49;
  --navy-panel-muted: #A2A8B6;
  --navy-panel-text:  #D3D7DE;

  /* accents */
  --taupe:      #A89587;
  --taupe-tint: #D8DAE0;
  --wine:       #76272E;
  --wine-deep:  #5A1D23;
  --tint-neutral: #DFE1E6;
  --tint-warm:    #D9DADE;

  /* type. --mono is a deliberate misnomer: it marks the label/numeric layer
     (eyebrows, dates, amounts, table headers), NOT a monospace family. It was
     JetBrains Mono and was rejected — uppercase mono eyebrows looked wrong. */
  --serif: 'Instrument Serif', serif;
  --sans:  'DM Sans', ui-sans-serif, system-ui, sans-serif;
  --mono:  'DM Sans', ui-sans-serif, sans-serif;

  /* motion */
  --ease-enter: cubic-bezier(.2,.8,.3,1);
  --ease-inter: cubic-bezier(.2,.9,.3,1.3);

  --shadow-card:   0 12px 26px rgba(23,21,15,.10);
  --shadow-board:  0 14px 28px rgba(23,21,15,.16);
  --shadow-btn:    0 2px 0 rgba(23,21,15,.16);
  --shadow-btn-h:  0 8px 18px rgba(23,21,15,.20);
}

*{box-sizing:border-box}
html,body{background:var(--canvas)}
body{margin:0;color:var(--ink);font:400 15px/1.55 var(--sans);-webkit-font-smoothing:antialiased}
::selection{background:var(--taupe-tint)}

h1,h2,h3{margin:0;font-family:var(--serif);font-weight:400;letter-spacing:-.02em}
em{font-style:italic;color:var(--wine)}

.eyebrow{font-family:var(--mono);font-size:11.5px;letter-spacing:.13em;text-transform:uppercase;
  color:var(--muted-2)}
.num{font-family:var(--mono);font-variant-numeric:tabular-nums}
.muted{color:var(--muted)}

.msr{font-family:'Material Symbols Rounded';font-weight:400;font-style:normal;
  font-variation-settings:'opsz' 24,'wght' 400,'FILL' 0,'GRAD' 0;
  line-height:1;letter-spacing:normal;text-transform:none;white-space:nowrap;
  direction:ltr;-webkit-font-feature-settings:'liga';-webkit-font-smoothing:antialiased;
  user-select:none}

/* ---------------------------------------------------------------- controls */
button{font:500 14px/1 var(--sans);cursor:pointer;border-radius:11px;padding:11px 16px;
  border:1px solid var(--border);background:var(--surface);color:var(--ink);
  transition:transform .2s var(--ease-inter),background .2s,color .2s,border-color .2s,box-shadow .2s}
button:hover{transform:translateY(-2px)}
button.primary{background:var(--navy);color:var(--surface-alt);border-color:var(--navy);
  box-shadow:var(--shadow-btn)}
button.primary:hover{background:var(--navy-deep);box-shadow:var(--shadow-btn-h)}
button.ghost:hover{background:var(--navy);color:var(--surface-alt);border-color:var(--navy)}
button.wine{background:var(--wine);color:#fff;border-color:var(--wine)}
button.wine:hover{background:var(--wine-deep)}
button[disabled]{opacity:.5;cursor:default;transform:none}
button.pill{border-radius:999px}

input,select,textarea{width:100%;padding:11px 13px;border:1px solid var(--border);
  border-radius:10px;background:var(--surface);color:var(--ink);font:400 15px/1.4 var(--sans)}
input:focus,select:focus,textarea:focus{outline:2px solid var(--taupe);outline-offset:1px}
label{display:block;font-family:var(--mono);font-size:11.5px;letter-spacing:.13em;
  text-transform:uppercase;color:var(--muted-2);margin:0 0 6px}

.card{background:var(--surface);border:1px solid var(--border);border-radius:16px}
.pill-tag{display:inline-block;padding:4px 11px;border-radius:999px;font-size:12.5px;
  background:var(--tint-neutral);color:var(--ink-2)}

/* ------------------------------------------------------------------ motion */
@keyframes rise    {from{opacity:0;transform:translateY(12px)} to{opacity:1;transform:none}}
@keyframes fade    {from{opacity:0} to{opacity:1}}
@keyframes slidein {from{opacity:0;transform:translateX(-8px)} to{opacity:1;transform:none}}
@keyframes grow    {from{transform:scaleX(0)} to{transform:scaleX(1)}}
@keyframes growY   {from{transform:scaleY(0)} to{transform:scaleY(1)}}
@keyframes pop     {0%{transform:scale(.9);opacity:0}60%{transform:scale(1.03)}100%{transform:scale(1);opacity:1}}
@keyframes breathe {0%,100%{opacity:.45}50%{opacity:1}}

.a-fade{animation:fade .35s var(--ease-enter) both}
.a-rise{animation:rise .5s var(--ease-enter) both}
.a-slide{animation:slidein .45s var(--ease-enter) both}
.a-pop{animation:pop .42s var(--ease-inter) both}
.a-grow{animation:grow .6s var(--ease-enter) both;transform-origin:left}
.a-growY{animation:growY .7s var(--ease-enter) both;transform-origin:bottom}
.breathe{animation:breathe 1.9s ease-in-out infinite}

@media (prefers-reduced-motion:reduce){
  .a-rise,.a-slide,.a-pop,.a-grow,.a-growY{animation:fade .3s both}
  button:hover,.lift:hover{transform:none!important}
}

/* ------------------------------------------------------------------- shell */
.shell{display:flex;min-height:100vh}
.rail{position:sticky;top:0;width:78px;flex:0 0 78px;height:100vh;background:var(--surface);
  border-right:1px solid var(--border);z-index:20;display:flex;flex-direction:column;
  align-items:center;padding:18px 0;gap:2px}
.rail .logo{width:38px;height:38px;border-radius:11px;background:var(--navy);color:var(--surface);
  font-family:var(--serif);font-size:21px;display:grid;place-items:center;margin-bottom:18px;flex:0 0 auto}
.rail button{position:relative;width:52px;height:44px;border-radius:12px;border:0;background:none;
  color:var(--muted-3);display:grid;place-items:center;padding:0;box-shadow:none}
.rail button .msr{font-size:22px}
.rail button:hover{background:var(--hairline);transform:translateY(-2px)}
.rail button[aria-current=page]{background:var(--tint-neutral);color:var(--ink)}
.rail button::before{content:'';position:absolute;left:-8px;top:50%;width:3px;height:0;margin-top:0;
  background:var(--navy);border-radius:0 3px 3px 0;transition:height .25s var(--ease-inter),margin-top .25s var(--ease-inter)}
.rail button[aria-current=page]::before{height:22px;margin-top:-11px}
.rail .spacer{flex:1}
.rail .avatar{width:38px;height:38px;flex:0 0 auto;border-radius:50%;background:var(--taupe-tint);
  border:1px solid var(--taupe);color:var(--navy-deep);font-size:13px;font-weight:700;
  display:grid;place-items:center}

main{flex:1;min-width:0;display:flex;flex-direction:column}
.hdr{position:sticky;top:0;z-index:15;display:flex;align-items:center;gap:14px;
  padding:14px 28px;background:var(--canvas-header);backdrop-filter:blur(12px);
  border-bottom:1px solid var(--border)}
.search{display:flex;align-items:center;gap:9px;width:320px;max-width:38vw;padding:9px 15px;
  border:1px solid var(--border);border-radius:999px;background:var(--surface);color:var(--muted)}
.search .msr{font-size:19px}
.search input{border:0;padding:0;background:none;font-size:14px;outline:0!important}
.kbd{font-family:var(--mono);font-size:11px;border:1px solid var(--border);border-radius:5px;
  padding:2px 6px;color:var(--muted-4)}
.bell{position:relative;width:40px;height:40px;border-radius:50%;display:grid;place-items:center;
  border:1px solid var(--border);background:var(--surface)}
.bell .dot{position:absolute;top:-2px;right:-2px;min-width:18px;height:18px;border-radius:999px;
  background:var(--wine);color:#fff;font-size:11px;display:grid;place-items:center;padding:0 5px}
.page{padding:30px 28px 72px;flex:1}
.wrapw{max-width:1320px;margin:0 auto}

/* ------------------------------------------------------------------ pieces */
.kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:14px}
.kpi{background:var(--surface);border:1px solid var(--border);border-radius:16px;padding:20px 22px}
.kpi b{display:block;font-family:var(--serif);font-size:40px;font-weight:400;line-height:1;
  letter-spacing:-.02em;margin:8px 0 6px}
.kpi .delta{font-size:13px;color:var(--muted)}
.kpi .delta.alert{color:var(--wine)}
.kpi.alert{background:#F6EDEE;border-color:#E3CBCE}

.panel{background:var(--surface);border:1px solid var(--border);border-radius:18px;padding:22px 24px}
.panel > h2{font-size:24px;margin-bottom:4px}
.panel .sub{font-size:13.5px;color:var(--muted);margin:0 0 16px}
.panel.navy{background:var(--navy);color:var(--surface-alt);border-color:var(--navy)}
.panel.navy .eyebrow{color:var(--navy-panel-muted)}
.panel.navy .line{border-color:var(--navy-panel-line)}

.rowitem{display:flex;align-items:center;gap:13px;padding:11px 0;border-bottom:1px solid var(--hairline)}
.rowitem:last-child{border-bottom:0}
.tile{width:34px;height:34px;flex:0 0 auto;border-radius:10px;background:var(--surface-sunken);
  display:grid;place-items:center;color:var(--ink-3)}
.tile .msr{font-size:19px}
.rowitem .grow{flex:1;min-width:0}
.rowitem .t{font-size:14.5px;font-weight:500}
.rowitem .s{font-size:12.5px;color:var(--muted)}

table{width:100%;border-collapse:collapse;background:var(--surface);border-radius:16px;overflow:hidden}
thead th{background:var(--surface-sunken);font-family:var(--mono);font-size:11px;font-weight:400;
  letter-spacing:.11em;text-transform:uppercase;color:var(--muted-2);text-align:left;padding:12px 20px}
tbody td{padding:15px 20px;border-bottom:1px solid var(--hairline);font-size:14.5px}
tbody tr:last-child td{border-bottom:0}
tbody tr{transition:background .18s}
tbody tr:hover{background:var(--surface-sunken)}
td.r{text-align:right;font-family:var(--mono)}
.initials{width:28px;height:28px;border-radius:50%;background:var(--taupe-tint);
  border:1px solid var(--taupe);display:inline-grid;place-items:center;font-size:11.5px;
  font-weight:700;color:var(--ink-3);margin-right:10px;vertical-align:middle}

.seg{display:inline-flex;background:var(--board-column);padding:3px;border-radius:10px;gap:2px}
.seg button{border:0;background:none;color:var(--muted);padding:7px 15px;border-radius:8px;
  box-shadow:none;font-size:13.5px}
.seg button:hover{transform:none}
.seg button[aria-selected=true]{background:var(--surface);color:var(--ink)}

.livedot{width:7px;height:7px;border-radius:50%;background:var(--taupe);display:inline-block}
.livepill{display:inline-flex;align-items:center;gap:7px;background:var(--tint-neutral);
  border-radius:999px;padding:5px 12px;font-size:12.5px;color:var(--ink-2)}

.empty{padding:26px 2px;color:var(--muted);font-size:14px}
.empty b{display:block;font-family:var(--serif);font-size:22px;color:var(--ink);margin-bottom:4px}

dialog{border:1px solid var(--border);border-radius:20px;padding:0;max-width:640px;width:94%;
  background:var(--surface);color:var(--ink)}
dialog::backdrop{background:rgba(23,27,37,.5)}

@media(max-width:900px){
  .shell{flex-direction:column}
  .rail{position:static;width:100%;height:auto;flex-direction:row;overflow-x:auto;
    border-right:0;border-bottom:1px solid var(--border);padding:10px}
  .rail .logo{margin:0 10px 0 0}
  .rail .spacer{display:none}
  .page{padding:20px}
  .grid2{grid-template-columns:1fr!important}
}
