/* LECTUS ERP - theme replicated from the reference system: blue sidebar, soft raised grey tiles, Poppins */
@font-face { font-family: 'Poppins'; font-weight: 300; font-style: normal; font-display: swap; src: url('../fonts/poppins-latin-300-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 400; font-style: normal; font-display: swap; src: url('../fonts/poppins-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 500; font-style: normal; font-display: swap; src: url('../fonts/poppins-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 600; font-style: normal; font-display: swap; src: url('../fonts/poppins-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 700; font-style: normal; font-display: swap; src: url('../fonts/poppins-latin-700-normal.woff2') format('woff2'); }

:root {
  --side-top: #3d64b2;
  --side-bottom: #2c4f96;
  --side-text: rgba(255, 255, 255, .92);
  --side-muted: rgba(255, 255, 255, .62);
  --side-active-bg: rgba(10, 25, 70, .22);
  --navy: #1c2a55;
  --chip: #35488c;
  --bg: #eef0f3;
  --tile: #e3e5e8;
  --card: #ffffff;
  --text: #2a313d;
  --muted: #697384;
  --line: #dadee4;
  --head-bg: #e9edf5;
  --accent: #f2c200;
  --primary: #34489a;
  --primary-hover: #2b3d85;
  --danger: #c0392b;
  --ok: #1d8a4a;
  --warn: #b7791f;
  --shadow-out: 7px 7px 15px rgba(158, 166, 180, .42), -7px -7px 15px rgba(255, 255, 255, .95);
  --shadow-out-sm: 4px 4px 9px rgba(158, 166, 180, .38), -4px -4px 9px rgba(255, 255, 255, .9);
  --shadow-card: 0 1px 2px rgba(30, 40, 70, .06), 0 6px 20px rgba(30, 40, 70, .06);
  --side-w: 248px;
  --top-h: 64px;
  --radius: 14px;
}
[data-theme='dark'] {
  --bg: #161a24;
  --tile: #1f2431;
  --card: #1c212d;
  --text: #e4e8f0;
  --muted: #98a1b3;
  --line: #2c3342;
  --head-bg: #242a39;
  --navy: #c9d4f5;
  --primary: #5d78d6;
  --primary-hover: #7088e0;
  --shadow-out: 6px 6px 14px rgba(0, 0, 0, .45), -6px -6px 14px rgba(255, 255, 255, .035);
  --shadow-out-sm: 4px 4px 9px rgba(0, 0, 0, .4), -3px -3px 8px rgba(255, 255, 255, .03);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  --side-top: #25376b;
  --side-bottom: #1b2850;
}
[data-sidebar='navy'] { --side-top: #25346a; --side-bottom: #18234d; }
[data-sidebar='teal'] { --side-top: #1f7a86; --side-bottom: #155c66; }
[data-sidebar='charcoal'] { --side-top: #3a4150; --side-bottom: #262b36; }
[data-tiles='flat'] { --shadow-out: none; --shadow-out-sm: none; }
[data-tiles='flat'] .tile { border: 1px solid var(--line); }

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-size: 13px; color: var(--text);
  background: var(--bg); -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
svg.i { width: 1em; height: 1em; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.hidden { display: none !important; }

/* ---------------------------------------------------------------- shell */
#app { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 40; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--side-top), var(--side-bottom)); color: var(--side-text); transition: transform .25s, width .25s;
}
.side-logo { height: var(--top-h); background: #ffffff; display: flex; align-items: center; justify-content: flex-start; gap: 8px; padding: 0 12px; border-bottom: 1px solid #d9dce2; flex: none; text-decoration: none; overflow: hidden; }
.side-logo svg, .side-logo img { max-height: 50px; max-width: 100px; object-fit: contain; flex: none; }
.side-brand { display: flex; flex-direction: column; justify-content: center; min-width: 0; flex: 1; line-height: 1.2; gap: 2px; padding-left: 8px; border-left: 2px solid #dfe3ee; }
.side-brand b { font-size: 19px; font-weight: 800; letter-spacing: .08em; color: #1c2a55; white-space: nowrap; }
.side-brand small { font-size: 10px; font-weight: 600; letter-spacing: .01em; color: #5d6676; white-space: normal; line-height: 1.15; }
.side-scroll { flex: 1; overflow-y: auto; padding: 8px 0 24px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .3) transparent; }
.menu-label { padding: 12px 22px 6px; font-size: 10px; letter-spacing: .12em; color: var(--side-muted); font-weight: 500; }
.nav-item, .nav-link {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 20px; border: 0; background: transparent; color: var(--side-text);
  font-size: 12.5px; text-align: left; cursor: pointer; text-decoration: none; position: relative;
}
.nav-item:hover, .nav-link:hover { background: rgba(255, 255, 255, .08); text-decoration: none; }
.nav-item .i { font-size: 17px; }
.nav-item .chev { margin-left: auto; font-size: 14px; transition: transform .2s; opacity: .85; }
.nav-item.open { font-weight: 600; background: var(--side-active-bg); color: #fff; }
.nav-item.open .chev { transform: rotate(90deg); }
.nav-sub { max-height: 0; overflow: hidden; opacity: 0; background: rgba(8, 20, 60, .12); transition: max-height .35s ease, opacity .25s ease, padding .25s ease; }
.nav-sub.open { max-height: 1400px; opacity: 1; padding: 4px 0; }
.nav-sub a, .nav-sub button.sub-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 20px 7px 50px; font-size: 11.5px; color: var(--side-text); background: transparent; border: 0; cursor: pointer; text-align: left;
}
.nav-sub a::before, .nav-sub button.sub-btn::before { content: ''; width: 5px; height: 1.5px; background: var(--side-muted); flex: none; }
.nav-sub a:hover, .nav-sub button.sub-btn:hover { background: rgba(255, 255, 255, .08); text-decoration: none; }
.nav-sub a.active { font-weight: 700; color: #fff; }
.nav-sub a.active::before { background: #fff; width: 7px; height: 2px; }
.nav-sub .sub-sep { height: 1px; background: rgba(255, 255, 255, .18); margin: 5px 20px 5px 50px; }
.nav-sub .nav-sub { background: rgba(8, 20, 60, .1); }
.nav-sub .nav-sub a { padding-left: 66px; }
.nav-link.active { font-weight: 700; background: var(--side-active-bg); color: #fff; }

.main { flex: 1; margin-left: var(--side-w); display: flex; flex-direction: column; min-width: 0; transition: margin .25s; }
body.side-collapsed .sidebar { transform: translateX(-100%); }
body.side-collapsed .main { margin-left: 0; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--top-h); display: flex; align-items: center; gap: 10px; padding: 0 22px 0 18px;
  background: var(--bg); border-bottom: 1px solid transparent;
}
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 18px; position: relative; }
.icon-btn:hover { background: rgba(120, 130, 150, .15); color: var(--text); }
.icon-btn .badge-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: #3b82f6; border: 2px solid var(--bg); }
.top-spacer { flex: 1; }
.top-title { font-size: 12px; color: var(--muted); }
.user-chip { display: flex; align-items: center; gap: 10px; background: var(--chip); color: #fff; padding: 6px 14px 6px 8px; border-radius: 5px; border: 0; cursor: pointer; min-width: 150px; }
.user-chip .av { width: 30px; height: 30px; border-radius: 50%; background: #fff; color: var(--chip); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }
.user-chip .nm { font-size: 11.5px; font-weight: 600; line-height: 1.2; text-align: left; text-transform: uppercase; letter-spacing: .02em; }
.user-chip .rl { font-size: 10px; opacity: .8; text-align: left; }
.user-menu { position: absolute; right: 22px; top: calc(var(--top-h) - 6px); background: var(--card); border-radius: 10px; box-shadow: var(--shadow-card); border: 1px solid var(--line); min-width: 190px; padding: 6px; z-index: 60; }
.user-menu button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 9px 12px; border: 0; background: transparent; color: var(--text); border-radius: 8px; cursor: pointer; font-size: 12.5px; }
.user-menu button:hover { background: var(--head-bg); }
#view { flex: 1; padding: 6px 26px 26px; min-width: 0; }
.footer { display: flex; justify-content: space-between; padding: 12px 26px; font-size: 10.5px; color: var(--muted); }
.gear {
  position: fixed; right: 0; top: 140px; z-index: 35; width: 36px; height: 38px; border: 0; background: var(--accent); color: #1a1a1a;
  border-radius: 8px 0 0 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 20px; box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
}
.gear svg { animation: spin 7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- home tiles */
.sec-head { display: flex; align-items: center; margin: 22px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.sec-head h2 { margin: 0; font-size: 14.5px; font-weight: 500; color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 20px 18px; }
.tile {
  background: var(--tile); border-radius: var(--radius); box-shadow: var(--shadow-out-sm); height: 98px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 11px; color: var(--text); border: 0; cursor: pointer; text-decoration: none; transition: transform .12s, box-shadow .12s; padding: 6px;
}
.tile { position: relative; overflow: hidden; transition: transform .22s cubic-bezier(.2, .8, .2, 1), box-shadow .22s, background .25s, color .2s; }
.tile::after { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, #4a73bb 0%, #2c4f96 100%); opacity: 0; transition: opacity .25s; z-index: 0; }
.tile > * { position: relative; z-index: 1; }
.tile:hover, .tile:focus-visible { transform: translateY(-6px) scale(1.04); text-decoration: none; box-shadow: 0 16px 30px rgba(44, 79, 150, .38); color: #fff; outline: none; }
.tile:hover::after, .tile:focus-visible::after { opacity: 1; }
.tile:active { transform: translateY(-2px) scale(.98); }
.tile .i { font-size: 30px; color: var(--navy); stroke-width: 1.5; transition: color .2s, transform .3s; }
.tile:hover .i, .tile:focus-visible .i { color: #fff; animation: tileIcon .55s ease; }
.tile span { font-size: 10.5px; font-weight: 500; text-align: center; line-height: 1.25; }
@keyframes tileIcon { 0% { transform: scale(1) rotate(0); } 35% { transform: scale(1.28) rotate(-8deg); } 70% { transform: scale(1.12) rotate(6deg); } 100% { transform: scale(1.18) rotate(0); } }
.kpi { transition: transform .2s, box-shadow .2s; }
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-out); }
@media (prefers-reduced-motion: reduce) { .tile, .tile .i, .nav-sub { transition: none; animation: none !important; } .tile:hover .i { animation: none; } }

/* ---------------------------------------------------------------- page chrome */
.page-head { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 14px 0 12px; }
.page-head h1 { margin: 0; font-size: 18px; font-weight: 600; color: var(--text); }
.crumbs { font-size: 11px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.page-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-card); }
.card.pad { padding: 18px 20px; }

.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px; font-size: 12.5px; font-weight: 500; border-radius: 9px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); cursor: pointer; transition: background .15s, border-color .15s; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--head-bg); text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.btn.danger:hover { background: color-mix(in srgb, var(--danger) 10%, var(--card)); }
.btn.sm { padding: 5px 10px; font-size: 11.5px; border-radius: 7px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------------------------------------------------------------- forms */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 18px; }
.field label { display: block; font-size: 11px; font-weight: 500; color: var(--muted); margin-bottom: 5px; }
.field label .req { color: var(--danger); }
.field .help { font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.field.wide { grid-column: 1 / -1; }
input[type='text'], input[type='number'], input[type='date'], input[type='month'], input[type='time'], input[type='email'], input[type='password'], input[type='search'], select, textarea {
  width: 100%; padding: 8px 11px; font: inherit; font-size: 12.5px; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 8px; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
input[readonly], input:disabled, select:disabled, textarea:disabled { background: var(--head-bg); color: var(--muted); }
input.num { text-align: right; font-variant-numeric: tabular-nums; }
textarea { min-height: 62px; resize: vertical; }
.field.err input, .field.err select, .field.err textarea { border-color: var(--danger); }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12.5px; padding-top: 6px; }
.switch input { width: 16px; height: 16px; accent-color: var(--primary); }
.combo { position: relative; }
.combo .menu { position: absolute; left: 0; right: 0; top: calc(100% + 3px); z-index: 80; background: var(--card); border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow-card); max-height: 240px; overflow: auto; min-width: 220px; }
.combo .menu div { padding: 8px 11px; font-size: 12.5px; cursor: pointer; }
.combo .menu div.act, .combo .menu div:hover { background: var(--head-bg); }
.combo .menu .none { color: var(--muted); cursor: default; }
.combo .menu .add-new { color: var(--primary); font-weight: 700; border-top: 1px solid var(--line); }
.combo input { text-overflow: ellipsis; padding-right: 30px; }
.combo .clear { position: absolute; right: 8px; top: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: none; }
.combo.has .clear { display: block; }
.form-errors { background: color-mix(in srgb, var(--danger) 10%, var(--card)); border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--line)); color: var(--danger); padding: 10px 14px; border-radius: 9px; margin-bottom: 14px; font-size: 12.5px; }
.form-foot { display: flex; gap: 10px; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.form-foot .grow { flex: 1; }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table.t { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.t th { background: var(--head-bg); color: var(--navy); text-align: left; font-weight: 600; font-size: 11.5px; padding: 10px 12px; white-space: nowrap; border-bottom: 1px solid var(--line); position: sticky; top: 0; }
table.t th.sortable { cursor: pointer; user-select: none; }
table.t td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:hover td { background: color-mix(in srgb, var(--head-bg) 55%, transparent); }
table.t td.nw { white-space: nowrap; }
table.t td.r, table.t th.r { text-align: right; font-variant-numeric: tabular-nums; }
table.t td.c, table.t th.c { text-align: center; }
table.t tr.bold td { font-weight: 600; background: color-mix(in srgb, var(--head-bg) 60%, transparent); }
table.t tr.total td { font-weight: 700; border-top: 2px solid var(--line); }
table.t tfoot td { font-weight: 700; background: var(--head-bg); }
table.t td.act { white-space: nowrap; text-align: right; width: 1%; }
.row-click { cursor: pointer; }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.toolbar .search { position: relative; }
.toolbar .search input { padding-left: 32px; width: 240px; }
.toolbar .search .i { position: absolute; left: 10px; top: 10px; color: var(--muted); font-size: 14px; }
.toolbar .grow { flex: 1; }
.pager { display: flex; gap: 8px; align-items: center; padding: 12px 16px; font-size: 12px; color: var(--muted); }
.pager .grow { flex: 1; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 10.5px; font-weight: 600; background: var(--head-bg); color: var(--muted); white-space: nowrap; }
.badge.ok { background: color-mix(in srgb, var(--ok) 15%, var(--card)); color: var(--ok); }
.badge.warn { background: color-mix(in srgb, var(--warn) 17%, var(--card)); color: var(--warn); }
.badge.bad { background: color-mix(in srgb, var(--danger) 14%, var(--card)); color: var(--danger); }
.badge.info { background: color-mix(in srgb, var(--primary) 14%, var(--card)); color: var(--primary); }
.progress { width: 110px; height: 8px; border-radius: 6px; background: var(--head-bg); overflow: hidden; display: inline-block; vertical-align: middle; }
.progress i { display: block; height: 100%; background: var(--primary); }

/* line items */
.lines { margin-top: 20px; }
.lines h3 { font-size: 13px; margin: 0 0 8px; font-weight: 600; }
.lines table.t td { padding: 6px 6px; }
.lines table.t td input, .lines table.t td select { padding: 6px 8px; }
.lines .rm { color: var(--danger); }
/* every box in a line grid keeps enough width to show its whole content; the table scrolls sideways when the columns do not fit */
.lines table.t td .combo { min-width: 500px; }
.lines table.t td input[type='text'], .lines table.t td input[type='email'], .lines table.t td textarea { min-width: 150px; }
.lines table.t td input[type='number'] { min-width: 100px; }
.lines table.t td input[type='date'], .lines table.t td input[type='month'] { min-width: 150px; }
.lines table.t td input[type='time'] { min-width: 110px; }
.lines table.t td select { min-width: 130px; }
.totals-box { margin-left: auto; width: min(340px, 100%); margin-top: 14px; }
.totals-box div { display: flex; justify-content: space-between; padding: 5px 0; font-size: 12.5px; }
.totals-box .grand { border-top: 2px solid var(--line); font-weight: 700; font-size: 14px; margin-top: 4px; padding-top: 8px; }

/* ---------------------------------------------------------------- dashboards */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi { background: var(--tile); border-radius: var(--radius); box-shadow: var(--shadow-out-sm); padding: 16px 18px; }
.kpi .l { font-size: 11px; color: var(--muted); font-weight: 500; }
.kpi .v { font-size: 22px; font-weight: 600; color: var(--navy); margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi.warn .v { color: var(--danger); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart h3, .card h3 { margin: 0 0 10px; font-size: 13px; font-weight: 600; }
.legend { display: flex; gap: 14px; font-size: 11px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }
.summary { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 12px; }
.summary b { font-weight: 600; }
.note { padding: 10px 16px; font-size: 12px; color: var(--muted); }
.params { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: flex-end; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.params .field { min-width: 150px; }

/* ---------------------------------------------------------------- overlays */
.toast-host { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #222b3e; color: #fff; padding: 11px 16px; border-radius: 10px; font-size: 12.5px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); max-width: 380px; }
.toast.err { background: #a8322a; }
.toast.ok { background: #1d7a43; }
.modal-back { position: fixed; inset: 0; background: rgba(15, 20, 35, .5); z-index: 150; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px; overflow: auto; }
.modal { background: var(--card); border-radius: 14px; width: min(520px, 100%); padding: 20px 22px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.modal h3 { margin: 0 0 12px; font-size: 15px; }
.modal .foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.drawer-back { position: fixed; inset: 0; background: rgba(15, 20, 35, .35); z-index: 90; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 320px; background: var(--card); z-index: 95; box-shadow: -10px 0 40px rgba(0, 0, 0, .2); padding: 20px; overflow: auto; }
.drawer h3 { margin: 0 0 16px; }
.drawer .grp { margin-bottom: 20px; }
.drawer .grp > b { display: block; font-size: 11px; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .08em; }
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg button { padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; font-size: 12px; }
.seg button.on { border-color: var(--primary); color: var(--primary); font-weight: 600; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.swatch.on { border-color: var(--text); }

/* ---------------------------------------------------------------- login */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(135deg, #3d64b2, #1d2f63); }
.login-card { width: min(400px, 100%); background: #ffffff; border-radius: 16px; padding: 30px 30px 26px; box-shadow: 0 24px 70px rgba(0, 0, 0, .35); color: #2a313d; }
.login-card .logo { display: flex; justify-content: center; margin-bottom: 8px; }
.login-card .logo svg, .login-card .logo img { height: 84px; max-width: 240px; object-fit: contain; border-radius: 8px; }
.login-card h1 { text-align: center; font-size: 15px; font-weight: 600; margin: 4px 0 20px; color: #55607a; }
.login-card .field { margin-bottom: 14px; }
.login-card .btn { width: 100%; justify-content: center; padding: 11px; font-size: 13.5px; }
.login-card .err { color: #c0392b; font-size: 12px; margin-bottom: 10px; min-height: 16px; }

/* ---------------------------------------------------------------- print */
.print-sheet { background: #fff; color: #111; max-width: 900px; margin: 0 auto; padding: 28px 34px; font-size: 12px; box-shadow: var(--shadow-card); }
[data-theme='dark'] .print-sheet { box-shadow: none; }
.print-sheet h1 { font-size: 20px; margin: 0; }
.print-sheet .ph { display: flex; gap: 20px; justify-content: space-between; border-bottom: 2px solid #1c2a55; padding-bottom: 12px; margin-bottom: 14px; }
.print-sheet .ph img { max-height: 60px; }
.print-sheet .co { font-size: 11px; color: #444; line-height: 1.5; }
.print-sheet .co b { font-size: 16px; color: #1c2a55; }
.print-sheet .title { text-align: center; font-size: 15px; font-weight: 700; letter-spacing: .06em; margin: 6px 0 12px; text-transform: uppercase; }
.print-sheet .meta { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 28px; margin-bottom: 12px; }
.print-sheet .meta div span { color: #666; display: inline-block; min-width: 118px; }
.print-sheet table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.print-sheet th, .print-sheet td { border: 1px solid #999; padding: 5px 7px; font-size: 11.5px; }
.print-sheet th { background: #e8ecf5; text-align: left; }
.print-sheet td.r, .print-sheet th.r { text-align: right; }
.print-sheet .sig { display: flex; justify-content: space-between; margin-top: 46px; gap: 14px; }
.print-sheet .sig div { flex: 1; border-top: 1px solid #333; text-align: center; padding-top: 4px; font-size: 11px; }
.print-sheet .words { margin-top: 10px; font-weight: 600; }
@media print {
  body { background: #fff !important; }
  .sidebar, .topbar, .footer, .gear, .page-head, .no-print, .toast-host { display: none !important; }
  .main { margin: 0 !important; }
  #view { padding: 0 !important; }
  .print-sheet { box-shadow: none; max-width: none; padding: 0; }
  .card { box-shadow: none; }
  table.t th { position: static; }
}

/* ---------------------------------------------------------------- responsive */
@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); }
  .main { margin-left: 0; }
  body.side-open .sidebar { transform: none; box-shadow: 10px 0 40px rgba(0, 0, 0, .3); }
  body.side-collapsed .sidebar { transform: translateX(-100%); }
  #view { padding: 4px 14px 20px; }
  .user-chip .rl, .user-chip .nm { display: none; }
  .user-chip { min-width: 0; padding: 6px; }
  .toolbar .search input { width: 100%; }
}

/* ---------------------------------------------------------------- platform additions */
.record-tools { margin-top: 18px; }
.rt-tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.rt-tab { background: none; border: 0; padding: 8px 12px; border-bottom: 2px solid transparent; cursor: pointer; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }
.rt-tab.on { color: var(--primary); border-color: var(--primary); font-weight: 600; }
.rt-list { display: flex; flex-direction: column; gap: 6px; }
.rt-row { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px dashed var(--line); flex-wrap: wrap; }
.rt-comment { padding: 8px 10px; background: var(--head-bg); border-radius: 10px; }
.rt-sign { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.approval-strip { margin-top: 12px; border-left: 4px solid var(--warn); }
.approval-strip.Approved { border-color: var(--ok); } .approval-strip.Rejected { border-color: var(--danger); }
.star { color: var(--muted); } .star.on { color: #f2a900; } .star.on svg { fill: #f2a900; }
.bulk-bar { display: flex; gap: 8px; align-items: center; padding: 8px 14px; background: var(--head-bg); border-bottom: 1px solid var(--line); }
th.sel, td.sel { width: 34px; text-align: center; }
.saved-filter { max-width: 160px; }
.btn.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.bell-wrap { position: relative; }
.bell-count { position: absolute; top: 2px; right: 0; background: var(--danger); color: #fff; font-size: 10px; border-radius: 9px; padding: 0 5px; line-height: 16px; min-width: 16px; text-align: center; }
.bell-panel { position: absolute; right: 0; top: 44px; width: 340px; max-height: 70vh; overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-card); z-index: 70; }
.bell-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.bell-item { display: block; padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.bell-item.unread { background: var(--head-bg); font-weight: 500; }
.bell-all { display: block; text-align: center; padding: 10px; }
.search-pal { position: fixed; top: 12vh; left: 50%; transform: translateX(-50%); width: min(620px, 94vw); background: var(--card); border-radius: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); z-index: 95; overflow: hidden; }
.search-pal input { width: 100%; border: 0; border-bottom: 1px solid var(--line); padding: 16px 18px; font-size: 16px; background: transparent; color: var(--text); outline: none; }
.sp-out { max-height: 56vh; overflow: auto; }
.sp-out a { display: flex; justify-content: space-between; gap: 10px; padding: 9px 18px; color: var(--text); text-decoration: none; }
.sp-out a.act, .sp-out a:hover { background: var(--head-bg); }
.sp-group { padding: 8px 18px 2px; font-size: 11px; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.fav-sub a { display: flex !important; gap: 8px; align-items: center; }
.fav-sub svg { color: #f2c200; }
.staging-banner { background: #e67e22; color: #fff; text-align: center; padding: 6px 12px; font-weight: 600; position: sticky; top: 0; z-index: 100; }
.onboarding { margin-bottom: 18px; border-left: 4px solid var(--primary); }
.ob-steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 18px; margin-top: 10px; }
.ob-steps a { display: flex; gap: 8px; align-items: center; color: var(--text); }
.ob-steps a.done { color: var(--muted); text-decoration: line-through; } .ob-steps a.done svg { color: var(--ok); }
.chat { height: 52vh; overflow: auto; display: flex; flex-direction: column; gap: 10px; padding: 6px; }
.chat-row { display: flex; } .chat-row.me { justify-content: flex-end; }
.bubble { max-width: 82%; padding: 10px 14px; border-radius: 14px; background: var(--head-bg); }
.chat-row.me .bubble { background: var(--primary); color: #fff; }
.chat-input { display: flex; gap: 8px; margin-top: 12px; } .chat-input input { flex: 1; }
.label-sheet { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; }
.label { border: 1px dashed #889; padding: 4px 6px; display: flex; gap: 6px; align-items: center; font-size: 10px; background: #fff; color: #000; page-break-inside: avoid; }
.label-text { flex: 1; line-height: 1.25; } .label-code { width: 24mm; height: 24mm; object-fit: contain; } .label-bar { height: 10mm; max-width: 40mm; }
@media print { .no-print, .sidebar, .topbar, .gear, .footer, .page-head { display: none !important; } .label { border: 0; } .main { margin: 0 !important; } }
html[dir='rtl'] .main { direction: rtl; } html[dir='rtl'] .sidebar { direction: ltr; }
html[dir='rtl'] .t th, html[dir='rtl'] .t td { text-align: right; } html[dir='rtl'] .t td.r, html[dir='rtl'] .t th.r { text-align: left; }

/* ---------------------------------------------------------------- team: permission panel, staff progress, tasks */
.av { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 12px; font-weight: 600; flex: none; }
.av.lg { width: 46px; height: 46px; font-size: 15px; }
.av .dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--card); background: #9aa3b2; }
.av .dot.online { background: #1fb36b; } .av .dot.idle { background: #e0a21b; }
.bad { color: var(--danger); } td.bad { color: var(--danger); font-weight: 600; }
.badge.soft { background: var(--head-bg); color: var(--muted); font-weight: 500; font-size: 10px; }
.pbar { height: 7px; border-radius: 6px; background: var(--head-bg); overflow: hidden; min-width: 70px; margin: 3px 0; }
.pbar i { display: block; height: 100%; background: var(--primary); border-radius: 6px; transition: width .4s; }
.pbar.ok i { background: var(--ok); } .pbar.soft i { background: #8fa3d6; }

.acc-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 16px; align-items: start; }
.acc-side { position: sticky; top: 76px; max-height: calc(100vh - 100px); overflow: auto; }
.acc-users { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.acc-user { display: flex; align-items: center; gap: 10px; text-align: left; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text); cursor: pointer; }
.acc-user:hover { background: var(--head-bg); } .acc-user.on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 9%, var(--card)); } .acc-user.off { opacity: .6; }
.acc-user .nm { display: flex; flex-direction: column; min-width: 0; flex: 1; } .acc-user .nm .help { font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; } .acc-head h3 { margin: 0; }
.acc-head .grow, .page-head .grow { flex: 1; }
.acc-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; } .acc-tools select { width: auto; min-width: 200px; }
.acc-sec { border: 1px solid var(--line); border-radius: 10px; margin: 8px 0; }
.acc-sec > summary { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; list-style: none; font-size: 13px; }
.acc-sec > summary::-webkit-details-marker { display: none; }
.acc-sec > summary::before { content: '▸'; color: var(--muted); } .acc-sec[open] > summary::before { content: '▾'; }
.acc-quick { margin-left: auto; display: flex; gap: 6px; }
.acc-t td, .acc-t th { padding: 6px 10px; } .acc-t tr.grp td { background: var(--head-bg); font-size: 11px; font-weight: 600; color: var(--navy); padding: 4px 10px; }
.acc-t tr.custom td { background: color-mix(in srgb, var(--warn) 7%, var(--card)); }
.acc-t input.inh { opacity: .55; }
.acc-t input[type='checkbox'], .acc-special input { width: 16px; height: 16px; accent-color: var(--primary); }
.acc-special { display: flex; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; cursor: pointer; align-items: flex-start; }
.acc-special .help { display: block; }
.acc-sum { padding: 8px 0; border-bottom: 1px dashed var(--line); } .acc-sum b { margin-right: 8px; }
.acc-features > input[type='search'] { max-width: 340px; margin-bottom: 6px; }

.live { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: #1fb36b; background: color-mix(in srgb, #1fb36b 12%, var(--card)); padding: 3px 10px; border-radius: 20px; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: #1fb36b; animation: livePulse 1.6s infinite; }
.live.off { color: var(--muted); background: var(--head-bg); } .live.off i { background: #9aa3b2; animation: none; }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 rgba(31, 179, 107, .55); } 70% { box-shadow: 0 0 0 8px rgba(31, 179, 107, 0); } 100% { box-shadow: 0 0 0 0 rgba(31, 179, 107, 0); } }
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.staff-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-card); padding: 14px 16px; border-top: 3px solid #9aa3b2; display: flex; flex-direction: column; gap: 8px; }
.staff-card.online { border-top-color: #1fb36b; } .staff-card.idle { border-top-color: #e0a21b; }
.sc-top { display: flex; gap: 10px; align-items: center; }
.sc-chip { font-size: 11.5px; padding: 5px 10px; border-radius: 8px; background: var(--head-bg); display: flex; gap: 6px; align-items: center; } .sc-chip.in { background: color-mix(in srgb, var(--ok) 13%, var(--card)); color: var(--ok); font-weight: 600; }
.sc-now { font-size: 12.5px; } .sc-now .help { font-size: 10.5px; }
.sc-nums { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); } .sc-nums b { color: var(--text); font-size: 14px; }
.sc-last, .sc-loc { font-size: 11px; display: flex; gap: 5px; align-items: center; } .sc-loc svg { width: 13px; height: 13px; }
.sc-act { display: flex; gap: 8px; margin-top: auto; }
.feed-row { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.feed-row .feed-t { flex: 1; min-width: 0; } .feed-ic { color: var(--primary); flex: none; } .feed-ic svg { width: 14px; height: 14px; }
.feed-row.task .feed-ic { color: #7b5bd6; } .feed-row.check .feed-ic { color: var(--ok); } .feed-row.report .feed-ic { color: var(--warn); }
.sdet h4 { margin: 16px 0 6px; font-size: 12.5px; }
.task-card { margin-bottom: 12px; } .task-card.late { border-left: 4px solid var(--danger); }
.task-ctl { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .task-ctl input[type='range'] { width: 180px; padding: 0; accent-color: var(--primary); } .task-ctl input[type='text'] { flex: 1; min-width: 160px; }
.tlog { margin-top: 12px; max-height: 150px; overflow: auto; } 
.invite-link { display: flex; gap: 8px; margin-top: 10px; } .invite-out { border: 2px solid var(--primary); margin-top: 16px; }
.steps { padding-left: 18px; line-height: 1.7; }
@media (max-width: 900px) { .acc-layout { grid-template-columns: 1fr; } .acc-side { position: static; max-height: none; } }

/* ---------------------------------------------------------------- module dashboards (quick tiles, range bar, KPI cards) */
.dash-quick { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.qtile { --qc: #2c6fd6; flex: 0 0 auto; width: 158px; min-height: 66px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 10px 8px; border: 1px solid var(--qc); color: var(--qc); border-radius: 6px; background: var(--card); text-align: center; font-size: 12.5px; text-decoration: none; transition: background .18s, color .18s, transform .18s, box-shadow .18s; }
.qtile .i { font-size: 20px; }
.qtile:hover { background: var(--qc); color: #fff; transform: translateY(-3px); box-shadow: 0 8px 18px color-mix(in srgb, var(--qc) 35%, transparent); text-decoration: none; }
.qtile.dark { --qc: #1c2a55; } .qtile.blue { --qc: #2c6fd6; } .qtile.teal { --qc: #12a58c; } .qtile.amber { --qc: #e0a100; } .qtile.red { --qc: #e5472e; }
[data-theme='dark'] .qtile.dark { --qc: #b9c6ee; }
.dash-range { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.dash-range input[type='date'] { width: 170px; }
.dcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 18px; }
.dcard { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-card); padding: 16px 20px; color: var(--text); text-decoration: none; transition: transform .2s, box-shadow .2s; }
.dcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-out); text-decoration: none; }
.dcard .dl { display: flex; justify-content: space-between; align-items: center; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.dcard .dic { color: #18a889; } .dcard .dic svg { width: 18px; height: 18px; }
.dcard .dv { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.dcard .dbadge { width: 52px; height: 52px; border-radius: 50%; background: color-mix(in srgb, var(--primary) 9%, var(--card)); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.dcard .dbadge svg { width: 24px; height: 24px; }
.dcard .dv b { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--navy); }
.dcard.warn .dv b { color: var(--danger); }
.dash-links { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.dblocks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-bottom: 18px; }
.dblock h4 { margin: 0 0 2px; font-size: 13px; } .dblock .dbn { display: flex; gap: 14px; margin-top: 8px; font-size: 12px; color: var(--muted); } .dblock .dbn b { color: var(--text); font-size: 15px; }

/* ---------------------------------------------------------------- mixed cartons: labels (4 x 6 in) and contents sheets */
.ctn-label { width: 100mm; height: 150mm; box-sizing: border-box; border: 1px solid #333; padding: 4mm; margin: 6px auto; background: #fff; color: #000; display: flex; flex-direction: column; gap: 2mm; page-break-after: always; break-after: page; overflow: hidden; font-size: 10pt; }
.ctn-label .cl-top { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1.5px solid #000; padding-bottom: 1.5mm; font-size: 9pt; }
.ctn-label .cl-top b { font-size: 12pt; }
.ctn-label .cl-to small { font-size: 7pt; color: #444; letter-spacing: .06em; display: block; }
.ctn-label .cl-to b { font-size: 13pt; display: block; line-height: 1.15; }
.ctn-label .cl-to div { font-size: 9pt; }
.ctn-label .cl-marks { font-weight: 700; margin-top: 1mm; }
.ctn-label .cl-mid { display: flex; gap: 3mm; align-items: center; border-top: 1px solid #999; border-bottom: 1px solid #999; padding: 2mm 0; }
.ctn-label .cl-mid img { width: 40mm; height: 40mm; image-rendering: pixelated; flex: none; }
.ctn-label .cl-big { font-size: 15pt; font-weight: 800; letter-spacing: .02em; }
.ctn-label .cl-seq { font-size: 13pt; font-weight: 700; margin: 1mm 0; }
.ctn-label .cl-no div { font-size: 9.5pt; line-height: 1.3; }
.ctn-label .cl-sscc { font-family: monospace; font-size: 8pt; }
.ctn-label .cl-list { width: 100%; border-collapse: collapse; font-size: 7.5pt; }
.ctn-label .cl-list th, .ctn-label .cl-list td { border-bottom: 1px solid #ccc; padding: .6mm 1mm; text-align: left; }
.ctn-label .cl-list th.r, .ctn-label .cl-list td.r { text-align: right; }
.ctn-label .cl-list i { color: #555; font-size: 6.5pt; }
.ctn-label .cl-more { font-size: 8pt; font-weight: 700; }
.ctn-label .cl-foot { margin-top: auto; text-align: center; font-size: 8.5pt; font-weight: 700; border-top: 1.5px solid #000; padding-top: 1.5mm; }
.ctn-print { background: transparent; }
.ctn-sheet { background: #fff; color: #111; max-width: 900px; margin: 0 auto 14px; padding: 18px 24px; font-size: 12px; page-break-after: always; break-after: page; }
.ctn-sheet .ph { display: flex; gap: 20px; justify-content: space-between; border-bottom: 2px solid #1c2a55; padding-bottom: 10px; margin-bottom: 12px; }
.ctn-sheet .co b { font-size: 16px; color: #1c2a55; }
.ctn-sheet .title { text-align: center; font-size: 15px; font-weight: 700; letter-spacing: .06em; margin: 6px 0 12px; text-transform: uppercase; }
.ctn-sheet .meta { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 28px; margin-bottom: 12px; }
.ctn-sheet .meta div span { color: #666; display: inline-block; min-width: 110px; }
.ctn-sheet table { width: 100%; border-collapse: collapse; }
.ctn-sheet th, .ctn-sheet td { border: 1px solid #999; padding: 4px 6px; font-size: 11.5px; text-align: left; }
.ctn-sheet th { background: #e8ecf5; } .ctn-sheet td.r, .ctn-sheet th.r { text-align: right; } .ctn-sheet td.chk { width: 60px; }
.ctn-sheet .sig { display: flex; justify-content: space-between; margin-top: 40px; gap: 14px; }
.ctn-sheet .sig div { flex: 1; border-top: 1px solid #333; text-align: center; padding-top: 4px; font-size: 11px; }
@media print { .ctn-label { border: 0; margin: 0 auto; } .ctn-sheet { padding: 0; margin: 0; } }

/* ---------------------------------------------------------------- phone fixes (kept last so they win over the rules above) */
.top-brand { display: none; }
@media (max-width: 991px) {
  .top-brand { display: flex; align-items: center; gap: 8px; min-width: 0; text-decoration: none; }
  .top-brand img, .top-brand svg { height: 34px; max-width: 96px; object-fit: contain; flex: none; }
  .top-brand b { font-size: 17px; font-weight: 800; color: #1c2a55; white-space: nowrap; }
  .topbar { padding: 0 10px; gap: 2px; }
  .icon-btn { width: 34px; height: 34px; }
  /* the theme gear sits low in the corner so it never covers buttons or text */
  .gear { top: auto; bottom: 22px; width: 30px; height: 34px; opacity: .85; font-size: 17px; }
  /* notifications: a full-width sheet under the top bar instead of a 340px box hanging off the bell */
  .bell-wrap { position: static; }
  .bell-panel { position: fixed; left: 8px; right: 8px; top: 62px; width: auto; max-height: calc(100vh - 80px); max-height: calc(100dvh - 80px); }
}

/* ---------------------------------------------------------------- order journey */
.oj-head { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 12px; }
.oj-wait { background: color-mix(in srgb, var(--warn) 12%, var(--card)); border: 1px solid color-mix(in srgb, var(--warn) 40%, var(--line)); border-radius: 10px; padding: 8px 12px; max-width: 460px; font-size: 13px; }
.oj-wait.ok { background: color-mix(in srgb, var(--ok) 12%, var(--card)); border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.oj-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.oj-tile { background: var(--head-bg); border-radius: 10px; padding: 10px 12px; }
.oj-num { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.oj-lbl { font-size: 11.5px; color: var(--muted); margin-bottom: 6px; }
.oj-bar { height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--muted) 25%, transparent); overflow: hidden; }
.oj-bar i { display: block; height: 100%; background: var(--warn); }
.oj-bar i.full { background: var(--ok); }
.oj-line { margin-top: 14px; display: flex; flex-direction: column; }
.oj-stage { display: flex; gap: 14px; position: relative; padding-bottom: 14px; }
.oj-stage::before { content: ''; position: absolute; left: 17px; top: 36px; bottom: 0; width: 2px; background: var(--line); }
.oj-stage:last-child::before { display: none; }
.oj-dot { flex: none; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--card); border: 2px solid var(--line); color: var(--muted); z-index: 1; }
.oj-stage.done .oj-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.oj-stage.active .oj-dot { border-color: var(--warn); color: var(--warn); }
.oj-stage.done::before { background: var(--ok); }
.oj-body { flex: 1; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.oj-stage.todo .oj-body, .oj-stage.skip .oj-body { opacity: .75; }
.oj-title { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.oj-state { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--head-bg); color: var(--muted); }
.oj-state.done { background: color-mix(in srgb, var(--ok) 15%, var(--card)); color: var(--ok); }
.oj-state.active { background: color-mix(in srgb, var(--warn) 15%, var(--card)); color: var(--warn); }
.oj-group { margin-top: 6px; }
.oj-glabel { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.oj-docs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
.oj-doc { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--head-bg); border-radius: 8px; padding: 5px 10px; color: var(--text); text-decoration: none; font-size: 12.5px; }
.oj-doc:hover { outline: 2px solid var(--primary); }
@media (max-width: 600px) { .oj-stage { gap: 8px; } .oj-dot { width: 30px; height: 30px; } .oj-stage::before { left: 14px; top: 30px; } .oj-body { padding: 8px 10px; } }

/* ---------------------------------------------------------------- gradient themes */
.gradgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gtile { border: 3px solid transparent; border-radius: 14px; padding: 12px 8px; min-height: 74px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; box-shadow: 0 3px 10px rgba(30, 40, 70, .14); font-family: inherit; }
.gtile b { font-size: 12.5px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.gtile small { font-size: 9.5px; opacity: .92; letter-spacing: .02em; }
.gtile.none { background: var(--head-bg); color: var(--text); font-size: 12px; font-weight: 600; grid-column: 1 / -1; min-height: 40px; box-shadow: none; border-color: var(--line); }
.gtile.on { border-color: var(--text); }
[data-grad] .sidebar { background: var(--g); }
[data-grad] .btn.primary { background: var(--g); border-color: transparent; }
[data-grad] .user-chip { background: var(--g); }
[data-grad][data-gtone='light'] { --side-text: rgba(28, 34, 56, .92); --side-muted: rgba(28, 34, 56, .62); --side-active-bg: rgba(255, 255, 255, .5); --chip: #6a7186; }
[data-grad][data-gtone='light'] .nav-item.open, [data-grad][data-gtone='light'] .nav-sub a.active { color: #1c2a55; }
[data-grad][data-gtone='light'] .nav-sub a.active::before { background: #1c2a55; }
[data-grad][data-gtone='light'] .nav-item:hover, [data-grad][data-gtone='light'] .nav-link:hover, [data-grad][data-gtone='light'] .nav-sub a:hover { background: rgba(255, 255, 255, .38); }
[data-grad][data-gtone='light'] .nav-sub { background: rgba(255, 255, 255, .22); }
[data-grad][data-gtone='light'] .menu-label { color: rgba(28, 34, 56, .6); }
[data-grad][data-gtone='light'] .btn.primary, [data-grad][data-gtone='light'] .user-chip, [data-grad][data-gtone='light'] .user-chip .nm, [data-grad][data-gtone='light'] .user-chip .rl { color: #1c2a55; }
[data-grad][data-gtone='light'] .user-chip .av { background: #ffffff; color: #1c2a55; }

/* gradient theme: the hover / focus effect of the home tiles and buttons follows the chosen gradient too */
[data-grad] .tile::after { background: var(--g); }
[data-grad] .tile:hover, [data-grad] .tile:focus-visible { box-shadow: 0 16px 30px color-mix(in srgb, var(--gc) 45%, transparent); }
[data-grad][data-gtone='light'] .tile:hover, [data-grad][data-gtone='light'] .tile:focus-visible { color: #1c2a55; }
[data-grad][data-gtone='light'] .tile:hover .i, [data-grad][data-gtone='light'] .tile:focus-visible .i { color: #1c2a55; }
[data-grad] .btn.primary:hover { filter: brightness(1.07) saturate(1.1); box-shadow: 0 6px 16px color-mix(in srgb, var(--gc) 40%, transparent); }

/* ---------------------------------------------------------------- top bar: spacing, avatar-only user button */
.topbar { gap: 8px; padding: 0 20px 0 16px; }
.topbar .icon-btn { width: 40px; height: 40px; }
.top-spacer { flex: 1; }
.user-chip.avatar-only { min-width: 0; width: 42px; height: 42px; padding: 0; margin-left: 6px; border-radius: 50%; justify-content: center; }
.user-chip.avatar-only .av { width: 34px; height: 34px; font-size: 13px; }
.user-menu .um-head { display: flex; flex-direction: column; gap: 1px; padding: 10px 14px 9px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.user-menu .um-head span { font-size: 11px; color: var(--muted); }
#view { padding-top: 14px; }
