/* ==========================================================================
   Apheris inventory - styles
   Tokens from the Apheris master deck (agents/skills/internal-presentation/
   references/design-tokens.md). Dark teal dominant, accent teal for
   highlights, coral ONLY for warnings, sentence-case titles, Univers -> Inter.
   ========================================================================== */

@font-face { font-family: "Univers"; src: local("Univers"), local("Univers-Regular"), local("UniversLTStd"); font-weight: 400; }
@font-face { font-family: "Univers"; src: local("Univers Bold"), local("Univers-Bold"), local("UniversLTStd-Bold"); font-weight: 700; }
@font-face { font-family: "Univers Light"; src: local("Univers Light"), local("Univers-Light"), local("UniversLTStd-Light"); font-weight: 300; }

:root {
  --dark: #20484D;          /* dk1  primary */
  --darkest: #1C423F;       /* gradient end */
  --teal: #429099;          /* accent5 accent teal */
  --teal-pale: #CEE7EA;     /* accent4 */
  --fog: #E9ECEC;           /* accent1 off-white */
  --grey-fill: #F2F2F2;     /* box fill */
  --border: #DADEDE;        /* header rule */
  --text: #000000;          /* body text: black (preferred over the deck's grey) */
  --body: var(--text);
  --muted: var(--text);     /* secondary text is black too, just smaller */
  --coral: #E84661;         /* warnings only */
  --purple: #5B567D;
  --yellow: #FBAE40;
  --orange: #F26B43;
  --white: #FFFFFF;

  --shadow: 2px 2px 4px rgba(32, 72, 77, 0.20); /* brand box shadow, bottom-right */
  --radius: 8px;
  --font-head: "Univers", "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Univers Light", "Inter", "Helvetica Neue", Arial, sans-serif;
  --sidebar-w: 248px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.5;
  color: var(--body);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--dark); }
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--dark); font-weight: 500; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 28px; line-height: 1.2; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
.material-symbols-outlined { font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 24; font-size: 20px; line-height: 1; vertical-align: middle; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; letter-spacing: 0; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.small { font-size: 12px; }
.hidden { display: none !important; }

/* ---------- Layout ------------------------------------------------------ */
.app { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--dark) 0%, var(--darkest) 100%);
  color: var(--white); display: flex; flex-direction: column;
  padding: 28px 16px 20px; overflow: hidden; z-index: 20;
}
.sidebar::after { /* brand sunburst, bleeding off the bottom-left */
  content: ""; position: absolute; width: 520px; height: 520px; left: -260px; bottom: -300px;
  background: url("brand/decor-1.svg") center / contain no-repeat;
  filter: invert(1); opacity: 0.10; pointer-events: none;
}
.brand { display: block; padding: 0 12px 28px; }
.brand img { width: 120px; height: 19px; display: block; }
.brand span { display: block; margin-top: 6px; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--white); }

.nav { list-style: none; margin: 0; padding: 0; position: relative; z-index: 1; }
.nav-label { font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--white); padding: 18px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 6px;
  color: var(--white); font-family: var(--font-head); font-size: 14px; position: relative;
}
.nav a:hover { background: rgba(255,255,255,0.06); color: var(--white); }
.nav a.active { background: rgba(255,255,255,0.10); color: var(--white); }
.nav a.active::before { content: ""; position: absolute; left: -16px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--teal); }
.nav .count { margin-left: auto; font-size: 11.5px; color: var(--white); font-family: var(--font-body); }
.sidebar-foot { margin-top: auto; padding: 12px; font-size: 11.5px; color: var(--white); position: relative; z-index: 1; }

.main { margin-left: var(--sidebar-w); flex: 1; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,0.92); backdrop-filter: blur(6px);
  display: flex; align-items: center; gap: 16px; padding: 14px 40px; border-bottom: 1px solid var(--fog);
}
.search { position: relative; flex: 0 1 420px; }
.search input[type=search] { padding-left: 38px; background: var(--grey-fill); border-color: transparent; }
.search input[type=search]:focus { background: var(--white); }
.search .material-symbols-outlined { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

.content { padding: 32px 40px 64px; position: relative; }

/* ---------- Page header (deck-style rule with teal end dot) ------------- */
.page-head { display: flex; align-items: flex-end; gap: 24px; margin-bottom: 8px; }
.page-head .titles { flex: 1; min-width: 0; }
.kicker { font-size: 11px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--teal); margin-bottom: 8px; font-family: var(--font-head); }
.subtitle { margin-top: 6px; color: var(--body); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.header-rule { position: relative; height: 1px; background: var(--border); margin: 18px 0 28px; }
.header-rule::after { content: ""; position: absolute; right: 0; top: -2.5px; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }

.decor-rings { position: absolute; right: -180px; top: -120px; width: 520px; height: 520px; opacity: 0.14; pointer-events: none; z-index: 0; }
.content > *:not(.decor-rings) { position: relative; z-index: 1; }

/* ---------- Cards & grid ------------------------------------------------ */
.grid { display: grid; gap: 24px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr); align-items: start; }
@media (max-width: 1200px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-main, .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .grid-4, .grid-2 { grid-template-columns: 1fr; } }

.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; border: 1px solid rgba(32,72,77,0.05); }
.card.flat { box-shadow: none; background: var(--grey-fill); border-color: transparent; }
.card.pale { box-shadow: none; background: var(--teal-pale); border-color: transparent; }
.card.dark { background: var(--dark); color: var(--white); box-shadow: none; }
.card.dark h2 { color: var(--white); }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head h2 { flex: 1; }
.card-head a { font-size: 12.5px; }
.card.pad-0 { padding: 0; }
.card.pad-0 .card-head { padding: 20px 24px 0; }
.stack > * + * { margin-top: 24px; }

/* KPI */
.kpi { display: block; color: inherit; transition: transform .15s ease; position: relative; overflow: hidden; }
a.kpi:hover { transform: translateY(-2px); color: inherit; }
.kpi .icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--fog); color: var(--dark); margin-bottom: 14px; }
.kpi .label { font-family: var(--font-head); color: var(--dark); font-size: 14px; }
.kpi .value { font-family: var(--font-head); font-size: 42px; font-weight: 300; color: var(--dark); line-height: 1.1; margin: 4px 0 10px; letter-spacing: -0.02em; }
.kpi .value small { font-size: 14px; color: var(--muted); font-weight: 400; letter-spacing: 0; margin-left: 4px; }
.kpi .split { display: flex; gap: 14px; font-size: 12.5px; flex-wrap: wrap; }
.kpi .split b { font-family: var(--font-head); font-weight: 500; color: var(--dark); }
.bar { height: 6px; border-radius: 3px; background: var(--fog); overflow: hidden; display: flex; margin-top: 14px; }
.bar i { display: block; height: 100%; }

/* Horizontal data bars (dashboard) */
.hbars { display: grid; gap: 12px; }
.hbar { display: grid; grid-template-columns: 110px 1fr 40px; align-items: center; gap: 12px; font-size: 13px; }
.hbar .track { height: 10px; border-radius: 5px; background: var(--fog); overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 5px; background: var(--teal); }
.hbar .n { text-align: right; font-family: var(--font-head); color: var(--dark); }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--fog); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { color: var(--dark); font-family: var(--font-head); }
.list .sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Attention panel (coral reserved for warnings) */
.issue { border-left: 3px solid var(--coral); padding: 2px 0 2px 14px; }
.issue + .issue { margin-top: 18px; }
.issue h3 { display: flex; align-items: center; gap: 8px; }
.issue h3 .n { background: #FCE4E8; color: #B92D45; font-size: 11.5px; border-radius: 999px; padding: 1px 8px; font-family: var(--font-body); }
.issue p { margin: 2px 0 6px; font-size: 12.5px; color: var(--muted); }
.issue .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.issue .chips a { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--grey-fill); color: var(--dark); }
.issue .chips a:hover { background: var(--teal-pale); }
.all-good { display: flex; gap: 10px; align-items: center; color: var(--teal); }

/* ---------- Badges ------------------------------------------------------ */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 8px; border-radius: 999px; font-size: 12px; white-space: nowrap; font-family: var(--font-head); line-height: 1.6; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tone-teal   { background: var(--teal-pale); color: var(--dark); }
.tone-teal::before { background: var(--teal); }
.tone-dark  { background: var(--dark); color: var(--white); }
.tone-dark::before { background: #7FD3DC; }
.tone-purple { background: #E7E6EF; color: var(--purple); }
.tone-coral  { background: #FCE4E8; color: #B92D45; }
.tone-orange { background: #FDEBE3; color: #B5461F; }
.tone-grey   { background: var(--grey-fill); color: var(--muted); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 4px; background: var(--fog); color: var(--dark); font-size: 12px; }
.tag.coral { background: #FCE4E8; color: #B92D45; }

/* ---------- Buttons ----------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 16px; border-radius: 6px;
  font-family: var(--font-head); font-size: 13.5px; cursor: pointer; border: 1px solid var(--dark);
  background: var(--white); color: var(--dark); transition: background .15s, color .15s, border-color .15s; white-space: nowrap;
}
.btn:hover { background: var(--fog); color: var(--dark); }
.btn.primary { background: var(--dark); color: var(--white); }
.btn.primary:hover { background: var(--teal); border-color: var(--teal); color: var(--white); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--grey-fill); }
.btn.danger { border-color: var(--coral); color: #B92D45; }
.btn.danger:hover { background: #FCE4E8; }
.btn.sm { height: 30px; padding: 0 12px; font-size: 12.5px; }
.btn.block { width: 100%; justify-content: center; }
.btn .material-symbols-outlined { font-size: 18px; }

/* ---------- Forms ------------------------------------------------------- */
input[type=text], input[type=search], input[type=date], input[type=email], input[type=number], select, textarea {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--border); border-radius: 6px;
  font: inherit; color: var(--dark); background: var(--white); transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(66,144,153,0.18); }
label { display: block; font-family: var(--font-head); color: var(--dark); font-size: 13px; margin-bottom: 6px; }
.field { margin-bottom: 18px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 760px) { .form-grid { grid-template-columns: 1fr; } }
.form-section + .form-section { margin-top: 8px; }
.form-section h2 { margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.form-section h2::after { content: ""; flex: 1; height: 1px; background: var(--fog); }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.form-actions .spacer { flex: 1; }

/* ---------- Toolbar & chips --------------------------------------------- */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .search { flex: 0 1 340px; }
.toolbar select { width: auto; min-width: 160px; }
.toolbar .spacer { flex: 1; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--white);
  font: inherit; font-size: 12.5px; color: var(--body); cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.chip .n { color: var(--muted); }
.chip:hover { border-color: var(--teal); }
.chip.on { background: var(--dark); border-color: var(--dark); color: var(--white); }
.chip.on .n { color: var(--teal-pale); }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--body); }

/* ---------- Tables ------------------------------------------------------ */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left; font-family: var(--font-head); font-weight: 500; font-size: 12px; color: var(--dark);
  padding: 10px 14px; border-bottom: 1px solid var(--dark); white-space: nowrap; user-select: none;
}
table.data th[data-sort] { cursor: pointer; }
table.data th[data-sort]:hover { color: var(--teal); }
table.data th .arrow { font-size: 10px; color: var(--teal); margin-left: 4px; }
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--fog); vertical-align: middle; }
table.data tbody tr[data-href] { cursor: pointer; }
table.data tbody tr:hover td { background: #F5F8F8; }
table.data td.primary { color: var(--dark); font-family: var(--font-head); }
table.data td.device { min-width: 190px; }
table.data td .sub { display: block; font-size: 12px; color: var(--muted); }
table.data td.clip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.data td.specs { min-width: 180px; max-width: 460px; font-size: 13px; line-height: 1.4; }
table.data .attach { font-size: 16px; color: var(--teal); margin-left: 6px; vertical-align: -3px; }
.table-foot { padding: 12px 14px; font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; }
.empty { padding: 48px 24px; text-align: center; color: var(--muted); }
.empty .material-symbols-outlined { font-size: 36px; color: var(--border); display: block; margin-bottom: 8px; }

/* ---------- Detail page ------------------------------------------------- */
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; margin: 0; }
.facts div { padding: 12px 0; border-bottom: 1px solid var(--fog); }
.facts dt { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.facts dd { margin: 0; color: var(--dark); font-family: var(--font-head); word-break: break-word; }
.facts .full { grid-column: 1 / -1; }
.facts dd.text { font-family: var(--font-body); color: var(--body); white-space: pre-line; }
.holder { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--teal-pale); color: var(--dark); font-family: var(--font-head); font-size: 13px;
}
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }
.avatar.off { background: var(--grey-fill); color: var(--muted); }
.card.pale .avatar { background: var(--white); }
.card.flat .avatar.off { background: var(--white); }

/* Timeline (history) */
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 1px; background: var(--border); }
.timeline li { position: relative; padding: 0 0 18px 30px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline .dot { position: absolute; left: 0; top: 3px; width: 11px; height: 11px; border-radius: 50%; background: var(--white); border: 2px solid var(--teal); margin-left: 4px; }
.timeline .ev-assigned .dot { background: var(--teal); }
.timeline .ev-returned .dot { border-color: var(--dark); }
.timeline .ev-disposed .dot, .timeline .ev-status .dot { border-color: var(--orange); }
.timeline .ev-note .dot { border-color: var(--purple); }
.timeline .ev-imported .dot, .timeline .ev-purchased .dot, .timeline .ev-updated .dot { border-color: var(--muted); }
.timeline .what { color: var(--dark); font-family: var(--font-head); }
.timeline .what a { color: inherit; border-bottom: 1px solid var(--teal-pale); }
.timeline .meta { font-size: 12px; color: var(--muted); }
.timeline .details { font-size: 13px; margin-top: 4px; white-space: pre-line; background: var(--grey-fill); border-radius: 6px; padding: 6px 10px; }

/* Tabs (detail quick actions) */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--fog); margin: -4px 0 16px; }
.tabs button { background: none; border: 0; padding: 8px 10px; font: inherit; font-family: var(--font-head); color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--dark); border-bottom-color: var(--teal); }

/* ---------- Flash toasts ------------------------------------------------ */
.flashes { position: fixed; top: 16px; right: 24px; z-index: 50; display: grid; gap: 8px; max-width: 420px; }
.flash {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 6px; background: var(--dark); color: var(--white);
  box-shadow: 0 6px 24px rgba(32,72,77,0.25); font-size: 13.5px; animation: slide-in .25s ease;
}
.flash.error { background: var(--white); color: #B92D45; border: 1px solid var(--coral); }
.flash button { margin-left: auto; background: none; border: 0; color: inherit; opacity: .6; cursor: pointer; padding: 0; }
@keyframes slide-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* Fade-up like the deck template, subtle */
/* "backwards", not "both": a finished animation must not keep a transform on the card.
   A kept transform traps the position:fixed status menu inside the card, so the menu
   was drawn behind the neighbouring cards and in the wrong place. */
.fade-up { animation: fade-up .45s ease backwards; }
.fade-up.d1 { animation-delay: .05s; } .fade-up.d2 { animation-delay: .1s; } .fade-up.d3 { animation-delay: .15s; } .fade-up.d4 { animation-delay: .2s; }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fade-up, .flash { animation: none; } }

@media (max-width: 960px) {
  .sidebar { position: static; width: 100%; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 14px 16px; }
  .sidebar::after, .sidebar-foot, .nav-label { display: none; }
  .brand { padding: 0 12px 0 4px; }
  .nav { display: flex; flex-wrap: wrap; gap: 2px; }
  .nav a.active::before { display: none; }
  .app { flex-direction: column; }
  .main { margin-left: 0; }
  .topbar, .content { padding-left: 20px; padding-right: 20px; }
}

@media print {
  .sidebar, .topbar, .actions, .toolbar, .flashes { display: none !important; }
  .main { margin: 0; }
  .card { box-shadow: none; border: 1px solid var(--border); }
}

/* ---------- Status dropdown ---------------------------------------------- */
.status-menu { display: inline-block; position: relative; }
.status-menu summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 2px; border-radius: 999px; }
.status-menu summary::-webkit-details-marker { display: none; }
.status-menu summary .caret { font-size: 16px; color: var(--text); transition: transform .15s; }
.status-menu[open] summary .caret { transform: rotate(180deg); }
.status-menu summary:hover .badge, .status-menu[open] .badge { box-shadow: 0 0 0 2px var(--white), 0 0 0 3px var(--teal); }
.status-menu summary:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.status-menu .menu {
  position: fixed; z-index: 60; width: 290px; background: var(--white); border-radius: 8px;
  box-shadow: 0 10px 32px rgba(32,72,77,0.22), 0 0 0 1px rgba(32,72,77,0.08); padding: 4px 6px; overflow-y: auto; overscroll-behavior: contain;
}
.menu-label { font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dark); padding: 6px 10px 2px; font-family: var(--font-head); }
.menu-sep { height: 1px; background: var(--fog); margin: 4px; }
.status-menu .menu button, .menu-link {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 5px 10px; border: 0; background: none;
  border-radius: 6px; font: inherit; font-size: 13.5px; color: var(--text); text-align: left; cursor: pointer;
}
.status-menu .menu button:hover:not(:disabled), .menu-link:hover { background: var(--fog); color: var(--text); }
.status-menu .menu button:disabled { cursor: default; background: #F5F8F8; }
.status-menu .menu .txt { flex: 1; font-family: var(--font-head); color: var(--dark); }
.status-menu .menu .txt small { display: block; font-family: var(--font-body); font-size: 11.5px; line-height: 1.3; color: var(--text); }
.status-menu .menu .check { font-size: 18px; color: var(--teal); }
.status-menu .menu .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; padding: 0; }
.menu .dot.tone-teal { background: var(--teal); } .menu .dot.tone-dark { background: var(--dark); }
.menu .dot.tone-purple { background: var(--purple); } .menu .dot.tone-coral { background: var(--coral); }
.menu .dot.tone-orange { background: var(--orange); } .menu .dot.tone-grey { background: var(--border); }
.menu-link { font-family: var(--font-head); color: var(--dark); }
.menu-link .material-symbols-outlined { font-size: 18px; }

/* ---------- Documents (invoices) ----------------------------------------- */
.docs { list-style: none; margin: 0 0 16px; padding: 0; }
.docs li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--fog); }
.docs li:last-child { border-bottom: 0; }
.docs .ficon { width: 36px; height: 36px; border-radius: 6px; background: var(--teal-pale); color: var(--dark); display: grid; place-items: center; flex: none; }
.docs .grow { flex: 1; min-width: 0; }
.docs .fname { color: var(--dark); font-family: var(--font-head); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.docs .fmeta { font-size: 12px; }
.dropzone { display: block; border: 1.5px dashed var(--border); border-radius: 8px; padding: 16px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--teal); background: #F5F8F8; }
.dropzone input[type=file] { display: none; }
.dropzone .material-symbols-outlined { font-size: 26px; color: var(--teal); display: block; margin-bottom: 4px; }
.dropzone .chosen { display: block; margin-top: 6px; font-family: var(--font-head); color: var(--dark); word-break: break-all; }
input[type=file].plain { height: auto; padding: 8px 0; border: 0; }

/* ---------- Device line drawings ---------------------------------------- */
.dev-cell { display: flex; align-items: center; gap: 12px; }
.dev-thumb { width: 46px; height: 32px; flex: none; object-fit: contain; }
.dev-icon { display: inline-grid; place-items: center; color: var(--dark); background: var(--fog); border-radius: 6px; }
.dev-icon.dev-thumb { width: 40px; height: 32px; margin: 0 3px; }
.dev-icon.dev-thumb .material-symbols-outlined { font-size: 20px; }
.dev-hero-card { text-align: center; padding: 28px 24px 20px; }
.dev-hero { width: 100%; max-width: 260px; height: 170px; object-fit: contain; display: block; margin: 0 auto; }
.dev-icon.dev-hero { width: 160px; height: 120px; border-radius: 12px; }
.dev-icon.dev-hero .material-symbols-outlined { font-size: 64px; font-variation-settings: "wght" 200; }
.dev-hero-cap { margin-top: 14px; font-family: var(--font-head); color: var(--dark); }
.dev-hero-cap span { display: block; font-family: var(--font-body); color: var(--text); font-size: 12.5px; margin-top: 2px; }

/* ---------- Signed-in user, role preview --------------------------------- */
.topbar .who { color: var(--text); gap: 10px; }
.who-text { display: flex; flex-direction: column; line-height: 1.25; font-size: 12.5px; }
.who-text b { font-weight: 500; font-family: var(--font-head); color: var(--dark); }
.avatar.sm { width: 30px; height: 30px; font-size: 12px; }
.role-tag { font-size: 11px; }
.role-tag.role-admin::before, .role-tag.role-editor::before, .role-tag.role-reader::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }
.role-tag.role-admin::before { background: var(--dark); }
.role-tag.role-editor::before { background: var(--teal); }
.role-tag.role-reader::before { background: var(--border); }
.role-switch { display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; border-radius: 999px; background: var(--grey-fill); }
.role-switch .chip { height: 26px; padding: 0 10px; font-size: 12px; }
.timeline .ev-document .dot { border-color: var(--teal); background: var(--teal-pale); }

/* ---------- Sign-in page (deck cover style) ------------------------------ */
.login-page { min-height: 100vh; margin: 0; display: grid; place-items: center; background: var(--darkest); position: relative; overflow: hidden; }
.login-hero { position: absolute; inset: 0; background-size: cover; background-position: center; }
.login-hero::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(120deg, rgba(28,66,63,0.92) 0%, rgba(32,72,77,0.65) 55%, rgba(32,72,77,0.85) 100%); }
.login-box { position: relative; z-index: 1; width: min(440px, 92vw); color: var(--white); padding: 40px; }
.login-kicker { margin: 10px 0 36px; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--white); }
.login-box h1 { color: var(--white); font-size: 34px; font-weight: 400; margin-bottom: 10px; }
.login-box p { color: var(--white); margin: 0 0 28px; font-size: 15px; }
.login-box .login-small { font-size: 12.5px; margin-top: 16px; }
.ms-btn { display: inline-flex; align-items: center; gap: 12px; height: 46px; padding: 0 20px; background: var(--white); color: #000;
  border-radius: 6px; font-family: var(--font-head); font-size: 15px; box-shadow: 0 6px 24px rgba(0,0,0,0.25); }
.ms-btn:hover { background: var(--fog); color: #000; }
.login-error { background: var(--white); color: #B92D45; border-left: 3px solid var(--coral); padding: 10px 14px; border-radius: 4px; margin-bottom: 20px; font-size: 13.5px; }
