/* SunSuite ERP — interface styles
   Palette: ink #13293D, brand #0096DB, sun #F37021, canvas #F3F6F9, line #DCE3EA */

@font-face { font-family: "Plex"; src: url("../fonts/plex-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex"; src: url("../fonts/plex-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex"; src: url("../fonts/plex-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plex"; src: url("../fonts/plex-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --brand: #0096DB;
  --brand-ink: #006FA3;
  --brand-soft: #E5F4FB;
  --sun: #F37021;
  --sun-soft: #FFF1E7;
  --ink: #13293D;
  --ink-2: #44566A;
  --ink-3: #6B7C8F;
  --canvas: #F3F6F9;
  --surface: #FFFFFF;
  --line: #DCE3EA;
  --line-2: #EBF0F4;
  --green: #18794E; --green-soft: #E6F4EC;
  --amber: #9A5B00; --amber-soft: #FFF4DB;
  --red: #C0322B;  --red-soft: #FDECEA;
  --grey-soft: #EEF1F4;
  --radius: 6px;
  --radius-lg: 10px;
  --sidebar-w: 248px;
  --topbar-h: 60px;
  --font: "Plex", "Segoe UI", system-ui, -apple-system, "Nirmala UI", "Noto Sans Bengali", "Vrinda", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14.5px; line-height: 1.5; color: var(--ink); background: var(--canvas); }
img { max-width: 100%; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; font-weight: 600; }
h1 { font-size: 1.55rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.25rem 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 3px; }
.icon { flex: none; vertical-align: middle; }
.muted { color: var(--ink-3); }
.small { font-size: .85rem; }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.pad { padding: 1rem; }
.mt { margin-top: 1rem; } .mt0 { margin-top: 0; } .mb { margin-bottom: 1rem; } .mb0 { margin-bottom: 0; }
.right { text-align: right; }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 100; border-radius: var(--radius); }
.skip-link:focus { left: 8px; }

/* ---------- Shell ---------- */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 40; }
.sidebar-brand { height: 76px; display: flex; align-items: center; justify-content: center; padding: 0 20px; border-bottom: 1px solid var(--line-2); }
.brand-link { display: flex; align-items: center; justify-content: center; }
.brand-logo { max-height: 46px; width: auto; display: block; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 10px 20px; }
.nav-group + .nav-group { margin-top: 14px; }
.nav-group-label { font-size: .76rem; color: var(--ink-3); padding: 4px 12px; font-weight: 500; }
.nav-link { position: relative; display: flex; align-items: center; gap: 11px; padding: 7px 12px; border-radius: var(--radius); color: var(--ink-2); font-weight: 500; }
.nav-link:hover { background: var(--canvas); color: var(--ink); text-decoration: none; }
.nav-link.is-active { background: var(--brand-soft); color: var(--brand-ink); }
.nav-link.is-active::before { content: ""; position: absolute; left: -10px; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--sun); }
/* Collapsible sidebar sections */
.sidebar-nav > .nav-link, .nav-section { margin-bottom: 2px; }
.nav-section-head { display: flex; align-items: center; gap: 11px; padding: 7px 12px; border-radius: var(--radius); color: var(--ink-2); font-weight: 500; cursor: pointer; list-style: none; user-select: none; }
.nav-section-head::-webkit-details-marker { display: none; }
.nav-section-head:hover { background: var(--canvas); color: var(--ink); }
.nav-section-head.has-active { color: var(--ink); }
.nav-section-head span { flex: 1; }
.nav-chevron { color: var(--ink-3); transition: transform .15s ease; }
.nav-section[open] > .nav-section-head .nav-chevron { transform: rotate(90deg); }
.nav-section-items { position: relative; margin: 2px 0 6px 21px; padding-left: 12px; border-left: 1px solid var(--line); }
.nav-sublink { position: relative; display: block; padding: 6px 10px; border-radius: var(--radius); color: var(--ink-2); font-size: .92rem; }
.nav-sublink:hover { background: var(--canvas); color: var(--ink); text-decoration: none; }
.nav-sublink.is-active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 500; }
.nav-sublink.is-active::before { content: ""; position: absolute; left: -13px; top: 6px; bottom: 6px; width: 3px; border-radius: 3px; background: var(--sun); }
.sidebar-foot { display: flex; align-items: center; gap: 6px; padding: 10px 10px 10px 12px; border-top: 1px solid var(--line-2); }
.sidebar-user { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: var(--radius); color: var(--ink); }
.sidebar-user:hover { background: var(--canvas); text-decoration: none; }
.sidebar-user .avatar { flex: none; }
.avatar-img { padding: 0; object-fit: cover; background: var(--line); border: 1px solid var(--line); }
.sidebar-user-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.sidebar-user-text strong { font-weight: 500; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-text small { font-size: .75rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-logout { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink-2); font: inherit; font-size: .85rem; font-weight: 500; cursor: pointer; white-space: nowrap; }
.sidebar-logout span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.sidebar-logout:hover { border-color: #F3C3BF; background: var(--red-soft); color: var(--red); }
.shell { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; height: var(--topbar-h); background: rgba(255,255,255,.94); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 24px; }
.topbar-title { flex: 1; min-width: 0; }
.breadcrumbs { display: flex; gap: 8px; align-items: center; font-size: .88rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.breadcrumbs a { color: var(--ink-3); }
.breadcrumbs [aria-current] { color: var(--ink); font-weight: 500; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 0; background: transparent; color: var(--ink-2); border-radius: var(--radius); cursor: pointer; }
.icon-btn:hover { background: var(--canvas); }
.menu-btn { display: none; }
.dot-count { position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--sun); color: #fff; font-size: .7rem; font-weight: 600; line-height: 18px; text-align: center; }
.user-btn { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 4px 8px 4px 4px; border-radius: 20px; cursor: pointer; color: var(--ink); font: inherit; }
.user-btn:hover { background: var(--canvas); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 600; }
.user-name { font-weight: 500; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main { padding: 24px 28px 48px; max-width: 1480px; width: 100%; }
.main:focus { outline: none; }

/* Dropdowns */
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 12px 32px rgba(19,41,61,.14); padding: 6px; display: none; z-index: 50; }
.dropdown.is-open .dropdown-menu { display: block; }
.dropdown-wide { width: 360px; max-width: calc(100vw - 24px); }
.dropdown-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }
.dropdown-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; font: inherit; color: var(--ink); border-radius: var(--radius); cursor: pointer; }
.dropdown-item:hover { background: var(--canvas); text-decoration: none; }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item { display: block; padding: 9px 10px; border-radius: var(--radius); color: var(--ink); }
.notif-item:hover { background: var(--canvas); text-decoration: none; }
.notif-item.unread { border-left: 3px solid var(--sun); background: #FFFAF6; }
.notif-item strong { display: block; font-weight: 500; }
.notif-item span { font-size: .82rem; color: var(--ink-3); }

/* ---------- Page header ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.page-head .sub { margin: 4px 0 0; color: var(--ink-3); }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.doc-number { font-size: 1.9rem; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.doc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 6px; color: var(--ink-3); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 7px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; line-height: 1.2; }
.btn:hover { border-color: #C3CDD7; background: #FAFBFC; text-decoration: none; }
.btn:disabled, .btn.is-busy { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #A2271F; border-color: #A2271F; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--brand-ink); }
.btn-ghost:hover { background: var(--brand-soft); border-color: transparent; }
.btn-sm { min-height: 30px; padding: 4px 10px; font-size: .85rem; }
.btn-link { border: 0; background: none; padding: 0; color: var(--brand-ink); font: inherit; cursor: pointer; }
.btn-link:hover { text-decoration: underline; }
.btn-link.danger { color: var(--red); }
.inline-form { display: inline; }

/* ---------- Panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); margin-bottom: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.panel-head h2, .panel-head h3 { margin: 0; font-size: 1rem; }
.panel-body { padding: 18px; }
.panel-body.flush { padding: 0; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
.grid > .panel { margin-bottom: 0; }
.grid > * { min-width: 0; }
.grid-side { grid-template-columns: minmax(200px, 260px) minmax(0, 1fr); align-items: start; }

/* Key-value lists */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- Stats ---------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 20px; }
.stat { background: var(--surface); padding: 16px 18px; display: block; color: var(--ink); border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); margin: 0 -1px -1px 0; }
a.stat:hover { background: #FAFCFE; text-decoration: none; }
.stat-row-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1200px) { .stat-row-5 { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); } }
@media (max-width: 640px) { .stat-row-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat-label { color: var(--ink-3); font-size: .85rem; }
.stat-value { font-size: 1.45rem; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em; margin-top: 2px; }
.stat-note { font-size: .8rem; color: var(--ink-3); }
.stat.attention .stat-value { color: var(--sun); }
.stat.danger .stat-value { color: var(--red); }
.section-title { font-size: .95rem; color: var(--ink-2); font-weight: 600; margin: 4px 0 10px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; position: relative; }
table.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 14px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: top; }
.table th { font-weight: 500; color: var(--ink-3); font-size: .84rem; background: #FAFBFC; white-space: nowrap; }
.table tbody tr:hover { background: #FAFCFE; }
.table tr:last-child td { border-bottom: 0; }
.table tfoot td { font-weight: 600; background: #FAFBFC; border-top: 1px solid var(--line); }
.table .actions { text-align: right; white-space: nowrap; }
.table th.num, .table td.num { text-align: right; }
.table .actions > * + * { margin-left: 10px; }
.table.compact th, .table.compact td { padding: 7px 12px; }
.sort-link { color: inherit; }
.row-title { font-weight: 500; color: var(--ink); }
.row-sub { display: block; color: var(--ink-3); font-size: .84rem; }
.empty { padding: 36px 20px; text-align: center; color: var(--ink-3); }
.empty strong { display: block; color: var(--ink); font-weight: 500; margin-bottom: 4px; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.filters .field { margin: 0; min-width: 150px; }
.filters .field-grow { flex: 1; min-width: 200px; }
.pager { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line-2); font-size: .88rem; color: var(--ink-3); }
.pager-links { display: flex; gap: 4px; }
.pager-links a, .pager-links span { min-width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; padding: 0 8px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink-2); }
.pager-links .current { background: var(--ink); color: #fff; border-color: var(--ink); }
.pager-links .disabled { opacity: .45; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 11px; font-size: .78rem; font-weight: 500; line-height: 1.5; white-space: nowrap; }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-blue { background: var(--brand-soft); color: var(--brand-ink); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-grey { background: var(--grey-soft); color: var(--ink-2); }

/* ---------- Alerts ---------- */
.alert { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 11px 14px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid; }
.alert-success { background: var(--green-soft); border-color: #B8DFC9; color: #0F5132; }
.alert-error { background: var(--red-soft); border-color: #F3C3BF; color: #8A1F19; }
.alert-info { background: var(--brand-soft); border-color: #B5DEF2; color: #04476A; }
.alert-warn { background: var(--amber-soft); border-color: #F1D79B; color: #6B4000; }
.alert-close { border: 0; background: none; color: inherit; cursor: pointer; padding: 2px; opacity: .7; }
.notice { padding: 12px 14px; border-radius: var(--radius); background: var(--canvas); color: var(--ink-2); margin-bottom: 16px; }
.notice.warn { background: var(--sun-soft); color: #7A3500; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-all { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.form-grid .field { margin-bottom: 0; }
.field > label, .label { font-weight: 500; font-size: .88rem; color: var(--ink-2); }
.req { color: var(--red); margin-left: 2px; }
.hint { font-size: .8rem; color: var(--ink-3); }
.input, select.input, textarea.input { width: 100%; min-height: 38px; padding: 7px 11px; border: 1px solid #C9D3DD; border-radius: var(--radius); background: #fff; color: var(--ink); font: inherit; }
textarea.input { min-height: 84px; resize: vertical; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,150,219,.16); }
.input.is-invalid { border-color: var(--red); }
.input[readonly] { background: var(--canvas); }
.field-error { color: var(--red); font-size: .82rem; }
.check { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--brand); }
.form-section { padding: 18px; border-bottom: 1px solid var(--line-2); }
.form-section:last-child { border-bottom: 0; }
.form-section > h3 { margin-bottom: 14px; font-size: .95rem; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; padding: 14px 18px; border-top: 1px solid var(--line-2); background: #FAFBFC; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* Line items editor */
.lines { width: 100%; border-collapse: collapse; }
.lines th { text-align: left; font-weight: 500; font-size: .82rem; color: var(--ink-3); padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.lines td { padding: 6px; vertical-align: top; border-bottom: 1px solid var(--line-2); }
.lines .input { min-height: 34px; padding: 5px 8px; }
.lines .c-item { min-width: 220px; }
.lines .c-qty { width: 90px; } .lines .c-price { width: 120px; } .lines .c-disc { width: 110px; } .lines .c-tax { width: 110px; } .lines .c-total { width: 130px; }
.lines .line-total { padding-top: 13px; font-variant-numeric: tabular-nums; text-align: right; font-weight: 500; }
.lines .desc { margin-top: 6px; }
.totals { margin-left: auto; width: min(360px, 100%); }
.totals div { display: flex; justify-content: space-between; padding: 6px 0; font-variant-numeric: tabular-nums; }
.totals .grand { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; font-weight: 600; font-size: 1.1rem; }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--ink-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.is-active { color: var(--brand-ink); border-bottom-color: var(--brand); }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 18px; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.timeline li::after { content: ""; position: absolute; left: 3px; top: 16px; bottom: 0; width: 1px; background: var(--line-2); }
.timeline li:last-child::after { display: none; }
.timeline .when { font-size: .8rem; color: var(--ink-3); }

/* Progress */
.progress { height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; min-width: 80px; }
.progress > span { display: block; height: 100%; background: var(--brand); }

/* Permission matrix */
.perm-module { border: 1px solid var(--line-2); border-radius: var(--radius); padding: 12px 14px; }
.perm-module h3 { display: flex; justify-content: space-between; align-items: center; font-size: .92rem; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.perm-list { display: grid; gap: 6px; }
.tag-sensitive { font-size: .72rem; color: var(--sun); margin-left: 4px; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(19,41,61,.45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 90; }
.modal-box { background: #fff; border-radius: var(--radius-lg); width: min(440px, 100%); padding: 22px; box-shadow: 0 24px 60px rgba(19,41,61,.3); }
.modal-title { font-size: 1.1rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.modal-box .field { margin-top: 10px; }

/* ---------- Guest pages ---------- */
body.guest { background: var(--canvas); }
.guest-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; }
.guest-card { width: min(420px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 32px; border-top: 4px solid var(--sun); }
.guest-card-wide { width: min(640px, 100%); }
.guest-brand { text-align: center; margin-bottom: 22px; }
.guest-brand img { max-height: 64px; }
.guest-title { font-size: 1.25rem; margin-bottom: 4px; }
.guest-foot { margin-top: 18px; font-size: .82rem; color: var(--ink-3); text-align: center; }
.btn-block { width: 100%; }
.req-list { list-style: none; padding: 0; margin: 0 0 16px; }
.req-list li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line-2); }

.error-page { max-width: 520px; padding: 40px 0; }
.error-code { font-size: 3.4rem; font-weight: 700; color: var(--sun); margin: 0; line-height: 1; }

/* Chart */
.chart-box { position: relative; height: 280px; }

/* ---------- Print (invoices, quotations) ---------- */
.doc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 40px; max-width: 900px; }
.doc-head { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 20px; border-bottom: 2px solid var(--ink); margin-bottom: 22px; }
.doc-head img { max-height: 64px; }
.doc-title { font-size: 1.8rem; font-weight: 600; text-align: right; }
.doc-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 22px; }
.doc .table th { background: var(--canvas); }
.doc-foot { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: .88rem; }
.doc-sign { margin-top: 40px; text-align: right; }
.doc-sign img { max-height: 70px; display: block; margin-left: auto; }
.doc-sign span { display: inline-block; border-top: 1px solid var(--ink-2); padding-top: 4px; min-width: 200px; text-align: center; }
.print-bar { display: flex; gap: 8px; margin-bottom: 16px; }

@media print {
  .sidebar, .topbar, .print-bar, .alert, .no-print, .skip-link { display: none !important; }
  .shell { margin: 0; }
  .main { padding: 0; max-width: none; }
  body { background: #fff; font-size: 12.5px; }
  .doc { border: 0; padding: 0; max-width: none; }
  .badge { border: 1px solid currentColor; }
  a { color: inherit; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid-main, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(19,41,61,.2); }
  body.sidebar-open .sidebar { transform: none; }
  .sidebar-scrim { display: none; position: fixed; inset: 0; background: rgba(19,41,61,.35); z-index: 35; }
  body.sidebar-open .sidebar-scrim { display: block; }
  .shell { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .main { padding: 18px 16px 40px; }
  .topbar { padding: 0 12px; }
  .grid-2, .form-grid, .form-grid-3, .grid-side { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .user-name { display: none; }
  .doc { padding: 20px; }
  .doc-parties, .doc-head { grid-template-columns: 1fr; flex-direction: column; }
  .doc-title { text-align: left; }
}
@media (max-width: 640px) {
  /* stacked tables on phones */
  .table.stack thead { display: none; }
  .table.stack, .table.stack tbody, .table.stack tr, .table.stack td { display: block; width: 100%; }
  .table.stack tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .table.stack td { border: 0; padding: 4px 14px; text-align: left; }
  .table.stack td[data-label]::before { content: attr(data-label); display: block; font-size: .76rem; color: var(--ink-3); }
  .table.stack td.num { text-align: left; }
  .table.stack .actions { text-align: left; }
  .page-head { align-items: flex-start; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 12px 14px; }
  .stat-value { font-size: 1.15rem; }
  .stat-note { display: none; }
  .doc-number { font-size: 1.5rem; }
  .filters .field { min-width: 0; flex: 1 1 140px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- Reports hub ---------- */
.rp-hero { display: flex; gap: 24px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; margin-bottom: 18px; }
.rp-hero h1 { margin: 0 0 4px; font-size: 1.6rem; }
.rp-hero p { margin: 0; color: var(--ink-3); max-width: 640px; }
.rp-search { position: relative; flex: 0 1 340px; min-width: 240px; }
.rp-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.rp-search .input { padding-left: 38px; height: 42px; border-radius: 999px; background: var(--surface); }
.rp-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.rp-chip { font: inherit; font-size: .88rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 6px 14px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.rp-chip span { font-size: .75rem; background: var(--grey-soft); color: var(--ink-3); border-radius: 999px; padding: 0 7px; line-height: 1.6; }
.rp-chip:hover { border-color: var(--brand); color: var(--brand-ink); }
.rp-chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.rp-chip.is-active span { background: rgba(255,255,255,.18); color: #fff; }
.rp-group { --tone: var(--brand); --tone-soft: var(--brand-soft); margin-bottom: 28px; }
.rp-group.tone-green { --tone: var(--green); --tone-soft: var(--green-soft); }
.rp-group.tone-amber { --tone: var(--amber); --tone-soft: var(--amber-soft); }
.rp-group.tone-sun   { --tone: var(--sun); --tone-soft: var(--sun-soft); }
.rp-group.tone-ink   { --tone: var(--ink); --tone-soft: var(--grey-soft); }
.rp-group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.rp-group-head h2 { margin: 0; font-size: 1.05rem; }
.rp-group-icon { width: 32px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: var(--tone-soft); color: var(--tone); }
.rp-count { color: var(--ink-3); font-size: .82rem; margin-left: 2px; }
.rp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.rp-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 16px 16px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); color: var(--ink); overflow: hidden; transition: border-color .15s, box-shadow .15s, transform .15s; }
.rp-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--tone); opacity: 0; transition: opacity .15s; }
.rp-card:hover, .rp-card:focus-visible { border-color: var(--tone); box-shadow: 0 6px 18px rgba(19,41,61,.08); transform: translateY(-1px); }
.rp-card:hover::before, .rp-card:focus-visible::before { opacity: 1; }
.rp-card-title { font-weight: 600; font-size: .98rem; }
.rp-card-desc { color: var(--ink-3); font-size: .86rem; line-height: 1.45; flex: 1; }
.rp-card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.rp-tag { display: inline-flex; align-items: center; gap: 5px; font-size: .75rem; color: var(--tone); background: var(--tone-soft); border-radius: 999px; padding: 2px 9px; }
.rp-open { font-size: .82rem; color: var(--tone); font-weight: 600; opacity: 0; transition: opacity .15s; }
.rp-card:hover .rp-open, .rp-card:focus-visible .rp-open { opacity: 1; }
@media (max-width: 640px) { .rp-search { flex: 1 1 100%; } .rp-grid { grid-template-columns: 1fr; } }
.rp-card[hidden], .rp-group[hidden], .rp-none[hidden] { display: none; }
.rp-card, .rp-card:hover, .rp-card:focus-visible { text-decoration: none; }
.check-row { display: flex; flex-wrap: wrap; gap: 10px 22px; padding: 6px 0 2px; }

/* ---------- Searchable picker (client field) ---------- */
.cb { position: relative; }
.cb-input { padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236B7C8F' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='4.5'/%3E%3Cpath d='M10.5 10.5L14 14'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.cb-list { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 12px 30px rgba(19,41,61,.14); max-height: 300px; overflow-y: auto; }
.cb-opt { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: 8px 10px; border-radius: var(--radius); cursor: pointer; }
.cb-opt.is-active { background: var(--brand-soft); }
.cb-opt[aria-selected="true"] .cb-name { font-weight: 600; }
.cb-name { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-meta { color: var(--ink-3); font-size: .8rem; white-space: nowrap; }
.cb-new { color: var(--brand-ink); font-weight: 600; border-top: 1px solid var(--line-2); margin-top: 2px; }
.cb-opt.cb-new:first-child { border-top: 0; margin-top: 0; }
.cb-empty { padding: 8px 10px; color: var(--ink-3); font-size: .88rem; }
.qc .field { margin-top: 12px; }
.qc-dupes { margin-top: 14px; padding: 10px 12px; background: var(--amber-soft); border: 1px solid #F1D79B; border-radius: var(--radius); color: #6B4000; font-size: .9rem; }
.qc-dupes p { margin: 0 0 6px; }
.qc-dupe { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 4px 0; }

/* ---------- About ---------- */
.ab-hero { position: relative; overflow: hidden; display: flex; gap: 28px; align-items: center; padding: 28px 30px; margin-bottom: 20px; border-radius: var(--radius-lg); background: linear-gradient(120deg, #0B2235 0%, #13293D 55%, #0F3B57 100%); color: #fff; }
.ab-hero::after { content: ""; position: absolute; right: -80px; top: -120px; width: 360px; height: 360px; border-radius: 50%; background: radial-gradient(circle, rgba(243,112,33,.38) 0%, rgba(243,112,33,0) 65%); pointer-events: none; }
.ab-hero-brand { flex: none; background: #fff; border-radius: 14px; padding: 14px 18px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.ab-hero-brand img { display: block; height: 64px; width: auto; max-width: 220px; object-fit: contain; }
.ab-hero-text { position: relative; z-index: 1; min-width: 0; }
.ab-hero h1 { margin: 2px 0 2px; font-size: 2rem; color: #fff; }
.ab-tagline { margin: 0 0 14px; color: rgba(255,255,255,.75); font-size: 1.02rem; }
.ab-eyebrow { margin: 0; text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; font-weight: 600; color: var(--sun); }
.ab-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.ab-badge { font-size: .8rem; padding: 4px 11px; border-radius: 999px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); color: rgba(255,255,255,.9); }
.ab-badge-strong { background: var(--sun); border-color: var(--sun); color: #fff; font-weight: 600; }
.ab-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.ab-lead { margin: 0 0 14px; color: var(--ink-2); line-height: 1.65; }
.ab-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ab-chip { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; padding: 4px 10px; border-radius: 999px; background: var(--green-soft); color: var(--green); }
.ab-modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.ab-module { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--line-2); border-radius: var(--radius-lg); }
.ab-module strong { display: block; font-weight: 600; font-size: .93rem; }
.ab-module span:not(.ab-module-icon):not(.ab-off) { display: block; color: var(--ink-3); font-size: .83rem; line-height: 1.4; margin-top: 2px; }
.ab-module-icon { flex: none; width: 34px; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand-ink); }
.ab-module.is-off { opacity: .55; }
.ab-off { font-size: .7rem; font-weight: 600; padding: 1px 7px; margin-left: 4px; border-radius: 999px; background: var(--grey-soft); color: var(--ink-3); vertical-align: 2px; }
.ab-releases { list-style: none; margin: 0; padding: 0; }
.ab-releases > li { position: relative; padding: 0 0 18px 22px; border-left: 2px solid var(--line-2); margin-left: 6px; }
.ab-releases > li:last-child { padding-bottom: 0; border-left-color: transparent; }
.ab-releases > li::before { content: ""; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line); }
.ab-releases > li.is-current::before { border-color: var(--sun); background: var(--sun); }
.ab-rel-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 6px; }
.ab-rel-ver { font-weight: 700; font-size: .82rem; color: var(--brand-ink); background: var(--brand-soft); padding: 1px 8px; border-radius: 6px; }
.ab-releases ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: .9rem; }
.ab-releases ul li { margin: 3px 0; }
.ab-dev .panel-body { padding: 20px; }
.ab-dev-row { display: flex; align-items: center; gap: 12px; margin: 12px 0 16px; }
.ab-dev-row > div { display: flex; flex-direction: column; }
.ab-dev-mark { flex: none; width: 48px; height: 48px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--sun), #F7A23B); }
.ab-dev-name { font-size: 1.12rem; }
.ab-dev-link { width: 100%; justify-content: center; }
.ab-stack { list-style: none; margin: 0; padding: 0; }
.ab-stack li { display: flex; flex-direction: column; padding: 10px 18px; border-bottom: 1px solid var(--line-2); }
.ab-stack li:last-child { border-bottom: 0; }
.ab-stack strong { font-weight: 600; font-size: .9rem; }
.ab-stack span { color: var(--ink-3); font-size: .82rem; }
.ab-kv { grid-template-columns: 120px 1fr; font-size: .86rem; }
.ab-kv dd { word-break: break-word; }
.ab-foot { margin: 8px 0 0; text-align: center; }
.sidebar-version { display: block; padding: 0 22px 8px; font-size: .74rem; color: var(--ink-3); }
.sidebar-version:hover { color: var(--brand-ink); }
@media (max-width: 1000px) { .ab-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .ab-hero { flex-direction: column; align-items: flex-start; padding: 22px; } .ab-hero h1 { font-size: 1.6rem; } }

/* ---------- Backups ---------- */
.bk-create { display: flex; gap: 8px; flex-wrap: wrap; }
.bk-create .input { width: auto; min-width: 170px; }
.bk-sched { font-size: 1.15rem; }
.bk-name { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .72rem; word-break: break-all; }
.bk-actions { white-space: nowrap; }
.bk-actions .inline-form { display: inline; }
.bk-code { margin: 8px 0 10px; padding: 10px 12px; background: var(--ink); color: #E6F4FB; border-radius: var(--radius); font-size: .8rem; white-space: pre-wrap; word-break: break-all; }
.text-red { color: var(--red); } .text-amber { color: var(--amber); }
.check > span > .hint { display: block; margin-top: 2px; }

/* ---------- Email settings ---------- */
.em-adv { margin-top: 14px; }
.em-adv summary { cursor: pointer; color: var(--ink-2); font-weight: 500; }
.em-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px 24px; }
.em-group strong { font-weight: 600; }
.em-test-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.em-test-row .field { flex: 0 1 380px; margin: 0; }
.ps-hr { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; margin-top: 4px; color: var(--ink-2); }

/* ---------- HR: check-in card, attendance, leave ---------- */
.ci-card { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; padding: 20px 24px; margin-bottom: 20px; border-radius: var(--radius-lg); border: 1px solid var(--line); background: linear-gradient(110deg, var(--surface) 55%, var(--brand-soft)); }
.ci-card.is-working { background: linear-gradient(110deg, var(--surface) 55%, var(--green-soft)); border-color: #BFE3CF; }
.ci-card.is-done { background: var(--surface); }
.ci-date { color: var(--ink-3); font-size: .85rem; }
.ci-clock { font-size: 2.1rem; font-weight: 700; letter-spacing: .02em; font-variant-numeric: tabular-nums; line-height: 1.15; margin: 2px 0 4px; }
.ci-note { color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ci-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.ci-btn { min-height: 48px; padding: 0 26px; font-size: 1rem; gap: 8px; }
.ci-out { border-color: var(--sun); color: var(--sun); font-weight: 600; }
.ci-out:hover { background: var(--sun-soft); }
.ci-sub { color: var(--ink-3); font-size: .8rem; }
.ci-done { display: inline-flex; gap: 6px; align-items: center; color: var(--green); font-weight: 600; }
.ci-warn { margin: 0; color: var(--amber); font-size: .88rem; max-width: 240px; text-align: right; }
.badge-violet { background: #F1ECFB; color: #5B3CA8; }
.badge-none { background: transparent; color: var(--ink-3); }
.t-red { color: var(--red); } .t-amber { color: var(--amber); } .t-blue { color: var(--brand-ink); }
.at-month-head { justify-content: flex-start; gap: 12px; }
.at-month-head h2 { min-width: 150px; text-align: center; }
.at-stats { display: grid; grid-template-columns: repeat(6, 1fr); border-bottom: 1px solid var(--line-2); }
.at-stats > div { padding: 12px 16px; border-right: 1px solid var(--line-2); display: flex; flex-direction: column; }
.at-stats > div:last-child { border-right: 0; }
.at-stats strong { font-size: 1.35rem; }
.at-stats span { color: var(--ink-3); font-size: .8rem; }
.at-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.at-dow { font-size: .75rem; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; padding: 0 4px 2px; }
.at-dow.is-off { color: #B4BFCA; }
.at-day { --bg: var(--surface); --fg: var(--ink-3); position: relative; min-height: 76px; padding: 6px 8px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.at-day.is-blank { border: 0; background: transparent; }
.at-day.is-today { box-shadow: 0 0 0 2px var(--brand); }
.at-num { font-weight: 600; font-size: .9rem; color: var(--ink); }
.at-chip { font-size: .72rem; font-weight: 600; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.at-time { font-size: .72rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.at-edited { display: inline-block; font-size: .62rem; font-weight: 700; padding: 0 4px; border-radius: 4px; background: var(--grey-soft); color: var(--ink-3); }
.at-day .at-edited { position: absolute; top: 6px; right: 6px; }
.tone-green { --bg: var(--green-soft); --fg: var(--green); }
.tone-amber { --bg: var(--amber-soft); --fg: var(--amber); }
.tone-red { --bg: var(--red-soft); --fg: var(--red); }
.tone-blue { --bg: var(--brand-soft); --fg: var(--brand-ink); }
.tone-violet { --bg: #F1ECFB; --fg: #5B3CA8; }
.tone-grey { --bg: var(--canvas); --fg: #A0ACB8; }
.tone-none { --bg: var(--surface); --fg: var(--ink-3); }
.at-day-nav { justify-content: flex-start; gap: 10px; flex-wrap: wrap; }
.at-date-form .input { width: auto; }
.at-day-label { color: var(--ink-2); font-weight: 500; }
.at-sum { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.at-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); font-size: .82rem; color: var(--ink-2); }
.at-legend span { display: inline-flex; align-items: center; gap: 6px; }
.at-sheet-wrap { overflow-x: auto; position: relative; }
.at-sheet { border-collapse: separate; border-spacing: 0; font-size: .78rem; }
.at-sheet th, .at-sheet td { padding: 3px 2px; text-align: center; border-bottom: 1px solid var(--line-2); }
.at-sheet thead th { font-weight: 600; color: var(--ink-2); padding: 8px 2px; line-height: 1.1; }
.at-sheet thead th small { display: block; font-weight: 400; color: var(--ink-3); font-size: .66rem; }
.at-sheet thead th.is-off { color: #B4BFCA; }
.at-sheet .at-name { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; padding: 6px 12px 6px 16px; min-width: 170px; max-width: 200px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 1px 0 0 var(--line-2); }
.at-sheet .at-name small { display: block; color: var(--ink-3); font-weight: 400; font-size: .72rem; }
.at-cell { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 6px; background: var(--bg); color: var(--fg); font-weight: 700; font-size: .68rem; border: 0; font-family: inherit; padding: 0; }
button.at-cell { cursor: pointer; }
button.at-cell:hover { outline: 2px solid var(--brand); }
.at-cell.is-hr { box-shadow: inset 0 -3px 0 rgba(19,41,61,.25); }
.at-tot { font-weight: 600; padding: 3px 10px !important; color: var(--ink); white-space: nowrap; }
.lv-today { padding: 10px 14px; margin-bottom: 16px; border-radius: var(--radius); background: var(--brand-soft); color: var(--ink-2); font-size: .9rem; }
.lv-balances { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 20px; }
.lv-bal { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: var(--radius-lg); padding: 14px 16px; }
.lv-bal-name { font-weight: 600; font-size: .9rem; }
.lv-bal-big { font-size: 1.6rem; font-weight: 700; margin: 4px 0 6px; }
.lv-bal-big span { font-size: .85rem; font-weight: 400; color: var(--ink-3); }
.lv-bar { height: 6px; border-radius: 99px; background: var(--grey-soft); overflow: hidden; margin-bottom: 6px; }
.lv-bar i { display: block; height: 100%; background: var(--c); border-radius: 99px; }
.lv-bal-sub { font-size: .78rem; color: var(--ink-3); }
.lv-type { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.lv-type::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
.lv-approve { border-color: #F1D79B; }
.lv-preview { margin-top: 14px; padding: 10px 14px; border-radius: var(--radius); background: var(--canvas); color: var(--ink-2); font-size: .9rem; }
.lv-preview.is-ok { background: var(--green-soft); color: var(--ink); }
.lv-preview.is-bad { background: var(--red-soft); color: var(--ink); }
.lv-type-form { padding: 16px; border-top: 1px solid var(--line-2); }
.lv-type-form h3 { margin-top: 0; }
tr.is-muted td { color: var(--ink-3); }
@media (max-width: 760px) {
  .at-stats { grid-template-columns: repeat(3, 1fr); }
  .at-stats > div:nth-child(3n) { border-right: 0; }
  .at-day { min-height: 54px; padding: 4px; }
  .at-chip, .at-time { display: none; }
  .at-day.tone-green, .at-day.tone-red, .at-day.tone-amber, .at-day.tone-blue, .at-day.tone-violet { border-color: var(--fg); }
  .ci-right { align-items: stretch; width: 100%; }
  .ci-btn { width: 100%; justify-content: center; }
}
.dash-leave { display: flex; text-decoration: none; color: inherit; margin-bottom: 16px; } .dash-leave:hover { text-decoration: none; border-color: var(--amber); }

/* ---------- Documents ---------- */
.dm-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 20px; align-items: start; }
.dm-side { padding: 8px 0; position: sticky; top: calc(var(--topbar-h) + 16px); }
.dm-nav { display: flex; flex-direction: column; padding: 0 8px; }
.dm-nav a { display: flex; align-items: center; gap: 9px; padding: 7px 12px; border-radius: var(--radius); color: var(--ink-2); font-size: .9rem; min-width: 0; }
.dm-nav a span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-nav a b { font-size: .75rem; font-weight: 600; color: var(--ink-3); }
.dm-nav a:hover { background: var(--canvas); text-decoration: none; }
.dm-nav a.is-active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 500; }
.dm-nav a svg { flex: none; color: var(--ink-3); }
.dm-nav a.is-active svg { color: var(--brand-ink); }
.dm-folders-head { margin: 14px 20px 4px; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.dm-pad { padding: 0 12px; margin: 4px 0; }
.dm-newfolder { margin: 10px 16px 6px; }
.dm-newfolder summary { cursor: pointer; color: var(--brand-ink); font-size: .88rem; display: inline-flex; gap: 4px; align-items: center; }
.dm-newfolder form { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.dm-newfolder .field { margin: 0; }
.dm-main-head { flex-wrap: wrap; gap: 10px; }
.dm-search { position: relative; flex: 0 1 320px; min-width: 200px; }
.dm-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.dm-search .input { padding-left: 34px; }
.dm-folder-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 8px 16px; border-bottom: 1px solid var(--line-2); background: var(--canvas); }
.dm-rename summary { list-style: none; cursor: pointer; }
.dm-rename-form { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.dm-rename-form .input { width: auto; min-height: 32px; padding: 4px 8px; }
.dm-doc { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.dm-doc > div { min-width: 0; }
.dm-kind { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 26px; padding: 0 5px; border-radius: 6px; font-size: .66rem; font-weight: 700; letter-spacing: .03em; background: var(--bg); color: var(--fg); }
.dm-kind-lg { min-width: 52px; height: 52px; border-radius: 12px; font-size: .82rem; }
.dm-head { display: flex; gap: 14px; align-items: center; }
.dm-ver { display: inline-block; font-size: .75rem; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: var(--grey-soft); color: var(--ink-2); }
.dm-ver.is-cur { background: var(--brand-soft); color: var(--brand-ink); }
.dm-lock { display: inline-flex; align-items: center; gap: 4px; color: var(--amber); font-size: .82rem; }
.dm-desc { color: var(--ink-2); line-height: 1.6; }
.dm-preview { text-align: center; background: var(--canvas); }
.dm-preview img { max-width: 100%; max-height: 520px; border-radius: 6px; box-shadow: 0 4px 16px rgba(19,41,61,.12); }
.dm-cur td { background: #FAFDFF; }
.dm-newver { padding: 14px 16px; border-top: 1px solid var(--line-2); }
.dm-newver > summary { list-style: none; display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.dm-newver > summary::-webkit-details-marker { display: none; }
.dm-newver form { margin-top: 14px; }
.dm-access .dm-roles { margin-top: 12px; padding: 12px; border-radius: var(--radius); background: var(--canvas); }
.dm-access:has(input[name="visibility"][value="all"]:checked) .dm-roles { display: none; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; flex-wrap: wrap; }
.pager-links { display: flex; gap: 8px; align-items: center; }
@media (max-width: 900px) { .dm-layout { grid-template-columns: 1fr; } .dm-side { position: static; } }

/* ---------------------------------------------------------------- Support tickets */
.tk-tabs a { display: inline-flex; align-items: center; gap: 6px; }
.tk-count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--grey-soft); color: var(--ink-2); font-size: .72rem; font-weight: 600; line-height: 18px; text-align: center; }
.tk-tabs a.is-active .tk-count { background: var(--brand-soft); color: var(--brand-ink); }
.tk-count.is-red { background: var(--red-soft); color: var(--red); }
.tk-confirm-banner { display: block; margin-bottom: 16px; }
.tk-confirm-banner:hover { text-decoration: none; }
.tk-row-late td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.tk-table .row-sub svg { vertical-align: -1px; }
.tk-pri { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.tk-pri::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--ink-3)); }
.tk-pri-low { --c: #9AA8B6; }
.tk-pri-normal { --c: var(--brand); }
.tk-pri-high { --c: var(--sun); color: #A4470F; }
.tk-pri-urgent { --c: var(--red); color: var(--red); font-weight: 600; }

/* raise form */
.tk-form { max-width: 900px; }
.tk-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.tk-cats.has-error .tk-cat { border-color: var(--red); }
.tk-cat, .tk-pri-opt { position: relative; display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius-lg); cursor: pointer; background: var(--surface); transition: border-color .12s, background .12s; }
.tk-cat:hover, .tk-pri-opt:hover { border-color: var(--brand); }
.tk-cat input, .tk-pri-opt input { margin-top: 3px; accent-color: var(--brand); }
.tk-cat span, .tk-pri-opt span { display: flex; flex-direction: column; min-width: 0; }
.tk-cat small, .tk-pri-opt small { color: var(--ink-3); font-size: .8rem; line-height: 1.35; margin-top: 2px; }
.tk-cat:has(input:checked), .tk-pri-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand) inset; }
.tk-pris { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.tk-pri-opt-high:has(input:checked) { border-color: var(--sun); background: var(--sun-soft); box-shadow: 0 0 0 1px var(--sun) inset; }
.tk-pri-opt-urgent:has(input:checked) { border-color: var(--red); background: var(--red-soft); box-shadow: 0 0 0 1px var(--red) inset; }
.tk-pri-opt-high input { accent-color: var(--sun); }
.tk-pri-opt-urgent input { accent-color: var(--red); }

/* conversation */
.tk-msgs { padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.tk-msg { display: flex; gap: 12px; align-items: flex-start; }
.tk-msg > .avatar { flex: none; margin-top: 2px; }
.tk-bubble { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); padding: 10px 14px 12px; }
.tk-bubble header { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-bottom: 4px; }
.tk-body { line-height: 1.6; overflow-wrap: anywhere; }
.tk-msg-req .tk-bubble { background: #FAFBFC; }
.tk-msg-agent > .avatar { background: var(--brand); color: #fff; }
.tk-msg-agent .tk-bubble { border-color: #BFE3F5; background: #F5FBFE; }
.tk-msg-note > .avatar { background: var(--amber-soft); color: var(--amber); }
.tk-msg-note .tk-bubble { border: 1px dashed #E7C677; background: #FFFBF0; }
.tk-role { display: inline-flex; align-items: center; gap: 4px; font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: 1px 7px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-ink); }
.tk-role-note { background: var(--amber-soft); color: var(--amber); }
.tk-event { text-align: center; font-size: .8rem; color: var(--ink-3); position: relative; }
.tk-event::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--line-2); }
.tk-event span { position: relative; background: var(--surface); padding: 0 10px; }
.tk-files { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tk-files a { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px 5px 6px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); font-size: .85rem; max-width: 280px; }
.tk-files a:hover { border-color: var(--brand); text-decoration: none; }
.tk-files a > span:last-child { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.tk-files a > span:last-child { white-space: nowrap; text-overflow: ellipsis; }
.tk-files small { color: var(--ink-3); font-size: .72rem; }
.tk-closed { margin: 0 18px 18px; padding: 12px 14px; border-radius: var(--radius); background: var(--grey-soft); color: var(--ink-2); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tk-composer { border-top: 1px solid var(--line-2); padding: 14px 18px 16px; background: #FBFCFD; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.tk-composer textarea { resize: vertical; min-height: 96px; background: var(--surface); }
.tk-composer.is-note textarea { background: #FFFBF0; border-color: #E7C677; }
.tk-mode { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 10px; background: var(--surface); }
.tk-mode label { cursor: pointer; }
.tk-mode input { position: absolute; opacity: 0; pointer-events: none; }
.tk-mode span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; font-size: .86rem; font-weight: 500; color: var(--ink-2); }
.tk-mode label + label span { border-left: 1px solid var(--line); }
.tk-mode input:checked + span { background: var(--brand-soft); color: var(--brand-ink); }
.tk-mode label:last-child input:checked + span { background: var(--amber-soft); color: var(--amber); }
.tk-mode input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: -2px; }
.tk-composer-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.tk-composer-bar .input { width: auto; min-height: 34px; padding: 4px 8px; }
.tk-saved { max-width: 210px; }
.tk-spacer { flex: 1; }
.tk-attach { cursor: pointer; }
.tk-attach:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }

/* requester: is it fixed? */
.tk-resolve { border-color: #A7D9BD; background: var(--green-soft); }
.tk-resolve h2 { display: flex; align-items: center; gap: 8px; color: var(--green); }
.tk-resolve-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; }
.tk-resolve-grid form { display: flex; flex-direction: column; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 12px; }
.tk-resolve-no label { font-weight: 500; }
.tk-rate { display: flex; gap: 8px; }
.tk-rate label { flex: 1; cursor: pointer; }
.tk-rate input { position: absolute; opacity: 0; }
.tk-rate span { display: block; text-align: center; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius); font-size: .88rem; }
.tk-rate input:checked + span { border-color: var(--green); background: var(--green-soft); color: var(--green); font-weight: 500; }
.tk-rate label:last-child input:checked + span { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.tk-rate input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

/* side panels */
.tk-props { display: flex; flex-direction: column; gap: 10px; }
.tk-props .field { margin: 0; }
.tk-person { display: flex; gap: 10px; align-items: center; }
.tk-others { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.tk-others .label { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.tk-others ul { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: .88rem; }
.tk-others li { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.tk-others li a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* settings */
.tk-sla .input { max-width: 110px; }
.tk-inline-form { padding: 16px 18px; border-top: 1px solid var(--line-2); background: #FBFCFD; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.tk-inline-form h3 { font-size: 1rem; }

@media (max-width: 760px) {
  .tk-pris { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tk-resolve-grid { grid-template-columns: 1fr; }
  .tk-msgs { padding: 14px 12px; }
  .tk-msg > .avatar { display: none; }
  .tk-composer { padding: 12px; }
  .tk-saved { max-width: none; flex: 1 1 100%; }
  .tk-composer-bar .btn-primary { flex: 1 1 auto; }
}

/* ---------------------------------------------------------------- Login history */
.lh-table tr.lh-bad td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
.lh-device { display: inline-flex; gap: 8px; align-items: flex-start; }
.lh-device > svg { flex: none; margin-top: 3px; color: var(--ink-3); }
.lh-ip { font-variant-numeric: tabular-nums; color: var(--ink); }
.lh-alert { display: flex; justify-content: flex-start; gap: 12px; align-items: flex-start; margin-bottom: 20px; }
.lh-alert > svg { flex: none; margin-top: 2px; }
.lh-alert ul { margin: 6px 0; padding-left: 18px; }
.lh-sessions .is-current td { background: #F5FBFE; }

/* ---------------------------------------------------------------- Notification settings */
.nt-summary { display: flex; flex-wrap: wrap; gap: 14px 40px; align-items: center; padding: 16px 20px; }
.nt-summary > div { display: flex; align-items: baseline; gap: 8px; }
.nt-big { font-size: 1.6rem; font-weight: 600; color: var(--ink); }
.nt-mail { margin-left: auto; flex-wrap: wrap; align-items: center !important; }
.nt-group .panel-head h2 { display: flex; align-items: center; gap: 8px; }
.nt-group .panel-head h2 svg { color: var(--ink-3); }
.nt-cols { display: flex; gap: 0; font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.nt-cols span { width: 104px; text-align: center; }
.nt-row { display: grid; grid-template-columns: minmax(0, 1fr) 104px 104px; align-items: center; gap: 0; padding: 11px 18px; border-top: 1px solid var(--line-2); }
.nt-row:first-child { border-top: 0; }
.nt-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nt-text strong { font-weight: 500; }
.nt-row.is-off .nt-text strong { color: var(--ink-3); }
.nt-switch { position: relative; display: inline-flex; justify-content: center; align-items: center; gap: 6px; cursor: pointer; }
.nt-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.nt-track { position: relative; width: 38px; height: 22px; border-radius: 11px; background: #C9D3DD; transition: background .15s; flex: none; }
.nt-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(19,41,61,.25); transition: transform .15s; }
.nt-switch input:checked + .nt-track { background: var(--brand); }
.nt-switch input:checked + .nt-track::after { transform: translateX(16px); }
.nt-switch input:focus-visible + .nt-track { outline: 2px solid var(--brand); outline-offset: 2px; }
.nt-switch input:disabled + .nt-track { opacity: .45; cursor: not-allowed; }
.nt-label { display: none; font-size: .82rem; color: var(--ink-2); }
.nt-bar { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin: 0 0 20px; background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 -4px 16px rgba(19,41,61,.06); }
@media (prefers-reduced-motion: reduce) { .nt-track, .nt-track::after { transition: none; } }
@media (max-width: 640px) {
  .nt-cols { display: none; }
  .nt-row { grid-template-columns: 1fr 1fr; row-gap: 10px; }
  .nt-text { grid-column: 1 / -1; }
  .nt-switch { justify-content: flex-start; }
  .nt-label { display: inline; }
  .nt-mail { margin-left: 0; }
}

/* Orders: invoice column */
.or-inv { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.or-inv:hover { text-decoration: none; }
.or-inv:hover .row-sub { text-decoration: underline; }
.or-ready { display: block; }
.or-ready:hover { text-decoration: none; }
.or-ready svg { vertical-align: -3px; }
