/* Hello Logistics BMS — design system */
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/poppins-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/poppins-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/poppins-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/poppins-latin-700-normal.woff2') format('woff2'); }
:root {
  --brand-900: #022B2D;
  --brand-800: #03393B;
  --brand-700: #05494C;
  --brand-600: #01717C;
  --brand-500: #0B8A92;
  --brand-400: #16A5A8;
  --accent: #17C3B2;
  --brand-50: #E8F4F4;
  --brand-100: #D3EBEB;

  --bg: #F2F6F7;
  --surface: #FFFFFF;
  --ink: #12232A;
  --ink-2: #33464E;
  --muted: #56686F;
  --line: #E1E8EB;
  --line-2: #EDF2F4;

  --ok: #16865B;   --ok-bg: #E4F5EC;
  --warn: #A66300; --warn-bg: #FFF2DC;
  --bad: #C0392B;  --bad-bg: #FCE9E7;
  --info: #1C6EA4; --info-bg: #E5F1FA;
  --violet: #6C4BB4; --violet-bg: #EFEAFA;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(3, 57, 59, .05), 0 4px 16px rgba(3, 57, 59, .06);
  --shadow-lg: 0 10px 40px rgba(3, 57, 59, .16);
  --sidebar: 248px;
  --font: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--ink); background: var(--bg); }
a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-800); }
h1, h2, h3 { margin: 0; line-height: 1.25; color: var(--ink); }
small { font-size: 12px; }
.muted { color: var(--muted); }
.block { display: block; }
.mono { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: 13px; letter-spacing: .01em; }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }

.icon { width: 20px; height: 20px; flex: none; }
.icon.sm { width: 16px; height: 16px; }
.icon.xs { width: 14px; height: 14px; }
.icon.xl { width: 44px; height: 44px; stroke-width: 1.4; }

/* ---------------------------------------------------------------- layout */
.app { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 40;
  background: linear-gradient(180deg, var(--brand-800) 0%, var(--brand-900) 100%);
  color: #CFE5E5; display: flex; flex-direction: column; padding: 22px 14px 16px; overflow-y: auto;
}
.brand { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 6px 0 22px; color: #fff; font-weight: 600; font-size: 17px; letter-spacing: .01em; }
.brand:hover { color: #fff; }
.brand-mark { width: 38px; height: 50px; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav form { margin: 0; }
.nav-link {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; border-radius: 10px;
  color: #CFE5E5; font: 500 14px var(--font); background: none; border: 0; cursor: pointer; text-align: left;
  transition: background .15s, color .15s;
}
.nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-link.active { background: linear-gradient(90deg, var(--brand-600), var(--brand-500)); color: #fff; box-shadow: 0 6px 18px rgba(1, 113, 124, .35); }
.nav-label { margin: 18px 14px 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: rgba(207, 229, 229, .5); }
.side-card { margin-top: auto; position: relative; border-radius: 14px; overflow: hidden; min-height: 120px; border: 1px solid rgba(255, 255, 255, .12); }
.side-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.side-card p { position: relative; margin: 0; padding: 14px; font-weight: 600; font-size: 13px; color: #fff; line-height: 1.35; background: linear-gradient(180deg, rgba(2, 43, 45, .85), rgba(2, 43, 45, 0)); }
.scrim { display: none; }

.main { flex: 1; margin-left: var(--sidebar); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; padding: 12px 28px;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.topbar .menu-btn { display: none; }
.top-search { flex: 1; max-width: 520px; position: relative; }
.top-search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.top-search input[type=search] { width: 100%; height: 42px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); padding: 0 16px 0 42px; font: 14px var(--font); color: var(--ink); }
.top-search input[type=search]:focus { outline: none; border-color: var(--brand-400); background: #fff; box-shadow: 0 0 0 4px rgba(22, 165, 168, .15); }
.user-menu { margin-left: auto; position: relative; }
.user-chip { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 4px 6px; border-radius: 12px; cursor: pointer; font-family: var(--font); color: var(--ink); }
.user-chip:hover { background: var(--line-2); }
.who { display: flex; flex-direction: column; text-align: left; line-height: 1.2; }
.who b { font-size: 14px; font-weight: 600; }
.who small { color: var(--muted); max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dropdown { position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; }
.dropdown-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; display: flex; flex-direction: column; }
.dropdown-head small { color: var(--muted); }
.dropdown a, .dropdown button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 8px; color: var(--ink); background: none; border: 0; font: 14px var(--font); cursor: pointer; }
.dropdown a:hover, .dropdown button:hover { background: var(--line-2); }
.dropdown form { margin: 0; }

.avatar { width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; background: var(--brand-700); color: #fff; font-weight: 600; font-size: 13px; letter-spacing: .02em; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.avatar.lg { width: 52px; height: 52px; font-size: 17px; }
.avatar.company { background: var(--brand-600); }
.avatar.individual { background: #3D6E8F; }

.content { padding: 24px 28px 32px; flex: 1; width: 100%; max-width: 1480px; }
.foot { padding: 14px 28px 22px; color: var(--muted); font-size: 12px; }

/* ---------------------------------------------------------------- page */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 600; letter-spacing: -.01em; }
.page-head p { margin: 4px 0 0; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.page-head .actions form { margin: 0; }
.back { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.back:hover { color: var(--brand-600); }
.with-avatar { display: flex; align-items: center; gap: 14px; }
.with-avatar small { display: block; font-size: 13px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.job-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.job-title .badge, .job-title .pri { font-size: 12px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-head h2 .icon { color: var(--brand-600); }
.link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 500; }
.stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.grid-2-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; }
.grid-1-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 18px; margin-bottom: 18px; align-items: start; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.empty { color: var(--muted); margin: 6px 0; font-size: 13px; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state .icon { color: var(--brand-400); margin-bottom: 8px; }
.empty-state h3 { color: var(--ink); font-size: 17px; margin-bottom: 4px; }
.empty-state p { margin: 0 0 16px; }
.empty-state.small { padding: 28px 12px; }

/* ---------------------------------------------------------------- alerts */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 13.5px; border: 1px solid transparent; }
.alert .icon { margin-top: 2px; }
.alert span { flex: 1; }
.alert-success { background: var(--ok-bg); color: #0F5E40; border-color: #BFE6D2; }
.alert-error { background: var(--bad-bg); color: #8E2318; border-color: #F4C7C1; }
.alert-info { background: var(--info-bg); color: #134D74; border-color: #C3DDF0; }
.alert-warn { background: var(--warn-bg); color: #7A4800; border-color: #F5D9A8; }
.alert-x { background: none; border: 0; color: inherit; opacity: .6; cursor: pointer; padding: 0; }
.alert-x:hover { opacity: 1; }

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent; font: 500 14px var(--font); cursor: pointer; white-space: nowrap; transition: background .15s, box-shadow .15s, border-color .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, var(--brand-600), #016670); color: #fff; box-shadow: 0 4px 12px rgba(1, 113, 124, .28); }
.btn-primary:hover { background: linear-gradient(180deg, var(--brand-500), var(--brand-600)); color: #fff; }
.btn-secondary { background: #fff; color: var(--brand-800); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--brand-400); color: var(--brand-600); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--line-2); color: var(--ink); }
.btn-danger-ghost { background: #fff; color: var(--bad); border-color: #F1C9C4; }
.btn-danger-ghost:hover { background: var(--bad-bg); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { height: 50px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--line-2); color: var(--ink); }
.icon-btn.danger:hover { background: var(--bad-bg); color: var(--bad); }

/* ---------------------------------------------------------------- forms */
.form fieldset { border: 0; margin: 0 0 8px; padding: 0 0 14px; border-bottom: 1px solid var(--line-2); }
.form fieldset:last-of-type { border-bottom: 0; }
.form legend { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-600); padding: 0; margin-bottom: 12px; }
.form.narrow { max-width: 520px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; min-width: 0; }
.field label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.req { color: var(--bad); font-style: normal; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=search], input:not([type]), select, textarea {
  width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid #D5DFE3; border-radius: var(--radius-sm); background: #fff;
  font: 14px var(--font); color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 84px; }
select[multiple] { padding: 6px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-400); box-shadow: 0 0 0 4px rgba(22, 165, 168, .15); }
.is-invalid, .is-invalid:focus { border-color: var(--bad) !important; box-shadow: 0 0 0 4px rgba(192, 57, 43, .1); }
.field-error { color: var(--bad); font-size: 12.5px; }
.hint { color: var(--muted); font-size: 12.5px; margin: 0 0 10px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.span-2 { grid-column: span 2; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding-top: 14px; flex-wrap: wrap; }
.form-actions.pad { padding: 14px 20px; border-top: 1px solid var(--line-2); justify-content: space-between; }
.form-inline-actions { flex-direction: row; align-items: flex-end; justify-content: flex-end; gap: 6px; }
.segmented { display: inline-flex; background: var(--line-2); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.segmented label { margin: 0; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 8px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.segmented input:checked + span { background: #fff; color: var(--brand-700); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.segmented input:focus-visible + span { outline: 2px solid var(--brand-400); }
.segmented input:disabled + span { opacity: .6; cursor: not-allowed; }
.segmented.is-invalid { box-shadow: 0 0 0 2px var(--bad); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.check input, .role-opt input, .status-opt input, td.c input { accent-color: var(--brand-600); width: 16px; height: 16px; }
.warn-check { margin-right: auto; color: var(--warn); font-weight: 500; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px; margin-bottom: 14px; }
.filters select { width: auto; min-width: 140px; }
.search-input { position: relative; flex: 1 1 260px; }
.search-input .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-input input { padding-left: 36px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.on { color: var(--brand-700); border-color: var(--brand-600); }

/* ---------------------------------------------------------------- tables */
.table-card { padding: 0; overflow: hidden; }
.table-card > .card-head { padding: 16px 20px 0; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: #F7FAFB; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table small { color: var(--muted); }
.row-link { cursor: pointer; transition: background .1s; }
.row-link:hover td { background: #F6FAFA; }
.cell-main { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.cell-main span { display: flex; flex-direction: column; }
.cell-main small { color: var(--muted); }
.cell-main b { white-space: nowrap; }
.override { margin-top: 14px; width: 100%; border-top: 1px dashed var(--line); padding-top: 10px; }
.override summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.override .ov-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.override select { flex: 1 1 220px; width: auto; }
.forgot summary { list-style: none; cursor: pointer; color: var(--brand-600); font-size: 13px; }
.forgot summary::-webkit-details-marker { display: none; }
.forgot p { margin: 6px 0 0; font-size: 12.5px; color: var(--ink-2); max-width: 220px; }
.route span { color: var(--brand-400); }
.team { max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mode { display: inline-flex; align-items: center; gap: 6px; }
.mode-icon { width: 16px; height: 16px; color: var(--brand-600); }
.mode-icon.in { transform: rotate(180deg); }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions form { display: inline; margin: 0; }
.overdue-text { color: var(--bad); font-weight: 600; }
tr.editing td { background: #F7FBFB; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.pages { display: flex; gap: 4px; }
.pages a { min-width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; color: var(--ink-2); border: 1px solid var(--line); background: #fff; font-weight: 500; }
.pages a.on { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }

/* ---------------------------------------------------------------- badges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-pre { background: #EEF1F5; color: #4D5D72; }
.st-ops, .st-docs { background: var(--info-bg); color: var(--info); }
.st-customs { background: var(--violet-bg); color: var(--violet); }
.st-delivery { background: var(--brand-50); color: var(--brand-600); }
.st-finance { background: #E9F6EF; color: #22784F; }
.st-closed { background: var(--ok-bg); color: var(--ok); }
.st-hold { background: var(--warn-bg); color: var(--warn); }
.st-cancelled { background: var(--bad-bg); color: var(--bad); }
.st-bg-pre { background: #8A9AAE; } .st-bg-docs { background: var(--info); } .st-bg-customs { background: var(--violet); }
.st-bg-delivery { background: var(--brand-400); } .st-bg-finance { background: #2E9E6A; } .st-bg-hold { background: #E09B2D; }
.pri { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.pri-urgent { background: var(--bad); color: #fff; }
.pri-high { background: #FDE6CC; color: #9A4D00; }
.pri-low { background: var(--line-2); color: var(--muted); }
.pri-normal { background: var(--line-2); color: var(--ink-2); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--line-2); color: var(--muted); font-size: 11.5px; font-style: normal; }
.tag.warn { background: var(--warn-bg); color: var(--warn); }

/* ---------------------------------------------------------------- dashboard */
.hero-banner {
  position: relative; border-radius: 18px; overflow: hidden; min-height: 132px; display: flex; align-items: center; padding: 26px 30px; margin-bottom: 18px;
  background: linear-gradient(90deg, var(--brand-800) 0%, var(--brand-800) 38%, rgba(3, 57, 59, .55) 60%, rgba(3, 57, 59, 0) 85%), var(--banner) right center / 62% auto no-repeat, var(--brand-800);
  color: #fff; box-shadow: var(--shadow);
}
.hero-banner::after { content: ''; position: absolute; left: 34%; top: -40%; width: 220px; height: 200%; background: linear-gradient(90deg, transparent, rgba(23, 195, 178, .25), transparent); transform: rotate(18deg); pointer-events: none; }
.hero-banner h1 { color: #fff; font-size: 26px; font-weight: 600; }
.hero-banner p { margin: 6px 0 0; color: #CFE5E5; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.kpi { position: relative; display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); color: var(--ink); overflow: hidden; transition: transform .15s, box-shadow .15s; }
.kpi:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(3, 57, 59, .12); color: var(--ink); }
.kpi-ic { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand-600), var(--brand-800)); color: #fff; flex: none; }
.kpi:nth-child(2) .kpi-ic { background: linear-gradient(135deg, #6C4BB4, #3F2A75); }
.kpi:nth-child(3) .kpi-ic { background: linear-gradient(135deg, var(--brand-800), var(--brand-900)); }
.kpi:nth-child(4) .kpi-ic { background: linear-gradient(135deg, #22A06B, #116A45); }
.kpi small { color: var(--muted); font-weight: 500; }
.kpi strong { display: block; font-size: 28px; font-weight: 600; line-height: 1.15; letter-spacing: -.01em; }
.delta { display: block; font-size: 12px; color: var(--muted); }
.delta.up { color: var(--ok); }
.delta.down { color: var(--bad); }
.spark { position: absolute; right: 14px; top: 16px; width: 86px; height: 30px; fill: none; stroke: var(--brand-400); stroke-width: 2; opacity: .8; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line-2); }
.chart .axis { font: 11px var(--font); fill: var(--muted); }
.chart .ln { fill: none; stroke-width: 2.5; stroke-linejoin: round; }
.chart .ln.a, .chart .pt.a { stroke: var(--brand-400); }
.chart .ln.b, .chart .pt.b { stroke: #2F7FD1; }
.chart .pt { fill: #fff; stroke-width: 2; }
.chart .area.a { fill: url(#none); fill: rgba(22, 165, 168, .12); }
.legend { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); flex-wrap: wrap; }
.lg { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.lg.a { background: var(--brand-400); } .lg.b { background: #2F7FD1; margin-left: 6px; }
.pipeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.pipeline a { display: flex; justify-content: space-between; color: var(--ink-2); font-size: 13.5px; margin-bottom: 5px; }
.pipeline a:hover { color: var(--brand-600); }
.pipeline b { color: var(--ink); }
.bar { height: 7px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; }
.split { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-2); text-align: center; }
.split div { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.split b { font-size: 16px; }
.split small { color: var(--muted); }
.overdue { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: var(--bad-bg); color: var(--bad); font-size: 13px; font-weight: 500; }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quick a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 16px 8px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink-2); font-size: 12.5px; font-weight: 500; line-height: 1.3; min-height: 92px; transition: all .15s; }
.quick a .icon { color: var(--brand-600); width: 24px; height: 24px; }
.quick a:hover { border-color: var(--brand-400); background: var(--brand-50); color: var(--brand-800); }

.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; position: relative; }
.timeline::before { content: ''; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 14px; }
.timeline li::before { content: ''; position: absolute; left: -18px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--brand-400); }
.timeline li.ev-status_changed::before { background: var(--brand-400); }
.timeline li.ev-created::before { background: var(--brand-800); border-color: var(--brand-800); }
.timeline b, .timeline a { display: block; font-size: 13.5px; font-weight: 500; color: var(--ink); }
.timeline a b { display: inline; font-weight: 600; }
.timeline p { margin: 2px 0; font-size: 13px; color: var(--ink-2); }
.timeline small { color: var(--muted); }
.timeline.compact li { padding-bottom: 12px; }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li > a, .mini-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mini-list li > a { padding: 10px 8px; margin: 0 -8px; border-radius: 10px; color: var(--ink); width: calc(100% + 16px); }
.mini-list li > a:hover { background: var(--line-2); }
.mini-list li + li { border-top: 1px solid var(--line-2); }
.mini-list.plain li { padding: 8px 0; }
.mini-list div { display: flex; flex-direction: column; min-width: 0; }
.mini-list .r { flex-direction: row; gap: 6px; align-items: center; flex: none; }
.mini-list small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ok-text { color: var(--ok); } .bad-text { color: var(--bad); }

/* ---------------------------------------------------------------- detail pages */
.stat-strip { display: grid; grid-template-columns: repeat(5, 1fr); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; }
.stat-strip div { padding: 14px 18px; display: flex; flex-direction: column; }
.stat-strip div + div { border-left: 1px solid var(--line-2); }
.stat-strip small { color: var(--muted); }
.stat-strip b { font-size: 22px; font-weight: 600; }
.stat-strip b.sm { font-size: 14px; padding-top: 6px; }
.details { display: grid; grid-template-columns: 130px 1fr; gap: 10px 14px; margin: 0; font-size: 13.5px; }
.details dt { color: var(--muted); }
.details dd { margin: 0; word-break: break-word; }
.details.cols { grid-template-columns: 150px 1fr; }
.meta { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--line-2); color: var(--muted); font-size: 12px; }
.notes-box { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: #F7FAFB; border: 1px solid var(--line-2); }
.notes-box small { color: var(--muted); font-weight: 500; }
.notes-box p { margin: 4px 0 0; }
.note-form { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; margin-bottom: 14px; }
.notes { list-style: none; padding: 0; margin: 0; }
.notes li { padding: 12px 0; border-top: 1px solid var(--line-2); }
.notes p { margin: 0 0 4px; white-space: pre-wrap; }
.notes small { color: var(--muted); }
.dup-card { border-color: #F5D9A8; background: #FFFCF5; margin-bottom: 16px; }
.dup-card h3 { display: flex; align-items: center; gap: 8px; color: var(--warn); font-size: 15px; margin-bottom: 4px; }

.stepper { list-style: none; display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; margin: 0 0 18px; padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); counter-reset: s; }
.stepper li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 500; text-align: center; }
.stepper li::before { content: ''; position: absolute; top: 14px; left: -50%; right: 50%; height: 3px; background: var(--line); z-index: 0; }
.stepper li:first-child::before { display: none; }
.stepper span { position: relative; z-index: 1; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid var(--line); font-weight: 600; font-size: 12.5px; }
.stepper li.done { color: var(--brand-700); }
.stepper li.done::before, .stepper li.current::before { background: var(--brand-400); }
.stepper li.done span { background: var(--brand-400); border-color: var(--brand-400); color: #fff; }
.stepper li.current { color: var(--ink); }
.stepper li.current span { border-color: var(--brand-600); color: var(--brand-600); box-shadow: 0 0 0 5px rgba(22, 165, 168, .18); }
.status-card { border-color: var(--brand-100); background: linear-gradient(180deg, #F6FBFB, #fff); }
.status-options { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.status-opt { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; font-size: 13.5px; font-weight: 500; }
.status-opt:hover { border-color: var(--brand-400); }
.status-opt:has(input:checked) { border-color: var(--brand-600); background: var(--brand-50); color: var(--brand-800); }
.status-opt.neg { color: var(--warn); }
.status-opt.neg:has(input:checked) { border-color: var(--warn); background: var(--warn-bg); }
.status-form { display: flex; flex-direction: column; align-items: flex-start; }
.status-form .field { width: 100%; }
.totals { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0 20px 12px; font-size: 13px; color: var(--muted); }
.totals b { color: var(--ink); }
.cons-form { padding: 14px 20px; background: #F7FBFB; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
tr.editing .cons-form { padding: 4px 0; background: none; border: 0; }
.table-card .empty { padding: 4px 20px 18px; }
.people { list-style: none; margin: 0 0 12px; padding: 0; }
.people li { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.people li + li { border-top: 1px solid var(--line-2); }
.people li div { flex: 1; display: flex; flex-direction: column; }
.people small { color: var(--muted); }
.people form { margin: 0; }
.assign-form { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.assign-form .btn { align-self: flex-end; }

.role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; border-radius: 10px; }
.role-grid.is-invalid { box-shadow: 0 0 0 2px var(--bad); padding: 4px; }
.role-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.role-opt:has(input:checked) { border-color: var(--brand-400); background: var(--brand-50); }
.role-opt input { margin-top: 3px; }
.role-opt span { display: flex; flex-direction: column; }
.role-opt small { color: var(--muted); line-height: 1.35; }
.action-list { display: flex; flex-direction: column; gap: 8px; }
.action-list form { margin: 0; }
.temp-pass { display: flex; gap: 16px; align-items: flex-start; border-color: #BFE6D2; background: #F5FCF8; margin-bottom: 18px; }
.temp-pass > div:first-child { width: 44px; height: 44px; border-radius: 12px; background: var(--ok-bg); color: var(--ok); display: grid; place-items: center; flex: none; }
.temp-pass h3 { font-size: 16px; }
.temp-pass p { margin: 4px 0 10px; }
.copy-row { display: flex; gap: 10px; align-items: center; }
.copy-row code { font-size: 18px; letter-spacing: .08em; padding: 6px 14px; background: #fff; border: 1px dashed #9CD3B9; border-radius: 8px; }

.matrix-wrap { max-height: calc(100vh - 260px); }
.matrix th.rot { text-align: center; vertical-align: bottom; min-width: 96px; white-space: normal; text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--ink-2); line-height: 1.25; position: sticky; top: 0; z-index: 2; }
.matrix th.rot small { display: block; color: var(--muted); font-weight: 400; margin-top: 2px; }
.matrix th.sticky { position: sticky; left: 0; top: 0; z-index: 3; }
.matrix td.sticky { position: sticky; left: 0; background: #fff; z-index: 1; min-width: 260px; }
.matrix td.c { text-align: center; }
.matrix tr.group td { background: #F3F8F8; font-size: 11.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--brand-600); padding-top: 9px; padding-bottom: 9px; }
.matrix tbody tr:not(.group):hover td { background: #FAFCFC; }
.details-cell { color: var(--ink-2); font-size: 13px; max-width: 520px; }

.error-page { max-width: 520px; margin: 60px auto; text-align: center; }
.error-page .error-code { display: inline-block; font-size: 64px; font-weight: 700; line-height: 1; background: linear-gradient(135deg, var(--brand-600), var(--brand-800)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-page h1 { font-size: 22px; margin: 10px 0 6px; }
.error-page .actions { display: flex; justify-content: center; gap: 10px; margin-top: 18px; }

/* ---------------------------------------------------------------- sign-in */
body.auth { min-height: 100vh; display: flex; flex-direction: column; position: relative; overflow-x: hidden; background: linear-gradient(115deg, #F7FAFF 0%, #EAF2FE 45%, #DCE9FD 100%); }
.auth-corner { position: fixed; width: 260px; height: 260px; pointer-events: none; z-index: 0; }
.auth-corner.tl { top: -130px; left: -130px; background: linear-gradient(135deg, var(--brand-800), var(--brand-400)); transform: rotate(45deg); }
.auth-corner.br { bottom: -60px; right: -150px; background: linear-gradient(135deg, var(--brand-400), var(--brand-800)); transform: rotate(45deg); opacity: .85; }
.auth-wrap { position: relative; z-index: 1; flex: 1; display: grid; grid-template-columns: 1.1fr 470px; align-items: center; gap: 40px; max-width: 1240px; width: 100%; margin: 0 auto; padding: 48px 40px; }
.auth-hero { color: #fff; text-align: left; padding-left: 40px; text-shadow: 0 2px 18px rgba(2, 30, 40, .55); }
.auth-hero .auth-mark { filter: drop-shadow(0 4px 14px rgba(2, 30, 40, .4)); }
.auth-mark { width: 100px; height: 133px; display: block; margin: 0 0 14px 70px; }
.auth-word { font-size: 40px; font-weight: 700; letter-spacing: -.01em; color: #fff; margin-bottom: 26px; }
.auth-hero h1 { font-size: 40px; font-weight: 600; line-height: 1.15; color: #fff; }
.auth-tag { font-size: 19px; color: #E8F6F6; margin: 14px 0 0; }
.auth-tag span { color: var(--accent); margin: 0 6px; }
.auth-card { position: relative; background: rgba(255, 255, 255, .80); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid rgba(255, 255, 255, .9); border-radius: 22px; padding: 40px 36px 30px; box-shadow: 0 24px 60px rgba(3, 57, 59, .25); }
/* Corner accent: a glowing teal stroke hugging the card's top-left corner */
.auth-card::before { content: ''; position: absolute; top: -6px; left: -6px; width: 42%; height: 46%; border-top: 4px solid var(--accent); border-left: 4px solid var(--accent); border-top-left-radius: 28px; pointer-events: none;
  filter: drop-shadow(0 0 5px rgba(23, 195, 178, .9)) drop-shadow(0 0 12px rgba(23, 195, 178, .45));
  -webkit-mask: linear-gradient(135deg, #000 0%, #000 45%, transparent 85%); mask: linear-gradient(135deg, #000 0%, #000 45%, transparent 85%); }
.auth-card h2 { font-size: 32px; font-weight: 700; color: var(--brand-800); letter-spacing: -.01em; }
.auth-card > .muted { margin: 6px 0 24px; font-size: 15px; }
.input-icon { position: relative; display: block; margin-bottom: 14px; }
.input-icon > .icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--brand-800); }
.input-icon input { height: 54px; padding: 0 48px 0 50px; border-radius: 12px; font-size: 15px; background: rgba(255, 255, 255, .92); }
.input-icon.is-invalid input { border-color: var(--bad); }
.reveal { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--brand-800); cursor: pointer; padding: 8px; border-radius: 8px; }
.reveal:hover { background: var(--line-2); }
.input-icon + .field-error { margin: -8px 0 12px; }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 20px; flex-wrap: wrap; }
.auth-card .btn-primary { background: linear-gradient(90deg, var(--brand-800), var(--brand-500)); }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 10px; color: var(--muted); font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: #CFDADE; }
.auth-help { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; color: var(--ink-2); font-size: 14px; }
.auth-foot { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 40px; background: var(--brand-800); color: #DCEDED; font-size: 13.5px; }
.auth-foot div { display: flex; align-items: center; gap: 8px; }
.auth-foot i { opacity: .4; font-style: normal; margin: 0 4px; }
.auth .error-page { position: relative; z-index: 1; margin: auto; background: rgba(255, 255, 255, .9); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-3 > :last-child { grid-column: span 2; }
}
@media (max-width: 1000px) {
  .grid-2-1, .grid-1-2, .grid-2 { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: repeat(3, 1fr); }
  .stat-strip div:nth-child(4) { border-left: 0; }
  .stat-strip div:nth-child(n+4) { border-top: 1px solid var(--line-2); }
  .auth-wrap { grid-template-columns: 1fr; justify-items: center; padding: 32px 20px; }
  .auth-hero { padding-left: 0; text-align: center; }
  .auth-mark { margin: 0 auto 10px; width: 70px; height: 93px; }
  .auth-word { font-size: 30px; margin-bottom: 8px; }
  .auth-hero h1 { font-size: 26px; }
  .auth-tag { font-size: 15px; }
  .auth-card { width: 100%; max-width: 470px; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(2, 30, 32, .45); z-index: 35; }
  .main { margin-left: 0; }
  .topbar .menu-btn { display: inline-grid; }
  .topbar { padding: 10px 16px; gap: 10px; }
  .who { display: none; }
  .content { padding: 16px; }
  .foot { padding: 12px 16px 18px; }
  .row-2, .row-3, .row-4, .role-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-3 > :last-child { grid-column: auto; }
  .stepper { grid-template-columns: repeat(6, minmax(52px, 1fr)); overflow-x: auto; font-size: 11px; padding: 14px 10px; }
  .hero-banner { padding: 20px; background: linear-gradient(90deg, rgba(3, 57, 59, .95), rgba(3, 57, 59, .7)), var(--banner) center / cover; }
  .hero-banner h1 { font-size: 21px; }
  .filters select { flex: 1 1 140px; }
  .details, .details.cols { grid-template-columns: 1fr; gap: 2px; }
  .details dd { margin-bottom: 8px; }
  .page-head h1 { font-size: 21px; }
  .auth-foot { padding: 12px 16px; justify-content: center; text-align: center; }
}
@media (max-width: 520px) {
  .kpis { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .stat-strip div { border-left: 0 !important; border-top: 1px solid var(--line-2); }
  .quick { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: repeat(3, 1fr); row-gap: 12px; }
  .auth-card { padding: 28px 20px 22px; }
  .auth-card h2 { font-size: 26px; }
}
@media print {
  .sidebar, .topbar, .foot, .actions, .status-card, form { display: none !important; }
  .main { margin: 0; }
  .card { box-shadow: none; }
}
.dev-credit { color: #fff; } .dev-credit:hover { color: var(--accent); }
@media (max-width: 860px) { .auth-foot div { flex-wrap: wrap; justify-content: center; } }

/* ================================================================ sign-in page (brand design) */
.login { --lb-900: #03393B; --lb-700: #05494C; --lb-600: #01717C; --lb-500: #16A5A8; --lb-300: #7FD6D2; color: #12232A; }
.lg-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
body.auth:not(.login) .lg-bg { display: none; }
.lg-photo { position: absolute; left: 0; bottom: 0; width: 62vw; height: 72vh; background: var(--login-photo) 18% 82% / cover no-repeat; }
.lg-photo::after { content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, #F2F8F8 0%, rgba(242, 248, 248, .85) 14%, rgba(242, 248, 248, 0) 42%),
              linear-gradient(90deg, rgba(232, 243, 243, 0) 62%, rgba(232, 243, 243, .9) 92%, #E8F3F3 100%),
              linear-gradient(0deg, rgba(2, 43, 45, .55) 0%, rgba(2, 43, 45, 0) 30%); }
.lg-dots { position: absolute; left: 22vw; top: 4vh; width: 44vw; height: 46vh; opacity: .55;
  background-image: radial-gradient(circle, #4FA6A6 1.3px, transparent 1.6px); background-size: 9px 9px;
  -webkit-mask: radial-gradient(ellipse 22% 30% at 30% 40%, #000 60%, transparent 62%), radial-gradient(ellipse 14% 26% at 52% 70%, #000 60%, transparent 62%), radial-gradient(ellipse 26% 22% at 70% 32%, #000 60%, transparent 62%), radial-gradient(ellipse 9% 12% at 86% 74%, #000 60%, transparent 62%);
  mask: radial-gradient(ellipse 22% 30% at 30% 40%, #000 60%, transparent 62%), radial-gradient(ellipse 14% 26% at 52% 70%, #000 60%, transparent 62%), radial-gradient(ellipse 26% 22% at 70% 32%, #000 60%, transparent 62%), radial-gradient(ellipse 9% 12% at 86% 74%, #000 60%, transparent 62%); }
.lg-shape { position: absolute; transform: skewX(-32deg); }
.lg-shape.s1 { right: -6vw; top: -10vh; width: 30vw; height: 58vh; background: linear-gradient(180deg, rgba(178, 222, 220, .55), rgba(178, 222, 220, 0)); }
.lg-shape.s2 { right: -4vw; bottom: -6vh; width: 12vw; height: 44vh; background: linear-gradient(160deg, var(--lb-500), var(--lb-700)); opacity: .95; }
.lg-shape.s3 { right: 6vw; bottom: -8vh; width: 7vw; height: 26vh; background: linear-gradient(160deg, #5FCFC6, #0B8A92); opacity: .55; }
.lg-swoosh { position: absolute; left: 0; bottom: 0; width: 70vw; height: 30vh; filter: drop-shadow(0 0 6px rgba(23, 195, 178, .9)); }

.lg-lang { position: absolute; top: 28px; right: 42px; z-index: 2; display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 15px; color: #12232A; }
.lg-lang .icon { width: 22px; height: 22px; }
.lg-lang .icon.xs { width: 14px; height: 14px; }
.lg-wrap { position: relative; z-index: 1; flex: 1; display: grid; grid-template-columns: 1fr 500px; align-items: center; gap: 48px; width: 100%; max-width: 1360px; margin: 0 auto; padding: 56px 56px 110px; }
.lg-hero { align-self: start; padding-top: 6px; }
.lg-brand, .lg-card-brand { display: flex; align-items: center; gap: 16px; }
.lg-brand span, .lg-card-brand span { font-size: 40px; font-weight: 600; line-height: 1.02; color: var(--lb-900); letter-spacing: -.015em; }
.lg-mark { width: 62px; height: 82px; }
.lg-mark.sm { width: 48px; height: 64px; }
.lg-card-brand { justify-content: center; margin-bottom: 30px; }
.lg-card-brand span { font-size: 34px; }
.lg-hero h1 { margin-top: 64px; font-size: 52px; font-weight: 700; line-height: 1.16; color: var(--lb-900); letter-spacing: -.02em; }
.lg-hero h1 em { font-style: normal; color: var(--lb-600); }
.lg-tag { margin: 18px 0 0; font-size: 24px; color: #1F3138; }
.lg-rule { display: block; width: 92px; height: 3px; margin-top: 18px; border-radius: 3px; background: linear-gradient(90deg, var(--lb-600), var(--lb-300)); }

.lg-card { position: relative; background: rgba(255, 255, 255, .86); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid rgba(255, 255, 255, .95); border-radius: 26px; padding: 42px 46px 30px; box-shadow: 0 30px 70px rgba(3, 57, 59, .18); }
.lg-card::before { content: ''; position: absolute; top: -6px; left: -6px; width: 40%; height: 46%; border-top: 4px solid var(--lb-500); border-left: 4px solid var(--lb-500); border-top-left-radius: 30px; pointer-events: none;
  filter: drop-shadow(0 0 5px rgba(23, 195, 178, .85)) drop-shadow(0 0 14px rgba(23, 195, 178, .4));
  -webkit-mask: linear-gradient(135deg, #000 0%, #000 45%, transparent 85%); mask: linear-gradient(135deg, #000 0%, #000 45%, transparent 85%); }
.lg-card h2 { font-size: 40px; font-weight: 700; color: var(--lb-900); letter-spacing: -.02em; }
.lg-sub { margin: 8px 0 30px; font-size: 17px; color: #3E5158; }
.lg-input { position: relative; display: block; margin-bottom: 18px; }
.lg-input > .icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 21px; height: 21px; color: #12232A; }
.lg-input input { height: 56px; padding: 0 52px 0 56px; border-radius: 12px; font-size: 16px; background: rgba(255, 255, 255, .7); border: 1px solid #C8D8DC; color: #12232A; }
.lg-input input::placeholder { color: #7A8C93; }
.lg-input input:focus { border-color: var(--lb-500); box-shadow: 0 0 0 4px rgba(22, 165, 168, .15); background: #fff; }
.lg-input.is-invalid input { border-color: var(--bad); }
.lg-input .reveal { color: #12232A; }
.lg-input + .field-error { margin: -12px 0 12px; }
.lg-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 26px; }
.lg-check { display: inline-flex; align-items: center; gap: 12px; font-size: 15px; color: #1F3138; cursor: pointer; }
.lg-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.lg-check span { width: 22px; height: 22px; border-radius: 5px; border: 2px solid #9DB8BD; background: #fff; display: grid; place-items: center; transition: all .15s; }
.lg-check input:checked + span { background: var(--lb-600); border-color: var(--lb-600); }
.lg-check input:checked + span::after { content: ''; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px); }
.lg-check input:focus-visible + span { box-shadow: 0 0 0 4px rgba(22, 165, 168, .25); }
.login .pop summary { color: var(--lb-600); font-size: 15px; }
.login .pop summary:hover { color: var(--lb-700); }
.login .pop p { background: var(--lb-900); }
.lg-btn { width: 100%; height: 58px; display: flex; align-items: center; justify-content: center; gap: 12px; border: 0; border-radius: 12px; cursor: pointer;
  font: 600 18px var(--font); color: #fff; background: linear-gradient(90deg, #0B8A92 0%, #01717C 45%, #03393B 100%); box-shadow: 0 12px 24px rgba(1, 113, 124, .32); transition: filter .15s, transform .05s; }
.lg-btn:hover { filter: brightness(1.07); }
.lg-btn:active { transform: translateY(1px); }
.lg-btn .icon { width: 22px; height: 22px; }
.lg-or { display: flex; align-items: center; gap: 14px; margin: 22px 0 18px; color: #5C6E75; font-size: 14px; }
.lg-or::before, .lg-or::after { content: ''; flex: 1; height: 1px; background: #D3E0E3; }
.lg-help { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 20px; font-size: 14.5px; color: #3E5158; }
.lg-feats { position: absolute; left: 56px; bottom: 36px; z-index: 2; display: flex; align-items: center; gap: 22px; color: #fff; font-size: 15px; font-weight: 500; text-shadow: 0 1px 8px rgba(2, 30, 32, .55); }
.lg-feats span { display: flex; align-items: center; gap: 10px; }
.lg-feats .icon { width: 26px; height: 26px; }
.lg-feats i { width: 1px; height: 28px; background: rgba(255, 255, 255, .6); }
.lg-credit { position: absolute; right: 30px; bottom: 16px; z-index: 2; font-size: 12px; color: rgba(255, 255, 255, .85); }
.lg-credit a { color: #fff; font-weight: 600; }

@media (max-width: 1100px) {
  .lg-wrap { grid-template-columns: 1fr; justify-items: center; padding: 76px 20px 150px; gap: 26px; }
  .lg-hero { text-align: center; }
  .lg-brand { justify-content: center; }
  .lg-hero h1 { margin-top: 22px; font-size: 34px; }
  .lg-tag { font-size: 18px; }
  .lg-rule { margin: 14px auto 0; }
  .lg-card { width: 100%; max-width: 500px; }
  .lg-photo { width: 100vw; height: 50vh; }
  .lg-photo::after { background: linear-gradient(180deg, #F2F8F8 0%, rgba(242, 248, 248, 0) 45%), linear-gradient(0deg, rgba(2, 43, 45, .6) 0%, rgba(2, 43, 45, 0) 40%); }
  .lg-feats { left: 0; right: 0; bottom: 44px; justify-content: center; flex-wrap: wrap; gap: 12px; font-size: 13px; }
  .lg-credit { left: 0; right: 0; text-align: center; }
}
@media (max-width: 560px) {
  .lg-brand { display: none; }
  .lg-hero h1 { font-size: 27px; margin-top: 0; }
  .lg-card { padding: 30px 22px 24px; border-radius: 22px; }
  .lg-card-brand span { font-size: 28px; }
  .lg-card h2 { font-size: 30px; }
  .lg-feats i { display: none; }
  .lg-lang { top: 18px; right: 20px; }
}
/* sign-in refinements */
body.auth.login { background: linear-gradient(115deg, #F4F9F9 0%, #E9F3F3 50%, #DCEDEC 100%); }
.lg-photo::after { background:
  linear-gradient(180deg, #F4F9F9 0%, rgba(244, 249, 249, .9) 12%, rgba(244, 249, 249, 0) 46%),
  linear-gradient(90deg, rgba(233, 243, 243, 0) 60%, rgba(233, 243, 243, .85) 90%, #E9F3F3 100%),
  linear-gradient(0deg, rgba(2, 43, 45, .55) 0%, rgba(2, 43, 45, 0) 30%); }
.lg-photo { height: 78vh; }
.lg-dots { opacity: .32; }
.pop { position: relative; }
.pop summary { list-style: none; cursor: pointer; font-weight: 500; }
.pop summary::-webkit-details-marker { display: none; }
.pop summary::marker { content: ''; }
.pop p { position: absolute; right: 0; top: calc(100% + 8px); z-index: 5; width: 260px; margin: 0; padding: 12px 14px; color: #E6F3F3; font-size: 12.5px; line-height: 1.45; border-radius: 10px; box-shadow: var(--shadow-lg); text-align: left; background: var(--brand-900); }
.pop.up p { top: auto; bottom: calc(100% + 8px); left: 50%; right: auto; transform: translateX(-50%); }
.lg-wrap { padding: 40px 56px 84px; }
.lg-card { padding: 30px 40px 24px; }
.lg-card-brand { margin-bottom: 18px; }
.lg-card-brand span { font-size: 30px; }
.lg-mark.sm { width: 42px; height: 56px; }
.lg-card h2 { font-size: 36px; }
.lg-sub { margin: 4px 0 22px; font-size: 16px; }
.lg-input { margin-bottom: 14px; }
.lg-input input { height: 50px; }
.lg-row { margin: 2px 0 20px; }
.lg-btn { height: 52px; font-size: 17px; }
.lg-or { margin: 16px 0 14px; }
.lg-help { margin-top: 14px; }
@media (max-width: 1100px) { .lg-wrap { padding: 76px 20px 150px; } }
.lg-photo { height: 100vh; }
.lg-photo::after { background:
  linear-gradient(180deg, #F4F9F9 0%, #F4F9F9 18%, rgba(244, 249, 249, .75) 34%, rgba(244, 249, 249, 0) 58%),
  linear-gradient(90deg, rgba(233, 243, 243, 0) 60%, rgba(233, 243, 243, .85) 90%, #E9F3F3 100%),
  linear-gradient(0deg, rgba(2, 43, 45, .55) 0%, rgba(2, 43, 45, 0) 30%); }
.lg-wrap { padding-top: 76px; }
.lg-hero { padding-top: 0; margin-top: -30px; }
.lg-credit { color: rgba(255, 255, 255, .9); text-shadow: 0 1px 6px rgba(2, 30, 32, .6); }
@media (max-width: 1100px) { .lg-photo { height: 55vh; } .lg-hero { margin-top: 0; } }
.lg-credit { position: fixed; bottom: 10px; }
.lg-check, .login .pop summary, .lg-help { white-space: nowrap; }
.lg-help { flex-wrap: wrap; }
@media (max-width: 1100px) {
  .lg-credit { position: absolute; bottom: 14px; color: var(--brand-700); text-shadow: none; }
  .lg-credit a { color: var(--brand-800); }
  .lg-feats { color: var(--brand-800); text-shadow: none; }
}
@media (max-width: 560px) {
  .lg-check, .login .pop summary { font-size: 14px; }
  .lg-help { font-size: 13.5px; }
  .lg-card-brand { margin-bottom: 12px; }
}
/* sign-in: teal page + blue-design card */
body.auth, body.auth.login { background: var(--login-photo) center / cover no-repeat, #0E3B4A; }
body.auth .auth-wrap { grid-template-columns: 1.1fr 480px; padding: 36px 40px; }
body.auth .lg-card { background: rgba(255, 255, 255, .82); padding: 30px 38px 24px; }
body.auth .auth-hero { margin-top: 0; }
@media (max-width: 1000px) { body.auth .auth-wrap { grid-template-columns: 1fr; } body.auth .lg-card { width: 100%; max-width: 480px; } }
@media (max-width: 560px) { body.auth .lg-card { padding: 26px 20px 22px; } .auth-mark { display: none; } }
/* sign-in corner bands (from the teal design) */
.auth-corner { display: none; }
.corner-tl, .corner-br { position: absolute; z-index: 0; pointer-events: none; }
.corner-tl { top: 0; left: 0; width: 190px; height: 180px; }
.corner-tl i, .corner-br i { position: absolute; inset: 0; }
.corner-tl .a { background: linear-gradient(135deg, #03393B, #05494C); clip-path: polygon(0 0, 55% 0, 0 42%); }
.corner-tl .b { background: linear-gradient(135deg, #0B8A92, #16A5A8); clip-path: polygon(55% 0, 92% 0, 0 92%, 0 42%); }
.corner-br { right: 0; bottom: 52px; width: 230px; height: 190px; }
.corner-br .a { background: rgba(22, 165, 168, .35); clip-path: polygon(0 100%, 100% 12%, 100% 40%, 32% 100%); }
.corner-br .b { background: linear-gradient(160deg, #0B8A92, #05494C); clip-path: polygon(32% 100%, 100% 40%, 100% 70%, 62% 100%); }
.corner-br .c { background: #03393B; clip-path: polygon(62% 100%, 100% 70%, 100% 100%); }
body.auth { position: relative; }
@media (max-width: 860px) { .corner-tl { width: 120px; height: 114px; } .corner-br { width: 150px; height: 124px; bottom: 96px; } }
.corner-br { width: 340px; height: 170px; }
.corner-br .a { clip-path: polygon(0 100%, 100% 0, 100% 30%, 30% 100%); }
.corner-br .b { clip-path: polygon(30% 100%, 100% 30%, 100% 62%, 58% 100%); }
.corner-br .c { clip-path: polygon(58% 100%, 100% 62%, 100% 100%); }
/* new teal background: dark brand text reads well on its light sky */
body.auth .auth-hero { color: var(--brand-800); text-shadow: 0 1px 12px rgba(255, 255, 255, .6); }
body.auth .auth-word, body.auth .auth-hero h1 { color: var(--brand-800); }
body.auth .auth-tag { color: var(--ink-2); }
body.auth .auth-tag span { color: var(--brand-400); }
body.auth .auth-hero .auth-mark { filter: none; }
body.auth, body.auth.login { background-position: center bottom; }
body.auth .auth-wrap { align-items: start; }
body.auth .auth-hero { padding-top: 34px; }
body.auth .auth-mark { width: 64px; height: 85px; margin: 0 0 10px 0; }
body.auth .auth-word { font-size: 34px; margin-bottom: 12px; }
body.auth .auth-hero h1 { font-size: 34px; }
body.auth .auth-tag { font-size: 17px; margin-top: 8px; }
body.auth .corner-br { display: none; }
@media (max-width: 1000px) { body.auth .auth-hero { padding-top: 0; } body.auth .auth-mark { margin: 0 auto 8px; } body.auth .auth-wrap { align-items: center; } }
/* hide the left-side brand text on phones and small tablets; the card already carries the logo */
@media (max-width: 860px) { body.auth .auth-hero { display: none; } body.auth .auth-wrap { padding-top: 32px; padding-bottom: 32px; } }
body.auth .lg-help { margin-top: 20px; padding-top: 16px; border-top: 1px solid #D3E0E3; }

/* ---------------------------------------------------------------- customs */
.flag-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.flag-tile { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.flag-tile .icon { grid-row: span 2; width: 36px; height: 36px; padding: 8px; border-radius: 10px; background: var(--brand-50); color: var(--brand-600); }
.flag-tile b { font-size: 22px; line-height: 1.1; }
.flag-tile span { font-size: 12.5px; color: var(--muted); }
.flag-tile:hover { border-color: var(--brand-400); transform: translateY(-1px); color: var(--ink); }
.flag-tile.on { border-color: var(--brand-600); box-shadow: 0 0 0 3px rgba(22, 165, 168, .15); }
.flag-tile.zero { opacity: .7; }
.tab-note { margin-left: auto; align-self: center; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.lane { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.lane::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.lane-green { background: #E3F6EA; color: #178A4B; }
.lane-yellow { background: #FFF5D6; color: #9A6B00; }
.lane-red { background: #FDE6E3; color: #C0392B; }
.lane-blue { background: #E4EEFB; color: #2463B0; }
.stat-strip.six { grid-template-columns: repeat(6, 1fr); }
.stat-strip.six small:last-child:not(:first-child) { color: var(--muted); }
.stepper.five { grid-template-columns: repeat(5, 1fr); }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; }
.inline-form .field { margin-bottom: 0; flex: 1 1 150px; }
.inline-form .field.grow { flex: 3 1 260px; }
.inline-form > .btn { margin-bottom: 1px; }
.assess-form .field { flex: 1 1 120px; }
.sum-field output { display: flex; align-items: center; min-height: 42px; padding: 0 12px; border-radius: var(--radius-sm); background: var(--brand-50); color: var(--brand-800); font-weight: 600; white-space: nowrap; }
.more-actions { margin-top: 16px; border-top: 1px dashed var(--line); }
.more-actions details { border-bottom: 1px dashed var(--line); }
.more-actions summary { cursor: pointer; padding: 10px 2px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.more-actions summary.neg { color: var(--bad); }
.more-actions details[open] { padding-bottom: 14px; }
.more-actions .hint { margin-top: 0; }
.lane-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lane-opt { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: #fff; }
.lane-opt span { display: flex; flex-direction: column; line-height: 1.2; }
.lane-opt small { color: var(--muted); }
.lane-opt input { accent-color: var(--brand-600); }
.lane-opt.lane-green:has(input:checked) { border-color: #178A4B; background: #F1FBF5; }
.lane-opt.lane-yellow:has(input:checked) { border-color: #C79200; background: #FFFBEB; }
.lane-opt.lane-red:has(input:checked) { border-color: #C0392B; background: #FEF4F3; }
.lane-opt.lane-blue:has(input:checked) { border-color: #2463B0; background: #F3F8FE; }
.lane-opt.lane-green b { color: #178A4B; } .lane-opt.lane-yellow b { color: #9A6B00; } .lane-opt.lane-red b { color: #C0392B; } .lane-opt.lane-blue b { color: #2463B0; }
.row-6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.form-inline-actions.right { display: flex; justify-content: flex-end; gap: 6px; }
.table tfoot td { border-top: 1px solid var(--line); background: #F7FAFB; }
tr.superseded td { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(0, 0, 0, .25); }
tr.superseded td .tag { text-decoration: none; }
.released-card { display: flex; gap: 16px; align-items: center; border-color: #BFE6D2; background: #F5FCF8; }
.released-card > .icon { width: 44px; height: 44px; padding: 10px; border-radius: 12px; background: var(--ok-bg); color: var(--ok); }
.released-card h3 { font-size: 16px; }
.released-card p { margin: 2px 0 0; }
.queries { list-style: none; margin: 0; padding: 0; }
.queries li { padding: 14px 0; border-top: 1px solid var(--line-2); }
.queries li:first-child { border-top: 0; padding-top: 0; }
.q-head { display: flex; align-items: center; gap: 10px; }
.q-head small { color: var(--muted); }
.queries p { margin: 8px 0 0; white-space: pre-wrap; }
.q-resp { margin-top: 10px; padding: 10px 12px; border-left: 3px solid var(--brand-400); background: #F6FBFB; border-radius: 0 8px 8px 0; }
.q-resp small { color: var(--muted); font-weight: 500; }
.q-resp p { margin-top: 2px; }
.q-form { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.q-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.note-form:has(input) { flex-direction: row; align-items: center; }
.note-form input { flex: 1; }
@media (max-width: 1200px) { .flag-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } .stat-strip.six { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 860px) { .row-6 { grid-template-columns: 1fr 1fr; } .stepper.five { grid-template-columns: repeat(5, minmax(56px, 1fr)); } }
@media (max-width: 520px) { .flag-tiles { grid-template-columns: 1fr 1fr; } .stat-strip.six { grid-template-columns: 1fr 1fr; } }

/* ---------------------------------------------------------------- documents */
.icon.dl { transform: rotate(90deg); }
.alert-warn .icon { color: var(--warn); }
.overdue.warn { background: var(--warn-bg); color: var(--warn); margin-top: 10px; }
.tag.bad { background: var(--bad-bg); color: var(--bad); }
.check-score { font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); }
.check-score.ok { background: var(--ok-bg); color: var(--ok); }
.checklist { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.checklist li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: #F7FAFB; font-size: 13.5px; }
.checklist .ck { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.checklist .got .ck { background: var(--ok-bg); color: var(--ok); }
.checklist .missing .ck { background: var(--warn-bg); color: var(--warn); }
.checklist .waived .ck { background: var(--line-2); color: var(--muted); }
.checklist .ck-name { flex: 1; display: flex; flex-direction: column; line-height: 1.3; font-weight: 500; }
.checklist .ck-name small { font-weight: 400; color: var(--muted); }
.checklist .missing .ck-name small { color: var(--warn); }
.checklist form { margin: 0; }
.link-btn { background: none; border: 0; padding: 0; color: var(--muted); font: 500 12.5px var(--font); cursor: pointer; }
.link-btn:hover { color: var(--brand-600); text-decoration: underline; }
.pop-form { position: absolute; right: 0; top: calc(100% + 6px); z-index: 6; display: flex; gap: 6px; width: 280px; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); }
.pop-form input { min-height: 34px; padding: 6px 10px; }
.upload-toggle { margin-bottom: 12px; }
.upload-form { margin: 0 0 14px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #FAFCFC; }
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 22px 16px; border: 2px dashed #BFD6D8; border-radius: 12px; background: #fff; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone .icon { width: 30px; height: 30px; color: var(--brand-500); }
.dropzone b { color: var(--brand-600); }
.dropzone small { color: var(--muted); }
.dropzone.drag, .dropzone:hover { border-color: var(--brand-400); background: var(--brand-50); }
.dropzone.has-files { border-style: solid; border-color: var(--brand-400); }
.dropzone.is-invalid { border-color: var(--bad); }
.camera-btn { display: none; position: relative; align-items: center; justify-content: center; gap: 6px; margin-top: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-weight: 500; color: var(--brand-700); cursor: pointer; }
.camera-btn input { position: absolute; inset: 0; opacity: 0; }
@media (pointer: coarse) { .camera-btn { display: flex; } }
.upload-form .row-3 { margin-top: 12px; }
.upload-details { margin-top: 12px; }
.upload-details > summary { list-style: none; display: inline-flex; }
.upload-details > summary::-webkit-details-marker { display: none; }
.upload-details[open] > summary { margin-bottom: 12px; }
.doc-list { list-style: none; margin: 0; padding: 0; }
.doc-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-2); }
.doc-list li:first-child { border-top: 0; }
.doc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; color: var(--ink); }
.doc-main b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-main small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-main:hover b { color: var(--brand-600); }
.doc-meta { font-size: 12px; color: var(--muted); white-space: nowrap; }
.file-ic { flex: none; width: 38px; height: 44px; border-radius: 6px; display: grid; place-items: end center; padding-bottom: 6px; font-size: 9.5px; font-weight: 700; letter-spacing: .04em; color: #fff; background: #7A8C93; position: relative; clip-path: polygon(0 0, 72% 0, 100% 22%, 100% 100%, 0 100%); }
.file-ic.ft-pdf { background: #D04A3C; } .file-ic.ft-jpg, .file-ic.ft-png, .file-ic.ft-webp { background: #2E86C1; }
.file-ic.ft-docx, .file-ic.ft-doc { background: #2B5797; } .file-ic.ft-xlsx, .file-ic.ft-xls { background: #1E7145; }
.file-ic.big { width: 64px; height: 76px; font-size: 13px; margin: 0 auto 12px; }
.cell-main .file-ic { width: 32px; height: 38px; font-size: 8.5px; }
b.wrap { white-space: normal; }
.preview-card { padding: 0; overflow: hidden; min-height: 520px; display: flex; }
.pdf-frame { width: 100%; min-height: 78vh; border: 0; background: #525659; }
.img-frame { display: flex; align-items: center; justify-content: center; width: 100%; background: #F1F4F5; padding: 16px; }
.img-frame img { max-width: 100%; max-height: 78vh; border-radius: 6px; box-shadow: var(--shadow); }
.preview-card .empty-state { margin: auto; }
.version-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line-2); }
.version-form input[type=file] { font-size: 13px; }
.version-form .btn { align-self: flex-end; }
.versions { list-style: none; margin: 0; padding: 0; }
.versions li { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.versions li + li { border-top: 1px solid var(--line-2); }
.versions li div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.versions b { font-weight: 500; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.versions small { color: var(--muted); }
.vno { flex: none; width: 34px; height: 26px; border-radius: 6px; display: grid; place-items: center; background: var(--line-2); font-size: 12px; font-weight: 600; color: var(--ink-2); }
.versions li.current .vno { background: var(--brand-600); color: #fff; }
@media (max-width: 860px) { .checklist { grid-template-columns: 1fr; } .doc-meta { display: none; } .preview-card { min-height: 300px; } .pdf-frame { min-height: 60vh; } }

/* ---------------------------------------------------------------- pre-alerts & email settings */
.nav-badge { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: #17C3B2; color: #03393B; font: 700 11.5px/18px var(--font); font-style: normal; text-align: center; }
.overdue.info { background: var(--info-bg); color: var(--info); margin-top: 10px; }
.mail-list { padding: 0; overflow: hidden; }
.mail-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--line-2); color: inherit; text-decoration: none; transition: background .12s; }
.mail-row:last-of-type { border-bottom: 0; }
.mail-row:hover { background: #F6FAFA; }
.mail-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mail-top { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.mail-top b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-top small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-subj { font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-snip { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; color: var(--muted); }
.att-count { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; }
.ref-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ref-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 3px; border-radius: 7px; background: var(--brand-50); color: var(--brand-800); font: 600 12px/20px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.ref-chip i { font: 700 10px/16px var(--font); font-style: normal; letter-spacing: .04em; padding: 0 6px; border-radius: 5px; background: #fff; color: var(--brand-600); }
.ref-chip.more { padding: 2px 9px; font-family: var(--font); }
.state-banner { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 18px; border-radius: 14px; background: var(--line-2); border: 1px solid var(--line); }
.state-banner.ok { background: var(--ok-bg); border-color: #BFE6D2; color: #0F5E40; }
.state-banner > div { flex: 1; display: flex; flex-direction: column; }
.state-banner small { opacity: .8; }
.mail-view { padding: 0; overflow: hidden; }
.mail-head { display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line-2); }
.mail-head small { display: block; color: var(--muted); overflow-wrap: anywhere; }
.mail-body { padding: 20px 22px 24px; font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; max-height: 70vh; overflow-y: auto; }
.action-card h3 { font-size: 15px; margin: 0 0 4px; }
.action-card > .muted { margin: 0 0 14px; font-size: 13.5px; }
.action-card .field { margin-bottom: 12px; }
.att-pick { display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 8px; align-items: center; margin-top: 8px; font-size: 13px; }
.att-pick select { height: 36px; font-size: 13px; }
.action-card .check { margin: 4px 0 14px; }
.mt { margin-top: 16px; }
.mail-mini { list-style: none; margin: 0; padding: 0; }
.mail-mini li + li { border-top: 1px solid var(--line-2); }
.mail-mini a { display: flex; flex-direction: column; padding: 9px 0; color: inherit; }
.mail-mini b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-mini small { color: var(--muted); }
.from-email { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 18px; border-radius: 12px; background: var(--brand-50); color: var(--brand-800); }
.from-email > div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.from-email small { color: var(--ink-2); }
.input-reveal { position: relative; }
.input-reveal input { padding-right: 44px; }
.input-suffix { display: flex; align-items: stretch; }
.input-suffix input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-suffix span { display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--line); border-left: 0; border-radius: 0 10px 10px 0; background: var(--line-2); color: var(--muted); font-size: 13px; }
.switch-row { align-items: flex-start; margin: 2px 0 16px; }
.switch-row input { margin-top: 3px; }
.switch-row span { display: flex; flex-direction: column; }
.switch-row small { color: var(--muted); font-size: 12.5px; }
.wrap-actions { flex-wrap: wrap; }
.test-out { display: flex; gap: 8px; margin-right: auto; flex-wrap: wrap; }
.test-out input { width: 240px; }
.help-card h3 { font-size: 15px; margin: 0 0 6px; }
.help-card p { font-size: 13.5px; }
.help-card .tight { margin: 0 0 10px; padding-left: 18px; font-size: 13.5px; line-height: 1.7; }
pre.code { margin: 8px 0 10px; padding: 10px 12px; border-radius: 10px; background: #0B2B2D; color: #CFF3EE; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-all; }
.small { font-size: 12.5px; }
@media (max-width: 720px) {
  .mail-row { grid-template-columns: 30px minmax(0, 1fr); padding: 12px 14px; }
  .mail-side { grid-column: 2; flex-direction: row; align-items: center; justify-content: flex-start; }
  .mail-head { grid-template-columns: 36px 1fr; }
  .mail-head > small { grid-column: 2; }
  .att-pick { grid-template-columns: 1fr; }
  .test-out, .test-out input { width: 100%; }
}
.wrap-actions .test-out { flex-basis: 100%; margin-right: 0; padding-bottom: 6px; border-bottom: 1px dashed var(--line); margin-bottom: 4px; }

/* Login keeps the same layout over the photo at every screen size and browser zoom level
   (designed at 1850 x 907; the factor is set by a small script in the auth layout). */
@media (min-width: 1001px) { body.auth .auth-wrap, body.auth .auth-foot { zoom: var(--auth-zoom, 1); } }
@media (min-width: 1001px) { body.auth, body.auth.login { background-position: center var(--login-bg-y, bottom); } }
/* Login card: a little lower and narrower on desktop */
@media (min-width: 1001px) { body.auth .auth-wrap { grid-template-columns: 1.1fr 430px; } body.auth .lg-card { margin-top: 56px; padding-left: 34px; padding-right: 34px; } }
/* Login: original logo lockup in the hero; hero in the clear sky on the left, card lower and further right */
.auth-logo { display: block; width: 300px; height: auto; margin: 0 0 26px; }
@media (min-width: 1001px) {
  body.auth .auth-wrap { max-width: none; margin: 0; padding: 36px 230px 36px 110px; grid-template-columns: 1fr 430px; }
  body.auth .auth-hero { padding-left: 0; padding-top: 40px; }
  body.auth .lg-card { margin-top: 120px; }
}
@media (max-width: 1000px) { .auth-logo { width: 220px; margin: 0 auto 14px; } }
/* Login logo: the H mark becomes a plane, flies a loop and returns (see app.js) */
.logo-stage { position: relative; width: 300px; height: 211px; margin: 0 0 26px; cursor: pointer; }
.logo-stage .auth-logo { display: block; width: 100%; height: auto; margin: 0; overflow: visible; }
.hl-mark rect { will-change: transform; }
@media (max-width: 1000px) { .logo-stage { margin: 0 auto 14px; width: 220px; height: 155px; } }

/* ---------------------------------------------------------------- responsive dashboard (all screen sizes) */
.content { max-width: none; }
.card-head { flex-wrap: wrap; row-gap: 6px; }
.chart-box { position: relative; width: 100%; }
.chart-box svg.chart { width: 100%; height: auto; }
.chart-box.live { height: var(--chart-h, 260px); }
.chart-box.live svg.chart { position: absolute; inset: 0; width: 100%; height: 100%; }
/* side by side with the pipeline: the chart fills the card's full height */
@media (min-width: 1281px) {
  .grid-2-1 > .card:first-child { display: flex; flex-direction: column; }
  .grid-2-1 > .card:first-child .chart-box.live { flex: 1; height: auto; min-height: 240px; }
}
.chart-box .axis { font-size: 11.5px; }
.chart-tip { position: absolute; pointer-events: none; background: var(--brand-800); color: #fff; font-size: 12px; line-height: 1.4; padding: 6px 9px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, -115%); box-shadow: var(--shadow); opacity: 0; transition: opacity .12s; }
.chart-tip.on { opacity: 1; }
.chart .hover-line { stroke: var(--brand-400); stroke-dasharray: 3 3; }
/* wide screens: more room for the chart, bigger numbers */
@media (min-width: 1800px) {
  .kpi strong { font-size: 32px; }
  .content { padding: 28px 36px 36px; }
}
/* laptops / small desktops with the sidebar: stack chart and pipeline so neither is cramped */
@media (max-width: 1280px) {
  .grid-2-1 { grid-template-columns: 1fr; }
}
@media (max-width: 1200px) and (min-width: 861px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-3 > :last-child { grid-column: span 2; }
}
/* phones: two KPI cards per row, compact */
@media (max-width: 520px) {
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; }
  .kpi-ic { width: 38px; height: 38px; }
  .kpi-ic .icon { width: 18px; height: 18px; }
  .kpi strong { font-size: 24px; }
  .kpi small { font-size: 12px; }
  .kpi .delta { font-size: 11.5px; }
  .kpi .spark { display: none; }
  .split { grid-template-columns: repeat(5, 1fr); gap: 2px; }
  .split b { font-size: 15px; }
  .split small { font-size: 10.5px; }
  .hero-banner { padding: 18px; margin-bottom: 14px; }
  .hero-banner h1 { font-size: 19px; }
  .hero-banner p { font-size: 13px; }
  .grid-2-1, .grid-3, .kpis { margin-bottom: 14px; }
  .grid-2-1, .grid-3 { gap: 14px; }
  .card { padding: 16px; }
  .quick { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .quick a { min-height: 80px; padding: 12px 4px; font-size: 11.5px; }
}
@media (max-width: 360px) { .quick { grid-template-columns: 1fr 1fr; } }
/* KPI cards: hide the little trend line when the card is too narrow for it */
.kpi { container-type: inline-size; }
@container (max-width: 330px) { .kpi .spark { display: none; } }

/* ---------------------------------------------------------------- billing */
.pad { padding: 16px 20px; } .pad-x { padding: 0 20px; } .pad-y { padding: 12px 0; }
.charge-form { background: #F7FAFB; border: 1px solid var(--line-2); border-radius: 12px; padding: 14px; }
.charge-grid { display: grid; grid-template-columns: 1.3fr 2fr .6fr 1.4fr 1.2fr; gap: 10px; }
.charge-grid .span-2 { grid-column: auto; }
.charge-grid .pair { display: flex; }
.charge-grid .pair .cur { width: 74px; flex: none; border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: 0; }
.charge-grid .pair input { border-top-left-radius: 0; border-bottom-left-radius: 0; min-width: 0; }
.charge-form .form-inline-actions { margin-top: 6px; }
.vat-code { display: inline-block; min-width: 24px; padding: 1px 6px; border-radius: 6px; background: var(--brand-50); color: var(--brand-800); font: 600 11.5px/18px ui-monospace, Menlo, Consolas, monospace; text-align: center; }
tr.billed td { color: var(--ink-2); }
.bill-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--line-2); background: #FBFDFD; }
.cur-split { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; padding-bottom: 14px; }
.inv-mini { list-style: none; margin: 0; padding: 0 20px 8px; border-top: 1px solid var(--line-2); }
.inv-mini li + li { border-top: 1px solid var(--line-2); }
.inv-mini a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; color: inherit; }
.inv-mini a > span:first-child { display: flex; flex-direction: column; } .inv-mini small { color: var(--muted); }
.inv-mini .r { display: flex; align-items: center; gap: 10px; text-align: right; }
.warn-banner { background: var(--warn-bg); border-color: #F2D7A6; color: #7A4B00; }
.inv-doc { padding: 22px; }
.inv-parties { display: grid; grid-template-columns: 1fr auto; gap: 20px; margin-bottom: 18px; }
.inv-parties > div { display: flex; flex-direction: column; gap: 2px; }
.inv-parties small { text-transform: uppercase; letter-spacing: .08em; font-size: 10.5px; color: var(--muted); }
.inv-parties b { font-size: 15px; }
.inv-parties span { color: var(--ink-2); font-size: 13px; }
.inv-parties dl { display: grid; grid-template-columns: auto auto; gap: 4px 16px; margin: 0; font-size: 13px; }
.inv-parties dt { color: var(--muted); } .inv-parties dd { margin: 0; text-align: right; }
.inv-lines td, .inv-lines th { padding-left: 10px; padding-right: 10px; }
.inv-totals { margin: 14px 0 0 auto; max-width: 380px; display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.inv-totals div { display: flex; justify-content: space-between; gap: 16px; padding: 5px 10px; }
.inv-totals .grand { background: var(--brand-50); border-radius: 9px; font-size: 15px; color: var(--brand-800); margin-top: 4px; }
.inv-totals .grand.bad { background: var(--bad-bg); color: var(--bad); }
.inv-totals .grand.ok { background: var(--ok-bg); color: #0F5E40; }
.inv-notes { margin: 16px 0 0; padding: 10px 12px; border-left: 3px solid var(--brand-400); background: #F7FAFB; font-size: 13px; color: var(--ink-2); }
.issue-card { border: 1.5px solid var(--brand-400); }
.issue-card h3 { display: flex; align-items: center; gap: 8px; }
.steps { margin: 6px 0 14px; padding-left: 20px; font-size: 13px; color: var(--ink-2); display: flex; flex-direction: column; gap: 8px; }
.steps .btn { margin-top: 6px; }
.alloc-table input { width: 130px; text-align: right; height: 36px; }
.bill-kpis .kpi strong { font-size: 22px; }
.acct-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; }
.acct-row + .acct-row { border-top: 1px solid var(--line-2); }
.acct-row > div { display: flex; flex-direction: column; }
.acct-row b { font-size: 18px; }
.acct-row small { color: var(--muted); }
.stat-strip.five { grid-template-columns: repeat(5, 1fr); margin-bottom: 16px; }
.stat-strip.five div.bad b { color: var(--bad); }
.sub-row td { background: #F7FAFB; color: var(--ink-2); }
.muted-row td { opacity: .55; }
.warn-text { color: var(--warn); }
label.inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
label.inline input { width: auto; }
@media (max-width: 1100px) { .charge-grid { grid-template-columns: 1fr 1fr; } .charge-grid .span-2 { grid-column: span 2; } }
@media (max-width: 720px) {
  .inv-parties { grid-template-columns: 1fr; }
  .inv-parties dd { text-align: left; }
  .inv-doc { padding: 16px; }
  .inv-totals { max-width: none; }
  .stat-strip.five { grid-template-columns: 1fr 1fr; }
  .charge-grid { grid-template-columns: 1fr; } .charge-grid .span-2 { grid-column: auto; }
}

/* ---------------------------------------------------------------- transport & delivery */
.trip-planned { background: #EEF1F5; color: #4D5D72; }
.trip-loading { background: var(--info-bg); color: var(--info); }
.trip-in_transit { background: var(--brand-50); color: var(--brand-600); }
.trip-delivered { background: var(--ok-bg); color: var(--ok); }
.trip-cancelled { background: var(--bad-bg); color: var(--bad); }
.trip-list { list-style: none; margin: 0; padding: 0; }
.trip-list li + li { border-top: 1px solid var(--line-2); }
.trip-list a { display: flex; align-items: center; gap: 12px; padding: 12px 18px; color: inherit; }
.trip-list a:hover { background: var(--line-2); }
.trip-ic { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-600); }
.trip-ic.st-delivered { background: var(--ok-bg); color: var(--ok); }
.trip-ic.st-cancelled { background: var(--bad-bg); color: var(--bad); }
.trip-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.trip-main small { color: var(--muted); }
.trip-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.trip-side small { color: var(--muted); font-size: 11.5px; }
.trip-steps { list-style: none; display: flex; margin: 0 0 18px; padding: 14px 18px; background: #fff; border: 1px solid var(--line); border-radius: 14px; gap: 8px; }
.trip-steps li { flex: 1; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13.5px; font-weight: 500; position: relative; }
.trip-steps li:not(:last-child)::after { content: ''; flex: 1; height: 2px; background: var(--line); border-radius: 2px; }
.trip-steps li.done:not(:last-child)::after { background: var(--brand-400); }
.trip-steps span { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--line-2); font-size: 12.5px; font-weight: 700; }
.trip-steps li.done { color: var(--ink-2); }
.trip-steps li.done span { background: var(--brand-400); color: #fff; }
.trip-steps li.on { color: var(--brand-700, #03393B); }
.trip-steps li.on span { background: var(--brand-600); color: #fff; box-shadow: 0 0 0 4px var(--brand-50); }
.pod-card { display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.pod-card h2 { color: var(--ok); display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 16px; }
.pod-text { flex: 1 1 300px; min-width: 0; }
.pod-stamp { flex: none; margin: 0 auto; }
.pod-stamp svg { display: block; max-width: 100%; height: auto; }
.cost-grid { grid-template-columns: 1fr 2fr 1.4fr 1fr 1fr; }
.fleet-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.pad-x-form { padding: 0 18px 14px; }
label.inline { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); margin-right: auto; }
label.inline select { width: auto; }
.muted-row td { opacity: .55; }
tr.editing td { background: var(--line-2); }
.overdue-text { color: var(--bad); font-weight: 600; }
.deliver-card { border-top: 3px solid var(--brand-400); }
.mb { margin-bottom: 12px; }
@media (max-width: 900px) {
  .cost-grid, .fleet-grid { grid-template-columns: 1fr 1fr; }
  .trip-steps { overflow-x: auto; }
  .trip-steps li { flex: none; }
  .trip-steps li:not(:last-child)::after { width: 18px; flex: none; }
}
@media (max-width: 560px) { .cost-grid, .fleet-grid { grid-template-columns: 1fr; } .trip-steps li { font-size: 0; gap: 4px; } .trip-steps li.on { font-size: 13px; } }
.trip-solo { max-width: 980px; margin-bottom: 18px; }
@media (max-width: 900px) { .act-first > .stack:last-child { order: -1; } }

/* ---------------------------------------------------------------- document viewer & letterhead */
.doc-viewer { background: #DCE5E5; border-radius: 16px; padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 14px; overflow: hidden; }
.doc-paper { background: #fff; box-shadow: 0 12px 36px rgba(3, 57, 59, .18); transform-origin: top left; position: relative; }
.doc-paper iframe { display: block; border: 0; width: 100%; height: 100%; background: #fff; }
.doc-hint { max-width: 760px; text-align: center; font-size: 12.5px; margin: 0; }
@media (max-width: 700px) { .doc-viewer { padding: 10px; border-radius: 12px; margin: 0 -6px; } .doc-head .actions { width: 100%; } .doc-head .actions .btn { flex: 1; justify-content: center; } }
.lh-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.lh-side { position: sticky; top: 86px; }
.lh-file { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.lh-thumb { width: 220px; height: 64px; flex: none; border: 1px dashed var(--line); border-radius: 10px; background: repeating-conic-gradient(#F2F5F5 0 25%, #fff 0 50%) 0 0 / 14px 14px; display: grid; place-items: center; overflow: hidden; }
.lh-thumb.tall { height: 120px; width: 85px; }
.lh-thumb img { max-width: 100%; max-height: 100%; display: block; }
.lh-thumb span { color: var(--muted); font-size: 12px; }
.lh-file-side { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; }
.lh-file-side .hint, .lh-file-side .field-error { flex-basis: 100%; }
.file-btn { position: relative; overflow: hidden; cursor: pointer; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.lh-prev { position: relative; width: 100%; aspect-ratio: 210 / 297; background: #fff; border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(3, 57, 59, .12); overflow: hidden; margin: 4px 0 14px; container-type: inline-size; }
.lh-prev > div { position: absolute; }
.lh-p-bg { inset: 0; } .lh-p-bg img { width: 100%; height: 100%; object-fit: fill; display: block; }
.lh-p-head, .lh-p-foot { outline: 1px dashed rgba(1, 113, 124, .45); outline-offset: -1px; }
.lh-p-head img, .lh-p-foot img { width: 100%; height: 100%; display: block; }
.lh-p-area { outline: 1px dashed rgba(224, 155, 45, .8); outline-offset: -1px; display: flex; flex-direction: column; gap: 1.6cqw; padding-top: 1cqw; overflow: hidden; }
.lh-p-area i { display: block; height: 1.3cqw; background: #DCE5E5; border-radius: 2px; }
.lh-p-title { font-size: 3.4cqw; color: #03393B; letter-spacing: .03em; }
.lh-p-table { display: flex; flex-direction: column; gap: .9cqw; margin: 1cqw 0; }
.lh-p-table span { height: 2.6cqw; background: #03393B; border-radius: 1px; }
.lh-p-table i { height: 1.2cqw !important; background: #EDF2F2 !important; }
.lh-p-text { display: flex; justify-content: space-between; font-size: 1.6cqw; color: #5B7173; border-top: 1px solid #E1EAEA; padding-top: .4cqw; }
.lh-advice { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 12.5px; margin: 0 0 10px; }
.lh-advice dt { color: var(--muted); } .lh-advice dd { margin: 0; font-weight: 500; }
@media (max-width: 1100px) { .lh-layout { grid-template-columns: 1fr; } .lh-side { position: static; order: -1; } .lh-preview-card { max-width: 420px; } }
@media (max-width: 560px) { .lh-file { flex-direction: column; } .lh-thumb { width: 100%; } }
.sys-docs { margin: 14px 0 6px; }
.sys-docs h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 6px; }
.sys-docs ul { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; }
.sys-docs li + li { border-top: 1px solid var(--line-2); }
.sys-docs a { display: flex; align-items: center; gap: 12px; padding: 10px 14px; color: inherit; }
.sys-docs a:hover { background: var(--line-2); }
.sd-ic { width: 32px; height: 32px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-600); }
.sd-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sd-main small { color: var(--muted); }

/* ---------------------------------------------------------------- ZRA checks, HS suggestions, reference data */
.zra-card { border-left: 4px solid var(--ok); }
.zra-card.zra-bad { border-left-color: var(--bad); }
.zra-card.zra-warn { border-left-color: #E0A23A; }
.zra-card .card-head h2 { display: flex; align-items: center; gap: 8px; }
.zra-bad .card-head h2 { color: var(--bad); } .zra-ok .card-head h2 { color: var(--ok); }
.zra-sum { font-size: 13px; color: var(--ink-2); } .zra-sum b { color: var(--bad); font-size: 15px; }
.zra-list { list-style: none; margin: 8px 0 0; padding: 0; }
.zra-list > li { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-top: 1px solid var(--line-2); }
.zra-box { flex: none; min-width: 44px; text-align: center; padding: 3px 6px; border-radius: 7px; font: 700 12px/1.3 ui-monospace, Menlo, Consolas, monospace; background: var(--bad-bg); color: var(--bad); }
.zra-box::before { content: 'Box '; font-weight: 500; font-size: 10px; opacity: .8; }
.zra-warning .zra-box { background: var(--warn-bg); color: var(--warn); }
.zra-reminder .zra-box { background: var(--info-bg); color: var(--info); }
.zra-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.zra-txt b { font-size: 14px; } .zra-txt small { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.zra-lines { margin: 4px 0 0; padding-left: 16px; font-size: 12.5px; color: var(--ink-2); }
.zra-reminder .zra-txt b { font-weight: 500; }
.zra-passed { margin-top: 8px; font-size: 13px; }
.zra-passed summary { cursor: pointer; color: var(--ok); font-weight: 500; }
.zra-passed ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; color: var(--ink-2); }
.zra-passed li { display: flex; gap: 6px; align-items: center; } .zra-passed .icon { color: var(--ok); }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tag.mini { font-size: 10.5px; padding: 0 6px; background: var(--brand-50); color: var(--brand-600); }
.tariff-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.tariff-chips i { font-style: normal; font-size: 10.5px; padding: 1px 6px; border-radius: 5px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.tariff-chips i.permit { background: var(--warn-bg); color: var(--warn); font-weight: 600; }
.goods-table td { vertical-align: top; }
.hs-sugs { margin: -4px 0 14px; border: 1px solid var(--brand-100); background: #F7FBFB; border-radius: 12px; overflow: hidden; }
.hs-sugs-head { padding: 8px 12px; font-size: 12px; font-weight: 600; color: var(--brand-600); text-transform: uppercase; letter-spacing: .06em; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.hs-sugs-head small { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--muted); }
.hs-sug { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--brand-100); }
.hs-sug.chosen { background: var(--brand-50); }
.hs-sug-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hs-sug-main > b { font-size: 14.5px; }
.hs-sug .tdesc { color: var(--ink-2); font-size: 12.5px; } .hs-sug .why { color: var(--muted); font-size: 12px; }
.verdict { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 6px; }
.verdict.vhi { background: var(--ok-bg); color: var(--ok); } .verdict.vmid { background: var(--info-bg); color: var(--info); } .verdict.vlo { background: var(--line-2); color: var(--muted); }
.hs-sug-main .basis { font-size: 11px; color: var(--muted); }
.hs-sug-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hs-sug-top b { font-size: 14.5px; }
.tools-panel { margin: 0 18px 14px; border: 1px solid var(--line); border-radius: 12px; }
.tool { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 12px 14px; flex-wrap: wrap; }
.tool + .tool { border-top: 1px solid var(--line-2); }
.tool > div:first-child { flex: 1 1 320px; display: flex; flex-direction: column; gap: 2px; }
.tool small { color: var(--muted); font-size: 12.5px; }
.tool-in { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tool-in .input-suffix { width: 170px; }
.estimate-card .hint { margin: 0 0 8px; }
.import-form { display: flex; flex-direction: column; gap: 10px; }
.import-form > div:first-of-type { display: flex; flex-direction: column; gap: 3px; } .import-form small { color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.import-in { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.selected-row td { background: var(--brand-50); }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
@media (max-width: 700px) { .hs-sug { flex-direction: column; align-items: stretch; } .tool-in .input-suffix { width: 100%; } }
.dec-timeline { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); margin: 0 0 14px; padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-radius: 14px; gap: 0; }
.dec-timeline li { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 30px 8px 0 0; min-width: 0; }
.dec-timeline li::before { content: ''; position: absolute; top: 11px; left: 24px; right: 0; height: 2px; background: var(--line); }
.dec-timeline li:last-child::before { display: none; }
.dec-timeline li.done::before { background: var(--brand-400); }
.dec-timeline .dot { position: absolute; top: 0; left: 0; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); background: #fff; display: grid; place-items: center; color: #fff; }
.dec-timeline li.done .dot { background: var(--brand-400); border-color: var(--brand-400); }
.dec-timeline li.current .dot { border-color: var(--brand-600); box-shadow: 0 0 0 4px var(--brand-50); }
.dec-timeline b { font-size: 13.5px; } .dec-timeline small { font-size: 12px; line-height: 1.35; }
.dec-timeline li:not(.done):not(.current) b { color: var(--muted); }
.dec-timeline .wait { color: var(--warn); font-weight: 600; }
.tl-total { margin: -6px 0 14px; font-size: 13px; }
@media (max-width: 760px) { .dec-timeline { grid-template-columns: 1fr; gap: 14px; } .dec-timeline li { padding: 0 0 0 36px; } .dec-timeline li::before { top: 26px; left: 11px; right: auto; width: 2px; height: calc(100% - 12px); } }

/* ---------------------------------------------------------------- notifications */
.bell-menu { margin-left: auto; margin-right: 6px; }
.bell { position: relative; }
.bell-n { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font: 700 10.5px/18px var(--font); font-style: normal; text-align: center; box-shadow: 0 0 0 2px #fff; }
.bell-drop { width: min(380px, calc(100vw - 24px)); padding: 0; right: 0; }
.bell-head { display: flex; justify-content: space-between; align-items: center; }
.bell-empty { padding: 18px 16px; color: var(--muted); font-size: 13px; margin: 0; }
.bell-drop .bell-all { display: block; text-align: center; padding: 10px; font-weight: 600; font-size: 13px; border-top: 1px solid var(--line-2); color: var(--brand-600); }
.ntf { display: flex; gap: 12px; padding: 11px 16px; color: inherit; border-top: 1px solid var(--line-2); align-items: flex-start; }
.ntf:hover { background: var(--line-2); }
.ntf.unread { background: #F4FAFA; } .ntf.unread b::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--brand-400); margin-right: 6px; vertical-align: 2px; }
.ntf-ic { width: 32px; height: 32px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-600); }
.ntf-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ntf-txt b { font-size: 13.5px; font-weight: 600; } .ntf-txt small { font-size: 12.5px; color: var(--ink-2); } .ntf-txt .when { color: var(--muted); font-size: 11.5px; }
.ntf-card { padding: 0; overflow: hidden; } .ntf-card .ntf:first-child { border-top: 0; }
.rules-table .c { text-align: center; width: 76px; }
.role-pick summary { cursor: pointer; font-size: 13px; }
.role-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; margin-top: 8px; font-size: 13px; }
.cron-help { margin: 0 18px 14px; padding: 12px 14px; border-radius: 10px; background: var(--warn-bg); }
.cron-help p { margin: 0 0 6px; font-size: 13.5px; }
.cron-line { display: block; padding: 8px 10px; background: #fff; border-radius: 8px; font-size: 12.5px; overflow-x: auto; white-space: nowrap; margin-bottom: 6px; }
.bell-menu { position: relative; }
.bell-drop .bell-head { flex-direction: row; text-align: left; padding: 12px 16px; }
.bell-drop .bell-head form { margin: 0; }
@media (max-width: 640px) { .bell-drop { position: fixed; left: 10px; right: 10px; top: 62px; width: auto; max-height: calc(100vh - 80px); overflow-y: auto; } }
.bell-menu + .user-menu { margin-left: 0; }
.bell-drop a.ntf { padding: 11px 16px; border-radius: 0; align-items: flex-start; gap: 12px; }
.bell-drop a.ntf.unread { background: #F4FAFA; }
.bell-drop .link-btn { width: auto; padding: 0; font-size: 12.5px; color: var(--brand-600); }
.bell-drop a.bell-all { justify-content: center; border-radius: 0; }

/* ---------------------------------------------------------------- Hello AI */
.ai-pill { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 20px; font-size: 12.5px; font-weight: 600; background: var(--line-2); color: var(--muted); }
.ai-pill i { width: 8px; height: 8px; border-radius: 50%; background: #A9B6BB; }
.ai-pill.on { background: var(--ok-bg); color: var(--ok); } .ai-pill.on i { background: var(--ok); box-shadow: 0 0 0 3px rgba(22, 134, 91, .2); }
.conf { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 0 6px; border-radius: 5px; vertical-align: 1px; }
.conf.chi { background: var(--ok-bg); color: var(--ok); } .conf.cmid { background: var(--info-bg); color: var(--info); } .conf.clo { background: var(--warn-bg); color: var(--warn); }
.warn-text { color: var(--warn); }
.ai-split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, 1fr); gap: 18px; align-items: start; }
.ai-preview { padding: 0; overflow: hidden; position: sticky; top: 86px; height: calc(100vh - 110px); background: #E6ECEE; }
.ai-preview iframe { width: 100%; height: 100%; border: 0; display: block; }
.ai-preview img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ai-text { white-space: pre-wrap; font-size: 11.5px; line-height: 1.45; max-height: 420px; overflow: auto; background: var(--line-2); padding: 10px; border-radius: 8px; margin: 8px 0 0; }
.ai-preview .ai-text { max-height: none; height: 100%; margin: 0; border-radius: 0; }
.ai-state { display: flex; gap: 8px; align-items: center; padding: 9px 12px; border-radius: 10px; font-size: 13px; font-weight: 600; margin-bottom: 14px; background: var(--info-bg); color: var(--info); }
.ai-state.ai-confirmed, .ai-state.ai-corrected { background: var(--ok-bg); color: var(--ok); }
.ai-h { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 16px 0 8px; }
.ai-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.ai-f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ai-f label { font-size: 12.5px; font-weight: 500; color: var(--ink-2); display: flex; gap: 6px; align-items: center; }
.ai-f input, .ai-f textarea { width: 100%; }
.ai-f:has(textarea) { grid-column: 1 / -1; }
.ai-fields:not(.show-all) .ai-f.empty { display: none; }
.ai-raw { margin-top: 12px; font-size: 13px; } .ai-raw summary { cursor: pointer; color: var(--brand-600); }
.sticky-actions { position: sticky; bottom: 0; background: #fff; padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--line-2); }
.token-card { border-left: 4px solid var(--warn); margin-bottom: 18px; }
.token-card h3 { display: flex; gap: 8px; align-items: center; margin: 0 0 4px; }
.token-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.token-row code { padding: 9px 12px; background: var(--line-2); border-radius: 8px; font-size: 13px; word-break: break-all; }
.queue-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; } .queue-actions form { margin: 0; }
.failed-list { margin-top: 12px; font-size: 13px; }
.setup-steps code { font-size: 12px; background: var(--line-2); padding: 1px 5px; border-radius: 4px; word-break: break-all; }
.kpi strong.sm { font-size: 20px; }
.ai-findings { list-style: none; margin: 0; padding: 0; }
.ai-findings li { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line-2); align-items: flex-start; }
.ai-findings li:first-child { border-top: 0; }
.ai-findings .lvl { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--info-bg); color: var(--info); }
.ai-findings .warning .lvl { background: var(--warn-bg); color: var(--warn); }
.ai-findings b { font-size: 13.5px; display: block; } .ai-findings small { color: var(--muted); font-size: 12.5px; }
@media (max-width: 1100px) { .ai-split { grid-template-columns: 1fr; } .ai-preview { position: static; height: 60vh; } }
@media (max-width: 560px) { .ai-fields { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- settings hub & bar */
.set-group { margin-bottom: 22px; }
.set-h { font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 10px; }
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.set-card { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
.set-card:hover { border-color: var(--brand-100); box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.set-ic { width: 40px; height: 40px; flex: none; border-radius: 11px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-600); }
.set-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.set-txt b { font-size: 15px; } .set-txt small { color: var(--muted); font-size: 13px; line-height: 1.45; }
.set-st { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-style: normal; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.set-st i { width: 7px; height: 7px; border-radius: 50%; background: #A9B6BB; }
.set-st.st-ok i { background: var(--ok); } .set-st.st-warn { color: var(--warn); } .set-st.st-warn i { background: #E0A23A; } .set-st.st-bad { color: var(--bad); } .set-st.st-bad i { background: var(--bad); }
.set-go { color: var(--muted); margin-top: 10px; flex: none; }
.set-bar { display: flex; gap: 4px; overflow-x: auto; margin: -4px 0 18px; padding: 4px; background: #fff; border: 1px solid var(--line); border-radius: 12px; scrollbar-width: thin; }
.set-bar a { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.set-bar a:hover { background: var(--line-2); }
.set-bar a.on { background: var(--brand-600); color: #fff; }

/* ---------------------------------------------------------------- page tabs */
.ptabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 0 0 18px; scrollbar-width: none; position: sticky; top: 70px; z-index: 5; background: var(--bg); }
.ptabs::-webkit-scrollbar { display: none; }
.ptabs a { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 11px 14px 10px; font-size: 14px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.ptabs a:hover { color: var(--ink); }
.ptabs a.on { color: var(--brand-600); border-bottom-color: var(--brand-600); font-weight: 600; }
.tab-n { font-style: normal; font-size: 11px; font-weight: 700; min-width: 20px; padding: 1px 6px; border-radius: 10px; background: var(--line-2); color: var(--ink-2); text-align: center; }
.tab-n.bad { background: var(--bad); color: #fff; } .tab-n.warn { background: var(--warn-bg); color: var(--warn); } .tab-n.ok { background: var(--ok-bg); color: var(--ok); }
.js .tab-panel { display: none; } .js .tab-panel.on { display: block; }
.tab-panel > .card + .card, .tab-panel > .stack { margin-top: 0; }
.zra-mini { display: flex; gap: 14px; align-items: center; padding: 14px 18px; color: inherit; border-left: 4px solid var(--ok); }
.zra-mini.zra-bad { border-left-color: var(--bad); } .zra-mini.zra-warn { border-left-color: #E0A23A; }
.zm-ic { width: 38px; height: 38px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--ok-bg); color: var(--ok); }
.zra-bad .zm-ic { background: var(--bad-bg); color: var(--bad); } .zra-warn .zm-ic { background: var(--warn-bg); color: var(--warn); }
.zm-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; } .zm-txt b { font-size: 14px; } .zm-txt small { color: var(--muted); font-size: 12.5px; }
.zm-go { flex: none; font-size: 13px; font-weight: 600; color: var(--brand-600); display: inline-flex; align-items: center; gap: 4px; }
@media (max-width: 640px) { .ptabs { top: 60px; } .zm-go { display: none; } }
.tab-narrow { max-width: 780px; }

/* ---------------------------------------------------------------- UI polish: focus, lighter banner, chips, phone tables */
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible, .btn:focus-visible { outline: 2px solid var(--brand-500, #16A5A8); outline-offset: 2px; border-radius: 6px; }
.hero-banner { min-height: 0; padding: 18px 26px; margin-bottom: 16px; }
.hero-banner h1 { font-size: 21px; }
.hero-banner p { font-size: 13.5px; margin-top: 3px; }
.tariff-chips { flex-wrap: nowrap; overflow: hidden; max-width: 100%; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
.tariff-chips:hover { flex-wrap: wrap; -webkit-mask-image: none; mask-image: none; }
@media (max-width: 640px) {
  .table.rt thead { display: none; }
  .table.rt, .table.rt tbody, .table.rt tr, .table.rt td { display: block; width: 100%; }
  .table.rt tr { padding: 10px 16px; border-bottom: 1px solid var(--line); }
  .table.rt td { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 4px 0 !important; border: 0; text-align: right; min-height: 0; }
  .table.rt td::before { content: attr(data-label); flex: none; max-width: 45%; text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
  .table.rt td.rt-main { display: block; text-align: left; font-size: 14.5px; padding-bottom: 6px !important; }
  .table.rt td.rt-main::before, .table.rt td.rt-full::before, .table.rt td[data-label=""]::before { display: none; }
  .table.rt td.rt-full { display: block; text-align: left; }
  .table.rt td[data-label=""] { justify-content: flex-end; }
  .table.rt td:empty { display: none; }
  .table.rt .rt-v { min-width: 0; text-align: right; }
  .table.rt td:not(.rt-main):not(.rt-full) > :last-child { margin-left: auto; }
  .table.rt .rt-v > * { margin-left: 4px; }
  .table.rt tfoot { display: block; } .table.rt tfoot tr { display: flex; flex-wrap: wrap; justify-content: space-between; }
  .table.rt tfoot td { display: block; width: auto; }
  .table-wrap:has(.table.rt) { overflow: visible; }
}

/* ---------------------------------------------------------------- find anything */
.top-search { position: relative; }
.kbd-hint { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font: 600 11px/1 inherit; font-family: inherit; color: var(--muted); background: #fff; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 4px 6px; pointer-events: none; }
.top-search input:focus ~ .kbd-hint { display: none; }
.find-drop { position: absolute; left: 0; right: 0; top: calc(100% + 8px); min-width: 420px; max-height: min(70vh, 560px); overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 50px rgba(3, 57, 59, .18); padding: 6px; z-index: 60; }
.find-g { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 10px 10px 4px; }
.find-i { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; color: var(--ink); }
.find-i.on, .find-i:hover { background: var(--brand-50, #E8F6F6); color: var(--ink); }
.find-ic { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--line-2); color: var(--brand-600); }
.find-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.find-tx b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.find-tx small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.find-tag { font-style: normal; flex: none; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: var(--line-2); color: var(--ink-2); }
.find-all { display: block; margin-top: 4px; padding: 10px; border-top: 1px solid var(--line-2); font-size: 13px; font-weight: 600; color: var(--brand-600); border-radius: 0 0 9px 9px; }
.find-all.on, .find-all:hover { background: var(--brand-50, #E8F6F6); }
.find-empty { margin: 0; padding: 14px 12px 8px; color: var(--muted); font-size: 13.5px; }
.search-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
@media (max-width: 900px) { .search-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .kbd-hint { display: none; } .find-drop { position: fixed; left: 10px; right: 10px; top: 62px; min-width: 0; } }
.find-drop svg, .find-drop .icon { position: static !important; transform: none !important; left: auto !important; top: auto !important; width: 16px; height: 16px; color: inherit; }
.with-avatar .avatar { display: grid !important; place-items: center; line-height: 1; text-align: center; }
@media (max-width: 640px) {
  .stepper li:not(.current) { font-size: 0; gap: 0; }
  .stepper li:not(.current) span { font-size: 12px; }
  .stepper li.current { font-size: 11.5px; white-space: nowrap; }
}

/* ---------------------------------------------------------------- reports */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.rp-range { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 18px; }
.rp-range select, .rp-range input[type=date] { width: auto; min-width: 0; padding-top: 8px; padding-bottom: 8px; }
.rp-dates { display: inline-flex; align-items: center; gap: 6px; }
.rp-dates[hidden] { display: none; }
.rp-label { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.rh-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.rh-card { display: block; color: var(--ink); padding: 20px; transition: transform .15s, box-shadow .15s; }
.rh-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(3, 57, 59, .12); color: var(--ink); }
.rh-head { display: flex; gap: 14px; align-items: flex-start; }
.rh-head h2 { font-size: 16px; margin: 2px 0 3px; } .rh-head p { margin: 0; font-size: 13px; color: var(--muted); }
.rh-head > div { flex: 1; min-width: 0; }
.rh-ic { width: 42px; height: 42px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-600); }
.rh-go { color: var(--muted); margin-top: 4px; }
.rh-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.rh-k small { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.3; min-height: 2.6em; }
.rh-k b { display: block; font-size: 17px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.rp-tabs { position: static; margin-bottom: 14px; }
.rp-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.rp-kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); border-top: 3px solid var(--brand-400); }
.rp-kpi.bad { border-top-color: var(--bad); } .rp-kpi.warn { border-top-color: #E0A23A; } .rp-kpi.ok { border-top-color: var(--ok); }
.rp-kpi > small { display: block; font-size: 12.5px; color: var(--muted); }
.rp-kpi strong { display: block; font-size: 24px; font-weight: 700; margin: 6px 0 4px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.rp-kpi strong .cur { font-size: 12px; font-weight: 600; color: var(--muted); margin-right: 4px; letter-spacing: 0; }
.rp-kpi > span { font-size: 12px; color: var(--muted); }
.rp-kpi.bad > span { color: var(--bad); }
.rp-layout { display: grid; gap: 18px; }
.rp-chart-card { padding: 18px 20px 12px; }
.rp-chart { margin: 0; position: relative; }
.rp-chart figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 8px; font-size: 14px; }
.rp-legend { display: inline-flex; gap: 14px; font-size: 12.5px; color: var(--ink-2); }
.rp-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); margin-right: 6px; vertical-align: -1px; }
.rp-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.zero { color: #A9B7BB; }
.rp-grid { stroke: #E6EDEF; stroke-width: 1; vector-effect: non-scaling-stroke; } .rp-grid.base { stroke: #B9C8CC; }
.rp-ax { font-size: 11px; fill: var(--muted); font-family: inherit; }
.rp-hit { fill: transparent; }
.rp-g:hover .rp-hit { fill: rgba(3, 57, 59, .045); }
.rp-tip { position: absolute; pointer-events: none; background: #12232A; color: #fff; font-size: 12px; line-height: 1.5; padding: 7px 10px; border-radius: 8px; white-space: pre; z-index: 5; box-shadow: 0 6px 18px rgba(0,0,0,.18); transform: translate(-50%, -100%); }
.rp-tip b { display: block; font-weight: 600; }
.rp-note { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); font-weight: 400; max-width: 760px; }
.rp-table .card-head { align-items: flex-start; }
.rp-table tfoot td { font-weight: 700; border-top: 1px solid var(--line); background: #F7FAFB; }
.rp-table td.num, .rp-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-showall { display: block; margin: 10px 20px 14px; }
@media (max-width: 1100px) { .rh-grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .rp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .rh-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rp-kpis { gap: 10px; } .rp-kpi { padding: 12px 14px; } .rp-kpi strong { font-size: 18px; }
  .rp-label { margin-left: 0; width: 100%; }
  .rp-table .table.rt td.num { text-align: right; }
}

/* ---------------------------------------------------------------- branches */
.form-row { display: flex; gap: 12px; } .form-row > .field { flex: 1; } .form-row > .field.sm, .field.sm { flex: 0 0 120px; max-width: 160px; }
.check-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; margin-top: 6px; }
fieldset.field { border: 0; padding: 0; margin: 0 0 14px; } fieldset.field legend { font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 0; }
.muted-row td { opacity: .6; }
.br-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.br-card { display: flex; flex-direction: column; gap: 10px; padding: 18px; color: var(--ink); transition: transform .15s, box-shadow .15s; }
.br-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(3, 57, 59, .12); color: var(--ink); }
.br-card.has-unread { border-color: var(--brand-400); }
.br-top { display: flex; gap: 12px; align-items: center; }
.br-name { flex: 1; min-width: 0; } .br-name h2 { font-size: 16px; margin: 0; } .br-name small { color: var(--muted); font-size: 12.5px; }
.br-code { flex: none; display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 6px; border-radius: 12px; background: var(--brand-700); color: #fff; font-weight: 700; font-size: 13px; letter-spacing: .04em; }
.br-code.sm { min-width: 34px; height: 26px; border-radius: 7px; font-size: 10.5px; }
.br-unread { flex: none; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; background: var(--bad); color: #fff; font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }
.br-unread.sm { min-width: 20px; height: 20px; font-size: 11px; padding: 0 6px; }
.br-last { margin: 0; font-size: 13px; color: var(--ink-2); min-height: 2.6em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.br-last time { color: var(--muted); font-size: 12px; margin-left: 4px; }
.br-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); align-items: center; }
.br-meta span { display: inline-flex; gap: 5px; align-items: center; }

.br-wrap { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 20px; align-items: start; }
.br-side { position: sticky; top: 84px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; max-height: calc(100vh - 110px); overflow-y: auto; }
.br-side-h { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.br-li { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 9px; color: var(--ink); font-size: 14px; }
.br-li:hover { background: var(--line-2); color: var(--ink); }
.br-li.on { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.br-li-n { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.br-main { min-width: 0; }
.br-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.br-head-t { flex: 1; min-width: 0; } .br-head h1 { font-size: 22px; margin: 0; } .br-head small { color: var(--muted); font-size: 13px; }
.br-back { display: none; }
.br-faces { display: flex; } .br-faces .avatar { margin-left: -8px; border: 2px solid var(--bg); } .br-faces .avatar.more { background: var(--line); color: var(--ink-2); }
.br-tabs { position: static; margin-bottom: 14px; } .br-tabs a { gap: 6px; }

/* chat */
.chat { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); height: calc(100vh - 250px); min-height: 420px; }
.chat.drop::after { content: 'Drop the file to attach it'; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(1, 113, 124, .1); border: 2px dashed var(--brand-500); border-radius: var(--radius); font-weight: 600; color: var(--brand-700); }
.chat-log { flex: 1; overflow-y: auto; padding: 14px 18px 8px; background: #F6F9FA; border-radius: var(--radius) var(--radius) 0 0; scroll-behavior: auto; }
.chat-empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 50px 20px; color: var(--muted); max-width: 520px; margin: 0 auto; }
.chat-empty .icon { width: 36px; height: 36px; color: var(--brand-400); }
.chat-more { display: block; margin: 0 auto 10px; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 6px 14px; font-size: 13px; color: var(--brand-600); cursor: pointer; }
.cm-day { text-align: center; margin: 14px 0 8px; } .cm-day span { font-size: 12px; font-weight: 600; color: var(--muted); background: #E7EFF1; padding: 3px 10px; border-radius: 10px; }
.cm { display: flex; gap: 10px; align-items: flex-start; margin-top: 10px; max-width: 78%; }
.cm.cont { margin-top: 3px; } .cm.cont .cm-av { visibility: hidden; height: 0; } .cm.cont .cm-h { display: none; }
.cm-av { margin-top: 2px; }
.cm-b { position: relative; background: #fff; border: 1px solid #E1E9EC; border-radius: 4px 14px 14px 14px; padding: 7px 12px 8px; min-width: 120px; box-shadow: 0 1px 1px rgba(0,0,0,.03); }
.cm.cont .cm-b { border-radius: 14px; }
.cm.me { margin-left: auto; flex-direction: row-reverse; } .cm.me .cm-av { display: none; }
.cm.me .cm-b { background: #DDF3F1; border-color: #C3E7E4; border-radius: 14px 4px 14px 14px; } .cm.me.cont .cm-b { border-radius: 14px; }
.cm-h { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; font-size: 12.5px; margin-bottom: 2px; }
.cm-h b { color: var(--brand-700); } .cm.me .cm-h b { display: none; } .cm-h time { color: var(--muted); font-size: 11px; }
.cm-t { font-size: 14px; line-height: 1.45; white-space: normal; overflow-wrap: anywhere; }
.cm-t .mention { color: var(--brand-600); font-weight: 600; }
.chip-ref { font-family: var(--mono, ui-monospace, monospace); font-size: 12.5px; background: rgba(1, 113, 124, .08); padding: 0 4px; border-radius: 4px; }
.cm-quote { display: block; border-left: 3px solid var(--brand-400); background: rgba(3, 57, 59, .05); padding: 4px 8px; border-radius: 4px; margin: 2px 0 6px; font-size: 12.5px; color: var(--ink-2); }
.cm-quote b { display: block; color: var(--brand-700); font-size: 12px; } .cm-quote span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 380px; }
.cm-img { display: block; margin: 4px 0; } .cm-img img { display: block; max-width: min(320px, 100%); max-height: 300px; border-radius: 10px; object-fit: cover; background: #eef; }
.cm-video { display: block; max-width: min(360px, 100%); max-height: 300px; border-radius: 10px; margin: 4px 0; background: #000; }
.cm-audio { display: block; width: 260px; max-width: 100%; margin: 4px 0; height: 40px; }
.cm-file { display: flex; gap: 10px; align-items: center; padding: 8px 10px; margin: 4px 0; border-radius: 10px; background: rgba(3, 57, 59, .05); color: var(--ink); max-width: 320px; }
.cm-file span { display: flex; flex-direction: column; min-width: 0; } .cm-file b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .cm-file small { color: var(--muted); font-size: 11.5px; }
.cm-file.gone { opacity: .6; }
.cm-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.cm-links a { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: #fff; border: 1px solid var(--line); }
.cm-act { position: absolute; top: -12px; right: 8px; display: none; gap: 2px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 2px; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.cm.me .cm-act { right: auto; left: 8px; }
.cm:hover .cm-act, .cm:focus-within .cm-act { display: flex; }
.cm-act form { margin: 0; } .cm-act button { border: 0; background: none; padding: 4px 6px; border-radius: 6px; cursor: pointer; color: var(--ink-2); display: grid; place-items: center; }
.cm-act button:hover { background: var(--line-2); color: var(--brand-700); }
.cm-del .cm-b { background: transparent !important; border-style: dashed; color: var(--muted); font-size: 13px; }
.cm-sys { justify-content: center; max-width: none; margin: 10px 0; } .cm-sys span { font-size: 12px; color: var(--muted); background: #EEF3F5; padding: 3px 10px; border-radius: 10px; }
.cm.flash .cm-b { animation: cmflash 2s ease-out; } @keyframes cmflash { 0%, 40% { box-shadow: 0 0 0 3px var(--brand-400); } 100% { box-shadow: none; } }
.chat-box { border-top: 1px solid var(--line); padding: 10px 14px 8px; position: relative; }
.chat-box.sending { opacity: .7; }
.chat-row { display: flex; gap: 8px; align-items: flex-end; position: relative; }
.chat-row textarea { flex: 1; resize: none; min-height: 42px; max-height: 160px; padding: 10px 12px; line-height: 1.4; border-radius: 12px; }
.chat-attach { flex: none; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); cursor: pointer; color: var(--ink-2); background: #fff; }
.chat-attach:hover { color: var(--brand-700); border-color: var(--brand-400); } .chat-attach input { display: none; }
.chat-send { height: 42px; width: 46px; padding: 0; justify-content: center; border-radius: 12px; }
.chat-hint { margin: 6px 2px 0; font-size: 11.5px; color: var(--muted); }
.chat-replying, .chat-file { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); background: var(--brand-50); padding: 6px 10px; border-radius: 8px; margin-bottom: 8px; }
.chat-replying[hidden], .chat-file[hidden] { display: none; }
.chat-replying span, .chat-file span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-replying button, .chat-file button { border: 0; background: none; font-size: 18px; line-height: 1; cursor: pointer; color: var(--muted); }
.chat-err { margin: 0 0 8px; padding: 6px 10px; border-radius: 8px; background: var(--bad-bg); color: var(--bad); font-size: 13px; }
.mention-pop { position: absolute; left: 50px; bottom: 50px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.14); padding: 4px; min-width: 240px; z-index: 10; }
.mention-pop button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: 7px; font-size: 13.5px; cursor: pointer; }
.mention-pop button.on, .mention-pop button:hover { background: var(--brand-50); }

/* files */
.br-files { padding: 0; }
.bf-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; padding: 14px 18px 0; }
.bf-crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 14px; font-weight: 600; } .bf-crumbs span { color: var(--muted); } .bf-crumbs a { display: inline-flex; gap: 5px; align-items: center; }
.bf-search input { width: 220px; padding: 7px 10px; }
.bf-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line-2); }
.bf-tools .btn { cursor: pointer; } .bf-upload { margin: 0; } .bf-upload .loading { opacity: .6; pointer-events: none; }
.bf-max { font-size: 12px; margin-left: auto; }
.bf-new { position: relative; } .bf-new summary { list-style: none; } .bf-new summary::-webkit-details-marker { display: none; }
.bf-pop { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; display: flex; flex-direction: column; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.12); min-width: 260px; }
.bf-pop form { display: flex; gap: 6px; margin: 0; } .bf-pop input { flex: 1; min-width: 0; }
form.bf-pop { flex-direction: row; }
.bf-note { margin: 10px 18px 0; font-size: 13px; color: var(--muted); }
.bf-folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; padding: 14px 18px; }
.bf-folder { display: flex; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #FAFCFC; }
.bf-folder:hover { border-color: var(--brand-400); color: var(--ink); background: var(--brand-50); }
.bf-folder .icon { color: #D9A23A; width: 26px; height: 26px; flex: none; fill: rgba(217, 162, 58, .18); }
.bf-folder span { display: flex; flex-direction: column; min-width: 0; } .bf-folder b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .bf-folder small { font-size: 12px; color: var(--muted); }
.bf-name { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 500; }
.bf-name img { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; flex: none; }
.bf-name span { display: flex; flex-direction: column; min-width: 0; word-break: break-word; } .bf-name small { font-size: 11.5px; color: var(--muted); font-weight: 400; } .bf-name small.ok-t { color: var(--ok); }
.bf-ic { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--line-2); color: var(--ink-2); }
.bf-ic.k-video { background: #EEE9FB; color: #6553C4; } .bf-ic.k-audio { background: #FDF0E1; color: #B4741E; } .bf-ic.k-document { background: #E6F2F3; color: var(--brand-600); }
.row-menu { position: relative; display: inline-block; } .row-menu summary { list-style: none; cursor: pointer; padding: 2px 10px; border-radius: 6px; font-size: 18px; line-height: 1; color: var(--ink-2); }
.row-menu summary::-webkit-details-marker { display: none; } .row-menu summary:hover { background: var(--line-2); }
.row-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; width: 290px; display: flex; flex-direction: column; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; box-shadow: 0 14px 40px rgba(0,0,0,.16); text-align: left; }
.row-pop form { display: flex; flex-direction: column; gap: 6px; margin: 0; padding-top: 10px; border-top: 1px solid var(--line-2); }
.row-pop label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.row-pop a { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; font-size: 13px; }
.row-pop .btn { align-self: flex-start; }
.table-wrap:has(.row-menu[open]) { overflow: visible; }

/* media */
.br-media { padding: 14px 18px 18px; }
.bm-filter { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; } .bm-filter .muted { margin-left: auto; font-size: 13px; }
.chip { display: inline-flex; padding: 6px 12px; border-radius: 16px; border: 1px solid var(--line); font-size: 13px; font-weight: 500; color: var(--ink-2); background: #fff; }
.chip.on { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.bm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.bm-day { grid-column: 1 / -1; margin: 10px 0 2px; font-size: 13px; color: var(--muted); font-weight: 600; }
.bm-item { aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #E9EFF1; position: relative; display: block; }
.bm-item img, .bm-item video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
a.bm-item:hover img { transform: scale(1.04); }
.bm-video video { background: #000; }
.bm-audio { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 10px; text-align: center; background: #FDF6EC; }
.bm-audio .icon { color: #B4741E; width: 28px; height: 28px; } .bm-audio small { font-size: 11px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; } .bm-audio audio { width: 100%; height: 32px; }

/* photo viewer */
.lb { position: fixed; inset: 0; z-index: 200; background: rgba(6, 18, 20, .92); display: grid; grid-template-columns: 60px 1fr 60px; align-items: center; }
.lb figure { margin: 0; grid-column: 2; display: flex; flex-direction: column; align-items: center; gap: 10px; max-height: 100vh; padding: 50px 0; }
.lb img { max-width: 100%; max-height: calc(100vh - 140px); object-fit: contain; border-radius: 4px; }
.lb figcaption { color: #CFE0E3; font-size: 13px; text-align: center; }
.lb button { background: none; border: 0; color: #fff; font-size: 38px; cursor: pointer; opacity: .8; } .lb button:hover { opacity: 1; }
.lb-x { position: absolute; top: 10px; right: 18px; } .lb-p { grid-column: 1; } .lb-nx { grid-column: 3; }
.lb-bar { position: absolute; top: 18px; left: 22px; display: flex; gap: 16px; align-items: center; color: #CFE0E3; font-size: 13px; }
.lb-bar a { color: #fff; font-weight: 600; }

@media (max-width: 900px) {
  .br-wrap { grid-template-columns: 1fr; } .br-side { display: none; } .br-back { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--ink-2); }
  .br-faces { display: none; }
  .chat { height: calc(100vh - 210px); min-height: 360px; }
  .cm { max-width: 92%; }
  .check-cols { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .br-head h1 { font-size: 18px; } .br-head .br-code { display: none; }
  .chat { height: calc(100dvh - 190px); border-radius: 12px; } .chat-log { padding: 10px; } .chat-hint { display: none; }
  .bm-grid { grid-template-columns: repeat(3, 1fr); gap: 3px; }
  .bf-search input { width: 100%; } .bf-search { flex: 1; } .bf-max { display: none; } .hide-sm { display: none; }
  .lb { grid-template-columns: 40px 1fr 40px; }
  .form-row { flex-direction: column; gap: 0; }
}

/* ---------------------------------------------------------------- WhatsApp inbox */
.wa { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 16px; align-items: start; }
.wa-side { padding: 0; display: flex; flex-direction: column; height: calc(100vh - 120px); position: sticky; top: 84px; overflow: hidden; }
.wa-side-h { display: flex; justify-content: space-between; align-items: center; padding: 14px 14px 8px; }
.wa-side-h h1 { font-size: 18px; margin: 0; display: flex; gap: 8px; align-items: center; } .wa-side-h h1 .icon { color: #1FA855; }
.wa-search { padding: 0 14px 8px; } .wa-search input { width: 100%; padding: 8px 10px; }
.wa-views { display: flex; gap: 2px; padding: 0 10px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.wa-views a { flex: none; padding: 8px 9px; font-size: 13px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.wa-views a.on { color: var(--brand-600); border-bottom-color: var(--brand-600); font-weight: 600; }
.wa-views em { font-style: normal; font-size: 11px; background: var(--line-2); border-radius: 8px; padding: 0 6px; margin-left: 2px; color: var(--ink-2); }
.wa-list { flex: 1; overflow-y: auto; }
.wa-none { padding: 30px 16px; text-align: center; color: var(--muted); font-size: 13.5px; }
.wa-li { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line-2); color: var(--ink); }
.wa-li:hover { background: #F6FAFA; color: var(--ink); } .wa-li.on { background: var(--brand-50); box-shadow: inset 3px 0 0 var(--brand-600); }
.wa-av { background: #1FA855 !important; }
.wa-li-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wa-li-1 { display: flex; justify-content: space-between; gap: 8px; } .wa-li-1 b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .wa-li-1 time { font-size: 11.5px; color: var(--muted); flex: none; }
.wa-li.unread .wa-li-1 time { color: #1FA855; font-weight: 700; }
.wa-li-2 { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .wa-li.unread .wa-li-2 { color: var(--ink); font-weight: 500; }
.wa-you { font-style: normal; color: var(--ink-2); }
.wa-li-3 { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; } .wa-li-3 small { font-size: 11px; color: var(--muted); }
.wa-job { background: var(--brand-50); color: var(--brand-700) !important; padding: 0 6px; border-radius: 6px; font-weight: 600; }
.wa-who { background: var(--line-2); padding: 0 6px; border-radius: 6px; } .wa-who.none { background: var(--warn-bg); color: var(--warn) !important; }
.wa-n { margin-left: auto; font-style: normal; background: #1FA855; color: #fff; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 10px; display: inline-grid; place-items: center; padding: 0 6px; }
.wa-main { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.wa-banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 12px; background: var(--warn-bg); color: #7A4E0F; font-size: 13.5px; }
.wa-empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 70px 30px; color: var(--muted); } .wa-empty .icon { width: 44px; height: 44px; color: #1FA855; } .wa-empty h2 { color: var(--ink); font-size: 18px; margin: 0; } .wa-empty p { max-width: 520px; margin: 0; }
.wa-new { max-width: 620px; } .wa-new h2 { margin-top: 0; }
.wa-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.wa-head-t { flex: 1; min-width: 0; } .wa-head h2 { font-size: 17px; margin: 0; } .wa-head small { color: var(--muted); }
.wa-back, .wa-info-btn { display: none; }
.wa-body { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 12px; align-items: start; }
.wa-chat { height: calc(100vh - 210px); }
.wa-chat .chat-log { background: #EFEAE2; }
.wa-m .cm-b { min-width: 90px; } .wa-m.me .cm-b { background: #D9FDD3; border-color: #C5EDBE; }
.wa-m .cm-h b:empty { display: none; } .wa-m.me .cm-h b { display: inline; color: #3B7A43; font-size: 11.5px; }
.wa-foot { display: flex; justify-content: flex-end; align-items: center; gap: 6px; margin-top: 2px; min-height: 14px; }
.wa-tick { font-size: 11.5px; color: var(--muted); letter-spacing: -2px; } .wa-tick.st-read { color: #34B7F1; } .wa-tick.st-failed { color: var(--bad); letter-spacing: 0; font-weight: 700; }
.wa-m.failed .cm-b { border-color: var(--bad); }
.wa-err { margin: 4px 0 0; font-size: 12px; color: var(--bad); }
.wa-rbtn { border: 0; background: none; color: var(--muted); padding: 0 2px; cursor: pointer; opacity: 0; } .wa-m:hover .wa-rbtn { opacity: 1; }
.wa-tpl { font-size: 11.5px; color: var(--muted); display: flex; gap: 4px; align-items: center; margin-bottom: 2px; }
.wa-save, .wa-saved { display: inline-flex; gap: 5px; align-items: center; font-size: 12px; font-weight: 600; margin: 2px 0 4px; }
.wa-save { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 3px 8px; color: var(--brand-700); cursor: pointer; } .wa-saved { color: var(--ok); }
.cm-file.pending { opacity: .75; }
.wa-window { font-size: 12px; color: var(--muted); padding: 6px 14px; border-top: 1px solid var(--line); display: flex; gap: 6px; align-items: center; background: #FAFCFC; }
.wa-window.closed { color: #7A4E0F; background: var(--warn-bg); }
.wa-tplform { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; } .wa-tplform select, .wa-tplform input { flex: 1; min-width: 160px; }
.wa-nowin { margin: 0; padding: 12px 14px; font-size: 13px; color: var(--muted); }
.wa-info { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px 0; position: sticky; top: 84px; }
.wa-info-sec { padding: 12px 16px; border-bottom: 1px solid var(--line-2); } .wa-info-sec:last-child { border-bottom: 0; }
.wa-info-sec h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 6px; }
.wa-info-sec p { margin: 0 0 6px; font-size: 13.5px; }
.wa-inline { display: flex; gap: 6px; margin: 0 0 4px; } .wa-inline select, .wa-inline input { flex: 1; min-width: 0; padding: 7px 8px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }
.wa-dlg { border: 0; border-radius: 14px; padding: 20px; width: min(420px, 92vw); box-shadow: 0 30px 80px rgba(0,0,0,.3); } .wa-dlg::backdrop { background: rgba(6, 18, 20, .45); } .wa-dlg h3 { margin: 0 0 12px; }
.copy-row { display: flex; gap: 6px; } .copy-row input { flex: 1; min-width: 0; }
.steps-ol { padding-left: 18px; margin: 8px 0 12px; font-size: 13.5px; } .steps-ol li { margin-bottom: 8px; }
.wa-log { list-style: none; padding: 0; margin: 6px 0 0; font-size: 12.5px; } .wa-log li { padding: 5px 0; border-bottom: 1px solid var(--line-2); } .wa-log time { color: var(--muted); margin-right: 6px; } .wa-log li.bad { color: var(--bad); }
.warn-t { color: #8A5A12; font-size: 13px; } .h-xs { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 4px; }
details.adv summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--brand-600); margin-bottom: 10px; }
@media (max-width: 1200px) { .wa-body { grid-template-columns: 1fr; } .wa-info { display: none; position: static; } .wa.show-info .wa-info { display: block; } .wa-info-btn { display: inline-flex; } }
@media (max-width: 900px) {
  .wa { grid-template-columns: 1fr; } .wa-side { position: static; height: auto; max-height: none; } .wa.has-conv .wa-side { display: none; } .wa:not(.has-conv) .wa-main > .wa-empty { display: none; }
  .wa-back { display: grid; place-items: center; width: 32px; height: 32px; }
  .wa-chat { height: calc(100dvh - 230px); }
}

/* ---------------------------------------------------------------- workflows */
.wf-toc { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.wf-toc a { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 16px; background: #fff; border: 1px solid var(--line); font-size: 13px; font-weight: 500; color: var(--ink-2); }
.wf-toc a:hover { border-color: var(--brand-400); color: var(--brand-700); } .wf-toc em { font-style: normal; font-size: 11px; color: var(--warn); }
.wf-list { display: grid; gap: 18px; }
.wf { padding: 20px 22px; scroll-margin-top: 90px; } .wf.draft { border-style: dashed; }
.wf-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
.wf-ic { width: 42px; height: 42px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-600); }
.wf-head-t { flex: 1; min-width: 0; } .wf-head h2 { font-size: 18px; margin: 0 0 4px; } .wf-head p { margin: 0; color: var(--ink-2); font-size: 14px; max-width: 900px; }
.wf-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; counter-reset: s; }
.wf-step { position: relative; display: flex; gap: 10px; background: #F7FAFB; border: 1px solid var(--line-2); border-radius: 12px; padding: 14px; }
.wf-step:not(:last-child)::after { content: ''; position: absolute; right: -11px; top: 26px; width: 10px; height: 2px; background: var(--brand-400); }
.wf-n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--brand-700); color: #fff; font-size: 12.5px; font-weight: 700; display: grid; place-items: center; }
.wf-c { min-width: 0; } .wf-c h3 { font-size: 14.5px; margin: 2px 0 6px; line-height: 1.3; }
.wf-who { display: inline-flex; gap: 5px; align-items: center; font-size: 12px; font-weight: 600; color: var(--brand-700); background: var(--brand-50); padding: 2px 8px; border-radius: 10px; margin-bottom: 6px; }
.wf-c p { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.wf-go { display: inline-flex; gap: 4px; align-items: center; font-size: 12.5px; font-weight: 600; margin-top: 8px; }
.wf-upd { margin: 12px 0 0; font-size: 12px; color: var(--muted); }
.wf-sh { font-size: 16px; margin: 22px 0 10px; }
.wf-edit { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; }
.wf-erow { padding: 14px 16px; } .wf-erow-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.wf-emove { display: flex; gap: 4px; } .wf-emove button { border: 1px solid var(--line); background: #fff; border-radius: 7px; width: 30px; height: 28px; cursor: pointer; font-size: 14px; color: var(--ink-2); }
.wf-emove button.danger { color: var(--bad); } .wf-emove button:hover { border-color: var(--brand-400); }
.wf-erow .field { margin-bottom: 8px; }
@media (max-width: 640px) { .wf { padding: 16px; } .wf-steps { grid-template-columns: 1fr; } .wf-step:not(:last-child)::after { right: auto; left: 26px; top: auto; bottom: -11px; width: 2px; height: 10px; } }
@media (max-width: 640px) { .wf-toc { display: none; } }

/* ---------------------------------------------------------------- API reference */
.api-ref h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 16px 0 6px; } .api-ref h3:first-child { margin-top: 0; }
.api-ep { border: 1px solid var(--line-2); border-radius: 8px; margin-bottom: 6px; }
.api-ep summary { display: flex; gap: 10px; align-items: baseline; padding: 8px 10px; cursor: pointer; list-style: none; flex-wrap: wrap; } .api-ep summary::-webkit-details-marker { display: none; }
.api-ep[open] summary { border-bottom: 1px solid var(--line-2); background: #F8FBFB; }
.api-m { font-size: 10.5px; font-weight: 700; padding: 2px 6px; border-radius: 4px; min-width: 40px; text-align: center; } .m-get { background: #E3F2FD; color: #1565C0; } .m-post { background: #E6F4EA; color: #1E7B3A; }
.api-ep code { font-size: 13px; font-weight: 600; } .api-s { color: var(--muted); font-size: 12.5px; flex: 1 1 200px; }
.api-d { padding: 8px 12px 10px; font-size: 13px; } .api-d p { margin: 0 0 6px; }
.api-t { border-collapse: collapse; width: 100%; } .api-t td { padding: 4px 8px 4px 0; border-top: 1px solid var(--line-2); vertical-align: top; } .api-t td:first-child { white-space: nowrap; width: 1%; }
.api-ex { background: #0F2A2C; color: #D7ECEC; padding: 12px; border-radius: 8px; font-size: 12px; overflow-x: auto; white-space: pre; }

/* ---------------------------------------------------------------- paper cards (documents, templates, letters) */
.repo-head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: flex-end; margin-bottom: 14px; }
.repo-head h1 { margin: 0; } .repo-head p { margin: 4px 0 0; color: var(--ink-2); font-size: 13.5px; }
.repo-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; margin-bottom: 18px; }
.repo-bar input[type=search], .repo-bar input[type=text] { flex: 1 1 220px; max-width: 320px; }
.repo-bar select { width: auto; min-width: 140px; }
.repo-bar .sp { flex: 1; }
.viewtog { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.viewtog button { border: 0; background: #fff; padding: 7px 11px; cursor: pointer; color: var(--ink-2); display: grid; place-items: center; }
.viewtog button.on { background: var(--brand-600, #01717C); color: #fff; }
.paper-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 22px; }
.paper { position: relative; display: flex; flex-direction: column; background: #fff; border-radius: 3px; padding: 18px 18px 14px 22px; min-height: 405px; color: var(--ink);
  box-shadow: 0 1px 2px rgba(16, 40, 44, .08), 0 6px 18px rgba(16, 40, 44, .06); cursor: pointer; transition: transform .15s, box-shadow .15s; text-align: left; border: 0; font: inherit; width: 100%; }
.paper::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--acc, #1E6FC9); border-radius: 3px 0 0 3px; }
.paper:hover, .paper:focus-visible { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(16, 40, 44, .08), 0 14px 32px rgba(16, 40, 44, .13); color: var(--ink); }
.paper.muted { opacity: .62; }
.paper-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.paper-ref { font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace); font-size: 11.5px; font-weight: 700; color: #1E6FC9; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.paper-badge { flex: none; font-size: 9.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); border: 1px solid #C9D3D6; border-radius: 10px; padding: 2px 8px; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paper h3 { font-size: 14.5px; font-weight: 700; margin: 0 0 3px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.paper-sub { font-size: 12px; color: var(--ink-2); margin: 0 0 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.paper-page { position: relative; flex: 1; min-height: 120px; border-top: 1px solid #E6ECEE; padding-top: 12px; margin-bottom: 12px; overflow: hidden; }
.paper-page .ln { display: block; height: 4px; background: #E9EEF0; border-radius: 2px; margin-bottom: 7px; }
.paper-page .ln:nth-child(2) { width: 88%; } .paper-page .ln:nth-child(3) { width: 92%; } .paper-page .ln:nth-child(4) { width: 70%; } .paper-page .ln:nth-child(1) { width: 96%; }
.paper-page.has-img .ln, .paper-page.has-img .paper-kind { display: none; }
.paper-page img { display: block; width: 100%; height: 150px; object-fit: cover; object-position: top center; border: 1px solid #E6ECEE; border-radius: 2px; background: #fff; }
.paper-kind { position: absolute; right: 2px; bottom: 4px; font-size: 10px; font-weight: 700; letter-spacing: .06em; color: #9AABB0; text-transform: uppercase; }
.paper-text { font-size: 9px; line-height: 1.5; color: #56686F; max-height: 150px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.paper-text b { color: var(--ink); font-size: 9.5px; }
.paper-meta { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 9px 12px; padding-bottom: 11px; border-bottom: 1px dashed #E1E8EA; }
.paper-meta > div { min-width: 0; }
.paper-meta small { display: block; font-size: 9.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #8A9BA0; margin-bottom: 1px; }
.paper-meta span { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.paper-meta .val { color: #1E6FC9; }
.paper-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; padding-top: 10px; }
.chip-s { font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 4px; border: 1px solid; white-space: nowrap; }
.chip-s.ok { color: #2E7D46; border-color: #A9D8B6; background: #F0FAF3; } .chip-s.warn { color: #B4581E; border-color: #F2C3A1; background: #FFF6EE; }
.chip-s.bad { color: #B42318; border-color: #F4B9B3; background: #FFF4F2; } .chip-s.neutral { color: var(--ink-2); border-color: #D3DCDF; background: #F7F9FA; }
.paper-sig { flex: 0 1 52%; text-align: right; font-size: 9.5px; color: #8A9BA0; border-top: 1px solid #C9D3D6; padding-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.paper-new { display: grid; place-items: center; text-align: center; color: var(--brand-600); border: 2px dashed #B9D3D5; background: #FBFDFD; box-shadow: none; gap: 8px; align-content: center; }
.paper-new::before { display: none; } .paper-new .icon { width: 30px; height: 30px; }
.repo-empty { text-align: center; padding: 50px 20px; color: var(--muted); }

/* preview / edit window */
.docwin { border: 0; padding: 0; width: min(1240px, 96vw); height: min(92vh, 980px); max-height: none; border-radius: 14px; overflow: hidden; box-shadow: 0 40px 100px rgba(0, 0, 0, .35); }
.docwin::backdrop { background: rgba(6, 18, 20, .55); }
.docwin-in { display: grid; grid-template-columns: minmax(0, 1fr) 360px; height: 100%; }
.docwin-view { background: #525659; overflow: auto; padding: 18px; position: relative; }
.docwin-view img.full { display: block; max-width: 100%; margin: 0 auto; box-shadow: 0 4px 20px rgba(0,0,0,.4); background: #fff; }
.docwin-side { display: flex; flex-direction: column; background: #fff; border-left: 1px solid var(--line); min-height: 0; }
.docwin-h { display: flex; gap: 10px; align-items: flex-start; padding: 16px 18px 12px; border-bottom: 1px solid var(--line-2); }
.docwin-h h2 { font-size: 16px; margin: 0 0 3px; line-height: 1.3; } .docwin-h small { color: var(--muted); font-size: 12px; }
.docwin-h .x { margin-left: auto; border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); padding: 0 4px; }
.docwin-body { flex: 1; overflow-y: auto; padding: 14px 18px; }
.docwin-body .field { margin-bottom: 10px; } .docwin-body .field label { font-size: 12px; }
.docwin-acts { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line-2); background: #FAFCFC; }
.docwin-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line-2); padding: 0 12px; }
.docwin-tabs button { border: 0; background: none; padding: 9px 10px; font: inherit; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; }
.docwin-tabs button.on { color: var(--brand-600); border-bottom-color: var(--brand-600); font-weight: 600; }
.docwin-load { color: #D7E1E3; text-align: center; padding: 60px 20px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; font-size: 13px; margin: 0 0 12px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.pdfv-page { position: relative; margin: 0 auto 14px; width: fit-content; box-shadow: 0 4px 20px rgba(0,0,0,.35); background: #fff; }
.pdfv-page canvas { display: block; }
.pdfv-n { position: absolute; right: 8px; bottom: 6px; font-size: 11px; color: #666; background: rgba(255,255,255,.85); padding: 1px 6px; border-radius: 6px; }
.pdfv-wait { color: #D7E1E3; text-align: center; padding: 40px; } .pdfv-wait a { color: #fff; }

/* editor */
.rte { border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.rte-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line-2); background: #F8FBFB; border-radius: 10px 10px 0 0; position: sticky; top: 70px; z-index: 3; }
.rte-bar button { border: 0; background: none; min-width: 30px; height: 30px; border-radius: 6px; cursor: pointer; font-weight: 600; color: var(--ink-2); font-size: 13px; padding: 0 6px; }
.rte-bar button:hover { background: #E5EFF0; color: var(--brand-700); } .rte-bar .sep { width: 1px; background: var(--line); margin: 4px 4px; }
.rte-bar select { height: 30px; padding: 0 8px; font-size: 13px; width: auto; margin-left: auto; }
.rte-area { min-height: 320px; padding: 18px 22px; outline: none; font-size: 14px; line-height: 1.6; }
.rte-area p { margin: 0 0 10px; } .rte-area table { border-collapse: collapse; width: 100%; margin: 6px 0 12px; } .rte-area td, .rte-area th { border: 1px solid #C9D6D9; padding: 5px 8px; text-align: left; } .rte-area th { background: #EEF5F5; }
.rte-area h2 { font-size: 17px; } .rte-area h3 { font-size: 15px; }
.letter-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.letter-view { background: #525659; border-radius: var(--radius); padding: 14px; position: sticky; top: 84px; max-height: calc(100vh - 110px); overflow: auto; }
.letter-form .card-body { padding: 16px 18px; }
.save-state { font-size: 12.5px; color: var(--muted); } .save-state.bad { color: var(--bad); }
.gaps { display: flex; gap: 8px; align-items: flex-start; padding: 10px 14px; border-radius: 10px; background: var(--warn-bg); color: #7A4E0F; font-size: 13px; margin-bottom: 12px; }
.gaps[hidden] { display: none; }
.field-help { columns: 2; font-size: 12px; color: var(--ink-2); } .field-help code { font-size: 11.5px; }
@media (max-width: 1100px) { .letter-wrap { grid-template-columns: 1fr; } .letter-view { position: static; max-height: none; } }
@media (max-width: 900px) { .docwin-in { grid-template-columns: 1fr; grid-template-rows: 55% 45%; } .docwin { height: 100dvh; width: 100vw; max-width: 100vw; max-height: 100dvh; margin: 0; inset: 0; border-radius: 0; } .docwin-side { border-left: 0; border-top: 1px solid var(--line); } }
@media (max-width: 640px) { .paper-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } .paper { min-height: 300px; padding: 12px 12px 10px 15px; } .paper-meta { grid-template-columns: 1fr; } .paper-page img { height: 110px; } .repo-bar input[type=search] { max-width: none; } .field-help { columns: 1; } }
.tpl-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.tpl-opt { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.tpl-opt:has(input:checked) { border-color: var(--brand-500, #16A5A8); background: var(--brand-50, #E8F6F6); }
.tpl-opt span { display: flex; flex-direction: column; gap: 2px; } .tpl-opt small { color: var(--muted); font-size: 12px; }
.save-state.ok { color: var(--ok, #2E7D46); }
.docwin-view [data-docwin-pdf] { max-width: 860px; margin: 0 auto; }
.docwin-load .file-ic.big { margin: 0 auto 10px; }
.docwin-load .btn { margin-top: 8px; }
.docwin-body .version-form { display: grid; gap: 8px; margin-bottom: 12px; }
.docwin-acts form { margin: 0; }

.paper-top { min-width: 0; } .paper-ref, .paper-badge { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 520px) { .paper-grid { grid-template-columns: minmax(0, 1fr); } .paper { min-height: 0; } .paper-page { max-height: 170px; } .paper-meta { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
