/* ==========================================================================
   Maruti Infra PEB LLP — design system
   Steel-plant palette: cool graphite ink, structural blue, molten amber.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700&family=Inter+Tight:wght@400;500;600;700&display=swap');

:root {
  /* surfaces */
  --bg:          #eef1f7;
  --bg-grain:    #e7ebf3;
  --surface:     #ffffff;
  --surface-2:   #f5f7fc;
  --surface-3:   #eceff7;
  --line:        #dfe4ef;
  --line-2:      #ccd3e3;

  /* ink */
  --ink:         #0f1626;
  --ink-2:       #3a4560;
  --ink-3:       #6b7694;
  --ink-4:       #9aa4bf;

  /* brand */
  --blue:        #2347d9;
  --blue-deep:   #16309b;
  --blue-soft:   #e7ebfd;
  --violet:      #6d3bd4;
  --amber:       #e07c05;
  --amber-soft:  #fdf1dd;
  --green:       #0f7a46;
  --green-soft:  #e2f5eb;
  --red:         #c92a3a;
  --red-soft:    #fdeaec;
  --cyan:        #0a7490;

  /* stage colours, used everywhere a stage appears */
  --s-inquiry:   #64748b;
  --s-quote:     #0a7490;
  --s-po:        #0d8a7a;
  --s-advance:   #0f7a46;
  --s-drawing:   #4f46e5;
  --s-nesting:   #9333ea;
  --s-fitting:   #d4327c;
  --s-painting:  --amber;
  --s-dispatch:  #b45309;
  --s-billing:   #a16207;
  --s-collect:   #3f6212;

  --font-display: 'Sora', system-ui, sans-serif;
  --font-ui: 'Inter Tight', system-ui, sans-serif;

  --sh-1: 0 1px 2px rgb(15 22 38 / .05), 0 1px 1px rgb(15 22 38 / .03);
  --sh-2: 0 4px 12px rgb(15 22 38 / .07), 0 2px 4px rgb(15 22 38 / .04);
  --sh-3: 0 18px 44px rgb(15 22 38 / .12), 0 4px 12px rgb(15 22 38 / .06);
  --sh-blue: 0 8px 22px rgb(35 71 217 / .26), 0 2px 6px rgb(35 71 217 / .2);

  --r1: 10px; --r2: 14px; --r3: 20px;
  --nav: 248px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: var(--font-ui);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv05','ss03';
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--blue-soft); }
.hidden { display: none !important; }

/* thin, quiet scrollbars */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--ink-4); background-clip: content-box; }

.icn { display: inline-flex; width: var(--sz,18px); height: var(--sz,18px); flex: none; vertical-align: -3px; }
.icn svg { width: 100%; height: 100%; }
.num { font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Shell
   ========================================================================== */
.shell { display: grid; grid-template-columns: var(--nav) 1fr; min-height: 100dvh; }

.nav {
  position: sticky; top: 0; height: 100dvh;
  background: linear-gradient(177deg, #141c30 0%, #0d1424 60%, #121a2d 100%);
  color: #cdd6ea;
  display: flex; flex-direction: column;
  padding: 18px 12px 14px;
  overflow: hidden;
}
.nav::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(rgb(255 255 255 / .05) 1px, transparent 1px);
  background-size: 22px 22px; pointer-events: none;
}
.nav > * { position: relative; }

.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 20px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, var(--blue) 0%, var(--violet) 100%);
  box-shadow: 0 6px 16px rgb(35 71 217 / .45);
}
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: #fff; letter-spacing: -.01em; line-height: 1.2; }
.brand-sub { font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: #76839f; font-weight: 600; margin-top: 1px; }

.nav-scroll { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.nav-scroll::-webkit-scrollbar { width: 0; }
.nav-group { font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: #5d6a86; font-weight: 700; padding: 16px 10px 7px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: var(--r1);
  color: #b3bdd4; font-weight: 500; font-size: 13.5px;
  transition: background .16s, color .16s, transform .16s;
  position: relative;
}
.nav-item:hover { background: rgb(255 255 255 / .06); color: #fff; transform: translateX(2px); }
.nav-item.on { background: rgb(255 255 255 / .1); color: #fff; font-weight: 600; }
.nav-item.on::before {
  content: ''; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px;
  border-radius: 0 4px 4px 0; background: linear-gradient(var(--blue), var(--violet));
}
.nav-item .icn { color: #8b97b4; }
.nav-item.on .icn, .nav-item:hover .icn { color: #fff; }
.nav-count { margin-left: auto; font-size: 10.5px; font-weight: 700; background: rgb(255 255 255 / .12); padding: 1px 7px; border-radius: 20px; }
.nav-count.hot { background: var(--red); color: #fff; }

.nav-foot { border-top: 1px solid rgb(255 255 255 / .09); padding-top: 12px; margin-top: 6px; }
.nav-user { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
.nav-user .who { min-width: 0; }
.nav-user .nm { font-size: 12.5px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-user .rl { font-size: 10.5px; color: #76839f; text-transform: capitalize; }
.nav-out { margin-left: auto; color: #76839f; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; transition: background .15s, color .15s; }
.nav-out:hover { background: rgb(255 255 255 / .1); color: #fff; }

/* main column */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 28px;
  background: rgb(238 241 247 / .82);
  backdrop-filter: blur(14px) saturate(1.6);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.topbar.stuck { border-bottom-color: var(--line); box-shadow: 0 6px 18px rgb(15 22 38 / .05); }
.crumb { font-size: 11.5px; color: var(--ink-3); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.crumb a:hover { color: var(--blue); }
.ttl { font-family: var(--font-display); font-size: 21px; font-weight: 600; letter-spacing: -.025em; line-height: 1.2; }
.sub { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.page { padding: 4px 28px 96px; max-width: 1560px; width: 100%; margin: 0 auto; }
.menu-btn { display: none; }

/* two columns that fold into one when the window is narrow */
.two { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.stack { display: grid; gap: 16px; }
.two > *, .stack > * { min-width: 0; }   /* a wide table scrolls inside its card, never pushes the column */
@media (max-width: 1240px) { .two { grid-template-columns: 1fr; } }

/* ==========================================================================
   Primitives
   ========================================================================== */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r3); box-shadow: var(--sh-1); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px 0; }
.card-h h3 { font-family: var(--font-display); font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; }
.card-h .sp { flex: 1; }
.card-b { padding: 14px 20px 18px; }
.hint { color: var(--ink-3); font-size: 12.5px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8.5px 15px; border-radius: var(--r1);
  border: 1px solid var(--line-2); background: var(--surface);
  font-weight: 600; font-size: 13px; color: var(--ink);
  box-shadow: var(--sh-1);
  transition: transform .16s cubic-bezier(.34,1.5,.64,1), box-shadow .16s, background .16s, border-color .16s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1.5px); box-shadow: var(--sh-2); border-color: var(--ink-4); }
.btn:active { transform: translateY(0) scale(.98); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-p { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: var(--sh-blue); }
.btn-p:hover { background: var(--blue-deep); border-color: var(--blue-deep); }
.btn-g { background: var(--green); border-color: var(--green); color: #fff; }
.btn-d { background: var(--red); border-color: var(--red); color: #fff; }
.btn-q { border-color: transparent; box-shadow: none; background: transparent; color: var(--ink-2); }
.btn-q:hover { background: var(--surface-3); box-shadow: none; transform: none; }
.btn-s { padding: 5.5px 11px; font-size: 12px; border-radius: 8px; }
.btn-xs { padding: 4px 9px; font-size: 11.5px; border-radius: 7px; }
.btn-blk { width: 100%; }

.ibtn { width: 32px; height: 32px; border-radius: 9px; display: inline-grid; place-items: center;
        vertical-align: middle; color: var(--ink-3); transition: background .15s, color .15s; }
.ibtn:hover { background: var(--surface-3); color: var(--ink); }
.ibtn.danger:hover { background: var(--red-soft); color: var(--red); }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 20px;
  background: color-mix(in srgb, var(--c, var(--blue)) 10%, white);
  color: var(--c, var(--blue));
  border: 1px solid color-mix(in srgb, var(--c, var(--blue)) 22%, white);
  white-space: nowrap;
}
.pill-s { font-size: 10px; padding: 1.5px 7px; }
.tag { font-size: 11px; color: var(--ink-3); background: var(--surface-3); border: 1px solid var(--line); border-radius: 6px; padding: 1.5px 7px; font-weight: 500; }

.av { border-radius: 11px; display: grid; place-items: center; font-weight: 700; flex: none; letter-spacing: -.02em; }

/* ==========================================================================
   KPI band
   ========================================================================== */
.kpis { display: grid; gap: 13px; margin-bottom: 18px; }
.kpis.k4 { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
.kpis.k3 { grid-template-columns: 1.3fr 1fr 1fr; }
.kpi { position: relative; overflow: hidden; padding: 16px 18px 15px; transition: transform .2s, box-shadow .2s; }
.kpi:hover { transform: translateY(-3px); box-shadow: var(--sh-2); }
.kpi-l { display: flex; align-items: center; gap: 7px; font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.kpi-v { font-family: var(--font-display); font-size: 29px; font-weight: 600; letter-spacing: -.03em; margin-top: 7px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.kpi-f { font-size: 11.5px; color: var(--ink-3); margin-top: 5px; }
.kpi-hero {
  border: none; color: #fff;
  background: linear-gradient(135deg, #1b2f9e 0%, var(--blue) 48%, #5c3ad0 100%);
  box-shadow: var(--sh-blue);
}
.kpi-hero .kpi-l, .kpi-hero .kpi-f { color: rgb(255 255 255 / .74); }
.kpi-hero::after { content: ''; position: absolute; right: -38px; top: -38px; width: 136px; height: 136px; border-radius: 50%; background: rgb(255 255 255 / .09); }
.kpi-hero::before { content: ''; position: absolute; right: 14px; bottom: -56px; width: 108px; height: 108px; border-radius: 50%; background: rgb(255 255 255 / .06); }

/* ==========================================================================
   Flow rail — the project's journey, shown as a track
   ========================================================================== */
.rail { display: flex; align-items: stretch; gap: 0; overflow-x: auto; padding: 4px 2px; }
.rail-step { flex: 1; min-width: 104px; position: relative; padding: 2px 6px 0; text-align: center; }
.rail-step::before {
  content: ''; position: absolute; top: 17px; left: -50%; width: 100%; height: 2.5px;
  background: var(--line-2); z-index: 0;
}
.rail-step:first-child::before { display: none; }
.rail-step.ok::before, .rail-step.now::before { background: var(--c); }
.rail-dot {
  width: 34px; height: 34px; border-radius: 50%; margin: 0 auto; position: relative; z-index: 1;
  display: grid; place-items: center;
  background: var(--surface); border: 2.5px solid var(--line-2); color: var(--ink-4);
  transition: all .25s;
}
.rail-step.ok .rail-dot { background: var(--c); border-color: var(--c); color: #fff; }
.rail-step.now .rail-dot { border-color: var(--c); color: var(--c); animation: ring 2.4s infinite; }
@keyframes ring {
  0%,100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 16%, white); }
  50%     { box-shadow: 0 0 0 9px color-mix(in srgb, var(--c) 7%, white); }
}
.rail-l { font-size: 10.5px; font-weight: 700; margin-top: 7px; color: var(--ink-4); letter-spacing: .01em; }
.rail-step.ok .rail-l, .rail-step.now .rail-l { color: var(--ink-2); }
.rail-h { font-size: 10px; color: var(--ink-4); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* a step you can act on: pressing it opens that very step's form */
button.rail-step { background: none; border: 0; font: inherit; cursor: pointer; }
.rail-step.go:hover .rail-dot, .rail-step.go:focus-visible .rail-dot { border-color: var(--c); color: var(--c); transform: scale(1.09); }
.rail-step.go.ok:hover .rail-dot, .rail-step.go.ok:focus-visible .rail-dot { color: #fff; }
.rail-go {
  font-size: 9.5px; font-weight: 700; letter-spacing: .02em; color: var(--c);
  margin-top: 3px; opacity: 0; transition: opacity .18s;
  display: inline-flex; align-items: center; gap: 2px; white-space: nowrap;
}
.rail-step.go.now .rail-go { opacity: 1; }                 /* the step that is waiting says so */
.rail-step.go:hover .rail-go, .rail-step.go:focus-visible .rail-go { opacity: 1; }
@media (hover: none) { .rail-step.go .rail-go { opacity: .85; } }   /* on a phone there is no hover */

/* ==========================================================================
   Production — the quantity ladder
   ========================================================================== */
.ladder { display: flex; height: 9px; border-radius: 6px; overflow: hidden; background: var(--surface-3); }
.ladder i { display: block; transition: width .5s cubic-bezier(.22,.9,.32,1); }
.ladder-key { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 7px; font-size: 10.5px; color: var(--ink-3); }
.ladder-key span { display: inline-flex; align-items: center; gap: 4px; }
.ladder-key i { width: 8px; height: 8px; border-radius: 3px; }

.stage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 12px; }
.pcard {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2);
  padding: 14px; transition: transform .18s, box-shadow .18s, border-color .18s;
  position: relative; overflow: hidden;
}
.pcard:hover { transform: translateY(-3px); box-shadow: var(--sh-2); border-color: var(--line-2); }
.pcard::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c, var(--line-2)); }
.pcard-top { display: flex; align-items: flex-start; gap: 10px; }
.pcard-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--c, var(--blue)); flex: none; }
.pcard-nm { font-weight: 600; font-size: 13px; line-height: 1.3; }
.pcard-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.pcard-big { display: flex; align-items: baseline; gap: 6px; margin-top: 11px; }
.pcard-big b { font-family: var(--font-display); font-size: 25px; font-weight: 600; line-height: 1; letter-spacing: -.03em; }
.pcard-big span { font-size: 11.5px; color: var(--ink-3); }
.pcard-act { margin-top: 11px; display: flex; gap: 6px; }
.pcard-act .btn { flex: 1; }

/* ==========================================================================
   Pieces — COL1-1, COL1-2 … every physical piece shows its own stage
   ========================================================================== */
/* a project block on a plant screen: the header opens and closes it */
.pgroup-h { cursor: pointer; padding-bottom: 16px; user-select: none; }
.pgroup-h:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; border-radius: var(--r3); }
.pgroup-h:hover h3 { color: var(--blue); }
.pgroup-chev { transition: transform .2s; color: var(--ink-4); flex: none; }
.pgroup.open .pgroup-chev { transform: rotate(90deg); }
.pgroup-b { border-top: 1px solid var(--line); }
.pgroup[hidden] { display: none; }
.pitem[hidden] { display: none; }

/* the drawing pinned to one product, shown wherever that product is listed */
.pdrg { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pdrg .btn { --c: var(--violet); }
.pdrg .btn[data-file] { border-color: color-mix(in srgb, var(--violet) 30%, white); color: var(--violet); }
.pdrg .btn.busy { opacity: .6; pointer-events: none; }

.pchips { display: flex; flex-wrap: wrap; gap: 5px; }
.pchip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; color: var(--ink-2);
  border: 1.5px solid var(--line-2); background: var(--surface);
  border-radius: 9px; padding: 4px 9px 4px 8px;
  transition: transform .14s, border-color .14s, background .14s;
}
.pchip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; }
.pchip i { font-style: normal; font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--c); }
.pchip.pick { cursor: pointer; }
.pchip.pick:hover { border-color: var(--c); transform: translateY(-1px); }
.pchip.sel { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, white); color: var(--ink); }
.pchip.sel::before { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, white); }
.pchip[disabled] { opacity: .45; }

/* finished on this screen and moved on — the green light */
.pchip.done { --c: #0f7a46; border-color: color-mix(in srgb, #0f7a46 32%, white); background: #f1f9f4; color: #14613d; }
.pchip.done::before { background: #0f7a46; box-shadow: 0 0 0 2.5px color-mix(in srgb, #0f7a46 18%, white); }
.pchip.done svg { color: #0f7a46; margin-right: -2px; }
.pchip.done.pick:hover { border-color: #0f7a46; }

.st-pending    { --c: #9aa4bf; }
.st-nested     { --c: #9333ea; }
.st-fitted     { --c: #d4327c; }
.st-painted    { --c: #e07c05; }
.st-dispatched { --c: #0f7a46; }

/* the bar that appears once pieces are ticked */
/* Fixed, not sticky: the bar is written into a bare wrapper at the very end of the page, which gives a
   sticky box no room to slide in, so it silently fell to the bottom of the document — off-screen. */
.pickbar {
  position: fixed; left: max(16px, calc(var(--nav) + 16px)); right: 16px; bottom: 14px; z-index: 40;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--ink); color: #fff; border-radius: 14px;
  padding: 10px 14px; margin-top: 12px; box-shadow: var(--sh-3);
}
.pickbar b { font-family: var(--font-display); font-size: 14px; }
@media (max-width: 920px) { .pickbar { left: 16px; right: 16px; bottom: 10px; } }
.pickbar .btn { border-color: transparent; }

/* ==========================================================================
   Tables
   ========================================================================== */
.tw { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); }
table.t { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 13px; }
.tw.wide table.t { min-width: 940px; }
table.t th {
  text-align: left; font-size: 10px; letter-spacing: .11em; text-transform: uppercase;
  color: var(--ink-4); font-weight: 700; padding: 10px 14px;
  background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.t td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tbody tr { transition: background .14s; }
table.t tbody tr:hover { background: var(--surface-2); }
table.t tbody tr:last-child td { border-bottom: none; }
table.t td.r, table.t th.r { text-align: right; }
table.t .lead { font-weight: 600; }
.row-link { cursor: pointer; }

/* ==========================================================================
   Forms
   ========================================================================== */
.f { display: flex; flex-direction: column; gap: 5px; margin-bottom: 13px; }
.f > label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.f input, .f select, .f textarea {
  border: 1px solid var(--line-2); border-radius: var(--r1); padding: 9px 12px;
  background: var(--surface); outline: none; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.f input:focus, .f select:focus, .f textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.f input[readonly] { background: var(--surface-2); color: var(--ink-3); }
.f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.f3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.err { color: var(--red); font-size: 12.5px; font-weight: 600; min-height: 18px; }
.err b { display: block; }
.err small { display: block; font-weight: 500; color: var(--ink-3); margin-top: 3px; }

/* number stepper */
.stepper { display: flex; align-items: center; gap: 7px; }
.stepper input { width: 92px; text-align: center; font-size: 18px; font-weight: 700; padding: 8px; }
.sbtn { width: 34px; height: 38px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface); font-size: 17px; font-weight: 600; color: var(--ink-2); transition: all .15s; }
.sbtn:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }

/* pick chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; padding: 6px 11px; border-radius: 9px;
  border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink-2);
  transition: all .15s; user-select: none;
}
.chip:hover { border-color: var(--blue); color: var(--blue-deep); }
.chip.on { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-deep); }
.chip .icn { color: currentColor; }

/* file picker */
.drop {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  border: 1.5px dashed var(--line-2); border-radius: var(--r2); padding: 12px 14px;
  background: var(--surface-2); color: var(--ink-3); font-size: 12.5px; font-weight: 500;
  transition: all .16s;
}
.drop:hover { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-deep); }
.filelist { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.fchip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  border: 1px solid var(--line-2); background: var(--surface); border-radius: 9px;
  padding: 5px 10px; font-size: 11.5px; font-weight: 600; color: var(--ink-2); cursor: pointer;
  transition: all .15s;
}
.fchip:hover { border-color: var(--blue); color: var(--blue-deep); transform: translateY(-1px); }
.fchip .icn { color: var(--blue); flex: none; }
.fchip b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 170px; }
.fchip small { color: var(--ink-4); font-weight: 500; }

/* ==========================================================================
   Modal
   ========================================================================== */
.scrim {
  position: fixed; inset: 0; z-index: 60;
  background: rgb(15 22 38 / .45); backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 20px;
  opacity: 0; transition: opacity .22s;
}
.scrim.in { opacity: 1; }
.modal {
  width: min(520px, 100%); max-height: 90dvh; display: flex; flex-direction: column;
  background: var(--surface); border-radius: 22px; box-shadow: var(--sh-3);
  transform: translateY(14px) scale(.975); transition: transform .26s cubic-bezier(.34,1.4,.64,1);
}
.scrim.in .modal { transform: none; }
.modal.w { width: min(720px, 100%); }
.modal.xw { width: min(1020px, 100%); }
.modal-h { display: flex; align-items: flex-start; gap: 10px; padding: 20px 22px 6px; }
.modal-h h3 { font-family: var(--font-display); font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
.modal-h p { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.modal-b { padding: 14px 22px 6px; overflow-y: auto; }
.modal-f { padding: 12px 22px 20px; display: flex; justify-content: flex-end; gap: 9px; }

/* ==========================================================================
   Toast
   ========================================================================== */
#toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  display: flex; align-items: center; gap: 9px;
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 500;
  padding: 11px 18px; border-radius: 30px; box-shadow: var(--sh-3);
  opacity: 0; transform: translateY(14px); transition: opacity .3s, transform .3s cubic-bezier(.34,1.5,.64,1);
}
.toast.in { opacity: 1; transform: none; }
.toast.good .icn { color: #5fe0a0; }
.toast.bad { background: var(--red); }

/* ==========================================================================
   Alerts / empty / loading
   ========================================================================== */
.arow { display: flex; gap: 11px; padding: 11px 18px; border-top: 1px solid var(--line); align-items: flex-start; transition: background .14s; }
.arow:first-child { border-top: none; }
.arow.clickable { cursor: pointer; }
.arow.clickable:hover { background: var(--surface-2); }
.aico { width: 31px; height: 31px; border-radius: 9px; display: grid; place-items: center; flex: none; margin-top: 1px; }
.t-warn .aico { background: var(--amber-soft); color: var(--amber); }
.t-bad .aico  { background: var(--red-soft); color: var(--red); }
.t-good .aico { background: var(--green-soft); color: var(--green); }
.t-info .aico { background: var(--blue-soft); color: var(--blue); }
.atxt { font-size: 12.8px; font-weight: 600; line-height: 1.35; }
.asub { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }

.empty { text-align: center; padding: 42px 20px; color: var(--ink-3); }
.empty .icn { color: var(--ink-4); }
.empty h4 { font-family: var(--font-display); font-size: 16px; color: var(--ink-2); margin: 11px 0 4px; font-weight: 600; }
.empty p { font-size: 13px; max-width: 330px; margin: 0 auto; }

.loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 64px 0; color: var(--ink-3); font-size: 13px; }
.spin { width: 21px; height: 21px; border-radius: 50%; border: 2.5px solid var(--line-2); border-top-color: var(--blue); animation: rot .75s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* timeline */
.tl { padding: 4px 18px 14px; }
.tl-i { display: flex; gap: 12px; position: relative; padding: 8px 0; }
.tl-i::before { content: ''; position: absolute; left: 13px; top: 32px; bottom: -4px; width: 2px; background: var(--line); }
.tl-i:last-child::before { display: none; }
.tl-d { width: 27px; height: 27px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink-2); flex: none; z-index: 1; }
.tl-t { font-size: 12.5px; line-height: 1.4; }
.tl-m { font-size: 10.5px; color: var(--ink-4); margin-top: 1px; }

/* filters */
.filters { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; margin-bottom: 15px; }
.fpill { border: 1px solid var(--line-2); background: var(--surface); border-radius: 20px; padding: 6px 13px; font-size: 12px; font-weight: 600; color: var(--ink-2); transition: all .15s; }
.fpill:hover { border-color: var(--ink-4); }
.fpill.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 20px; padding: 6px 14px; min-width: 210px; }
.search input { border: none; outline: none; background: none; flex: 1; font-size: 13px; }
.search .icn { color: var(--ink-4); }

/* entrance */
[data-in] { opacity: 0; transform: translateY(14px); }
[data-in].vis { opacity: 1; transform: none; transition: opacity .5s ease var(--d,0ms), transform .5s cubic-bezier(.22,.9,.32,1) var(--d,0ms); }

/* ==========================================================================
   Sign in
   ========================================================================== */
.signin { min-height: 100dvh; display: grid; grid-template-columns: 1.05fr .95fr; }
.signin-art {
  position: relative; overflow: hidden; padding: 46px 52px; color: #fff;
  display: flex; flex-direction: column;
  background:
    radial-gradient(900px 520px at -8% -15%, rgb(109 59 212 / .5), transparent 58%),
    radial-gradient(760px 540px at 108% 112%, rgb(10 116 144 / .45), transparent 56%),
    linear-gradient(152deg, #101a3d 0%, #1b2f9e 55%, #3d2bb5 100%);
}
.signin-art::after {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(rgb(255 255 255 / .12) 1px, transparent 1px);
  background-size: 26px 26px; opacity: .45;
}
.signin-art > * { position: relative; z-index: 1; }
.signin-art h1 { font-family: var(--font-display); font-size: clamp(2rem, 3.3vw, 3rem); font-weight: 600; line-height: 1.08; letter-spacing: -.03em; margin-top: auto; max-width: 520px; }
.signin-art h1 em { font-style: normal; background: linear-gradient(100deg, #ffd089, #ffb04d); -webkit-background-clip: text; background-clip: text; color: transparent; }
.signin-art p { margin-top: 16px; max-width: 420px; color: rgb(255 255 255 / .76); font-size: 14px; }
.flowtags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 24px; max-width: 540px; }
.flowtags span { font-size: 10.5px; font-weight: 600; letter-spacing: .04em; border: 1px solid rgb(255 255 255 / .22); background: rgb(255 255 255 / .09); padding: 4px 10px; border-radius: 20px; backdrop-filter: blur(6px); }
.signin-form { display: grid; place-items: center; padding: 40px 28px; background: var(--bg); }
.signin-box { width: min(380px, 100%); }
.signin-box h2 { font-family: var(--font-display); font-size: 25px; font-weight: 600; letter-spacing: -.025em; }
.signin-box > p { color: var(--ink-3); font-size: 13.5px; margin: 5px 0 24px; }
.pw { position: relative; display: flex; }
.pw input { padding-right: 42px; }
.pw-eye { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: var(--ink-4); transition: all .15s; }
.pw-eye:hover { color: var(--ink-2); background: var(--surface-3); }
.pw-eye.on { color: var(--blue); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1180px) {
  .kpis.k4 { grid-template-columns: 1fr 1fr; }
  .kpis.k3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) { .kpis.k3 { grid-template-columns: 1fr; } }
@media (max-width: 920px) {
  /* on a phone the title keeps the row and the buttons drop to their own line */
  .topbar { flex-wrap: wrap; row-gap: 9px; padding-top: 11px; padding-bottom: 11px; }
  .tbar-title { flex: 1 1 auto; }
  .ttl { font-size: 18px; }
  .top-right { order: 3; width: 100%; margin-left: 0; }
  .top-right .btn { flex: 1; justify-content: center; }
  .filters { gap: 6px; }

  .shell { grid-template-columns: 1fr; }
  .nav { position: fixed; z-index: 70; width: 262px; transform: translateX(-100%); transition: transform .25s; }
  .nav.open { transform: none; box-shadow: var(--sh-3); }
  .menu-btn { display: grid; }
  .page, .topbar { padding-left: 16px; padding-right: 16px; }
  .signin { grid-template-columns: 1fr; }
  .signin-art { min-height: 30dvh; padding: 26px; }
  .f2, .f3 { grid-template-columns: 1fr; }
  .kpis.k4 { grid-template-columns: 1fr; }

  /* the search gets the whole row on a phone instead of being squeezed beside the filter pills */
  .filters .search { margin-left: 0 !important; width: 100%; min-width: 0; }

  /* On a phone a card header has no room for a name, two pills and a button on one row. The title
     block keeps the first line to itself and everything else drops below it, so a client's name is
     never squeezed into one word per line. */
  .card-h { flex-wrap: wrap; row-gap: 8px; }
  .card-h > div:first-of-type, .card-h > div:nth-child(2) { flex: 1 1 100%; min-width: 0; }
  .card-h .sp { display: none; }
}
