/* Ferber ERP — plain CSS, no build step. Colours are CSS variables below. */
:root {
  --sidebar-bg: #1d2327;
  --sidebar-bg-2: #2c3338;
  --sidebar-text: #c3c4c7;
  --sidebar-heading: #8c8f94;
  --accent: #2a78d6;
  --accent-dark: #1c5cab;
  --bg: #f3f4f6;
  --surface: #ffffff;
  --border: #e2e4e7;
  --text: #1d2327;
  --muted: #646970;
  --danger: #c62828;
  --danger-bg: #fdecea;
  --warning: #9a6700;
  --warning-bg: #fff4d6;
  --success: #1b7a3a;
  --success-bg: #e6f4ea;
  --info-bg: #e8f1fc;
  --radius: 8px;
  --sidebar-w: 240px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* the hidden attribute must win over display rules */
html, body { margin: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 14px; color: var(--text); background: var(--bg); line-height: 1.45; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; font-weight: 600; }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 600; }
h3 { font-size: 14px; margin: 0 0 8px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.pre { white-space: pre-wrap; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: var(--sidebar-bg); color: var(--sidebar-text); flex-shrink: 0; position: fixed; top: 0; bottom: 0; left: 0; overflow-y: auto; z-index: 20; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px; color: #fff; font-weight: 700; font-size: 16px; border-bottom: 1px solid #000; }
.sidebar .brand .logo { width: 30px; height: 30px; border-radius: 6px; }
.nav-section { padding: 10px 0 6px; border-bottom: 1px solid #111; }
.nav-section > .nav-heading { display: flex; align-items: center; gap: 8px; padding: 6px 18px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--sidebar-heading); }
.nav-section a { display: flex; align-items: center; gap: 8px; padding: 7px 18px 7px 30px; color: var(--sidebar-text); font-size: 13.5px; }
.nav-section a:hover { background: var(--sidebar-bg-2); color: #fff; text-decoration: none; }
.nav-section a.active { background: var(--accent); color: #fff; }
.nav-section a.sub { padding-left: 44px; font-size: 13px; }
.nav-section .count { margin-left: auto; background: #d63638; color: #fff; border-radius: 10px; font-size: 11px; padding: 0 7px; line-height: 18px; }
.main { margin-left: var(--sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 56px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 16px; padding: 0 24px; position: sticky; top: 0; z-index: 10; }
.topbar .spacer { flex: 1; }
.menu-toggle { display: none; background: none; border: 0; font-size: 22px; cursor: pointer; }
.content { padding: 24px; max-width: 1400px; width: 100%; }
.page-header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-header .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb { font-size: 12px; color: var(--muted); margin-bottom: 4px; }

/* ---------- Dropdowns (language, user) ---------- */
.dropdown { position: relative; }
.dropdown > button { background: none; border: 1px solid transparent; border-radius: 6px; padding: 6px 8px; cursor: pointer; display: flex; align-items: center; gap: 8px; font: inherit; color: inherit; }
.dropdown > button:hover { border-color: var(--border); }
.dropdown .menu { display: none; position: absolute; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.12); min-width: 180px; padding: 6px; z-index: 30; }
.dropdown.open .menu { display: block; }
.dropdown .menu a, .dropdown .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 6px; color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.dropdown .menu a:hover, .dropdown .menu button:hover { background: var(--bg); text-decoration: none; }
.flag { width: 24px; height: 16px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.15); object-fit: cover; display: block; }

/* ---------- Cards, grids ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 20px; }
.card.flush { padding: 0; }
.card.flush > h2 { padding: 16px 18px 0; }
.card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-header h2 { margin: 0; }
.card-header .actions { margin-left: auto; display: flex; gap: 8px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.stat .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 24px; font-weight: 600; margin-top: 4px; }
.stat .hint { color: var(--muted); font-size: 12px; margin-top: 2px; }
dl.props { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 8px 16px; margin: 0; }
dl.props dt { color: var(--muted); }
dl.props dd { margin: 0; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; background: #fafafa; white-space: nowrap; }
.table tbody tr:hover { background: #f8fafc; }
.table tr.row-link { cursor: pointer; }
.table td.num, .table th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table tr.highlight td { background: var(--danger-bg); }
.table .empty { text-align: center; color: var(--muted); padding: 30px; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: #eef0f2; color: #3c434a; }
.badge.high, .badge.received, .badge.active, .badge.ok { background: var(--success-bg); color: var(--success); }
.badge.low, .badge.danger, .badge.cancelled { background: var(--danger-bg); color: var(--danger); }
.badge.ordered, .badge.info { background: var(--info-bg); color: var(--accent-dark); }
.badge.obsolete { background: #eef0f2; color: var(--muted); }
.badge.warning { background: var(--warning-bg); color: var(--warning); }
.badge.role { background: #f0ecfb; color: #4a3aa7; }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid transparent; }
.alert.success { background: var(--success-bg); color: var(--success); border-color: #b7dfc3; }
.alert.error { background: var(--danger-bg); color: var(--danger); border-color: #f5c2c0; }
.alert.warning { background: var(--warning-bg); color: var(--warning); border-color: #f1d98c; }
.alert.info { background: var(--info-bg); color: var(--accent-dark); border-color: #c4dbf6; }
.alert ul { margin: 4px 0 0; padding-left: 18px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; line-height: 1.2; }
.btn:hover { background: #f6f7f7; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.success { background: var(--success); border-color: var(--success); color: #fff; }
.btn.danger { color: var(--danger); border-color: #f0b8b5; }
.btn.danger:hover { background: var(--danger-bg); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn.link { border: 0; background: none; color: var(--accent); padding: 0; }
form.inline { display: inline; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form-grid .full { grid-column: 1 / -1; }
.field label, .label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 13px; }
.field .help { color: var(--muted); font-size: 12px; margin-top: 4px; }
.field .error { color: var(--danger); font-size: 12px; margin-top: 4px; }
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=number], input[type=date], input[type=url], input[type=search], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #c3c4c7; border-radius: 6px; font: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(42,120,214,.35); border-color: var(--accent); }
input[readonly] { background: #f6f7f7; }
textarea { min-height: 90px; resize: vertical; }
textarea.tall { min-height: 220px; }
.input-group { display: flex; }
.input-group > * { border-radius: 0 !important; }
.input-group > :first-child { border-radius: 6px 0 0 6px !important; }
.input-group > :last-child { border-radius: 0 6px 6px 0 !important; }
.input-group > * + * { margin-left: -1px; }
.input-group select.prefix { width: 42%; }
.input-group select.suffix { width: 96px; flex: none; }
.check { display: flex; align-items: center; gap: 8px; font-weight: normal; cursor: pointer; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 16px; }
.checks.scroll { max-height: 360px; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; padding: 10px; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 16px; }
.filters > * { width: auto; }
.filters input[type=search] { min-width: 240px; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin: 0 0 20px; }
legend { font-weight: 600; padding: 0 6px; }

/* ---------- GHS pictograms ---------- */
.ghs-list { display: flex; gap: 6px; flex-wrap: wrap; }
.ghs-list img { width: 34px; height: 34px; }
.ghs-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.ghs-pick label { border: 1px solid var(--border); border-radius: 6px; padding: 8px; text-align: center; cursor: pointer; font-weight: normal; font-size: 12px; }
.ghs-pick label img { width: 48px; height: 48px; display: block; margin: 0 auto 4px; }
.ghs-pick input { display: none; }
.ghs-pick input:checked + span { color: var(--accent-dark); font-weight: 600; }
.ghs-pick label:has(input:checked) { border-color: var(--accent); background: var(--info-bg); }

/* ---------- Dropzone ---------- */
.dropzone { border: 2px dashed #c3c4c7; border-radius: var(--radius); padding: 22px; text-align: center; color: var(--muted); cursor: pointer; transition: .15s; background: #fcfcfc; }
.dropzone.drag { border-color: var(--accent); background: var(--info-bg); color: var(--accent-dark); }
.dropzone input[type=file] { display: none; }
.dropzone .files { margin-top: 8px; color: var(--text); font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.dropzone-file { display: inline-flex; align-items: center; gap: 4px; background: #f0f0f1; border-radius: 999px; padding: 2px 4px 2px 10px; }
.dropzone-remove { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0 4px; font-size: 12px; }
.dropzone-remove:hover { color: var(--danger); }
.safe-files { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.safe-files form { display: inline; }
.safe-add input[type=file] { display: none; }
.file-list { list-style: none; margin: 0; padding: 0; }
.file-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.file-list li:last-child { border-bottom: 0; }
.file-list .name { font-weight: 500; word-break: break-all; }
.file-list .meta { color: var(--muted); font-size: 12px; }
.file-list .actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 4px; border: 1px solid var(--border); }

/* ---------- Notes / timeline ---------- */
.note { border-left: 3px solid var(--accent); padding: 6px 12px; margin-bottom: 12px; background: #fafbfc; }
.note .meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; }

/* ---------- Charts ---------- */
.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid-line { stroke: #e9e9e7; stroke-width: 1; }
.chart .axis-label { fill: #52514e; font-size: 11px; }
.chart .bar { fill: #2a78d6; }
.chart .bar.neg { fill: #e34948; }
.chart .bar-hit { fill: transparent; cursor: default; }
.chart .bar-group:hover .bar { opacity: .8; }
.chart .zero-line { stroke: #8c8f94; stroke-width: 1; }
.chart-tooltip { position: absolute; pointer-events: none; background: #1d2327; color: #fff; padding: 6px 10px; border-radius: 6px; font-size: 12px; white-space: nowrap; transform: translate(-50%, -100%); margin-top: -8px; display: none; z-index: 5; }

/* ---------- Password generator ---------- */
.password-box input { font-family: ui-monospace, Menlo, Consolas, monospace; }

/* ---------- Login ---------- */
.auth-page { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #1d2327, #2c3338); padding: 20px; }
.auth-card { background: var(--surface); border-radius: 12px; padding: 32px; width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.auth-card .brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; margin-bottom: 24px; }
.auth-card .brand .logo { width: 40px; height: 40px; border-radius: 8px; }
.auth-lang { position: fixed; top: 16px; right: 16px; }
.auth-lang .dropdown > button { background: rgba(255,255,255,.1); color: #fff; }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 4px; margin-top: 16px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 6px 11px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.pagination .current { background: var(--accent); color: #fff; border-color: var(--accent); }
.pagination .disabled { color: #aaa; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  body.menu-open .sidebar { transform: none; }
  .main { margin-left: 0; }
  .menu-toggle { display: block; }
  .grid-2, .grid-3, .form-grid { grid-template-columns: 1fr; }
  .content { padding: 16px; }
  dl.props { grid-template-columns: 1fr; }
  dl.props dt { margin-top: 6px; }
}
@media print { .sidebar, .topbar, .actions, .btn { display: none !important; } .main { margin: 0; } }

/* ---------- Sortable column headers ---------- */
.table th a.sort { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.table th a.sort:hover { color: var(--text); }
.table th a.sort .arrow { font-size: 10px; opacity: .35; }
.table th a.sort.active { color: var(--accent-dark); }
.table th a.sort.active .arrow { opacity: 1; }

/* ---------- Work tracking ---------- */
.share-bar { height: 8px; background: #eef0f2; border-radius: 4px; overflow: hidden; margin-bottom: 2px; }
.share-bar span { display: block; height: 100%; background: #2a78d6; border-radius: 0 4px 4px 0; }
.table tfoot th { background: #fafafa; color: var(--text); font-size: 13px; text-transform: none; }
.table.heat td.num { font-variant-numeric: tabular-nums; }
details.card summary { cursor: pointer; }

/* ---------- Product documents ---------- */
.doc-block { padding: 12px 0; border-bottom: 1px solid var(--border); }
.doc-block:last-child { border-bottom: 0; }
.doc-block h3 { margin-bottom: 6px; }
.file-list li.old-version { opacity: .75; }
.doc-upload { margin-top: 10px; }
.doc-upload .dropzone { padding: 12px; }

/* ---------- Language flags on the login card ---------- */
.lang-flags { display: flex; justify-content: center; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.lang-flags a { opacity: .45; padding: 3px; border-radius: 4px; }
.lang-flags a:hover { opacity: 1; }
.lang-flags a.current { opacity: 1; outline: 2px solid var(--accent); }
.lang-flags .flag { width: 30px; height: 20px; }

/* ---------- Fulfillment tools (shipping label stamp, TSCA) ---------- */
.tool-grid { display: grid; grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); gap: 20px; align-items: start; }
.tool-grid .card h2 { margin-top: 0; }
.stamps { display: flex; flex-wrap: wrap; gap: 10px 8px; }
.stamp-btn { font: inherit; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; font-size: 13px; background: var(--surface); color: var(--text); border: 2px dashed var(--stamp-color, #8c8f94); border-radius: 6px; padding: 7px 12px; cursor: pointer; }
.stamp-btn:hover { background: #f6f7f7; }
.stamp-btn.selected { background: var(--stamp-color, #8c8f94); border-style: solid; color: #1d2327; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--stamp-color, #8c8f94); }
.tool-status { margin: 10px 0 0; font-size: 13px; color: var(--muted); min-height: 18px; }
.tool-status.error { color: var(--danger); font-weight: 600; }
.preview-card { position: sticky; top: 16px; }
.preview-card .card-header a { font-size: 13px; }
.pdf-preview { background: #eceef0; border-radius: 6px; height: calc(100vh - 170px); min-height: 480px; overflow: hidden; }
.pdf-preview iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.empty-preview { height: 100%; display: flex; align-items: center; justify-content: center; text-align: center; padding: 30px; color: var(--muted); }
.tsca-products { display: flex; flex-direction: column; gap: 8px; }
.tsca-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) 34px; gap: 6px; }
.tsca-row input { width: 100%; }
@media (max-width: 1000px) { .tool-grid { grid-template-columns: 1fr; } .preview-card { position: static; } .pdf-preview { height: 70vh; } }

/* ---------- Users & settings ---------- */
.input-group .addon { display: inline-flex; align-items: center; padding: 0 10px; background: #f0f0f1; border: 1px solid #c3c4c7; color: var(--muted); white-space: nowrap; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tabs a { padding: 8px 14px; border: 1px solid transparent; border-bottom: 0; border-radius: 6px 6px 0 0; color: var(--muted); font-weight: 600; margin-bottom: -1px; }
.tabs a.active { background: var(--surface); border-color: var(--border); color: var(--text); }
dl.credentials { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 0 0 12px; }
dl.credentials dt { color: var(--muted); font-size: 13px; }
dl.credentials dd { margin: 0; word-break: break-all; }
dl.credentials .secret { background: var(--warning-bg); padding: 2px 6px; border-radius: 4px; font-weight: 600; }
.site-row { display: grid; grid-template-columns: minmax(180px, 1.3fr) minmax(150px, 1fr) minmax(150px, 1fr) 30px auto; gap: 8px; align-items: center; }
.site-row.add { grid-template-columns: minmax(180px, 1.3fr) minmax(150px, 1fr) minmax(150px, 1fr) auto; padding: 14px 18px; border-top: 1px solid var(--border); }
.site-row input { width: 100%; }
form.inline { display: inline; }
@media print { .alert, .page-header .actions { display: none; } }

/* ---------- Transport ---------- */
.rates-table input { padding: 5px 8px; }
.table.surcharges td { vertical-align: middle; }
.table.surcharges select, .table.surcharges input[type=number] { width: 100%; }

/* ---------- Fulfillment work tracking ---------- */
.carrier-chip { display: inline-flex; align-items: center; gap: 4px; margin: 1px 4px 1px 0; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; background: #f6f7f7; border: 1px solid var(--c, #c3c4c7); border-left-width: 4px; white-space: nowrap; }
.carrier-line { display: grid; grid-template-columns: 10px minmax(70px, auto) minmax(60px, 1fr) 46px 40px; gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.carrier-line:last-child { border-bottom: 0; }
.carrier-dot { width: 10px; height: 10px; border-radius: 50%; }
.carrier-line .share-bar { display: block; }
.recaptcha-box { display: flex; justify-content: center; margin: 0 0 18px; min-height: 78px; }

/* ---------- Supplier risk ---------- */
.risk-score { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--radius); }
.risk-value { font-size: 34px; font-weight: 700; line-height: 1; }
.risk-value span { font-size: 15px; font-weight: 500; opacity: .7; }
.risk-reliable { background: var(--success-bg); color: var(--success); }
.risk-caution { background: var(--info-bg); color: var(--accent-dark); }
.risk-warning { background: var(--warning-bg); color: var(--warning); }
.risk-red { background: var(--danger-bg); color: var(--danger); }
.risk-gauge { height: 8px; border-radius: 4px; margin-top: 10px; background: linear-gradient(90deg, #f3b4b0 0 25%, #f6d79a 25% 50%, #b9d3f3 50% 75%, #a9dcb8 75%); position: relative; }
.risk-gauge span { display: block; height: 100%; border-right: 3px solid #1d2327; }

/* ---------- Human resources ---------- */
.section-title { display: flex; align-items: center; gap: 8px; margin: 26px 0 10px; font-size: 16px; }
.section-title .count { background: #eef0f2; color: var(--muted); border-radius: 10px; font-size: 12px; padding: 0 8px; line-height: 20px; font-weight: 600; }
form:not(.card) > .form-actions:last-child { margin-bottom: 26px; }
.card > h2 + .card-intro { margin-top: -4px; }
.card-intro { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.subnav { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 18px; }
.subnav a { padding: 5px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: 13px; }
.subnav a:hover { border-color: var(--accent); color: var(--accent-dark); }
.tool-grid-hr { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.tool-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; background: #fcfcfd; }
.tool-box h3 { margin: 0; display: flex; align-items: center; gap: 6px; }
.tool-box .btn { align-self: flex-start; margin-top: auto; }
.step { display: flex; align-items: center; gap: 8px; margin: 22px 0 12px; font-size: 14px; font-weight: 600; }
.step:first-of-type { margin-top: 4px; }
.step .num { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; }
.danger-zone { border-color: #f5c2c0; }
.danger-zone h2 { color: var(--danger); }

/* ---------- Warehouse > temporary workers ---------- */
.timesheet td { padding-top: 5px; padding-bottom: 5px; }
.timesheet input[type=time] { width: 120px; }
.timesheet tr.weekend td { background: #f6f7f7; }
.timesheet tr.today td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.timesheet tr.worked td[data-hours] { font-weight: 600; color: var(--success); }

/* ---------- Customer Service ---------- */
.cs-send-failed { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; }
.cs-send-failed form { margin: 0; }
.cs-layout { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 18px; align-items: start; }
.cs-list { position: sticky; top: 12px; max-height: calc(100vh - 140px); overflow-y: auto; }
.cs-list-head { position: sticky; top: 0; z-index: 2; background: var(--surface); border-radius: var(--radius) var(--radius) 0 0; } /* Open / Resolved always visible */
.cs-top-btn { margin-left: auto; }
.cs-tabs { display: flex; border-bottom: 1px solid var(--border); }
.cs-tabs a { flex: 1; text-align: center; padding: 10px; color: var(--muted); text-decoration: none; font-weight: 600; border-bottom: 2px solid transparent; }
.cs-tabs a.active { color: var(--accent-dark); border-bottom-color: var(--accent); }
.cs-search { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.cs-search input { width: 100%; }
.cs-item { display: block; padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; }
.cs-item:hover { background: #f6f7f7; }
.cs-item.active { background: var(--info-bg); box-shadow: inset 3px 0 0 var(--accent); }
.cs-item.priority { background: #fff8d6; }
.cs-item.priority:hover { background: #fff1b8; }
.cs-item.priority.active { background: #ffefa8; }
.cs-star { color: #dba617; }
.btn.warning-btn { border-color: #dba617; color: #8a6100; }
.cs-item.unread strong, .cs-item.unread .cs-item-subject { font-weight: 700; }
.cs-item.unread .cs-item-top strong::before { content: '● '; color: var(--danger); }
.cs-item-top { display: flex; justify-content: space-between; gap: 8px; }
.cs-item-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-item-subject, .cs-item-snippet { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-item-subject { font-size: 13px; margin-top: 2px; }
.cs-thread-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.cs-message { padding: 14px 18px; }
.cs-message.out { background: #f3f8fe; border-color: #c4dbf6; }
.cs-message.note { background: #fff8d6; border-color: #f1d98c; }
.cs-note-body { white-space: normal; word-wrap: break-word; }
.cs-note-btn { background: #fff8d6; border-color: #f1d98c; }
.cs-note-btn:hover { background: #fdeeb0; }
.cs-event { display: flex; align-items: center; gap: 10px; margin: 2px 0 14px; color: var(--muted, #646970); font-size: 12.5px; }
.cs-event::before, .cs-event::after { content: ""; flex: 1; border-top: 1px dashed #dcdcde; }
.cs-event.resolved span { color: var(--success); }
.cs-message-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.cs-body { width: 100%; border: 0; min-height: 60px; display: block; }
.cs-files { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.cs-reply textarea { width: 100%; margin-bottom: 10px; }
@media (max-width: 900px) { .cs-layout { grid-template-columns: 1fr; } .cs-list { position: static; max-height: none; } }

/* ---------- Video ---------- */
.video-folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.video-folder { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; color: var(--text); text-decoration: none; transition: .15s; }
.video-folder:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(0, 0, 0, .06); }
.video-folder.former { opacity: .75; }
.video-folder-icon { font-size: 30px; line-height: 1; }
.video-folder-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.video-drop { border: 2px dashed #c3c4c7; border-radius: var(--radius); padding: 26px; text-align: center; color: var(--muted); cursor: pointer; transition: .15s; background: #fcfcfc; }
.video-drop.drag { border-color: var(--accent); background: var(--info-bg); color: var(--accent-dark); }
.video-uploads { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.video-uploads:empty { display: none; }
.video-upload { border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; }
.video-upload-top { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 6px; font-size: 13px; }
.video-upload-top .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-upload .bar { height: 6px; background: #eef0f2; border-radius: 3px; overflow: hidden; }
.video-upload .bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.video-upload.ok .bar span { background: var(--success); }
.video-upload.ko { border-color: #f5c2c0; }
.video-upload.ko .bar span { background: var(--danger); }
.video-upload.ko .state { color: var(--danger); }
.video-player { width: min(1100px, 94vw); padding: 0; border: 0; border-radius: var(--radius); background: #000; }
.video-player::backdrop { background: rgba(0, 0, 0, .7); }
.video-player-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; background: var(--surface); }
.video-player video { display: block; width: 100%; max-height: 80vh; background: #000; }
.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.thumb-card { overflow: hidden; display: flex; flex-direction: column; }
.thumb-image { aspect-ratio: 16 / 9; background: #f0f0f1; display: flex; align-items: center; justify-content: center; }
.thumb-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.thumb-state { padding: 16px; text-align: center; color: var(--muted); font-size: 13px; display: flex; gap: 8px; align-items: center; }
.thumb-state.ko { color: var(--danger); }
.thumb-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.thumb-prompt { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.thumb-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.spinner { width: 16px; height: 16px; border: 2px solid #c3c4c7; border-top-color: var(--accent); border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.thumb-form { display: grid; grid-template-columns: minmax(0, 3fr) minmax(260px, 2fr); gap: 22px; align-items: start; }
.thumb-form-main textarea { width: 100%; min-height: 150px; resize: vertical; }
.thumb-form-actions { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.thumb-form-actions .field { margin-bottom: 0; flex: 0 1 280px; }
.thumb-form-actions .btn { height: 38px; }
.photo-drop { border: 2px dashed #c3c4c7; border-radius: var(--radius); padding: 20px 16px; text-align: center; color: var(--muted); cursor: pointer; transition: .15s; background: #fcfcfc; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.photo-drop.drag { border-color: var(--accent); background: var(--info-bg); color: var(--accent-dark); }
.photo-drop-icon { font-size: 28px; line-height: 1; }
.photo-previews { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.photo-previews:empty { display: none; }
.photo-preview { position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); background: #f0f0f1; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-remove { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; font-size: 12px; line-height: 22px; padding: 0; cursor: pointer; }
.photo-remove:hover { background: var(--danger); }
.thumb-refs { display: flex; gap: 4px; align-items: center; font-size: 12px; color: var(--muted); }
.thumb-refs img { width: 28px; height: 28px; object-fit: cover; border-radius: 4px; border: 1px solid var(--border); display: block; }
@media (max-width: 900px) { .thumb-form { grid-template-columns: 1fr; } }
.task-excerpt { max-width: 640px; }
.task-instructions { line-height: 1.6; white-space: normal; word-wrap: break-word; }
.lang-progress { display: flex; align-items: center; gap: 8px; }
.lang-progress-bar { width: 110px; height: 6px; background: #eef0f2; border-radius: 3px; overflow: hidden; display: inline-block; }
.lang-progress-bar span { display: block; height: 100%; background: var(--success); }
.lang-flags { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 4px; font-size: 15px; line-height: 1; }
.lang-table tr.mine > td { background: #f6fbf7; }
.lang-table .flag { font-size: 17px; }
.lang-form-row > td { background: #fbfbfc; }
.lang-form { padding: 6px 2px; }
.lang-form-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(150px, 1fr) minmax(0, 2fr); gap: 14px; align-items: start; }
.lang-form-grid .field { margin-bottom: 0; }
.small-drop { padding: 9px 12px; font-size: 13px; text-align: left; }
@media (max-width: 900px) { .lang-form-grid { grid-template-columns: 1fr; } }
.thumb-form-photos > .btn { width: 100%; justify-content: center; }
.script-card { padding: 16px 18px; }
.script-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.script-prompt { margin: 8px 0; }
.script-prompt summary { cursor: pointer; }
.script-text { white-space: pre-wrap; word-wrap: break-word; line-height: 1.6; background: #fbfbfc; border: 1px solid var(--border); border-radius: 6px; padding: 14px 16px; max-height: 520px; overflow: auto; font-size: 14px; }
.form-subtitle { font-size: 14px; margin: 18px 0 10px; padding-top: 14px; border-top: 1px solid var(--border); }
.schedule-tools { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.schedule-table td, .schedule-table th { padding-top: 6px; padding-bottom: 6px; }
.schedule-table input[type=time] { width: 110px; padding: 5px 6px; }
.schedule-table tr.off td { color: var(--muted); }
.schedule-table tr.off input[type=time] { opacity: .35; }
.schedule-table tfoot td { background: #fbfbfc; }
.switch-check input { width: 18px; height: 18px; }
.payout-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; } .payout-form input[type=date] { width: 140px; padding: 4px 6px; } .payout-form .small { flex-basis: 100%; }
.photo-input { display: flex; gap: 14px; align-items: center; border: 2px dashed #c3c4c7; border-radius: var(--radius); padding: 12px; background: #fcfcfc; transition: .15s; }
.photo-input.drag { border-color: var(--accent); background: var(--info-bg); }
.photo-input.missing { border-color: var(--danger); background: var(--danger-bg); }
.photo-input-preview { width: 96px; height: 96px; flex: 0 0 96px; border-radius: 8px; overflow: hidden; background: #f0f0f1; display: flex; align-items: center; justify-content: center; }
.photo-input-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-input-empty { font-size: 34px; opacity: .5; }
.photo-input-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.photo-input-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.inventory-thumb { width: 64px; height: 64px; border-radius: 6px; object-fit: cover; display: block; border: 1px solid var(--border); }
.inventory-thumb-missing { width: 64px; height: 64px; border-radius: 6px; display: flex; align-items: center; justify-content: center; background: var(--danger-bg); color: var(--danger); font-size: 11px; text-align: center; line-height: 1.1; }
.inventory-detail { display: grid; grid-template-columns: minmax(220px, 360px) minmax(0, 1fr); gap: 20px; align-items: start; }
.inventory-photo { padding: 10px; }
.inventory-photo img { width: 100%; max-height: 420px; object-fit: contain; border-radius: 6px; display: block; background: #f6f7f7; }
.inventory-fields dd { word-break: normal; }
@media (max-width: 800px) { .inventory-detail { grid-template-columns: 1fr; } }
.lang-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.lang-card { display: flex; flex-direction: column; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; color: var(--text); text-decoration: none; transition: .15s; }
.lang-card:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(0, 0, 0, .06); }
.lang-card.mine { border-color: #b7dfc3; background: #f6fbf7; }
.lang-card.state-done, .lang-card.state-stored { border-left: 4px solid var(--success); }
.lang-card.state-failed { border-left: 4px solid var(--danger); }
.lang-card.state-queued, .lang-card.state-uploading, .lang-card.state-yt_uploading { border-left: 4px solid var(--warning); }
.lang-card-head { display: flex; align-items: center; gap: 8px; }
.lang-card-flag { font-size: 22px; line-height: 1; }
.lang-card-name { font-weight: 600; flex: 1; }
.lang-card-body { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; font-size: 13px; }
.lang-card-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.lang-card-cta { color: var(--accent); font-weight: 600; }
.video-drop.missing { border-color: var(--danger); background: var(--danger-bg); }
.lang-detail { display: grid; grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); gap: 20px; align-items: start; }
.lang-thumb { width: 100%; border-radius: 6px; display: block; aspect-ratio: 16 / 9; object-fit: cover; }
@media (max-width: 860px) { .lang-detail { grid-template-columns: 1fr; } }

/* Video › Statistics */
.channel-stats .value.big { font-size: 30px; font-variant-numeric: tabular-nums; }
.channel-stats .value.flash { animation: stat-flash 1.2s ease-out; }
@keyframes stat-flash { from { color: var(--success); } to { color: inherit; } }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #d93025; margin-right: 2px; vertical-align: 1px; animation: live-pulse 2s infinite; }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 rgba(217, 48, 37, .5); } 70% { box-shadow: 0 0 0 6px rgba(217, 48, 37, 0); } 100% { box-shadow: 0 0 0 0 rgba(217, 48, 37, 0); } }
.avg-cell { display: flex; align-items: center; gap: 10px; }
.avg-cell .avg-value { min-width: 38px; font-variant-numeric: tabular-nums; }
.meter { flex: 1; height: 6px; background: #eef0f2; border-radius: 3px; overflow: hidden; min-width: 60px; }
.meter span { display: block; height: 100%; background: var(--accent); border-radius: 0 3px 3px 0; }
/* Video › Analytics: calendar (one hue, light → dark = fewer → more videos) */
.cal-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-legend { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; }
.cal-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid #e3e5e8; }
.calendar { display: grid; grid-template-columns: 44px repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); text-align: center; padding: 2px 0; }
.cal-wk { display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--muted); border-radius: 6px; }
.cal-wk:hover { background: #f0f0f1; color: var(--accent); }
.cal-day { position: relative; display: flex; flex-direction: column; min-height: 70px; padding: 5px 7px; border-radius: 6px; border: 1px solid #e3e5e8; color: var(--text); text-decoration: none; overflow: hidden; }
.cal-day:hover { border-color: var(--accent); }
.cal-day .cal-num { font-size: 11px; color: var(--muted); }
.cal-day .cal-count { font-size: 20px; font-weight: 700; line-height: 1.1; margin-top: 2px; font-variant-numeric: tabular-nums; }
.cal-day .cal-langs { display: flex; flex-wrap: wrap; gap: 2px 5px; font-size: 12px; margin-top: auto; }
.cal-day .cal-langs small { font-size: 10px; margin-left: 1px; }
.cal-day.out { opacity: .4; }
.cal-day.weekend { background-image: repeating-linear-gradient(135deg, rgba(0, 0, 0, .025) 0 6px, transparent 6px 12px); }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-day.selected { border: 2px solid #1d2327; padding: 4px 6px; }
.heat-0 { background-color: #fff; }
.heat-1 { background-color: #e3eefb; }
.heat-2 { background-color: #b9d4f5; }
.heat-3 { background-color: #78abea; }
.heat-4 { background-color: #2a78d6; }
.cal-day.heat-4 .cal-count, .cal-day.heat-4 .cal-num, .cal-day.heat-3 .cal-count { color: #fff; }
.cal-day.heat-4 .cal-num, .cal-day.heat-3 .cal-num { color: rgba(255, 255, 255, .85); }
@media (max-width: 700px) { .calendar { grid-template-columns: 30px repeat(7, minmax(0, 1fr)); } .cal-day { min-height: 54px; padding: 3px 4px; } .cal-day .cal-langs { display: none; } }

/* Customer Service: lock of a conversation (who is replying) */
.cs-locked { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.cs-lock-mine { margin: 4px 0 8px 2px; }
.cs-locked { margin: 4px 0 10px; }
.cs-item .cs-lock { margin-top: 4px; }
.cs-reply-fields { border: 0; padding: 0; margin: 0; min-width: 0; }
.cs-reply-fields:disabled { opacity: .55; }
/* Customer Service › Procedures: document, table of contents, editor */
.proc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-bottom: 18px; }
.proc-card { display: block; color: var(--text); text-decoration: none; }
.proc-card:hover { border-color: var(--accent); }
.proc-card-title { font-weight: 600; font-size: 16px; margin-bottom: 4px; }
.proc-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 18px; align-items: start; }
.proc-toc { position: sticky; top: 12px; max-height: calc(100vh - 40px); overflow-y: auto; padding: 14px 10px; font-size: 13px; }
.proc-toc-title { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 0 8px 6px; }
.proc-toc a { display: block; padding: 4px 8px; border-radius: 6px; color: var(--text); text-decoration: none; line-height: 1.35; }
.proc-toc a:hover { background: #f0f0f1; }
.proc-toc a.active { background: var(--info-bg); color: var(--accent-dark); }
.proc-toc .toc-1 { font-weight: 600; margin-top: 6px; }
.proc-toc .toc-2 { padding-left: 18px; }
.proc-toc .toc-3 { padding-left: 30px; color: var(--muted); }
.proc-doc { padding: 26px 34px; font-size: 15px; line-height: 1.65; max-width: 900px; }
.proc-doc > :first-child { margin-top: 0; }
.proc-doc h1 { font-size: 24px; margin: 34px 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--border); }
.proc-doc h2 { font-size: 19px; margin: 26px 0 8px; }
.proc-doc h3 { font-size: 16px; margin: 20px 0 6px; }
.proc-doc h1, .proc-doc h2, .proc-doc h3 { scroll-margin-top: 14px; line-height: 1.3; }
.proc-doc p { margin: 0 0 10px; }
.proc-doc ul, .proc-doc ol { margin: 0 0 12px; padding-left: 26px; }
.proc-doc li { margin-bottom: 3px; }
.proc-doc img { max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: 6px; display: inline-block; vertical-align: middle; margin: 6px 0; }
.proc-align { display: inline-block; width: 14px; height: 10px; vertical-align: middle; background: linear-gradient(currentColor, currentColor) 0 0 / 100% 2px no-repeat, linear-gradient(currentColor, currentColor) 0 4px / 60% 2px no-repeat, linear-gradient(currentColor, currentColor) 0 8px / 100% 2px no-repeat; }
.proc-align.c { background-position: 0 0, 50% 4px, 0 8px; }
.proc-align.r { background-position: 0 0, 100% 4px, 0 8px; }
.proc-doc video { width: 100%; max-height: 520px; background: #000; border-radius: 6px; margin: 6px 0; display: block; }
.proc-doc blockquote { margin: 8px 0 14px; padding: 12px 16px; background: #f6f7f9; border-left: 4px solid var(--accent); border-radius: 0 6px 6px 0; }
.proc-doc blockquote.template { background: #f7f9fc; border: 1px solid #d7e3f4; border-left: 4px solid var(--accent); font-size: 14px; }
.proc-doc blockquote p:last-child { margin-bottom: 0; }
.proc-doc table { border-collapse: collapse; margin: 8px 0 14px; font-size: 14px; }
.proc-doc td, .proc-doc th { border: 1px solid var(--border); padding: 6px 10px; vertical-align: top; }
.proc-doc hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
.proc-doc a { word-break: break-word; }
.proc-old { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.proc-old .actions { display: flex; gap: 8px; }
.proc-title-input { font-size: 22px; font-weight: 600; border: 1px solid transparent; padding: 4px 6px; margin-left: -7px; min-width: 420px; background: transparent; }
.proc-title-input:hover, .proc-title-input:focus { border-color: var(--border); background: #fff; }
.proc-toolbar { position: sticky; top: 0; z-index: 6; display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; box-shadow: 0 2px 6px rgba(0, 0, 0, .04); }
.proc-tools { display: flex; gap: 2px; padding-right: 6px; border-right: 1px solid #eee; }
.proc-tools:last-child { border-right: 0; }
.proc-tools button, .proc-menu > button { min-width: 32px; height: 32px; padding: 0 8px; border: 1px solid transparent; background: transparent; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--text); }
.proc-tools button:hover { background: #f0f0f1; }
.proc-tools button.active { background: var(--info-bg); border-color: #c4dbf6; color: var(--accent-dark); }
.proc-menu { position: relative; }
.proc-a { font-weight: 700; }
.proc-swatch-bar { display: block; height: 3px; background: linear-gradient(90deg, #c62828, #1c5cab, #1b7a3a); border-radius: 2px; margin-top: -2px; }
.proc-pop { position: absolute; top: 36px; left: 0; z-index: 10; display: grid; grid-template-columns: repeat(5, 26px); gap: 6px; padding: 10px; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 6px 18px rgba(0, 0, 0, .12); }
.proc-swatch { width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .15); cursor: pointer; padding: 0; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.proc-swatch-custom { position: relative; background: #fff; overflow: hidden; }
.proc-swatch-custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.proc-editor { min-height: 60vh; outline: none; }
.proc-editor:focus { border-color: #c4dbf6; box-shadow: 0 0 0 3px rgba(42, 120, 214, .12); }
.proc-editor img { cursor: default; }
.proc-editor img:hover { outline: 2px solid var(--accent); }
@media (max-width: 1000px) { .proc-layout { grid-template-columns: 1fr; } .proc-toc { position: static; max-height: none; } .proc-doc { padding: 18px; } .proc-title-input { min-width: 0; width: 100%; } }

.proc-table-pop { grid-template-columns: 1fr; width: 220px; gap: 8px; }
.proc-table-pop label { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.proc-table-pop input[type=number] { width: 70px; }
.proc-table-tools { display: inline-flex; gap: 2px; margin-left: 4px; padding-left: 6px; border-left: 1px dashed #ddd; }
.proc-doc th { background: #f6f7f7; font-weight: 600; text-align: left; }
.proc-editor td, .proc-editor th { min-width: 60px; }

.proc-zoom { display: inline-flex; gap: 2px; align-items: center; margin-right: 6px; }
.proc-zoom [data-zoom-value] { min-width: 58px; font-variant-numeric: tabular-nums; }
@media (max-width: 1000px) { .proc-zoom { display: none !important; } .proc-doc { zoom: 1 !important; } }
/* Office › Documents: list (table-like rows) or icons */
.fm-views { display: inline-flex; gap: 2px; }
.fm-views .btn.active { background: var(--info-bg); border-color: #c4dbf6; color: var(--accent-dark); }
.fm { position: relative; }
.fm-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.fm-path { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 15px; }
.fm-path a { padding: 4px 8px; border-radius: 6px; color: var(--text); font-weight: 600; text-decoration: none; }
.fm-path a:hover { background: #f0f0f1; }
.fm-selection { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px; background: var(--info-bg); border-radius: 999px; font-size: 13px; }
.fm-total { margin-left: auto; }
.fm-items { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-height: 160px; }
.fm-item { position: relative; transition: background .1s; }
.fm-item.selected { background: #eef5fd; }
.fm-item.dragging { opacity: .45; }
.drop-target, .fm-item.drop-target { outline: 2px dashed var(--accent); outline-offset: -2px; background: var(--info-bg) !important; }
.fm-icon { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.fm-icon img { object-fit: cover; border-radius: 4px; }
.fm-name { color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.fm-name:hover { color: var(--accent); }
.fm-item.is-folder .fm-name { font-weight: 600; }
.fm-actions { display: inline-flex; gap: 4px; justify-content: flex-end; }
.fm-empty { padding: 50px 20px; text-align: center; color: var(--muted); }
.fm-check input { margin: 0; }
/* list */
.fm.view-list .fm-head, .fm.view-list .fm-item { display: grid; grid-template-columns: 28px 34px minmax(0, 1fr) 110px 170px 140px 110px; gap: 10px; align-items: center; padding: 7px 14px; border-bottom: 1px solid #f0f0f1; }
.fm.view-list .fm-head { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; background: #fafafa; border-radius: var(--radius) var(--radius) 0 0; }
.fm.view-list .fm-head a { color: var(--muted); text-decoration: none; }
.fm.view-list .fm-item:hover { background: #f8f9fa; }
.fm.view-list .fm-icon { font-size: 20px; width: 34px; height: 30px; }
.fm.view-list .fm-icon img { width: 30px; height: 30px; }
.fm.view-list .fm-size, .fm.view-list .fm-head .num { text-align: right; }
.fm.view-list .fm-by, .fm.view-list .fm-date, .fm.view-list .fm-size { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fm.view-list .fm-actions { opacity: .35; }
.fm.view-list .fm-item:hover .fm-actions { opacity: 1; }
/* icons */
.fm.view-grid .fm-head { display: none; }
.fm.view-grid .fm-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; padding: 14px; align-content: start; }
.fm.view-grid .fm-item { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 14px 10px 10px; border: 1px solid transparent; border-radius: 10px; }
.fm.view-grid .fm-item:hover { background: #f8f9fa; border-color: var(--border); }
.fm.view-grid .fm-check { position: absolute; top: 8px; left: 8px; opacity: 0; }
.fm.view-grid .fm-item:hover .fm-check, .fm.view-grid .fm-item.selected .fm-check { opacity: 1; }
.fm.view-grid .fm-icon { font-size: 52px; width: 100%; height: 86px; }
.fm.view-grid .fm-icon img { max-width: 100%; max-height: 86px; }
.fm.view-grid .fm-name { width: 100%; margin-top: 6px; font-size: 13px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.fm.view-grid .fm-size { font-size: 11px; color: var(--muted); margin-top: 2px; }
.fm.view-grid .fm-by, .fm.view-grid .fm-date { display: none; }
.fm.view-grid .fm-actions { position: absolute; top: 6px; right: 6px; opacity: 0; }
.fm.view-grid .fm-item:hover .fm-actions { opacity: 1; }
.fm.view-grid .fm-empty { grid-column: 1 / -1; }
.fm-drop { position: fixed; inset: 0; z-index: 50; background: rgba(42, 120, 214, .12); border: 3px dashed var(--accent); display: flex; align-items: center; justify-content: center; pointer-events: none; }
.fm-drop[hidden] { display: none; }
.fm-drop div { background: #fff; padding: 18px 26px; border-radius: 12px; font-size: 18px; font-weight: 600; color: var(--accent-dark); box-shadow: 0 8px 30px rgba(0, 0, 0, .15); }
@media (max-width: 800px) { .fm.view-list .fm-head, .fm.view-list .fm-item { grid-template-columns: 24px 30px minmax(0, 1fr) 80px; } .fm.view-list .fm-by, .fm.view-list .fm-date, .fm.view-list .fm-actions, .fm.view-list .fm-head span:nth-last-child(-n+2) { display: none; } }
/* Month chooser (accounting, salaries) */
.month-picker { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.month-picker select { min-width: 170px; font-weight: 600; height: 34px; }
.month-picker .month-nav { width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; line-height: 1; }
.month-picker .month-nav.disabled { pointer-events: none; opacity: .35; }
.page-header .actions { align-items: center; flex-wrap: wrap; }
.stat .value.money { font-size: 20px; font-variant-numeric: tabular-nums; }
.stat .lines { font-size: 13px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.card > .card-header { margin-bottom: 0; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card.flush > .card-header h2 { font-size: 16px; }
.inline-upload { display: inline-flex; margin: 0; }
.inline-upload input[type=file] { display: none; }
.statement-files { display: flex; flex-direction: column; gap: 4px; }
.statement-files .file-row { display: flex; align-items: center; gap: 8px; }
.form-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.form-row .field { margin: 0; }
.card-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--border); }
.table tr.current-row td { background: #f2f7fd; }
.table.payroll td, .table.payroll th { vertical-align: middle; }
.table.payroll .hours-input { width: 84px; text-align: right; }
/* Foldable menu sections (remembered in localStorage, see layouts/sidebar) */
.nav-section > button.nav-heading { width: 100%; background: none; border: 0; cursor: pointer; text-align: left; font-family: inherit; }
.nav-section > button.nav-heading:hover { color: #fff; }
.nav-section > button.nav-heading:focus-visible { outline: 1px solid var(--sidebar-text); outline-offset: -2px; }
.nav-chevron { margin-left: auto; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform .15s; opacity: .7; margin-top: -3px; }
.nav-section.folded .nav-chevron { transform: rotate(-45deg); margin-top: 0; }
.nav-section.folded > a, .nav-section.folded > .nav-sub { display: none; }

/* Documents: "Move to…" dialog and ".." row */
.fm-move { border: 0; border-radius: 12px; padding: 0; width: min(520px, 92vw); max-height: 80vh; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.fm-move::backdrop { background: rgba(0, 0, 0, .35); }
.fm-move-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.fm-move-head button { margin-left: auto; }
.fm-move-list { max-height: 60vh; overflow-y: auto; padding: 6px; }
.fm-move-target { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 10px 7px calc(10px + var(--depth) * 20px); border-radius: 6px; cursor: pointer; font-size: 14px; color: var(--text); }
.fm-move-target:hover:not(:disabled) { background: var(--info-bg); color: var(--accent-dark); }
.fm-move-target:disabled { color: #b5b8bc; cursor: not-allowed; }
.fm-move-target.current::after { content: ' ✓'; }
.fm-item.fm-up .fm-name { font-weight: 600; }
.fm.view-grid .fm-item.fm-up .fm-icon { font-size: 40px; }
/* Temporary workers */
.inline-actions { display: inline-flex; gap: 8px; margin: 0; }
.assignment-dates { font-size: 14px; line-height: 1.7; margin-top: 4px; }
.fill-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 18px; background: #fafbfc; border-bottom: 1px solid var(--border); }
.fill-bar label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.fill-bar input[type=time] { width: 110px; }
.fill-bar input[type=number] { width: 70px; }
.timesheet .ts-date { width: 170px; }
.timesheet .ts-dow { display: inline-block; width: 38px; color: var(--muted); }
.timesheet .ts-break { width: 80px; text-align: right; }
.timesheet tr.ts-error td { color: var(--danger); background: var(--danger-bg); font-size: 13px; }
.timesheet tr.weekend .ts-dow { color: #9aa0a6; }
.secret { display: inline-flex; align-items: center; gap: 6px; }
.secret-value { min-width: 90px; display: inline-block; }
.departure-edit { margin-top: 14px; }
.departure-edit > summary { list-style: none; display: inline-flex; }
.departure-edit > summary::-webkit-details-marker { display: none; }
.proc-unused { margin-bottom: 10px; padding: 10px 16px; }
.proc-unused summary { cursor: pointer; font-weight: 600; }
.proc-unused-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.proc-unused-item { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.proc-unused-item [data-media-status] { margin-left: auto; }

/* Customer Service › AI agent */
.cs-tabs a { font-size: 13px; padding: 10px 6px; }
.ai-panel { border-left: 4px solid #7c4dff; }
.ai-panel h3 { font-size: 14px; margin: 12px 0 6px; }
.ai-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-reply { white-space: pre-wrap; background: #f7f7fb; border: 1px solid #e6e3f5; border-radius: 6px; padding: 10px 12px; font-size: 14px; line-height: 1.55; }
.ai-reply.note { background: #fffbea; border-color: #f2e3a3; font-size: 13px; }
.ai-actions { margin: 4px 0 0; padding-left: 20px; font-size: 13px; }
.ai-actions li { margin: 2px 0; }
.ai-running { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.ai-prompt { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; line-height: 1.5; background: #fbfbfc; }
.ai-call { border-bottom: 1px solid #f0f0f1; padding: 6px 0; }
.ai-call summary { cursor: pointer; }
.ai-json { background: #fbfbfc; border: 1px solid var(--border); border-radius: 6px; padding: 10px; font-size: 12px; max-height: 360px; overflow: auto; white-space: pre-wrap; }
.carrier-block { padding: 12px 0; border-top: 1px solid #f0f0f1; }
.carrier-block:first-of-type { border-top: 0; }
.carrier-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }

/* Order form: one block per reference */
.order-line { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; background: #fbfbfc; }
.order-line-grid { display: grid; grid-template-columns: 2fr 2fr 1.2fr 1.5fr 1.2fr auto; gap: 12px; align-items: start; }
.order-line-grid:has(select[name$="[status]"]) { grid-template-columns: 2fr 2fr 1.2fr 1.5fr 1.2fr 1fr auto; }
.order-line-grid > [data-repeat-remove] { margin-top: 22px; }
.order-line:only-child [data-repeat-remove] { visibility: hidden; }
.order-line-stats { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 8px; color: var(--muted); }
.order-line-stats strong { color: var(--text, inherit); }
.value-box { padding: 8px 0; font-size: 15px; }
.reverse-charge { padding: 8px 0; }
@media (max-width: 1100px) { .order-line-grid, .order-line-grid:has(select[name$="[status]"]) { grid-template-columns: 1fr 1fr; } }

/* Checkboxes in columns (countries of the AI price research…) */
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px 14px; margin-top: 6px; }
