:root {
  --bg: #f2f3f5;
  --surface: #ffffff;
  --ink: #17212b;
  --ink-2: #3a4652;
  --muted: #6b7682;
  --line: #e1e4e8;
  --line-2: #eef0f2;
  --side: #111a30;
  --side-2: #1c2745;
  --side-ink: #c5ced6;
  --accent: #2f4a9e;
  --accent-ink: #ffffff;
  --accent-soft: #e8ecf8;
  --pos: #22714a;
  --pos-soft: #e3f1e9;
  --neg: #b0392d;
  --neg-soft: #f8e6e3;
  --warn: #94600a;
  --warn-soft: #f8efdc;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 28, 38, .06), 0 1px 1px rgba(16, 28, 38, .04);
  font-size: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 15px; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.num, td.num, th.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--side); color: var(--side-ink); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { padding: 20px 18px 18px; border-bottom: 1px solid var(--side-2); }
.brand .logo { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 600; font-size: 15px; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 7px; background: var(--accent);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px;
}
.brand .sub { font-size: 11px; color: #7f8d99; margin-top: 4px; padding-left: 40px; }
.nav { padding: 12px 10px; flex: 1; }
.nav .group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #687784; padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px;
  color: var(--side-ink); font-size: 13.5px;
}
.nav a:hover { background: var(--side-2); color: #fff; text-decoration: none; }
.nav a.active { background: var(--accent); color: #fff; }
.nav svg { width: 17px; height: 17px; flex: none; opacity: .9; }
.nav .count {
  margin-left: auto; background: #c9862a; color: #1b1205; font-size: 11px; font-weight: 700;
  padding: 1px 7px; border-radius: 10px;
}
.userbox { border-top: 1px solid var(--side-2); padding: 14px 16px; font-size: 12.5px; }
.userbox .who { color: #fff; font-weight: 600; }
.userbox .role { color: #7f8d99; }
.userbox .links { display: flex; gap: 12px; margin-top: 8px; }
.userbox a, .userbox button { color: #9fb0bd; font-size: 12px; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
.userbox a:hover, .userbox button:hover { color: #fff; }

.main { min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 22px 32px 0;
}
.topbar .crumbs { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.content { padding: 20px 32px 48px; max-width: 1400px; }

/* ---------- components ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line-2); gap: 12px; }
.card-b { padding: 16px 18px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.mt { margin-top: 16px; }
.mt2 { margin-top: 24px; }

.kpi { padding: 16px 18px; }
.kpi .label { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi .value { font-size: 24px; font-weight: 600; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi .foot { font-size: 12px; color: var(--muted); margin-top: 4px; }
.kpi.accent { border-top: 3px solid var(--accent); }
.kpi.posb { border-top: 3px solid var(--pos); }
.kpi.negb { border-top: 3px solid var(--neg); }
.kpi.warnb { border-top: 3px solid #c9862a; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px;
  border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: #f7f8f9; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #263d84; }
.btn.danger { color: var(--neg); border-color: #e7c4bf; }
.btn.danger:hover { background: var(--neg-soft); }
.btn.ok { color: var(--pos); border-color: #bcdcc9; }
.btn.ok:hover { background: var(--pos-soft); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn svg { width: 15px; height: 15px; }
.linkbtn { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }
.linkbtn.danger { color: var(--neg); }

.badge {
  display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 10px;
  background: var(--line-2); color: var(--ink-2); white-space: nowrap;
}
.badge.Approved, .badge.Available, .badge.Completed { background: var(--pos-soft); color: var(--pos); }
.badge.Pending, .badge.Under-Repair, .badge.Planned { background: var(--warn-soft); color: var(--warn); }
.badge.Rejected, .badge.Damaged, .badge.Cancelled { background: var(--neg-soft); color: var(--neg); }
.badge.On-Job, .badge.Ongoing { background: var(--accent-soft); color: var(--accent); }
.badge.Retired, .badge.Sold { background: #eceef0; color: #66717c; }
.badge.Admin { background: #1d2a35; color: #fff; }
.badge.Manager { background: var(--accent-soft); color: var(--accent); }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
th { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; background: #fafbfb; position: sticky; top: 0; }
tbody tr:hover { background: #fafbfc; }
tfoot td { font-weight: 600; background: #fafbfb; border-top: 1px solid var(--line); }
td .sub { font-size: 12px; color: var(--muted); }
tr.clickable { cursor: pointer; }
.empty { padding: 36px 18px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); margin-bottom: 4px; }

/* filters */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line-2); }
.filters input, .filters select { height: 32px; }
.filters .search { min-width: 240px; flex: 1; max-width: 340px; }

/* forms */
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
label .req { color: var(--neg); }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=search], input[type=email], select, textarea {
  width: 100%; height: 36px; padding: 0 10px; border: 1px solid #d3d8dd; border-radius: 6px;
  background: #fff; color: var(--ink); font: inherit; font-size: 13.5px;
}
textarea { height: auto; min-height: 76px; padding: 8px 10px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(47, 74, 158, .25); border-color: var(--accent); }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form .full { grid-column: 1 / -1; }
.form .third { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; }
.help { font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-actions { display: flex; gap: 8px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-2); }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.check input { width: 16px; height: 16px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 16px; margin: 0; }
legend { font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 6px; text-transform: uppercase; letter-spacing: .04em; }
.calc { background: var(--accent-soft); border-radius: 6px; padding: 10px 12px; font-size: 13px; color: var(--accent); }

/* searchable select */
.ss { position: relative; }
.ss-input { padding-right: 28px !important; }
.ss-list {
  position: absolute; left: 0; right: 0; top: 38px; z-index: 30; max-height: 260px; overflow-y: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 24px rgba(16, 28, 38, .12);
  display: none;
}
.ss.open .ss-list { display: block; }
.ss-opt { padding: 7px 10px; cursor: pointer; font-size: 13px; }
.ss-opt:hover, .ss-opt.hl { background: var(--accent-soft); }
.ss-opt .sub { color: var(--muted); font-size: 12px; }
.ss::after { content: ""; position: absolute; right: 11px; top: 15px; border: 5px solid transparent; border-top-color: #7a8691; pointer-events: none; }

/* flash */
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 13px; border: 1px solid; }
.flash.ok { background: var(--pos-soft); border-color: #bcdcc9; color: #1b5a3a; }
.flash.error { background: var(--neg-soft); border-color: #e7c4bf; color: #8c2c22; }
.flash.warn { background: #fff6e5; border-color: #f0d9a8; color: #7a4f0b; } .flash.warn svg { width: 18px; height: 18px; }
.flash.info { background: #eef6fb; border-color: #c7e1ef; color: #1d4f6b; }

/* bars */
.bar-row { display: grid; grid-template-columns: 150px 1fr 110px; gap: 10px; align-items: center; padding: 6px 0; font-size: 13px; }
.bar-row .track { height: 8px; background: var(--line-2); border-radius: 4px; overflow: hidden; }
.bar-row .fill { height: 100%; background: var(--accent); border-radius: 4px; }
.bar-row .fill.neg { background: #c46a4f; }
.bar-row .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chart { width: 100%; height: 260px; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

.stat-list { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; font-size: 13.5px; }
.stat-list .k { color: var(--muted); }
.stat-list .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.stat-list .sep { grid-column: 1 / -1; border-top: 1px solid var(--line-2); margin: 2px 0; }
.stat-list .big { font-size: 16px; font-weight: 600; }

.pl th:first-child, .pl td:first-child { width: 34%; }
.pl tr.section td { font-weight: 600; background: #fafbfb; color: var(--ink-2); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.pl tr.indent td:first-child { padding-left: 28px; color: var(--ink-2); }
.pl tr.total td { font-weight: 600; border-top: 1px solid var(--line); }
.pl tr.grand td { font-weight: 700; font-size: 14.5px; background: #f5f7f8; border-top: 2px solid var(--ink); }

.progress { height: 6px; background: var(--line-2); border-radius: 3px; overflow: hidden; min-width: 70px; }
.progress span { display: block; height: 100%; background: var(--pos); }
.progress span.low { background: #c9862a; }

.pager { display: flex; justify-content: space-between; align-items: center; padding: 10px 18px; font-size: 12.5px; color: var(--muted); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs a { padding: 9px 14px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--ink); border-bottom-color: var(--accent); }
.tabs a:hover { text-decoration: none; color: var(--ink); }

/* auth pages */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: var(--side); color: #c8d2da; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side h2 { color: #fff; font-size: 26px; line-height: 1.25; max-width: 420px; font-weight: 600; }
.auth-side p { max-width: 420px; color: #93a3b0; }
.auth-side ul { padding-left: 18px; color: #a9b7c2; }
.auth-main { display: grid; place-items: center; padding: 32px; }
.auth-box { width: 100%; max-width: 380px; }
.auth-box h1 { margin-bottom: 4px; }
.auth-box .field { margin-top: 16px; }
.auth-box .btn { width: 100%; justify-content: center; height: 40px; margin-top: 22px; }

dialog { border: 1px solid var(--line); border-radius: 10px; padding: 0; width: 420px; box-shadow: 0 20px 50px rgba(0,0,0,.2); }
dialog::backdrop { background: rgba(16, 28, 38, .45); }
dialog .card-b { padding: 20px; }

@media print {
  .sidebar, .actions, .filters, .no-print { display: none !important; }
  .app { display: block; }
  body { background: #fff; }
  .card { box-shadow: none; }
}

/* logo */
.logo-tile { background: #fff; border-radius: 8px; padding: 8px 10px; margin-bottom: 12px; display: flex; align-items: center; justify-content: center; }
.logo-tile img { max-width: 100%; max-height: 66px; object-fit: contain; display: block; }
.logo-tile.lg { display: inline-flex; padding: 10px 14px; margin-bottom: 14px; }
.logo-tile.lg img { max-height: 64px; max-width: 220px; }
.brand .sub.nologo { padding-left: 0; }
.auth-logo { max-height: 72px; max-width: 240px; object-fit: contain; display: block; margin-bottom: 18px; }
.logo-preview { border: 1px dashed var(--line); border-radius: 8px; padding: 14px; display: flex; justify-content: center; background: #fafbfb; }
.logo-preview img { max-height: 90px; max-width: 100%; object-fit: contain; }
@media (min-width: 1000px) { .auth-logo { display: none; } }

/* =================================================================
   Responsive layout
   Breakpoints (CSS px — Windows display scaling shrinks these, e.g.
   1920x1080 at 150% = 1280x720):
   ≥1800 large monitors · 1200–1799 desktop/laptop · 1000–1199 small laptop
   <1000 tablet: sidebar becomes a slide-out menu · <640 phone
   ================================================================= */
.menu-btn { display: none; }
.nav-backdrop { display: none; }
.titlebox { min-width: 0; }
.titlebox h1 { overflow-wrap: anywhere; }
.topbar { flex-wrap: wrap; }
.actions { justify-content: flex-end; }
.tabs { overflow-x: auto; scrollbar-width: thin; white-space: nowrap; }
.tabs a { flex: none; }
.picker { min-width: 360px; flex: 1; max-width: 520px; }
.kpi .value { font-size: clamp(19px, 1.7vw, 26px); overflow-wrap: anywhere; }
img, svg { max-width: 100%; }
.chart svg { display: block; }
.table-wrap { -webkit-overflow-scrolling: touch; }
.bar-row > * { min-width: 0; }

/* short screens (e.g. 1366x768 laptops, or 125–150% scaling): tighter sidebar */
@media (max-height: 820px) {
  .brand { padding: 12px 16px 10px; }
  .nav { padding: 6px 10px; }
  .nav a { padding: 6px 10px; font-size: 13px; }
  .nav .group { padding: 10px 10px 4px; }
  .userbox { padding: 10px 16px; }
  .logo-tile img { max-height: 40px; }
}

/* large monitors: use the space, slightly larger text */
@media (min-width: 1800px) {
  :root { font-size: 15px; }
  .app { grid-template-columns: 260px 1fr; }
  .content, .topbar { max-width: 1760px; }
  .chart { height: 300px; }
}
@media (min-width: 2400px) {
  :root { font-size: 16px; }
  .content, .topbar { max-width: 2100px; }
}

/* desktop/laptop */
@media (max-width: 1400px) {
  .content, .topbar { padding-left: 24px; padding-right: 24px; }
  th, td { padding: 8px 10px; }
}
@media (max-width: 1280px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-2-1 { grid-template-columns: 1fr; }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 1199px) {
  .app { grid-template-columns: 212px 1fr; }
  .brand .sub { padding-left: 0; }
  th { font-size: 11px; }
  .chart { height: 230px; }
}

/* tablet and below: slide-out sidebar */
@media (max-width: 999px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 260px; height: 100%; z-index: 60;
    transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0,0,0,.35);
  }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; background: rgba(16,28,38,.45); z-index: 50; }
  .menu-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex: none;
    border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); cursor: pointer;
  }
  .menu-btn svg { width: 20px; height: 20px; }
  .topbar { align-items: flex-start; gap: 12px; padding-top: 16px; }
  .titlebox { flex: 1; }
  .actions { width: 100%; justify-content: flex-start; }
  .g3 { grid-template-columns: 1fr; }
  .picker { min-width: 0; width: 100%; max-width: none; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-main { padding: 24px 16px; }
  .filters .search { max-width: none; }
}

/* phone */
@media (max-width: 639px) {
  :root { font-size: 13.5px; }
  .content, .topbar { padding-left: 14px; padding-right: 14px; }
  .content { padding-top: 14px; }
  h1 { font-size: 19px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi .value { font-size: 18px; }
  .kpi .foot { font-size: 11px; }
  .form { grid-template-columns: 1fr; }
  .form .third { grid-template-columns: 1fr 1fr; }
  .kpi { padding: 12px 14px; }
  .card-h, .card-b { padding-left: 14px; padding-right: 14px; }
  .filters { padding: 10px 14px; }
  .filters > * { flex: 1 1 100%; width: 100% !important; }
  .filters .btn { flex: 1 1 auto; justify-content: center; }
  .actions .btn { flex: 1 1 auto; justify-content: center; }
  .actions form { flex: 1 1 auto; }
  .actions form select, .actions form .btn { width: 100%; }
  .bar-row { grid-template-columns: minmax(0, 1fr) auto !important; }
  .bar-row .track { display: none; }
  .bar-row > div:not(.track) { min-width: 80px; }
  .legend { flex-wrap: wrap; gap: 8px 12px; }
  .card-h { flex-wrap: wrap; }
  .chart { height: 200px; }
  .pl th:first-child, .pl td:first-child { width: auto; min-width: 170px; }
  .stat-list { font-size: 13px; }
  dialog { width: calc(100vw - 24px); }
  .form-actions { flex-wrap: wrap; }
  .form-actions .btn { flex: 1 1 auto; justify-content: center; }
}

.grid > * { min-width: 0; }
.card { min-width: 0; }

/* keep row labels visible while a wide table scrolls sideways */
@media (max-width: 1199px) {
  .pl td:first-child, .pl th:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; box-shadow: 1px 0 0 var(--line-2); }
  .pl tr.section td:first-child, .pl tr.grand td:first-child { background: #fafbfb; }
  .pl thead th:first-child { background: #fafbfb; z-index: 2; }
}

.kpi.accent { border-top-color: #4fb8e0; }
.brand .sub.center { text-align: center; margin-top: 0; }

/* logo sizing (logo contains the company name) */
.brand .logo-tile { width: fit-content; margin: 0 auto 8px; padding: 6px 12px; }
.brand .logo-tile img { max-height: 72px; max-width: 180px; }
.logo-tile.lg { padding: 12px 18px; }
.logo-tile.lg img { max-height: 120px; max-width: 260px; }
@media (max-height: 820px) { .brand .logo-tile img { max-height: 56px; } }
@media (max-width: 1199px) { .brand .logo-tile img { max-height: 60px; max-width: 150px; } }
.auth-side .brand .logo-tile { margin: 0; }

/* period switch */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: var(--surface); height: 34px; }
.seg a { display: inline-flex; align-items: center; padding: 0 12px; font-size: 13px; font-weight: 500; color: var(--ink-2); border-right: 1px solid var(--line); }
.seg a:last-child { border-right: 0; }
.seg a:hover { background: #f5f6f8; text-decoration: none; }
.seg a.on { background: var(--accent); color: #fff; }
@media (max-width: 639px) { .seg { width: 100%; } .seg a { flex: 1; justify-content: center; } }

/* =================================================================
   Waybill Manager additions (same tokens and look as the Cost Manager)
   ================================================================= */
.badge.Draft { background: var(--warn-soft); color: var(--warn); }
.badge.Issued { background: var(--accent-soft); color: var(--accent); }
.badge.Delivered { background: #e2eef6; color: #1f5f86; }
.badge.Returned { background: var(--pos-soft); color: var(--pos); }
.badge.Return { background: #eceef0; color: #3a4652; border: 1px solid var(--line); }
.badge.Dispatch { background: #eceef0; color: #3a4652; }
.badge.Part { background: #fff; color: var(--warn); border: 1px solid #e6d3ad; }
.badge.Overdue { background: var(--neg-soft); color: var(--neg); }
.badge.Consumable { background: #eceef0; color: #66717c; }
.app-tag { font-size: 12px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }

.kv { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 6px 14px; font-size: 13.5px; }
.kv .k { color: var(--muted); }
.kv .v { min-width: 0; overflow-wrap: anywhere; }
.kv .sep { grid-column: 1 / -1; border-top: 1px solid var(--line-2); margin: 2px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 14px; font-size: 12.5px; background: #fff; }
.chip form { display: inline; }
.chip button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; font-size: 14px; line-height: 1; }
.chip button:hover { color: var(--neg); }
.note { background: #fafbfb; border: 1px solid var(--line-2); border-radius: 6px; padding: 10px 12px; font-size: 13px; color: var(--ink-2); }
.warnbox { background: var(--warn-soft); border: 1px solid #e6d3ad; color: #6d4706; border-radius: 6px; padding: 10px 14px; font-size: 13px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.row-overdue td:first-child { box-shadow: inset 3px 0 0 var(--neg); }
.inline { display: inline; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* waybill form: item picker and line editor */
.picker-box { position: relative; }
.pick-list {
  position: absolute; left: 0; right: 0; top: 40px; z-index: 40; max-height: 360px; overflow-y: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 24px rgba(16, 28, 38, .14); display: none;
}
.pick-list.open { display: block; }
.pick-opt { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.pick-opt:last-child { border-bottom: 0; }
.pick-opt:hover, .pick-opt.hl { background: var(--accent-soft); }
.pick-opt .t { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.pick-opt .s { color: var(--muted); font-size: 12px; grid-column: 1 / 2; min-width: 0; overflow-wrap: anywhere; }
.pick-opt .a { grid-row: 1 / span 2; grid-column: 2; align-self: center; text-align: right; font-size: 12px; }
.pick-opt.na { opacity: .55; }
.lines input[type=text], .lines input[type=number], .lines select { height: 32px; font-size: 13px; padding: 0 8px; }
.lines td { padding: 6px 6px; vertical-align: top; }
.lines th { padding: 8px 6px; }
.lines .c-no { width: 34px; color: var(--muted); padding-top: 13px; }
.lines .c-sel { width: 28px; padding-top: 12px; }
.lines .c-ref { width: 130px; }
.lines .c-qty { width: 74px; }
.lines .c-ser { width: 150px; }
.lines .c-cond { width: 120px; }
.lines .c-wt { width: 80px; }
.lines .c-x { width: 36px; }
.lines .desc-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.lines .rem { margin-top: 4px; }
.xbtn { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--muted); cursor: pointer; display: inline-grid; place-items: center; }
.xbtn:hover { color: var(--neg); border-color: #e7c4bf; }
.xbtn svg { width: 14px; height: 14px; }
.bulk { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 10px 18px; border-top: 1px solid var(--line-2); background: #fafbfb; }
.bulk input, .bulk select { height: 30px; width: auto; min-width: 140px; }
.pkg-table input { height: 30px; width: 90px; }
.fixed-val { height: 36px; display: flex; align-items: center; padding: 0 10px; border: 1px dashed #d3d8dd; border-radius: 6px; background: #fafbfb; color: var(--ink-2); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sticky-actions { position: sticky; bottom: 0; z-index: 20; background: rgba(242, 243, 245, .96); border-top: 1px solid var(--line); padding: 12px 0; margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }

/* line editor turns into stacked cards on narrow screens (no sideways page scrolling) */
@media (max-width: 1099px) {
  .lines thead { display: none; }
  .lines, .lines tbody, .lines tr, .lines td { display: block; width: 100%; }
  .lines tr { border-bottom: 1px solid var(--line); padding: 10px 12px 12px; position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
  .lines td { padding: 0; border: 0; width: auto !important; }
  .lines td[data-l]::before { content: attr(data-l); display: block; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 3px; }
  .lines .c-desc { grid-column: 1 / -1; }
  .lines .c-no { position: absolute; top: 10px; right: 52px; padding: 0; width: auto !important; }
  .lines .c-sel { grid-column: 1 / -1; padding: 0; }
  .lines .c-x { position: absolute; top: 6px; right: 12px; }
}
@media (max-width: 639px) {
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv .k { margin-top: 6px; }
  .bulk > * { flex: 1 1 100%; width: 100% !important; }
  .sticky-actions .btn { flex: 1 1 auto; justify-content: center; }
  .pick-opt { grid-template-columns: 1fr; }
  .pick-opt .a { grid-row: auto; grid-column: 1; text-align: left; }
}
/* responsive data tables: secondary columns hide on small screens instead of scrolling the page */
@media (max-width: 1199px) { .hide-md { display: none; } }
@media (max-width: 799px) { .hide-sm { display: none; } }
@media (max-width: 639px) {
  .hide-xs { display: none; }
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { padding: 10px 14px; border-bottom: 1px solid var(--line-2); }
  table.stack td { border: 0; padding: 2px 0; text-align: left !important; }
  table.stack td.num { text-align: left; }
  table.stack td[data-l]::before { content: attr(data-l) ": "; color: var(--muted); font-size: 12px; }
}
.bar-row svg, .kv svg, td svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 3px; flex: none; }
.btn svg { width: 15px; height: 15px; margin: 0; }
@media (max-width: 1199px) { table.stack td.hide-md, table.stack th.hide-md { display: none; } }
@media (max-width: 799px) { table.stack td.hide-sm, table.stack th.hide-sm { display: none; } }
@media (max-width: 639px) {
  table.stack td.hide-xs, table.stack th.hide-xs { display: none; }
  table.stack tr.row-overdue { box-shadow: inset 3px 0 0 var(--neg); }
  table.stack tr.row-overdue td:first-child { box-shadow: none; }
}
@media (max-width: 999px) { .sidebar { box-shadow: none; } .app.nav-open .sidebar { box-shadow: 0 0 40px rgba(0,0,0,.35); } }

/* =================================================================
   Operations Suite: module switcher, avatars, users & access, home
   ================================================================= */
.avatar { display: inline-grid; place-items: center; flex: none; border-radius: 50%; overflow: hidden;
  background: linear-gradient(140deg, #3c5bb8, var(--accent)); color: #fff; font-weight: 600; letter-spacing: .02em;
  box-shadow: 0 0 0 2px rgba(255,255,255,.9); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar svg { width: 55%; height: 55%; stroke: #fff; }

.modswitch { display: grid; grid-template-columns: 36px 1fr 1fr; gap: 4px; margin: 12px 12px 2px; padding: 4px;
  background: rgba(255,255,255,.05); border: 1px solid var(--side-2); border-radius: 9px; }
.modswitch a { display: flex; align-items: center; justify-content: center; gap: 6px; height: 32px; border-radius: 6px;
  color: #9fb0bd; font-size: 12.5px; font-weight: 600; text-decoration: none; }
.modswitch a svg { width: 15px; height: 15px; }
.modswitch a:hover { color: #fff; background: rgba(255,255,255,.06); text-decoration: none; }
.modswitch a.on { background: #fff; color: var(--side); }
.modswitch a.on svg { stroke: var(--accent); }

.userbox .ub-who { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; margin-bottom: 8px; }
.userbox .ub-who:hover { text-decoration: none; }
.userbox .ub-who:hover .who { text-decoration: underline; }
.userbox .ub-who > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.userbox .ub-who .who, .userbox .ub-who .role { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.userbox .avatar { box-shadow: 0 0 0 2px var(--side-2); }

/* users & access */
.user-list { display: flex; flex-direction: column; }
.user-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.user-row.off { opacity: .55; }
.ur-main { flex: 1; min-width: 0; }
.ur-name { font-weight: 600; }
.ur-access { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ur-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pill-acc { font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 20px; border: 1px solid transparent; }
.pill-acc.wb { background: #e9edf3; color: var(--side); border-color: #d6dde8; }
.pill-acc.ct { background: var(--accent-soft); color: var(--accent); }
.pill-acc.admin { background: var(--side); color: #fff; }
.pill-acc.none { background: #f4f5f6; color: var(--muted); }
.access-grid { display: grid; gap: 8px; }
.access-tile { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fff; cursor: pointer; }
.access-tile.sel { cursor: default; }
.access-tile:has(input:checked) { border-color: #b9c4e6; background: #f7f9fe; }
.access-tile input[type=checkbox] { width: 18px; height: 18px; margin: 0; flex: none; }
.at-body { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.at-body > span:last-child { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.at-body .sub { font-size: 12px; }
.at-body select { margin-top: 4px; height: 32px; }
.at-ic { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.at-ic svg { width: 17px; height: 17px; stroke: #fff; }
.at-ic.wb { background: var(--side); }
.at-ic.ct { background: var(--accent); }
.photo-drop { display: flex; align-items: center; gap: 14px; }
.photo-drop > div { min-width: 0; flex: 1; }
.photo-pick { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.dlg-head { display: flex; align-items: center; gap: 14px; }
dialog.wide { width: min(640px, calc(100vw - 32px)); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.access-help p { margin: 0 0 6px; }
.mt-s { margin-top: 6px; }
.track-toggle { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfc; }
.track-toggle input { margin-top: 3px; }
.track-toggle span { display: flex; flex-direction: column; gap: 3px; }
@media (max-width: 639px) {
  .user-row { flex-wrap: wrap; padding: 12px 14px; }
  .ur-actions { width: 100%; justify-content: flex-start; padding-left: 58px; }
  .form-grid, .form-2 { grid-template-columns: 1fr; }
  .modswitch { margin: 10px 12px 2px; }
}

/* ---------- home ---------- */
body.home-page { background: var(--bg); min-height: 100vh; }
.h-top { background: var(--side); color: #c5ced6; height: 64px; display: flex; align-items: center; gap: 16px; padding: 0 28px;
  position: sticky; top: 0; z-index: 30; }
.h-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.h-logo { background: #fff; border-radius: 7px; padding: 4px 8px; display: flex; }
.h-logo img { height: 30px; width: auto; display: block; }
.h-name { color: #fff; font-weight: 600; font-size: 15px; display: flex; flex-direction: column; line-height: 1.2; white-space: nowrap; }
.h-name small { color: #7f8d99; font-weight: 400; font-size: 11.5px; }
.h-user { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.h-link { display: inline-flex; align-items: center; gap: 6px; color: #9fb0bd; font-size: 13px; padding: 7px 10px; border-radius: 6px; }
.h-link svg { width: 16px; height: 16px; }
.h-link:hover { color: #fff; background: rgba(255,255,255,.07); text-decoration: none; }
.h-menu { position: relative; margin-left: 6px; }
.h-menu summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 4px 4px 10px; border-radius: 24px; }
.h-menu summary::-webkit-details-marker { display: none; }
.h-menu summary:hover { background: rgba(255,255,255,.07); }
.h-who { display: flex; flex-direction: column; text-align: right; color: #fff; font-size: 13px; font-weight: 600; line-height: 1.25; }
.h-who small { color: #8d9aa6; font-weight: 400; font-size: 11.5px; }
.h-drop { position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(16,28,38,.18); padding: 6px; min-width: 220px; z-index: 40; }
.h-drop a, .h-drop button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 6px; color: var(--ink);
  font: inherit; font-size: 13.5px; background: none; border: 0; cursor: pointer; text-align: left; }
.h-drop a:hover, .h-drop button:hover { background: #f3f5f8; text-decoration: none; }
.h-drop svg { width: 16px; height: 16px; color: var(--muted); }
.h-drop form { margin: 0; }
.h-wrap { max-width: 1180px; margin: 0 auto; padding: 36px 28px 28px; }
.h-hello h1 { font-size: 26px; font-weight: 600; letter-spacing: -.015em; }
.h-hello p { margin: 6px 0 0; color: var(--muted); }
.h-mods { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 26px; }
.h-mods.one { grid-template-columns: minmax(0, 620px); }
.h-mod { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column;
  box-shadow: var(--shadow); transition: box-shadow .15s, transform .15s; }
.h-mod:hover { box-shadow: 0 6px 22px rgba(16,28,38,.10); transform: translateY(-1px); }
.h-mod-head { display: flex; gap: 16px; align-items: flex-start; padding: 24px 26px 20px; border-bottom: 1px solid var(--line-2); color: inherit; }
.h-mod-head:hover { text-decoration: none; }
.h-mod-head:hover h2 { color: var(--accent); }
.h-ic { width: 48px; height: 48px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.h-ic svg { width: 25px; height: 25px; stroke: #fff; }
.h-mod.wb .h-ic { background: var(--side); }
.h-mod.ct .h-ic { background: var(--accent); }
.h-mod h2 { font-size: 19px; font-weight: 600; }
.h-desc { display: block; color: var(--muted); margin-top: 5px; font-size: 13px; line-height: 1.5; }
.h-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 18px 26px; }
.h-stats b { display: block; font-size: 23px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.h-stats span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.h-foot { margin-top: auto; padding: 14px 26px; background: #fafbfc; border-top: 1px solid var(--line-2); display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.btn.h-btn { background: var(--accent); color: #fff; border-color: var(--accent); }
.h-mod.wb .btn.h-btn { background: var(--side); border-color: var(--side); }
.btn.h-btn:hover { filter: brightness(1.12); }
.h-quick { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 500; }
.h-quick svg { width: 15px; height: 15px; }
.h-note { margin-left: auto; font-size: 12px; color: var(--muted); }
.h-note-link { color: var(--accent); }
.h-row { display: grid; grid-template-columns: 1.35fr 1fr; gap: 22px; margin-top: 22px; }
.h-list h3 { padding: 16px 20px; border-bottom: 1px solid var(--line-2); margin: 0; }
.h-it { display: flex; gap: 12px; padding: 12px 20px; border-bottom: 1px solid #f1f2f4; align-items: center; color: inherit; }
.h-it:last-child { border-bottom: 0; }
.h-it:hover { background: #fafbfc; text-decoration: none; }
.h-it .t { flex: 1; min-width: 0; }
.h-it .t b { font-weight: 600; }
.h-it .t > span:not(.chip) { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.h-it .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted); }
.h-it .dot.warn { background: #c48a1e; } .h-it .dot.bad { background: var(--neg); } .h-it .dot.info { background: var(--accent); }
.h-it .tag { font-size: 11px; padding: 3px 9px; border-radius: 20px; font-weight: 600; white-space: nowrap; }
.h-it .tag.warn { background: var(--warn-soft); color: var(--warn); }
.h-it .tag.bad { background: var(--neg-soft); color: var(--neg); }
.h-it .tag.info { background: var(--accent-soft); color: var(--accent); }
.h-it .chip { display: inline-block; font-size: 10.5px; padding: 1px 7px; border-radius: 4px; border: 0; background: #eef0f2; color: var(--ink-2); margin-right: 7px; font-weight: 700; letter-spacing: .03em; }
.h-it .chip.wb { background: #e9edf3; color: var(--side); }
.h-it .chip.cost { background: var(--accent-soft); color: var(--accent); }
.h-it .when { color: var(--muted); font-size: 12px; white-space: nowrap; }
.h-empty { display: flex; align-items: center; gap: 10px; padding: 22px 20px; color: var(--muted); }
.h-empty svg { width: 18px; height: 18px; }
.h-footer { text-align: center; color: var(--muted); font-size: 12px; margin-top: 30px; }
@media (min-width: 1800px) { .h-wrap { max-width: 1360px; } }
@media (max-width: 899px) {
  .h-mods, .h-row { grid-template-columns: 1fr; }
  .h-link span { display: none; }
}
@media (max-width: 639px) {
  .h-top { padding: 0 14px; height: 58px; gap: 8px; }
  .h-name small, .h-who { display: none; }
  .h-wrap { padding: 22px 16px; }
  .h-hello h1 { font-size: 22px; }
  .h-mod-head { padding: 18px; gap: 12px; }
  .h-ic { width: 42px; height: 42px; }
  .h-stats { padding: 14px 18px; gap: 8px; }
  .h-stats b { font-size: 19px; }
  .h-foot { padding: 12px 18px; }
  .h-note { margin-left: 0; width: 100%; }
  .h-it { padding: 12px 16px; }
}
.auth-tag { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #4fb8e0; margin-bottom: 10px; }
.auth-mods { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 14px; }
.auth-mods li { display: flex; gap: 12px; align-items: flex-start; }
.auth-mods li > span:last-child { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; color: #a9b6c1; line-height: 1.45; }
.auth-mods strong { color: #fff; font-size: 14px; }
.am-ic { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.am-ic svg { width: 18px; height: 18px; stroke: #fff; }
.am-ic.wb { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); }
.am-ic.ct { background: var(--accent); }

/* sign-in side panel: survey-chart contours behind plain company details */
.auth-side.auth-chart { position: relative; overflow: hidden; background: var(--side) url("contours.svg") center / cover no-repeat; }
.auth-chart > * { position: relative; }
.auth-copy h2 { font-size: 30px; line-height: 1.2; letter-spacing: -.015em; max-width: 440px; }
.auth-copy p { margin: 12px 0 0; font-size: 15px; line-height: 1.55; color: #9aabb8; max-width: 400px; }
.auth-areas { display: flex; flex-wrap: wrap; gap: 0; margin-top: 26px; border-top: 1px solid rgba(255,255,255,.12); padding-top: 14px; max-width: 420px; }
.auth-areas span { font-size: 12.5px; font-weight: 600; letter-spacing: .04em; color: #c9d4dd; padding-right: 14px; margin-right: 14px; border-right: 1px solid rgba(255,255,255,.18); line-height: 1; }
.auth-areas span:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.auth-foot { font-size: 12px; line-height: 1.6; color: #6f8090; max-width: 360px; }

/* approvals: bell, waiting time, sign-in reminder */
.topbar { align-items: center; }
.bell { position: relative; margin-left: 8px; flex: none; }
.bell summary { list-style: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); position: relative; }
.bell summary::-webkit-details-marker { display: none; }
.bell summary:hover { border-color: #c4ccd6; color: var(--accent); }
.bell summary svg { width: 19px; height: 19px; }
.bell-n { position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
  background: var(--neg); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--surface); }
.bell-n[hidden] { display: none; }
.bell-drop { position: absolute; right: 0; top: calc(100% + 8px); width: min(380px, calc(100vw - 24px)); background: #fff; border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 14px 36px rgba(16,28,38,.18); z-index: 60; overflow: hidden; }
.bell-h { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.bell-it { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid #f1f2f4; color: var(--ink); }
.bell-it:hover { background: #f7f9fc; text-decoration: none; }
.bell-it .t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bell-it .t b { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bell-it .t span { font-size: 12px; color: var(--muted); }
.bell-it .a { font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bell-it .a.old { color: var(--warn); font-weight: 600; }
.bell-empty { padding: 18px 14px; color: var(--muted); font-size: 13px; }
.bell-all { display: block; padding: 11px 14px; font-weight: 600; font-size: 13px; background: #fafbfc; }
.h-user .bell summary { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); color: #c5ced6; }
.h-user .bell summary:hover { color: #fff; border-color: rgba(255,255,255,.3); }
.h-user .bell-n { box-shadow: 0 0 0 2px var(--side); }
.wait { font-size: 12.5px; color: var(--muted); }
.wait.old { color: var(--warn); background: var(--warn-soft); padding: 2px 8px; border-radius: 10px; font-weight: 600; }
tr:target td { background: #fff8e6; }
dialog.pend-dlg { width: min(460px, calc(100vw - 32px)); }
.pd-ic { width: 44px; height: 44px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 12px; }
.pd-ic svg { width: 22px; height: 22px; }
.pend-dlg h2 { font-size: 18px; }
.pend-dlg p { margin: 6px 0 12px; }
.pd-list { border: 1px solid var(--line-2); border-radius: 8px; }
.pd-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.pd-list > div:last-child { border-bottom: 0; }
.pd-list span { display: flex; flex-direction: column; min-width: 0; }
.pd-list em { font-style: normal; color: var(--muted); font-size: 12px; }
.pd-list b { white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 639px) { .bell { margin-left: 4px; } .bell-drop { position: fixed; left: 12px; right: 12px; top: 64px; width: auto; } }

/* ---------- packing specs: cases & checks */
.tabs .count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 10px; background: var(--bg); color: var(--muted); font-size: 12px; text-align: center; }
.tabs a.active .count { background: var(--accent-soft); color: var(--accent); }
.packtbl tr.needs-check td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.checklist { margin: 6px 0 0; padding: 6px 8px 6px 22px; background: var(--warn-soft); color: var(--warn); border-radius: 6px; font-size: 12.5px; line-height: 1.45; }
.checklist li { margin: 0; }
.packtbl .case { display: flex; gap: 8px; align-items: flex-start; padding: 3px 0; }
.packtbl .case + .case { border-top: 1px dashed var(--line); }
.case .cn, .caserow .cn { flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 11.5px; font-weight: 600; display: grid; place-items: center; margin-top: 1px; }
.caseed { display: grid; gap: 8px; margin-top: 8px; }
.caserow { display: grid; grid-template-columns: 20px 1fr 1fr; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.caserow .cn { grid-row: span 3; margin-top: 8px; }
.caserow .lab { grid-column: 2 / 4; }
.caserow .wt { display: grid; grid-template-columns: 1fr 64px; gap: 4px; }
.caserow .dm { display: grid; grid-template-columns: 1fr 1fr 1fr 58px; gap: 4px; grid-column: 3; }
.caserow .as { grid-column: 2; }
.caserow .nt { grid-column: 3; }
.caserow input, .caserow select { min-width: 0; }
@media (max-width: 560px) { .caserow { grid-template-columns: 20px 1fr; } .caserow .lab, .caserow .wt, .caserow .dm, .caserow .as, .caserow .nt { grid-column: 2; } .caserow .cn { grid-row: span 5; } }
.packpage { display: grid; gap: 16px; }
.packside { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
.packside > .card { margin-top: 0; }
.packtbl td[data-l="Cases"] { min-width: 260px; }
@media (max-width: 1000px) { .packside { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .packtbl td[data-l="Cases"] { min-width: 0; } }

/* ---------- waybill <-> job */
.jobcard { display: grid; grid-template-columns: 40px 1fr auto; gap: 14px; align-items: center; padding: 14px 18px; }
.jobcard .jc-ic { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.jobcard .jc-ic svg { width: 20px; height: 20px; }
.jobcard .jc-t { font-weight: 500; }
.jobcard .jc-act { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.jobcard .jc-link { display: flex; gap: 6px; }
.jobcard .jc-link select { width: 260px; height: 32px; }
@media (max-width: 760px) { .jobcard { grid-template-columns: 40px 1fr; } .jobcard .jc-act { grid-column: 1 / -1; justify-content: flex-start; } .jobcard .jc-link select { width: 100%; } }
.job-opt { padding: 14px 18px; }
.job-opt .check { display: flex; gap: 10px; align-items: flex-start; margin: 0; }
.job-opt .check input { width: 16px; height: 16px; margin-top: 3px; }
.job-opt .sub { display: block; }
.ratecard td .btn { white-space: nowrap; }
.pill-need { display: inline-block; padding: 1px 8px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: 12px; font-weight: 500; }
.pill-need { white-space: nowrap; }
.ratecard td[data-l="Waybill"], .ratecard td[data-l="Out"] { white-space: nowrap; }
.card-h .small svg { width: 13px; height: 13px; vertical-align: -2px; margin-left: 2px; }

/* ---------- waybill approvals */
.btn.danger-ghost { color: var(--neg); border-color: #e7c3be; background: var(--surface); }
.btn.danger-ghost:hover { background: var(--neg-soft); }
.approvebox { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; margin-bottom: 14px; border-radius: var(--radius);
  background: var(--accent-soft); border: 1px solid #cfd8f1; color: #20325f; }
.approvebox .ab-ic svg { width: 22px; height: 22px; margin-top: 1px; }
.apr-card { margin-bottom: 12px; }
.apr-card.old { box-shadow: inset 3px 0 0 var(--warn), var(--shadow); }
.apr-head { display: flex; justify-content: space-between; gap: 12px; padding: 14px 18px 8px; }
.apr-no { font-weight: 600; font-size: 16px; }
.apr-who { text-align: right; }
.apr-who .sub { display: block; }
.apr-lines { padding: 4px 18px 12px; display: grid; gap: 3px; font-size: 13.5px; }
.apr-act { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 18px; border-top: 1px solid var(--line); background: #fafbfb; }
.apr-log { padding: 4px 0; border-bottom: 1px dashed var(--line); }
@media (max-width: 600px) { .apr-head { flex-direction: column; } .apr-who { text-align: left; } }
.at-approver { display: flex; gap: 8px; align-items: center; margin: 8px 0 0 2px; } .at-approver input { width: 15px; height: 15px; }
.mail-flow { display: grid; gap: 8px; }
.mail-flow > div { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfb; }
.mail-flow b { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 12px; }
.mail-flow strong { display: block; margin-bottom: 2px; }
.mail-flow select { width: auto; height: 30px; display: inline-block; margin: 0 4px; }
.mail-flow .check { display: inline-flex; margin: 0; }

/* ---------- equipment photos */
.eqthumb { flex: none; display: inline-grid; place-items: center; border-radius: 8px; object-fit: contain; background: #fff; border: 1px solid var(--line); padding: 2px; }
.eqthumb.none { background: var(--bg); color: #b7bec6; border-style: dashed; }
.eqthumb.none svg { width: 45%; height: 45%; }
.eqcell { display: flex; align-items: center; gap: 12px; }
.eqhero { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: center; padding: 16px 20px; margin-bottom: 16px; }
.eqhero .eh-img { display: grid; place-items: center; height: 170px; border-radius: 10px; background: #fff; border: 1px solid var(--line); overflow: hidden; }
.eqhero .eh-img img { max-width: 100%; max-height: 100%; object-fit: contain; padding: 8px; }
.eqhero .eh-img.empty { color: #b7bec6; background: var(--bg); border-style: dashed; gap: 4px; font-size: 12.5px; grid-auto-flow: row; }
.eqhero .eh-img.empty svg { width: 36px; height: 36px; }
.eqhero.nophoto { grid-template-columns: 140px 1fr; }
.eqhero.nophoto .eh-img { height: 100px; }
.eqhero .eh-name { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.eqhero .eh-meta { color: var(--muted); font-size: 13.5px; margin-bottom: 2px; }
.eqhero .eh-body .small { display: inline-block; margin-top: 8px; }
@media (max-width: 600px) { .eqhero, .eqhero.nophoto { grid-template-columns: 1fr; } }
.pick-opt { grid-template-columns: 40px minmax(0, 1fr) auto; }
.pick-opt .pick-img { grid-row: span 2; width: 40px; height: 40px; border-radius: 6px; object-fit: contain; background: #fff; border: 1px solid var(--line); }
.pick-opt .pick-img.none { background: var(--bg); border-style: dashed; }
.pick-opt .t, .pick-opt .s { grid-column: 2 / 3; }
.pick-opt .a { grid-column: 3; }
.pick-opt:not(:has(.pick-img)) { grid-template-columns: minmax(0, 1fr); }
.pick-opt:not(:has(.pick-img)) .t, .pick-opt:not(:has(.pick-img)) .s { grid-column: 1; }
@media (max-width: 760px) { .pick-opt { grid-template-columns: 40px minmax(0, 1fr); } .pick-opt .a { grid-column: 2; grid-row: auto; } }
.photofield .pf-row { display: flex; gap: 14px; align-items: flex-start; }
.photofield .pf-prev { flex: none; width: 88px; height: 88px; border-radius: 8px; object-fit: contain; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; color: #b7bec6; }
.photofield .pf-prev.none { background: var(--bg); border-style: dashed; }
.photofield .pf-prev svg { width: 34px; height: 34px; }
.photofield .pf-prev img { max-width: 100%; max-height: 100%; object-fit: contain; }

.ratecard tr.muted-row td { opacity: .78; }
.ratecard td.num .row-actions { justify-content: flex-end; }

/* ---------------------------------------------------------------- quotes & commercials */
.form.q4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .form.q4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.qlines td { vertical-align: top; }
.qlines input.qnum { text-align: right; max-width: 110px; margin-left: auto; display: block; }
.qlines input.qdisc { max-width: 70px; }
.qlines select { min-width: 104px; }
.qlines .qdesc { font-weight: 600; }
.qlines .qdetail { margin-top: 4px; height: 30px; font-size: 12.5px; color: #3E5BAF; }
.qlines .qdetail.collapsed { display: none; }
.qlines .qline-total { font-variant-numeric: tabular-nums; white-space: nowrap; padding-top: 17px; font-weight: 600; }
.qtag { font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.qbtns { display: flex; gap: 2px; justify-content: flex-end; }
.qbtns .btn { padding: 0 7px; }
.qx { margin-top: 8px; padding: 10px 12px; background: #f6f8fc; border: 1px solid #e2e7f3; border-radius: 6px; display: grid; gap: 6px; }
.qx label { margin: 4px 0 0; font-size: 12px; }
.qx2 { display: grid; grid-template-columns: 1fr 100px; gap: 8px; }
.qx-cat { margin-top: 4px; }
tr.is-rented { background: #fbf8ef; }
tr.is-hidden td { opacity: .62; }
.qadd { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; border-top: 1px solid var(--line-2); padding-top: 12px; padding-bottom: 12px; }
.regpick { flex: 1 1 320px; max-width: 460px; }
.qbar { position: sticky; bottom: 0; z-index: 5; margin-top: 16px; background: #0F243E; color: #dfe6f3; border-radius: 8px;
  padding: 10px 16px; display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; box-shadow: 0 -4px 14px rgba(15,36,62,.18); }
.qbar .qtot { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; }
.qbar strong { color: #fff; font-variant-numeric: tabular-nums; }
.qbar .muted { color: #9fb0c8; }
.qbar .btn:not(.primary) { background: transparent; color: #dfe6f3; border-color: #3a4f72; }
.qbar .btn.primary { background: #58C0E3; border-color: #58C0E3; color: #0F243E; font-weight: 600; }
.badge.q-Draft { background: #eceef0; color: #4b5661; }
.badge.q-Sent { background: var(--accent-soft); color: var(--accent); }
.badge.q-Accepted { background: var(--pos-soft); color: var(--pos); }
.badge.q-Declined, .badge.q-Cancelled { background: var(--neg-soft); color: var(--neg); }
.badge.q-Expired { background: var(--warn-soft); color: var(--warn); }
/* document preview on the detail page */
.qdoc { background: #fff; max-width: 920px; margin: 0 auto; padding: 28px 34px; border: 1px solid var(--line); border-radius: 8px; font-family: Calibri, Carlito, "Segoe UI", Arial, sans-serif; color: #1F2328; }
.qdoc h3 { font-family: Cambria, Caladea, Georgia, serif; color: #0F243E; margin: 18px 0 6px; font-size: 15px; }
.qdoc table { font-size: 13px; }
.qdoc th { background: #0F243E; color: #fff; text-transform: none; letter-spacing: 0; font-size: 12.5px; position: static; }
.qdoc td { border-bottom: 1px solid #dfe3ea; padding: 6px 10px; }
.qdoc tr.qsech td { color: #3E5BAF; font-weight: 700; background: #eef6fb; }
.qdoc tr.qsum td { font-weight: 700; background: #f3f5f9; }
.qdoc tr.qgrand td { font-weight: 700; background: #0F243E; color: #fff; }
.qdoc .qdet { color: #3E5BAF; font-size: 12px; }
.qdoc .lh { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid #58C0E3; padding-bottom: 10px; }
.qdoc .lh img { max-height: 70px; }
.qdoc .lh .addr { font-size: 11.5px; text-align: right; line-height: 1.45; color: #34404c; white-space: pre-line; }
.qdoc .tag { text-align: center; font-size: 11px; font-weight: 700; color: #0F243E; margin: 6px 0 14px; letter-spacing: .02em; }
.qinternal { border-left: 3px solid #c9862a; }
@media (max-width: 700px) { .qdoc { padding: 16px; } .qdoc .lh { flex-direction: column; } .qdoc .lh .addr { text-align: left; } }
.qx[hidden] { display: none; }
.qlines select[name=l_uom] { min-width: 118px; }
@media (max-width: 700px) {
  .qbar { padding: 8px 12px; gap: 6px; }
  .qbar .qtot { gap: 4px 12px; font-size: 12px; }
  .qbar #t-margin, .qbar #t-ngn { display: none; }
  .qbar .btn { height: 32px; }
}
/* home: Quotes & Commercials card */
.h-mod.qt .h-ic { background: #0F243E; box-shadow: inset 0 -3px 0 #58C0E3; }
.h-mod.qt .btn.h-btn { background: #0F243E; border-color: #0F243E; }
.h-mod.qt .h-note a { color: var(--accent); }
.h-mods.three .h-mod.qt { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.h-mods.three .h-mod.qt .h-mod-head { border-bottom: 0; border-right: 1px solid var(--line-2); }
.h-mods.three .h-mod.qt .h-stats { align-content: center; }
.h-mods.three .h-mod.qt .h-foot { grid-column: 1 / -1; }
@media (min-width: 1500px) {
  .h-mods.three:not(.one) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .h-mods.three:not(.one) .h-mod.qt { grid-column: auto; display: flex; }
  .h-mods.three:not(.one) .h-mod.qt .h-mod-head { border-right: 0; border-bottom: 1px solid var(--line-2); }
}
@media (max-width: 900px) {
  .h-mods.three .h-mod.qt { display: flex; }
  .h-mods.three .h-mod.qt .h-mod-head { border-right: 0; border-bottom: 1px solid var(--line-2); }
}
.h-it .chip.qt { background: #e3f3fa; color: #0F243E; }
.qsec:not([data-sec=equipment]) .qlead { display: none; }
.qlines .qleadin { min-width: 120px; max-width: 150px; }
.qlines input[name=l_qty] { min-width: 56px; }
/* waybill custom items: ours / add to register / rented in */
.own-opts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 5px; }
.own-opts .own-sel { width: auto; height: 28px; font-size: 12px; padding: 0 6px; }
.own-opts .rent-sup { width: 190px; height: 28px; font-size: 12px; }
.own-opts .own-hint { font-size: 11.5px; color: var(--muted); }
select.pdf-size { width: auto; height: 34px; font-size: 13px; }
/* equipment tests */
.badge.t-Pass { background: var(--pos-soft); color: var(--pos); }
.badge.t-Pass-with-remarks { background: var(--warn-soft); color: var(--warn); }
.badge.t-Fail { background: var(--neg-soft); color: var(--neg); }
.seg-radio { display: flex; gap: 6px; flex-wrap: wrap; }
.seg-radio .t-opt { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 6px; padding: 7px 12px; font-weight: 500; cursor: pointer; margin: 0; }
.seg-radio .t-opt input { width: 15px; height: 15px; margin: 0; }
.seg-radio .t-opt.t-Pass:has(input:checked) { background: var(--pos-soft); border-color: #bcdcc9; color: var(--pos); }
.seg-radio .t-opt.t-Pass-with-remarks:has(input:checked) { background: var(--warn-soft); border-color: #ecd5a6; color: var(--warn); }
.seg-radio .t-opt.t-Fail:has(input:checked) { background: var(--neg-soft); border-color: #e7c4bf; color: var(--neg); }
.wt-table select, .wt-table input[type=text] { height: 32px; font-size: 13px; }
.wt-table select { min-width: 150px; }
.wt-bulk { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
/* module switch: 'Equipment' is a longer label than 'Waybills' was */
.modswitch { grid-template-columns: 32px 1.15fr 1fr; gap: 3px; }
.modswitch a { gap: 4px; font-size: 12.5px; padding: 0 4px; white-space: nowrap; min-width: 0; }
.modswitch a svg { width: 14px; height: 14px; flex: none; }
/* dashboard: comparison with the previous period */
.kpi .kcmp { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.kpi .kchg { display: inline-flex; align-items: center; gap: 3px; padding: 3px 9px; border-radius: 999px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi .kchg.good { background: var(--pos-soft); color: var(--pos); }
.kpi .kchg.bad { background: var(--neg-soft); color: var(--neg); }
.kpi .kprev { font-size: 13.5px; color: var(--ink-2); font-weight: 500; }
.kpi .kprev b, .kpi .foot b { color: var(--ink); font-weight: 700; }
.kpi .kcmp + .foot { margin-top: 6px; font-size: 12.5px; }
/* home: Team Workspace strip (opens its own window) */
.h-team { display: flex; align-items: center; gap: 22px; margin-top: 22px; padding: 16px 22px; border-radius: 12px; text-decoration: none; color: #dfe8f3;
  background: linear-gradient(100deg, #0F243E 0%, #1c3a63 100%); box-shadow: 0 6px 20px rgba(15,36,62,.18); flex-wrap: wrap; }
.h-team:hover { text-decoration: none; filter: brightness(1.07); }
.h-team-ic { width: 46px; height: 46px; border-radius: 11px; background: #58C0E3; display: grid; place-items: center; flex: none; }
.h-team-ic svg { width: 24px; height: 24px; stroke: #0F243E; }
.h-team-t { flex: 1 1 260px; min-width: 0; } .h-team-t b { display: block; color: #fff; font-size: 17px; } .h-team-t span { font-size: 12.5px; color: #a9bbd2; }
.h-team-s b { display: block; color: #fff; font-size: 22px; font-variant-numeric: tabular-nums; } .h-team-s b.hot { color: #ffb4ae; }
.h-team-s span { font-size: 11.5px; color: #a9bbd2; } .h-team-s em { font-style: normal; color: #ffb4ae; }
.h-team .btn.h-btn { background: #58C0E3; border-color: #58C0E3; color: #0F243E; font-weight: 700; }
.nav a.nav-team { background: rgba(88,192,227,.12); color: #bfe8f6; margin-bottom: 6px; }
.nav a.nav-team .ext { margin-left: auto; opacity: .7; }

/* equipment test photos & videos */
.tv-kv { margin: 0; } .tv-kv dt { color: var(--muted); } .tv-kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 4px 0 10px; }
.media-grid.big { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 0; }
.media-tile { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card, #fff); display: flex; flex-direction: column; }
.media-thumb { position: relative; display: block; aspect-ratio: 4 / 3; background: #0f1720; }
.media-thumb img, .media-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-grid.big .media-thumb video { object-fit: contain; }
.media-play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 26px; text-shadow: 0 2px 8px rgba(0,0,0,.6); pointer-events: none; }
.media-file { position: absolute; inset: 0; display: grid; place-items: center; color: #cfd8e3; font-weight: 700; letter-spacing: .05em; }
.media-cap { padding: 6px 8px 2px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-cap span { display: block; color: var(--muted); font-size: 11.5px; }
.media-tile .check { padding: 2px 8px 8px; margin: 0; }
.media-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.media-link svg { width: 14px; height: 14px; }
.wt-media { white-space: nowrap; } .wt-media .media-link { margin-right: 6px; }
.wt-file { cursor: pointer; } .wt-file svg { width: 14px; height: 14px; }

/* staff drop-down on name fields */
.staff-combo { position: relative; }
.staff-combo input { padding-right: 34px; }
.staff-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 13px; border-radius: 6px; }
.staff-btn:hover { background: #eef1f4; color: var(--ink); }
.staff-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 60; background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15,36,62,.16); max-height: 260px; overflow-y: auto; padding: 4px; }
.staff-list[hidden] { display: none; }
.staff-list button { display: flex; justify-content: space-between; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: 6px; cursor: pointer; font: inherit; font-size: 13.5px; color: var(--ink); }
.staff-list button span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.staff-list button:hover, .staff-list button.on { background: #eaf4fb; }
.staff-list button.cur b { color: #2d4f86; }
.staff-none { padding: 8px 10px; font-size: 12.5px; color: var(--muted); }
.pu-row { display: flex; gap: 6px; flex-wrap: wrap; } .pu-row input, .pu-row select { height: 32px; font-size: 13px; width: auto; min-width: 0; }
.pu-row input[type=text] { width: 130px; }
.pu-how .seg-radio { flex-wrap: wrap; }
.pu-pay[hidden] { display: none; }
.warn-t { color: #a8660b; font-weight: 600; }
.at-ic.qt { background: #1d7a8c; } .pill-acc.qt { background: #e3f4f7; color: #155f6d; border-color: #c5e6ec; }

/* ---- Invoicing */
.badge.ib-Draft { background: #eceef0; color: #4b5661; } .badge.ib-Sent { background: var(--accent-soft); color: var(--accent); }
.badge.ib-Part-paid { background: var(--warn-soft); color: var(--warn); } .badge.ib-Paid { background: var(--pos-soft); color: var(--pos); }
.badge.ib-Overdue { background: var(--neg-soft); color: var(--neg); } .badge.ib-Cancelled { background: #f3f4f5; color: #8a939c; text-decoration: line-through; }
.inv-start select { min-width: 240px; }
.inv-rows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.inv-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inv-row input[type=text], .inv-row select { height: 34px; font-size: 13px; }
.inv-row .kv-l { flex: 0 0 38%; min-width: 120px; font-weight: 600; } .inv-row .kv-v { flex: 1; min-width: 140px; }
.rbtns { display: inline-flex; gap: 2px; } .rbtns button { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; width: 28px; height: 30px; cursor: pointer; color: var(--muted); }
.rbtns button:hover { color: var(--ink); background: #f1f4f7; } .rbtns [data-del]:hover { color: var(--neg); }
.col-row .col-key { width: 100px; font-size: 12px; color: var(--muted); } .col-row input[type=text] { flex: 1; }
.tax-row { padding: 6px; border: 1px solid var(--line-2); border-radius: 8px; background: #fbfcfd; }
.tax-row .tx-l { flex: 1; min-width: 150px; } .tax-row .tx-n { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.tax-row .tx-n input { width: 76px; } .tax-row select { width: auto; }
.inv-presets { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.inv-lines { width: 100%; } .inv-lines th { font-size: 11px; white-space: nowrap; }
.inv-lines td { padding: 4px 4px; vertical-align: top; } .inv-lines input, .inv-lines textarea { height: 32px; font-size: 13px; padding: 5px 7px; min-width: 0; width: 100%; }
.inv-lines textarea { resize: vertical; min-height: 32px; min-width: 220px; line-height: 1.35; }
.inv-lines td[data-col=item] { width: 54px; } .inv-lines td[data-col=qty] { width: 76px; } .inv-lines td[data-col=uom] { width: 84px; }
.inv-lines td[data-col=delivery] { width: 124px; } .inv-lines td[data-col=unit_price] { width: 120px; } .inv-lines .numin { text-align: right; }
.inv-lines td[data-col=total] { width: 130px; text-align: right; font-weight: 600; padding-top: 10px; white-space: nowrap; }
.inv-lines .lt-tools { white-space: nowrap; width: 110px; padding-top: 8px; } .lt-tools button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 2px 5px; }
.lt-tools button:hover { color: var(--ink); } .lt-tools .ln-del:hover { color: var(--neg); }
.inv-totals { width: 100%; max-width: 420px; margin-left: auto; border-collapse: collapse; }
.inv-totals th, .inv-totals td { border: 1px solid var(--line); padding: 6px 10px; font-size: 13px; } .inv-totals th { text-align: left; background: #f7f9fb; }
.inv-totals td { text-align: right; } .inv-totals tr.due th, .inv-totals tr.due td { font-weight: 800; background: #eef4fb; }
.inv-banks { display: flex; flex-direction: column; gap: 8px; }
.inv-bank { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.inv-bank .sub { display: block; font-size: 11.5px; } .inv-bank input { margin-top: 3px; }
.inv-preview { width: 100%; height: 760px; border: 0; display: block; border-radius: 0 0 10px 10px; background: #525659; }
.inv-pay { border-top: 1px solid var(--line); }
.sig-prev { max-height: 60px; display: block; margin-bottom: 6px; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 4px; }
.rep-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.inv-cols { border-bottom: 1px solid var(--line); background: #fafbfc; }
.inv-lines input[type=checkbox] { width: 15px; height: 15px; padding: 0; min-width: 0; }
.inv-lines .lt-tools .check { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; }

/* revised issued waybills */
.rev-badge { background: #fff4d6; color: #8a5a00; border: 1px solid #f0d58a; }
.revise-box { border-left: 4px solid #e0a800; margin-bottom: 14px; }
.revise-box textarea { width: 100%; }
.rev-item { padding: 8px 0; border-bottom: 1px solid var(--line, #e5e7eb); }
.rev-item:last-child { border-bottom: 0; }
.rev-reason { font-style: italic; margin: 2px 0; }
.rev-changes { margin: 4px 0 0; padding-left: 18px; }

/* ---------------------------------------------------------------- notifications */
.avatar[data-ps="online"] { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #22a45a; }
.avatar[data-ps="away"] { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #e3a008; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; }
.nbell-drop { max-height: min(76vh, 620px); overflow: auto; }
.nbell-list { border-bottom: 1px solid var(--line); }
.nt-it { display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid #f1f2f4; color: var(--ink); font-size: 13px; }
.nt-it:hover { background: #f7f9fc; text-decoration: none; }
.nt-it > span:last-child { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.nt-it b { font-weight: 500; }
.nt-it.unread b { font-weight: 700; }
.nt-it .nt-b { color: var(--ink-2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.nt-it .nt-m { color: var(--muted); font-size: 11.5px; }
.nt-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; margin-top: 6px; background: transparent; }
.unread > .nt-dot { background: var(--accent); }
.lv-urgent.unread > .nt-dot { background: #d92d20; }
.lv-high.unread > .nt-dot { background: #e07b00; }
.nt-tag { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; padding: 1px 6px; border-radius: 4px;
  background: #eef1f6; color: var(--ink-2); vertical-align: 1px; }
.nt-tag.urgent { background: #d92d20; color: #fff; }
.nt-tag.high { background: #fff1db; color: #a35a00; }
.nt-tag.low { background: #f3f4f6; color: var(--muted); }
.nt-stack { position: fixed; right: 16px; top: 72px; z-index: 9999; display: flex; flex-direction: column; gap: 10px;
  width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.nt-pop { pointer-events: auto; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px;
  padding: 10px 12px 12px; box-shadow: 0 10px 30px rgba(15, 23, 42, .18); animation: ntIn .25s ease-out; transition: opacity .35s, transform .35s; }
.nt-pop.go { opacity: 0; transform: translateX(30px); }
.nt-pop.lv-high { border-left-color: #e07b00; }
.nt-pop.lv-low { border-left-color: #c3c8d0; }
.nt-pop.lv-urgent { border: 2px solid #d92d20; border-left-width: 6px; animation: ntIn .25s ease-out, ntPulse 1.6s ease-in-out infinite; }
.nt-pop-h { display: flex; gap: 6px; align-items: center; min-height: 18px; }
.nt-rep { font-size: 11px; color: var(--muted); }
.nt-x { margin-left: auto; background: none; border: 0; font-size: 18px; line-height: 1; color: var(--muted); cursor: pointer; }
.nt-pop-t { font-weight: 650; font-size: 14px; margin-top: 2px; }
.nt-pop-b { font-size: 13px; color: var(--ink-2); margin-top: 3px; }
.nt-pop-a { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
@keyframes ntIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes ntPulse { 0%, 100% { box-shadow: 0 10px 30px rgba(217, 45, 32, .18); } 50% { box-shadow: 0 10px 34px rgba(217, 45, 32, .45); } }
.nt-list .nt-row { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #f1f2f4; color: var(--ink); }
.nt-list .nt-row:hover { background: #f7f9fc; text-decoration: none; }
.nt-row .nt-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nt-row b { font-weight: 500; } .nt-row.unread b { font-weight: 700; }
.nt-row .nt-body { color: var(--ink-2); font-size: 13px; }
.nt-row .nt-meta { color: var(--muted); font-size: 12px; }
.nt-pref { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f1f2f4; }
.nt-pref .sub { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; }
.nt-rules > div { padding: 6px 0; border-bottom: 1px dashed #eceff2; line-height: 1.5; }
.nt-steps { padding-left: 18px; line-height: 1.7; }
.nt-code { background: #f3f6fc; border: 1px dashed #b9c6e6; border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.nt-code-v { font: 700 30px/1.2 ui-monospace, Consolas, monospace; letter-spacing: .12em; color: var(--accent); margin: 4px 0; }
.nt-dev { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f1f2f4; font-size: 13px; }
.nt-dev .sub { display: block; color: var(--muted); font-size: 12px; }
@media (max-width: 639px) { .nt-stack { right: 12px; left: 12px; top: 64px; width: auto; } }
.note.warn { background: #fff7ed; border-color: #f2c48d; color: #7a4a12; }

/* add several units of one instrument */
.units-ask { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.units-ask label.inline { display: flex; align-items: center; gap: 8px; font-weight: 500; margin: 0; }
.units-box { background: #f6f8fc; border: 1px solid var(--line-2); border-radius: 8px; padding: 12px 14px; }
.units-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin-bottom: 8px; }
.units-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 12px; margin-bottom: 8px; }
.units-grid label { font-size: 12px; margin-bottom: 2px; }

/* "Track costs…" menu on the equipment register */
details.menu { position: relative; display: inline-block; }
details.menu > summary { list-style: none; cursor: pointer; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu > summary.disabled { opacity: .55; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 270px; background: #fff; border: 1px solid var(--line-2);
  border-radius: 10px; box-shadow: 0 10px 30px rgba(15, 23, 32, .14); padding: 6px; }
.menu-it { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; background: none; border: 0;
  padding: 9px 10px; border-radius: 7px; font: inherit; font-weight: 600; cursor: pointer; color: var(--ink); }
.menu-it:hover { background: #f2f5fa; }
.badge.ct-badge { background: #e8f1ea; color: #23633d; }
.ct-bulk { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--line-2); background: #fafbfc; }
.lines .c-dim { width: 112px; }
.auth-tel { margin-top: 6px; display: flex; flex-direction: column; gap: 2px; }
.auth-tel b { color: #9fb0bf; font-weight: 600; }
.auth-tel a { color: #c9d6e2; text-decoration: none; }
.auth-tel a:hover { text-decoration: underline; }

/* expense tracker import */
.imp-counts { display: flex; gap: 6px; flex-wrap: wrap; }
.imp-bar { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line-2); position: sticky; top: 0; background: #fff; z-index: 3; }
.imp-total { margin-left: auto; font-weight: 600; }
.imp-table td { vertical-align: top; }
.imp-table select { min-width: 190px; }
.imp-same td { opacity: .55; }
.imp-off td:not(:first-child) { opacity: .45; }
.imp-nodate { border-color: #e0a95b !important; }
ul.tight { margin: 0; padding-left: 18px; } ul.tight li { margin-bottom: 6px; }

/* Finance files */
.fin-search { margin-bottom: 14px; max-width: 560px; }
.fin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.fin-folder { display: block; padding: 14px 16px; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.fin-folder:hover { border-color: #9fb4e6; box-shadow: 0 4px 14px rgba(30, 50, 110, .08); }
.fin-ico { font-size: 26px; line-height: 1; margin-bottom: 6px; }
.fin-ico.big { font-size: 34px; margin: 0; }
.fin-fname { font-weight: 600; margin-bottom: 4px; word-break: break-word; }
.fin-head-b { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; }
.fin-head-main { display: flex; gap: 14px; align-items: center; }
.fin-head-act { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.fin-money { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 16px; padding: 12px 18px 16px; align-items: end; }
.fin-money span { display: block; font-size: 12px; color: var(--ink-2); }
.fin-money b { font-size: 17px; }
.fin-drop { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; padding: 16px 18px; border: 2px dashed transparent; border-radius: 10px; }
.fin-drop.over { border-color: #6d8fe0; background: #f3f6fd; }
.fin-bulk { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* job page: budget, spending by category */
.job-budget .jb-top { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 8px; }
.jb-bar { height: 10px; border-radius: 6px; background: #eef1f6; overflow: hidden; }
.jb-bar i { display: block; height: 100%; background: #2f8a5b; border-radius: 6px; }
.job-budget.warn .jb-bar i { background: #d99a2b; }
.job-budget.over .jb-bar i { background: #c0392b; }
.job-budget.over { border-color: #e8b4ad; }
.cat-bars { padding: 8px 10px 12px; }
.cat-row { display: grid; grid-template-columns: minmax(120px, 1.3fr) 2fr auto 44px; gap: 10px; align-items: center; padding: 7px 8px;
  border-radius: 7px; color: inherit; text-decoration: none; font-size: 13px; }
.cat-row:hover { background: #f3f6fb; }
.cb-bar { height: 8px; background: #eef1f6; border-radius: 5px; overflow: hidden; }
.cb-bar i { display: block; height: 100%; background: #3b5bb5; border-radius: 5px; }
.cb-val { font-weight: 600; text-align: right; }
.cb-pct { text-align: right; font-size: 12px; }
.mt-s { margin-top: 6px; }
@media (max-width: 640px) { .cat-row { grid-template-columns: 1fr auto 40px; } .cb-bar { grid-column: 1 / -1; order: 5; } }
.fin-money a.btn { justify-self: start; align-self: center; }
.relay-box { margin-top: 10px; padding: 12px 14px; background: #f6f8fc; border: 1px solid var(--line-2); border-radius: 8px; }
ol.tight { margin: 0 0 10px; padding-left: 18px; } ol.tight li { margin-bottom: 6px; }

/* unsaved-work protection */
.as-bar { position: sticky; top: 8px; z-index: 40; box-shadow: 0 6px 18px rgba(80,60,0,.12); display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-bottom: 14px;
  padding: 12px 16px; background: #fff7e6; border: 1px solid #efcf8f; border-radius: 10px; color: #5c4100; }
.as-bar .as-act { display: flex; gap: 8px; }
.as-note { font-size: 12px; color: var(--ink-2, #6b7785); text-align: right; padding: 6px 18px 10px; }

/* invoice workings (Schedule A, B, C...) */
.w-sched { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 12px; background: #fbfcfe; }
.w-shead { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.w-badge { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.w-shead .w-code { width: 64px; font-weight: 800; text-align: center; height: 34px; }
.w-shead .w-stitle { flex: 1; min-width: 180px; height: 34px; }
.w-stot { margin-left: auto; font-weight: 800; white-space: nowrap; }
.w-table { background: #fff; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; overflow: hidden; }
.w-thead { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 8px; background: #eef4fb; border-bottom: 1px solid var(--line); }
.w-thead input[type=text] { height: 32px; font-size: 13px; flex: 1; min-width: 160px; } .w-thead .w-ttl { font-weight: 700; }
.w-grid td.w-n { width: 34px; text-align: center; color: var(--muted); padding-top: 10px; }
.w-grid input[data-w=units] { width: 60px; } .w-grid input[data-w=qty] { width: 74px; } .w-grid input[data-w=rate] { width: 100px; }
.w-grid input[type=date] { width: 138px; }
.w-grid td.w-tot { text-align: right; font-weight: 600; white-space: nowrap; padding-top: 10px; width: 120px; }
.w-grid tfoot td { border-top: 1px solid var(--line); background: #fafbfc; } .w-grid tfoot .w-ttot { font-weight: 800; }
.w-grid .lt-tools { width: 60px; }
.w-print { border-top: 1px dashed var(--line); padding-top: 10px; }
.inv-lines .ln-link { display: block; margin-top: 4px; height: 28px; font-size: 12px; width: 100%; color: var(--muted); }
.inv-lines tr.ln-linked .ln-link { color: var(--ink); background: #eef7ee; border-color: #9cc99c; font-weight: 600; }
.inv-lines tr.ln-linked [data-f=unit_price] { background: #f3f5f7; color: var(--muted); }
.inv-start { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* extra costs of an equipment purchase (customs, clearing, freight...) */
.pex { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fbfcfe; }
.pex-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.pex-row { display: grid; grid-template-columns: 1.3fr 1.3fr 1.2fr .9fr 1fr 1.2fr 28px; gap: 8px; align-items: start; padding: 8px 0; border-top: 1px dashed var(--line); }
.pex-row label { font-size: 11.5px; margin-bottom: 2px; } .pex-row input, .pex-row select { height: 34px; font-size: 13px; width: 100%; }
.pex-row input[type=file] { height: auto; font-size: 12px; padding: 4px 0; border: 0; background: none; }
.pex-money { display: grid; grid-template-columns: 1fr 70px; gap: 4px; }
.pex-del { border: 0; background: none; cursor: pointer; color: var(--muted); margin-top: 24px; font-size: 14px; } .pex-del:hover { color: var(--neg); }
.pex-done { width: 100%; font-size: 12.5px; margin-bottom: 6px; } .pex-done th { font-size: 11px; }
.pex-sum { margin: 6px 0 4px; }
.pex-box { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fbfcfe; }
@media (max-width: 760px) { .pex-row { grid-template-columns: 1fr 1fr; } .pex-del { grid-column: 2; justify-self: end; margin-top: 0; } }
