/* =====================================================================
   OUTWARD MODULE — DESIGN SYSTEM (Orange House brand)
   Palette sampled directly from the client logo — not a generic AI-tell
   palette: orange #F15B25 is the brand's own icon/wordmark colour, the
   two greys are lifted from "House" and the script tagline.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@500&display=swap');

:root {
  --bg:             #F7F7F8;
  --surface:        #FFFFFF;
  --surface-raised: #F4F4F5;
  --border:         #E5E5E7;
  --border-light:   #D7D7DA;

  --text:           #3B3B3B;   /* brand dark grey — script tagline colour */
  --text-dim:       #6B6B6E;
  --text-faint:     #9C9C9F;

  --orange:         #F15B25;   /* brand primary */
  --orange-deep:    #D94E1C;
  --orange-soft:    #FDEAE2;

  --success:        #2E9E5B;
  --danger:         #D64545;
  --info:           #3B82C4;

  --radius: 6px;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
}

/* ---------- shell layout ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 236px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  display: flex;
  flex-direction: column;
}

.sidebar__brand {
  padding: 0 20px 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar__brand img { height: 34px; width: auto; display: block; }
.sidebar__brand-text { line-height: 1.2; }
.sidebar__brand-mark { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--text); }
.sidebar__brand-mark span { color: var(--orange); }
.sidebar__brand-sub { color: var(--text-faint); font-size: 10.5px; margin-top: 1px; }

.nav-group { margin-bottom: 18px; }
.nav-group__label {
  padding: 0 20px;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  color: var(--text-dim);
  text-decoration: none;
  border-left: 2px solid transparent;
  font-size: 13.5px;
}
.nav-link:hover { color: var(--text); background: var(--surface-raised); }
.nav-link.is-active {
  color: var(--orange-deep);
  background: var(--orange-soft);
  border-left-color: var(--orange);
  font-weight: 600;
}

.main { 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;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
}
.topbar__context { color: var(--text-dim); font-size: 13px; }
.topbar__context b { color: var(--text); font-weight: 600; }

.content { padding: 24px 28px 60px; }

/* ---------- page header ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-head h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  margin: 0 0 4px;
  color: var(--text);
}
.page-head p { margin: 0; color: var(--text-dim); font-size: 13px; }

/* ---------- stat strip ---------- */
.stat-strip {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
  background: var(--surface);
}
.stat {
  flex: 1;
  padding: 14px 18px;
  border-right: 1px solid var(--border);
}
.stat:last-child { border-right: none; }
.stat__value { font-family: var(--font-display); font-size: 24px; font-weight: 600; color: var(--text); }
.stat__label { color: var(--text-dim); font-size: 12px; margin-top: 2px; }
.stat--amber .stat__value { color: var(--orange); }
.stat--success .stat__value { color: var(--success); }
.stat--danger .stat__value { color: var(--danger); }

/* ---------- toolbar ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.input, .select {
  background: var(--surface);
  border: 1px solid var(--border-light);
  color: var(--text);
  border-radius: var(--radius);
  padding: 8px 10px;
  font-size: 13px;
  font-family: var(--font-body);
}
.input:focus, .select:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-soft); }
.input--search { width: 240px; }
.spacer { flex: 1; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-light);
  background: var(--surface);
  color: var(--text);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-body);
}
.btn:hover { border-color: var(--text-faint); background: var(--surface-raised); }
.btn--primary { background: var(--orange); border-color: var(--orange); color: #FFFFFF; font-weight: 600; }
.btn--primary:hover { background: var(--orange-deep); border-color: var(--orange-deep); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn--ghost:hover { background: var(--surface-raised); }
.btn--danger { color: var(--danger); }
.btn--sm { padding: 5px 10px; font-size: 12px; }

/* ---------- table ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
table.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th {
  text-align: left;
  font-size: 11.5px;
  color: var(--text-faint);
  font-weight: 600;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-raised);
}
.data-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--surface-raised); }

.code { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-dim); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 500;
  border: 1px solid transparent;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--active { color: var(--success); border-color: rgba(46,158,91,0.25); background: rgba(46,158,91,0.08); }
.badge--inactive { color: var(--text-faint); border-color: var(--border-light); background: var(--surface-raised); }
.badge--available { color: var(--success); border-color: rgba(46,158,91,0.25); background: rgba(46,158,91,0.08); }
.badge--picking, .badge--assigned { color: var(--info); border-color: rgba(59,130,196,0.25); background: rgba(59,130,196,0.08); }
.badge--break { color: var(--orange); border-color: rgba(241,91,37,0.25); background: var(--orange-soft); }
.badge--offline { color: var(--text-faint); border-color: var(--border-light); background: var(--surface-raised); }

.empty-state { padding: 50px 20px; text-align: center; color: var(--text-dim); }
.empty-state h3 { font-family: var(--font-display); color: var(--text); margin-bottom: 6px; }

.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-dim); }

/* ---------- slide-over drawer ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(59,59,59,0.35);
  display: none; z-index: 40;
}
.overlay.is-open { display: block; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 440px; max-width: 92vw;
  background: var(--surface);
  border-left: 1px solid var(--border-light);
  box-shadow: -8px 0 24px rgba(59,59,59,0.08);
  transform: translateX(100%);
  transition: transform 0.22s ease;
  z-index: 41;
  display: flex; flex-direction: column;
}
.drawer.is-open { transform: translateX(0); }

.drawer__head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.drawer__head h2 { font-family: var(--font-display); font-size: 17px; margin: 0; font-weight: 600; color: var(--text); }
.drawer__body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.drawer__foot { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--text-dim); margin-bottom: 5px; }
.field .input, .field .select { width: 100%; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }
.field-error { color: var(--danger); font-size: 11.5px; margin-top: 4px; }
.field-hint { color: var(--text-faint); font-size: 11.5px; margin-top: 4px; }

/* ---------- toast ---------- */
.toast-stack { position: fixed; bottom: 20px; right: 20px; z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--info);
  color: var(--text);
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  min-width: 220px;
  box-shadow: 0 4px 16px rgba(59,59,59,0.1);
}
.toast--success { border-left-color: var(--success); }
.toast--error { border-left-color: var(--danger); }

.text-dim { color: var(--text-dim); }
.text-faint { color: var(--text-faint); }
.avatar-chip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--orange-soft); border: 1px solid rgba(241,91,37,0.2);
  font-family: var(--font-display); font-size: 11px; font-weight: 600; color: var(--orange-deep);
  margin-right: 8px;
}
.name-cell { display: flex; align-items: center; }

/* ---------- notifications ---------- */
.notif-bell { position: relative; cursor: pointer; margin-right: 14px; font-size: 15px; }
.notif-badge {
  position: absolute; top: -6px; right: -8px;
  background: var(--orange); color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 999px; padding: 1px 5px; min-width: 15px; text-align: center;
}
.notif-panel {
  display: none;
  position: fixed; top: 56px; right: 24px; width: 340px; max-height: 420px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(59,59,59,0.12); z-index: 50;
}
.notif-panel.is-open { display: block; }
.notif-panel__head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--text); }
.notif-item { padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 12.5px; cursor: pointer; }
.notif-item:hover { background: var(--surface-raised); }
.notif-item.is-unread { background: var(--orange-soft); }
.notif-item__title { font-weight: 600; color: var(--text); }
.notif-item__body { color: var(--text-dim); margin-top: 2px; }
.notif-item__time { color: var(--text-faint); font-size: 11px; margin-top: 4px; }

/* ---------- QR/Barcode choice dialog ---------- */
.label-type-dialog {
  display: none;
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 260px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 20px; z-index: 51; box-shadow: 0 12px 32px rgba(59,59,59,0.15);
}
.label-type-dialog.is-open { display: block; }
.label-type-dialog__title { font-family: var(--font-display); font-weight: 600; font-size: 14px; margin-bottom: 12px; text-align: center; }
.label-type-dialog__options { display: flex; gap: 8px; }
.label-type-dialog__options .btn { flex: 1; }

/* ============ BUSY INTEGRATION ============ */

/* A red badge — the queue needs a "needs attention" state, and the
   existing set only had active/assigned/picking. */
.badge--danger { color: var(--danger); border-color: rgba(214,69,69,0.25); background: rgba(214,69,69,0.08); }

/* The BUSY order detail drawer carries a line-item table plus the sync
   history, which does not fit the standard 440px. */
.drawer--wide { width: 760px; }

/* =====================================================================
   TOP NAVIGATION + DASHBOARD (replaces the sidebar shell)

   The sidebar is gone: modules live in top-bar dropdowns, which gives
   the dashboard the full width it needs to be dense without feeling
   crowded. The old .shell/.sidebar rules above are left untouched but
   are no longer referenced by any view.
   ===================================================================== */

.app { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }

.topnav {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 14px;
  padding: 0 18px; height: 60px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(59,59,59,0.04);
}
.topnav__brand { display: flex; align-items: center; text-decoration: none; flex: 0 0 auto; }
/* Logo carries the whole brand corner now — sized up from 30px now that
   there is no "OUTWARD / Warehouse Operations" text stack beside it. */
.topnav__brand img { height: 44px; width: auto; display: block; }

.topnav__menu { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; }
.topnav__item {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 12px; border-radius: 8px;
  font-size: 13.5px; font-weight: 500; color: var(--text-dim);
  text-decoration: none; background: none; border: none; cursor: pointer;
  font-family: inherit; white-space: nowrap;
}
.topnav__item:hover { background: var(--surface-raised); color: var(--text); }
.topnav__item.is-active,
.topnav__dropdown.is-active > .topnav__item { background: var(--orange-soft); color: var(--orange-deep); font-weight: 600; }
.caret { font-size: 9px; opacity: 0.6; }

.topnav__dropdown { position: relative; }
.topnav__panel {
  display: none; position: absolute; top: calc(100% + 6px); left: 0;
  min-width: 232px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 12px 30px rgba(59,59,59,0.14); z-index: 70;
}
.topnav__panel--right { left: auto; right: 0; }
.topnav__dropdown.is-open > .topnav__panel { display: block; }
.topnav__panel a, .topnav__panel button {
  display: block; width: 100%; text-align: left;
  padding: 8px 10px; border-radius: 7px;
  font-size: 13px; color: var(--text); text-decoration: none;
  background: none; border: none; cursor: pointer; font-family: inherit;
}
.topnav__panel a:hover, .topnav__panel button:hover { background: var(--surface-raised); }
.topnav__panel a.is-active { background: var(--orange-soft); color: var(--orange-deep); font-weight: 600; }
.topnav__panel a:focus-visible, .topnav__panel button:focus-visible { outline: 2px solid var(--orange); outline-offset: -2px; }

.topnav__right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.topnav__userbtn {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; font-family: inherit;
}
.topnav__userbtn:hover { background: var(--surface-raised); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--orange); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px; flex: 0 0 auto;
}
.mini-avatar {
  width: 22px; height: 22px; border-radius: 50%; margin-right: 7px;
  background: var(--orange-soft); color: var(--orange-deep);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
}
.topnav__userinfo { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.topnav__username { font-size: 12.5px; font-weight: 600; color: var(--text); }
.topnav__userrole { font-size: 10.5px; color: var(--text-faint); text-transform: capitalize; }
.topnav__burger { display: none; background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text); }

.content { padding: 20px 22px 32px; flex: 1; }
.app-footer {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 22px; border-top: 1px solid var(--border);
  color: var(--text-faint); font-size: 12px; background: var(--surface);
}
/* "Powered by" is credit, not the headline — kept visibly smaller than
   the copyright line next to it. */
.app-footer__powered { font-size: 10.5px; }

/* ---------- dashboard header + filters ---------- */
.dash-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.dash-hero h1 { font-family: var(--font-display); font-size: 24px; margin: 0 0 2px; }
.dash-hero p { margin: 0; color: var(--text-dim); font-size: 13px; }

.filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 9px; padding: 5px 10px; height: 36px;
}
.filter__icon { font-size: 13px; opacity: 0.7; }
.filter__sep { color: var(--text-faint); font-size: 12px; }
.filter__select, .filter__date {
  border: none; background: none; font-family: inherit; font-size: 13px;
  color: var(--text); outline: none; max-width: 160px;
}
.filter__select:disabled { color: var(--text-faint); }
.filter-bar .btn { height: 36px; }

/* ---------- KPI cards ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 13px 14px; display: flex; gap: 10px; align-items: flex-start;
  box-shadow: 0 1px 2px rgba(59,59,59,0.04);
}
.kpi__icon { width: 34px; height: 34px; border-radius: 9px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.kpi__body { min-width: 0; }
.kpi__value { font-family: var(--font-display); font-size: 24px; font-weight: 600; line-height: 1.05; }
.kpi__label { font-size: 12px; color: var(--text-dim); margin-top: 1px; }
.kpi__delta { font-size: 11px; margin-top: 4px; }
.kpi__delta--up { color: var(--success); }
.kpi__delta--down { color: var(--danger); }
.kpi__delta--flat { color: var(--text-faint); }
.kpi--blue   .kpi__icon { background: #E8F1FA; color: #3B82C4; }
.kpi--green  .kpi__icon { background: #E6F4EC; color: #2E9E5B; }
.kpi--amber  .kpi__icon { background: #FDF3DC; color: #B8860B; }
.kpi--violet .kpi__icon { background: #EFEAFC; color: #7C4DDB; }
.kpi--pink   .kpi__icon { background: #FCE9EE; color: #C7436A; }
.kpi--sky    .kpi__icon { background: #E7F3FB; color: #2F82AE; }
.kpi--danger .kpi__icon { background: #FBEAEA; color: var(--danger); }

/* ---------- cards + rows ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px; box-shadow: 0 1px 2px rgba(59,59,59,0.04); min-width: 0;
}
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.card__head h2 { font-family: var(--font-display); font-size: 14.5px; margin: 0; }
.card__link { font-size: 12px; color: var(--orange); text-decoration: none; white-space: nowrap; }
.is-loading { opacity: 0.55; transition: opacity 0.15s; }

.dash-row { display: grid; gap: 12px; margin-bottom: 12px; }
.dash-row--a { grid-template-columns: 1.35fr 1fr 1fr 1fr; }
.dash-row--b { grid-template-columns: 1.5fr 1.2fr 1fr; }
.dash-row--c { grid-template-columns: 1.1fr 1fr 0.9fr 1fr; }

.legend { font-size: 11px; color: var(--text-dim); display: flex; align-items: center; gap: 5px; }
.legend .dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot--today { background: var(--info); }
.dot--prev { background: var(--border-light); }

/* ---------- bar chart ---------- */
.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 176px; }
.bar-group { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; text-decoration: none; border-radius: 7px; padding: 4px 0; }
.bar-group:hover { background: var(--surface-raised); }
.bar-group__bars { flex: 1; display: flex; align-items: flex-end; gap: 3px; width: 100%; justify-content: center; }
.bar { width: 34%; border-radius: 4px 4px 0 0; min-height: 3px; }
.bar--today { background: var(--info); }
.bar--prev { background: var(--border-light); }
.bar-group__value { font-family: var(--font-display); font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.bar-group__label { font-size: 10.5px; color: var(--text-dim); margin-top: 6px; white-space: nowrap; }

/* ---------- donuts ---------- */
.donut-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.donut { position: relative; flex: 0 0 auto; }
.donut__center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut__total { font-family: var(--font-display); font-size: 19px; font-weight: 600; }
.donut__caption { font-size: 10px; color: var(--text-dim); }
.donut-legend { flex: 1; min-width: 120px; font-size: 12px; }
.donut-legend__row { display: flex; align-items: center; gap: 6px; padding: 1.5px 0; }
.donut-legend__swatch { width: 8px; height: 8px; border-radius: 2px; flex: 0 0 auto; }
.donut-legend__label { flex: 1; color: var(--text-dim); }
.donut-legend__value { font-weight: 600; white-space: nowrap; }
.donut-legend__value em { font-style: normal; color: var(--text-faint); font-weight: 400; }

/* ---------- tables ---------- */
.table-scroll { overflow-x: auto; }
.data-table--compact thead th { padding: 7px 9px; font-size: 11px; }
.data-table--compact tbody td { padding: 8px 9px; font-size: 12.5px; }
.cell-sub { font-size: 11px; color: var(--text-faint); }
.cell-dim { color: var(--text-dim); font-size: 11.5px; }

/* ---------- pending tasks ---------- */
.task-list { display: flex; flex-direction: column; gap: 5px; }
.task {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 8px; text-decoration: none;
  font-size: 12.5px; color: var(--text); border-left: 3px solid transparent;
}
.task:hover { filter: brightness(0.97); }
.task__label { flex: 1; }
.task__count { font-weight: 700; font-family: var(--font-display); }
.task__chevron { color: var(--text-faint); }
.task--orange { background: var(--orange-soft); border-left-color: var(--orange); }
.task--amber  { background: #FDF3DC; border-left-color: #E0A310; }
.task--blue   { background: #E8F1FA; border-left-color: var(--info); }
.task--violet { background: #EFEAFC; border-left-color: #7C4DDB; }
.task--pink   { background: #FCE9EE; border-left-color: #C7436A; }
.task--green  { background: #E6F4EC; border-left-color: var(--success); }
.task--danger { background: #FBEAEA; border-left-color: var(--danger); }

/* ---------- utilization ---------- */
.util__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.util__pct { font-family: var(--font-display); font-size: 20px; font-weight: 600; }
.util__ratio { font-size: 11.5px; color: var(--text-dim); }
.util__bar { height: 8px; border-radius: 5px; background: var(--surface-raised); margin: 9px 0 12px; overflow: hidden; }
.util__bar span { display: block; height: 100%; background: var(--info); border-radius: 5px; }
.util__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.util__cell { background: var(--surface-raised); border-radius: 8px; padding: 8px; text-align: center; }
.util__cell b { display: block; font-family: var(--font-display); font-size: 16px; }
.util__cell span { font-size: 10.5px; color: var(--text-dim); }
.util__note { font-size: 10.5px; color: var(--text-faint); margin-top: 9px; line-height: 1.35; }

/* ---------- top books ---------- */
.rank-list { display: flex; flex-direction: column; gap: 8px; }
.rank { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.rank__no { color: var(--text-faint); width: 16px; flex: 0 0 auto; }
.rank__name { flex: 0 0 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank__bar { flex: 1; height: 8px; background: var(--surface-raised); border-radius: 5px; overflow: hidden; }
.rank__bar i { display: block; height: 100%; background: var(--info); border-radius: 5px; }
.rank__qty { width: 38px; text-align: right; font-weight: 600; flex: 0 0 auto; }

/* ---------- activity ---------- */
.activity-feed { display: flex; flex-direction: column; gap: 10px; max-height: 200px; overflow-y: auto; }
.activity { display: flex; gap: 9px; }
.activity__dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex: 0 0 auto; background: var(--info); }
.activity__dot--warn { background: var(--danger); }
.activity__dot--ok { background: var(--success); }
.activity__text { font-size: 12.5px; line-height: 1.3; }
.activity__meta { font-size: 10.5px; color: var(--text-faint); margin-top: 1px; }

/* ---------- quick actions ---------- */
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.quick-action { display: block; padding: 11px 8px; border-radius: 9px; text-align: center; font-size: 12px; font-weight: 600; text-decoration: none; border: 1px solid transparent; }
.quick-action--orange { background: var(--orange-soft); color: var(--orange-deep); }
.quick-action--blue   { background: #E8F1FA; color: #2F6FA8; }
.quick-action--green  { background: #E6F4EC; color: #247845; }
.quick-action--violet { background: #EFEAFC; color: #6A3FC4; }
.quick-action--pink   { background: #FCE9EE; color: #A93656; }
.quick-action--amber  { background: #FDF3DC; color: #96700A; }
.quick-action--grey   { background: var(--surface-raised); color: var(--text-dim); border-color: var(--border); }

/* extra status colours used by the dashboard badges */
.badge--blue   { color: var(--info); border-color: rgba(59,130,196,0.25); background: rgba(59,130,196,0.08); }
.badge--green  { color: var(--success); border-color: rgba(46,158,91,0.25); background: rgba(46,158,91,0.08); }
.badge--amber  { color: #A9790C; border-color: rgba(245,179,1,0.3); background: rgba(245,179,1,0.12); }
.badge--violet { color: #6A3FC4; border-color: rgba(124,77,219,0.25); background: rgba(124,77,219,0.09); }
.badge--pink   { color: #A93656; border-color: rgba(199,67,106,0.25); background: rgba(199,67,106,0.09); }
.badge--grey   { color: var(--text-dim); border-color: var(--border); background: var(--surface-raised); }

/* ---------- responsive ---------- */
@media (max-width: 1500px) {
  .dash-row--a { grid-template-columns: 1.2fr 1fr 1fr; }
  .dash-row--a #cardActivity { grid-column: 1 / -1; }
  .dash-row--c { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1180px) {
  .dash-row--a, .dash-row--b { grid-template-columns: 1fr 1fr; }
  .dash-row--a #cardActivity, .dash-row--b #cardTasks { grid-column: 1 / -1; }
  .topnav__item { padding: 8px 9px; font-size: 13px; }
}
/* Phone drawer behaviour for the menu — the grid placement itself lives
   in the responsive-rows block further down. */
@media (max-width: 679px) {
  .topnav__menu {
    flex-direction: column; align-items: stretch; gap: 2px; padding-top: 8px;
  }
  .topnav__dropdown { width: 100%; }
  .topnav__item--toggle { width: 100%; justify-content: flex-start; }
  .topnav__item--toggle .caret { margin-left: auto; }
  .topnav__panel { position: static; box-shadow: none; border: none; padding: 0 0 4px 12px; min-width: 0; }
  .topnav__userinfo { display: none; }
}
@media (max-width: 900px) {
  .dash-row--a, .dash-row--b, .dash-row--c { grid-template-columns: 1fr; }
  .dash-row--a #cardActivity, .dash-row--b #cardTasks { grid-column: auto; }
  .content { padding: 16px 14px 28px; }
  .filter-bar { width: 100%; }
  .filter { flex: 1 1 auto; }
  .notif-panel { right: 12px; left: 12px; width: auto; }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .quick-grid { grid-template-columns: 1fr; }
  .util__grid { grid-template-columns: 1fr 1fr; }
  .dash-hero h1 { font-size: 20px; }
}

/* ---------- global search ---------- */
.topnav__search {
  position: relative; display: flex; align-items: center; gap: 7px;
  background: var(--surface-raised); border: 1px solid var(--border); border-radius: 9px;
  padding: 0 10px; height: 36px; width: 300px; flex: 0 1 300px;
}
.topnav__search:focus-within { border-color: var(--orange); background: var(--surface); }
.topnav__search-icon { font-size: 13px; opacity: 0.6; }
.topnav__search input {
  flex: 1; min-width: 0; border: none; background: none; outline: none;
  font-family: inherit; font-size: 13px; color: var(--text);
}
.topnav__search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.topnav__kbd { font-size: 10px; color: var(--text-faint); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; background: var(--surface); }
.topnav__search-results {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 12px 30px rgba(59,59,59,0.14); padding: 6px; z-index: 70; max-height: 380px; overflow-y: auto;
}
.topnav__search-results.is-open { display: block; }
.search-group__label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); padding: 6px 8px 2px; }
.search-hit { display: flex; justify-content: space-between; gap: 10px; padding: 7px 8px; border-radius: 7px; text-decoration: none; color: var(--text); font-size: 12.5px; }
.search-hit:hover { background: var(--surface-raised); }
.search-hit__title { font-family: var(--font-mono); font-weight: 600; }
.search-hit__sub { color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-empty { padding: 12px; font-size: 12.5px; color: var(--text-dim); text-align: center; }

.kpi--grey .kpi__icon { background: var(--surface-raised); color: var(--text-dim); }

@media (max-width: 1250px) { .topnav__search { width: 220px; flex-basis: 220px; } .topnav__kbd { display: none; } }


/* =====================================================================
   REFERENCE-MATCH PASS — tinted KPI cards, SVG icons, axis on the
   pipeline, compact tables. Later rules win, so these override the
   generic dashboard styles above where they differ.
   ===================================================================== */

.ow-icon { vertical-align: -3px; flex: 0 0 auto; }
.topnav__item .ow-icon { margin-right: 2px; opacity: 0.85; }
.topnav__search-icon { display: inline-flex; color: var(--text-faint); }
.notif-bell { display: inline-flex; align-items: center; color: var(--text-dim); }
.filter__icon { display: inline-flex; color: var(--text-faint); }
.btn .ow-icon { margin-right: 5px; }

.app-version { color: var(--text-dim); }
.app-version__dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--success); margin-left: 3px; vertical-align: middle; }

/* hero */
.dash-hero__text { display: flex; align-items: center; gap: 12px; }
.dash-hero__sun { color: #F5B301; display: inline-flex; }

/* KPI — tinted card, solid icon tile, like the reference */
.kpi { border: none; border-radius: 12px; padding: 14px 16px; gap: 12px; align-items: center; box-shadow: none; }
.kpi__icon { width: 40px; height: 40px; border-radius: 10px; color: #fff !important; }
.kpi__value { font-size: 24px; }
.kpi__label { font-size: 12.5px; color: var(--text); opacity: 0.85; }
.kpi__delta { font-size: 11.5px; margin-top: 4px; }
.kpi--blue   { background: #EAF2FD; } .kpi--blue   .kpi__icon { background: #3B82C4; }
.kpi--green  { background: #E8F6EE; } .kpi--green  .kpi__icon { background: #2E9E5B; }
.kpi--amber  { background: #FFF4E0; } .kpi--amber  .kpi__icon { background: #F59E0B; }
.kpi--violet { background: #F0EBFC; } .kpi--violet .kpi__icon { background: #8B5CF6; }
.kpi--pink   { background: #FDE9EF; } .kpi--pink   .kpi__icon { background: #E0447A; }
.kpi--sky    { background: #E7F4FB; } .kpi--sky    .kpi__icon { background: #2F9BD6; }
.kpi--danger { background: #FCE9E9; } .kpi--danger .kpi__icon { background: var(--danger); }
.kpi--grey   { background: var(--surface-raised); } .kpi--grey .kpi__icon { background: var(--text-dim); }

/* card polish */
.card { border: 1px solid #ECECEE; box-shadow: 0 1px 3px rgba(20,20,30,0.04); }
.card__head h2 { font-size: 15px; }

/* pipeline with axis + gridlines */
.bar-chart { display: flex; align-items: stretch; gap: 8px; height: 190px; padding-top: 6px; }
.bar-chart__axis { display: flex; flex-direction: column; justify-content: space-between; font-size: 10.5px; color: var(--text-faint); padding-bottom: 22px; width: 22px; text-align: right; }
.bar-chart__plot { position: relative; flex: 1; display: flex; align-items: flex-end; gap: 6px; }
.bar-chart__grid { position: absolute; inset: 0 0 22px 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.bar-chart__grid i { display: block; border-top: 1px solid #EEEEF1; height: 0; }
.bar-chart__plot .bar-group { position: relative; height: 100%; justify-content: flex-end; }
.bar-group__bars { flex: 0 0 auto; height: calc(100% - 40px); align-items: flex-end; }
.bar { width: 40%; max-width: 30px; border-radius: 4px 4px 0 0; }
.bar--today { background: #3B82F6; }
.bar--prev { background: #DDE3EA; }
.bar-group__label { height: 18px; }

/* donut legend bolder values like the reference */
.donut-legend__value { color: var(--text); }

/* tables — no wrapping, dot-less pill badges, View button */
.data-table--compact th, .data-table--compact td { white-space: nowrap; }
.data-table--compact td:nth-child(2) { white-space: normal; max-width: 160px; }
.data-table--compact .badge::before { display: none; }
.data-table--compact .badge { padding: 3px 9px; border: none; border-radius: 6px; font-size: 11.5px; text-transform: capitalize; }
.btn-view { display: inline-block; padding: 4px 12px; border-radius: 6px; background: #E8F1FA; color: #2F6FA8; font-size: 12px; font-weight: 600; text-decoration: none; }
.btn-view:hover { background: #D8E8F8; }
.mini-avatar { font-size: 10.5px; }

/* tasks + activity with icon bubbles */
.task { padding: 9px 12px; border-left: none; border-radius: 9px; }
.task__icon { display: inline-flex; width: 22px; height: 22px; border-radius: 6px; align-items: center; justify-content: center; background: rgba(255,255,255,0.7); }
.task--orange .task__icon { color: var(--orange); }
.task--amber  .task__icon { color: #D98E04; }
.task--blue   .task__icon { color: var(--info); }
.task--violet .task__icon { color: #7C4DDB; }
.task--pink   .task__icon { color: #C7436A; }
.task--green  .task__icon { color: var(--success); }
.task--danger .task__icon { color: var(--danger); }

.activity-feed { gap: 12px; max-height: 210px; }
.activity__bubble { width: 28px; height: 28px; border-radius: 50%; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; background: #EFEAFC; color: #7C4DDB; }
.activity__bubble--ok { background: #E8F6EE; color: var(--success); }
.activity__bubble--warn { background: #FCE9E9; color: var(--danger); }

/* quick actions: 3-up, like the reference */
.quick-grid { grid-template-columns: repeat(3, 1fr); }
.quick-action { padding: 12px 6px; font-size: 11.5px; }

/* utilization cells like white tiles */
.util__cell { background: var(--surface); border: 1px solid #ECECEE; }
.util__grid { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1500px) { .quick-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px)  { .quick-grid { grid-template-columns: 1fr; } .util__grid { grid-template-columns: 1fr 1fr; } }

/* pipeline: value rides on top of its own bar */
.bar-group__bars { height: calc(100% - 22px); }
.bar-col { width: 40%; max-width: 30px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-height: 3px; }
.bar-col .bar { width: 100%; max-width: none; flex: 1; }
.bar-col .bar-group__value { margin-bottom: 3px; }

/* recent orders gets the width it needs */
.dash-row--b { grid-template-columns: 1.75fr 1.15fr 0.9fr; }
.data-table--compact td:nth-child(2) { white-space: nowrap; max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.data-table--compact .badge { text-transform: none; }

/* Pending-task rows: the label must shrink, not push the count off-screen. */
.task { min-width: 0; }
.task__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-list { min-width: 0; }

/* =====================================================================
   TOP NAV — RESPONSIVE ROWS

   Three layouts, chosen by width so the menu is never clipped:

   ≥ 1400px  one row:   [brand] [menu ..........] [search] [bell/user]
   680–1399  two rows:  [brand] [search .........] [bell/user]
                        [menu ............................ wraps]
   < 680px   brand + bell/user + hamburger; menu opens as a drawer.

   The 900–1399 band is what a 1366/1536 screen at 125–150% zoom lands
   in, which is where the single row used to run out of room.
   ===================================================================== */
.topnav {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  grid-template-areas: "brand menu search right";
  align-items: center;
  column-gap: 14px;
  height: auto; min-height: 60px;
}
.topnav__brand  { grid-area: brand; }
.topnav__menu   { grid-area: menu; flex-wrap: wrap; row-gap: 4px; }
.topnav__search { grid-area: search; }
.topnav__right  { grid-area: right; }
.topnav__burger { grid-area: burger; }

@media (max-width: 1399px) {
  .topnav {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "brand search right"
      "menu  menu   menu";
    row-gap: 0;
    padding: 8px 18px 0;
  }
  .topnav__search { width: auto; flex-basis: auto; max-width: 520px; justify-self: stretch; }
  .topnav__kbd { display: inline; }
  .topnav__menu {
    margin-top: 8px; padding: 6px 0;
    border-top: 1px solid var(--border);
  }
  /* Dropdown panels open below the menu row, not below the whole bar. */
  .topnav__dropdown > .topnav__panel { top: calc(100% + 4px); }
}

@media (max-width: 679px) {
  .topnav {
    grid-template-columns: auto 1fr auto auto;
    grid-template-areas:
      "brand  brand  right burger"
      "search search search search"
      "menu   menu   menu  menu";
    padding: 10px 14px;
  }
  .topnav__burger { display: block; }
  .topnav__search { margin-top: 8px; max-width: none; }
  .topnav__menu { display: none; border-top: none; margin-top: 4px; }
  .topnav__menu.is-open { display: flex; }
}
