/* ═══════════════════════════════════════════════════════════
   DeliCore — Glassmorphism UI  ·  Forest Green Palette
   ═══════════════════════════════════════════════════════════ */

:root {
  color-scheme: light;

  /* ── Palette ── */
  --bg:           #cfdfc2;
  --ink:          #0c1809;
  --muted:        #4a5e40;
  --line:         rgba(80, 120, 60, 0.18);
  --teal:         #1a5020;
  --accent:       #2a7030;
  --mint:         rgba(80, 190, 90, 0.14);
  --green-glow:   rgba(42, 112, 48, 0.32);

  /* ── Glass layers ── */
  --glass:        rgba(255, 255, 255, 0.68);
  --glass-strong: rgba(255, 255, 255, 0.88);
  --glass-border: rgba(255, 255, 255, 0.80);
  --glass-inner:  inset 0 1px 0 rgba(255,255,255,0.90);

  /* ── Shadows ── */
  --shadow-xs:    0 2px 8px rgba(20, 50, 10, 0.08);
  --shadow-sm:    0 4px 16px rgba(20, 50, 10, 0.10);
  --shadow-md:    0 8px 32px rgba(20, 50, 10, 0.13);
  --shadow-lg:    0 20px 60px rgba(20, 50, 10, 0.18);

  /* ── Radius ── */
  --r-sm:   8px;
  --r-md:   14px;
  --r-lg:   20px;
  --r-pill: 100px;

  /* ── Blur ── */
  --blur-sm: blur(12px);
  --blur-md: blur(20px);
  --blur-lg: blur(32px);

  /* Legacy aliases so existing JS templates keep working */
  --panel:      var(--glass);
  --panel-soft: rgba(240, 248, 234, 0.70);
  --coral:      #4a9038;
  --coral-soft: rgba(100, 200, 80, 0.18);
  --lavender:   rgba(80, 160, 200, 0.20);
  --amber:      #1e6828;
  --shadow:     var(--shadow-md);
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

svg {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor;
  stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.9;
  flex-shrink: 0;
}

/* ── Body & background ───────────────────────────────────── */
html { min-width: 320px; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle, rgba(30, 80, 20, 0.07) 1px, transparent 1px);
  background-size: 26px 26px;
}

/* ── App shell ───────────────────────────────────────────── */
.app-root { min-height: 100vh; }

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 20px;
  height: 100vh;
  padding: 20px 14px;
  background: rgba(10, 20, 8, 0.94);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border-right: 1px solid rgba(80, 160, 60, 0.16);
  box-shadow: 4px 0 24px rgba(10, 30, 5, 0.20);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, #2a7030, #1a4f1e);
  color: #b8f0a0;
  font-weight: 900;
  font-size: 15px;
  box-shadow: 0 0 16px rgba(42, 112, 48, 0.50);
}

.brand strong { display: block; font-size: 14px; color: #c8edb8; }
.brand small  { color: rgba(180, 230, 160, 0.50); font-size: 11px; }

.main-nav {
  display: grid;
  align-content: start;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  padding: 0 12px;
  color: rgba(190, 230, 170, 0.55);
  font-weight: 700;
  font-size: 13.5px;
  transition: background 160ms, color 160ms, border-color 160ms, box-shadow 160ms;
}

.nav-item:hover {
  background: rgba(255,255,255,0.07);
  color: rgba(210, 245, 190, 0.90);
}

.nav-item.active {
  background: rgba(80, 200, 80, 0.14);
  border-color: rgba(100, 220, 100, 0.22);
  color: #a0f080;
  box-shadow: 0 0 12px rgba(80, 200, 80, 0.18);
}

.nav-item.active .nav-icon {
  background: rgba(80, 200, 80, 0.20);
  color: #80f060;
}

.nav-icon {
  display: inline-grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  color: currentColor;
  flex-shrink: 0;
}

.profile-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border: 1px solid rgba(100, 200, 80, 0.14);
  border-radius: var(--r-pill);
  padding: 4px 12px 4px 6px;
  background: rgba(255, 255, 255, 0.06);
}

.profile-chip > span {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(80, 200, 80, 0.18);
  color: #90f070;
  font-weight: 900;
  font-size: 13px;
}

.profile-chip strong { color: #c8edb8; font-size: 13px; }
.profile-chip small  { color: rgba(180,230,160,0.45); font-size: 11px; }

.logout-button { width: 100%; background: transparent; cursor: pointer; }

/* ── Main panel ──────────────────────────────────────────── */
.main-panel { min-width: 0; padding: 22px; }

/* ── Topbar ──────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  margin-bottom: 20px;
}

.page-title p  { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; }
.page-title h1 { margin-top: 3px; font-size: 30px; line-height: 1.1; font-weight: 900; }

.top-actions { display: flex; align-items: center; gap: 10px; }

/* ── Global search dropdown ──────────────────────────────── */
.search-field-wrap { position: relative; }
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: min(420px, 60vw);
  max-height: 60vh;
  overflow-y: auto;
  z-index: 60;
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  background: rgba(255,255,255,0.97);
  backdrop-filter: var(--blur-md);
  box-shadow: 0 18px 40px rgba(20,45,15,0.18);
}
.search-results[hidden] { display: none; }
.search-group { font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); padding: 6px 8px 2px; }
.search-empty { padding: 12px 8px; color: var(--muted); font-size: 13px; }
.search-item {
  display: grid;
  gap: 2px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.search-item:hover { background: rgba(36,118,79,0.10); border-color: rgba(36,118,79,0.18); }
.search-item strong { font-size: 13px; font-weight: 800; color: var(--ink); }
.search-item small { font-size: 12px; color: var(--muted); }

/* ── Notifications bell ──────────────────────────────────── */
.notif-wrap { position: relative; }
.notif-bell { position: relative; }
.notif-badge {
  position: absolute;
  top: -1px; right: -1px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #2a7030;
  border: 2px solid var(--surface, #f3f6ef);
  box-shadow: 0 0 0 1px rgba(42,112,48,0.25);
}
.notif-badge[hidden] { display: none; }
.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(360px, 80vw);
  max-height: 70vh;
  overflow-y: auto;
  z-index: 60;
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  background: rgba(255,255,255,0.97);
  backdrop-filter: var(--blur-md);
  box-shadow: 0 18px 40px rgba(20,45,15,0.18);
}
.notif-panel[hidden] { display: none; }
.notif-empty { padding: 12px 8px; color: var(--muted); font-size: 13px; text-align: center; }
.notif-item { display: flex; gap: 10px; padding: 9px 10px; border-radius: 9px; }
.notif-item.unread { background: rgba(36,118,79,0.08); }
.notif-item p { font-size: 13px; color: var(--ink); line-height: 1.4; }
.notif-item small { font-size: 11px; color: var(--muted); }
.notif-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; background: var(--muted); }
.notif-dot.notif-delivered { background: #14823c; }
.notif-dot.notif-accepted { background: #2864c8; }
.notif-dot.notif-problem { background: #b06a14; }
.notif-dot.notif-no_courier { background: #b52525; }

/* ── Glass panel ─────────────────────────────────────────── */
.panel, .login-card, .detail-panel {
  background: var(--glass);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  box-shadow: var(--glass-inner), var(--shadow-sm);
}

.panel { padding: 20px; }
.panel.full { min-height: calc(100vh - 120px); }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.eyebrow {
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.panel h2, .detail-panel h2 {
  margin-top: 4px;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 800;
}

/* ── Buttons ─────────────────────────────────────────────── */
.primary-button,
.ghost-button,
.icon-button,
.tabs button,
.segmented-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 800;
  transition: box-shadow 140ms, transform 120ms, background 140ms;
}

.primary-button {
  min-height: 42px;
  padding: 0 18px;
  background: linear-gradient(160deg, #2e7a28, #1a5018);
  border-color: #0e3210;
  color: #b8f0a0;
  box-shadow: 0 2px 0 #081a04, 0 4px 14px rgba(20, 80, 10, 0.30);
}

.primary-button:hover:not(:disabled) {
  background: linear-gradient(160deg, #368030, #1e5c1c);
  box-shadow: 0 3px 0 #081a04, 0 6px 20px rgba(20, 80, 10, 0.38);
  transform: translateY(-1px);
}

.primary-button:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 1px 0 #081a04, 0 2px 6px rgba(20,80,10,0.15);
}

.primary-button.compact { min-height: 36px; padding: 0 14px; font-size: 13px; }
.primary-button:disabled { opacity: 0.55; cursor: wait; }

.ghost-button {
  min-height: 36px;
  padding: 0 14px;
  background: var(--glass);
  backdrop-filter: var(--blur-sm);
  border-color: var(--glass-border);
  color: var(--ink);
  box-shadow: var(--glass-inner), var(--shadow-xs);
}

.ghost-button:hover { background: rgba(255,255,255,0.90); box-shadow: var(--glass-inner), var(--shadow-sm); }
.ghost-button.compact { min-height: 32px; padding: 0 12px; font-size: 13px; }
.ghost-button.danger  { color: #a02020; border-color: rgba(200,80,80,0.25); }

.icon-button {
  width: 38px; height: 38px;
  padding: 0;
  background: var(--glass);
  border-color: var(--glass-border);
  color: var(--ink);
  box-shadow: var(--glass-inner), var(--shadow-xs);
  border-radius: var(--r-sm);
}

.icon-button.danger { color: #b82020; border-color: rgba(180,60,60,0.22); }
.icon-button.danger:hover { background: rgba(255,220,220,0.60); }

/* ── Search field ────────────────────────────────────────── */
.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(300px, 26vw);
  height: 38px;
  border: 1px solid var(--glass-border);
  border-radius: var(--r-pill);
  padding: 0 14px;
  background: var(--glass);
  backdrop-filter: var(--blur-sm);
  color: var(--muted);
  box-shadow: var(--glass-inner), var(--shadow-xs);
}

.search-field input {
  height: 34px;
  border: 0;
  padding: 0;
  background: transparent;
  outline: none;
  color: var(--ink);
  width: 100%;
}

/* ── Tabs ────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--glass-border);
  border-radius: var(--r-pill);
  background: rgba(255,255,255,0.35);
}

.tabs button {
  min-height: 30px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}

.tabs button.active {
  background: var(--glass-strong);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}

/* ── KPI grid ────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 14px;
  margin-bottom: 0;
}

.kpi-grid article {
  min-height: 110px;
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  background: var(--glass);
  backdrop-filter: var(--blur-sm);
  box-shadow: var(--glass-inner), var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.kpi-grid article::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #2a7030, #60c050);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}

.kpi-grid span, .kpi-grid small { color: var(--muted); font-size: 12px; font-weight: 700; }

.kpi-grid strong {
  display: block;
  margin: 8px 0 3px;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  color: var(--ink);
}

/* ── Orders / Dashboard page ─────────────────────────────── */
.orders-page, .dashboard-page { display: grid; gap: 18px; }

.orders-page {
  height: calc(100vh - 136px);
  min-height: 520px;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0,1fr) 360px;
  gap: 18px;
  align-items: start;
}

.orders-page .workspace-grid {
  height: 100%;
  min-height: 0;
  align-items: stretch;
}

.workspace-grid.detail-hidden { grid-template-columns: 1fr; }
.workspace-grid.detail-hidden #detail-panel { display: none; }

.content-stack { display: grid; gap: 18px; }

.orders-page .content-stack {
  min-height: 0;
}

.orders-kanban-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

/* ── Kanban ──────────────────────────────────────────────── */
.kanban-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(160px, 1fr);
  gap: 12px;
  padding: 16px;
  background: rgba(255,255,255,0.22);
  border-radius: var(--r-md);
  border: 1px solid rgba(255,255,255,0.50);
}

.orders-page .kanban-board {
  min-height: 0;
  overflow-x: auto;
}

.kanban-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: hidden;
}

.kanban-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--r-md);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid transparent;
}

.col-new       { background: rgba(200,170,40,0.18);  border-color: rgba(200,170,40,0.30); color: #6a4e00; }
.col-confirmed { background: rgba(40,160,80,0.18);   border-color: rgba(40,160,80,0.30);  color: #0c4020; }
.col-delivery  { background: rgba(40,100,200,0.18);  border-color: rgba(40,100,200,0.30); color: #0c2460; }
.col-delivered { background: rgba(20,130,60,0.18);   border-color: rgba(20,130,60,0.30);  color: #082e18; }
.col-problem   { background: rgba(190,110,20,0.18);  border-color: rgba(190,110,20,0.30); color: #673500; }
.dispatch-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.dispatch-actions .ghost-button, .dispatch-actions .primary-button { flex: 1; min-width: 160px; }
.col-cancelled { background: rgba(180,40,40,0.16);   border-color: rgba(180,40,40,0.28);  color: #5a0a0a; }

.kanban-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px; height: 20px;
  border-radius: 6px;
  background: rgba(0,0,0,0.10);
  font-size: 11px;
}

.kanban-cards {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 6px;
  min-height: 0;
}

.orders-page .kanban-cards {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-width: thin;
}

.orders-page .kanban-cards::-webkit-scrollbar { width: 7px; }
.orders-page .kanban-cards::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(35, 49, 30, 0.28);
}

.kanban-card {
  border: 1px solid rgba(255,255,255,0.65);
  border-radius: var(--r-md);
  padding: 11px 13px;
  background: rgba(255,255,255,0.62);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: box-shadow 150ms, border-color 150ms, transform 150ms;
  outline: none;
}

.kanban-card:hover {
  border-color: rgba(255,255,255,0.90);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.kanban-card.active {
  border-color: rgba(42,112,48,0.60);
  background: rgba(200,250,190,0.55);
  box-shadow: 0 0 0 2px rgba(42,112,48,0.25), var(--shadow-sm);
}

.kanban-card:focus-visible {
  box-shadow: 0 0 0 3px rgba(42,112,48,0.40);
}

.kanban-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.kanban-num   { font-size: 11px; font-weight: 900; color: var(--accent); }
.kanban-price { font-size: 13px; font-weight: 900; }
.kanban-addr  { font-size: 12px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.kanban-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}

.kanban-client { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kanban-time   { font-size: 10px; color: var(--muted); white-space: nowrap; }
.kanban-empty  { padding: 14px 0; text-align: center; color: var(--muted); font-size: 12px; }

/* ── Detail panel ────────────────────────────────────────── */
.detail-panel {
  position: sticky;
  top: 22px;
  padding: 20px;
}

.orders-page .detail-panel {
  position: relative;
  top: auto;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.detail-close-btn {
  position: absolute;
  top: 14px; right: 14px;
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  border: 1px solid var(--glass-border);
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.50);
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: background 140ms;
}

.detail-close-btn:hover { background: rgba(255,255,255,0.90); color: var(--ink); }

.detail-head {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(0,0,0,0.07);
}

.detail-head p { margin-top: 6px; font-size: 13px; color: var(--muted); }

.detail-list { display: grid; gap: 10px; margin: 14px 0; }
.detail-list div { display: grid; gap: 2px; }
.detail-list dt  { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; }
.detail-list dd  { margin: 0; font-weight: 700; font-size: 13px; }

.items-list {
  display: grid;
  gap: 7px;
  padding: 12px 0;
  border-top: 1px solid rgba(0,0,0,0.07);
  border-bottom: 1px solid rgba(0,0,0,0.07);
}

.items-list div, .total-line { display: flex; justify-content: space-between; gap: 12px; }
.items-list span { color: var(--muted); font-size: 13px; }

.total-line {
  align-items: center;
  margin-top: 12px;
  font-size: 17px;
  font-weight: 800;
}

.assign-courier {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(0,0,0,0.07);
}

.assign-courier-inline {
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 12px;
  border-top: 0;
  border-bottom: 1px solid rgba(0,0,0,0.07);
}

.assign-courier-inline > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.assign-courier-inline span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.assign-courier-inline strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 13px;
}

.assign-courier-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: var(--accent);
}

.assign-courier-icon svg {
  width: 17px;
  height: 17px;
}

.assign-courier label {
  flex: 1;
  display: grid;
  gap: 5px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.assign-courier select {
  height: 36px;
  border: 1px solid rgba(255,255,255,0.70);
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.55);
  padding: 0 10px;
  outline: none;
}

.assign-courier-modal-card {
  width: min(420px, 100%);
}

.assign-courier-modal-subtitle {
  margin: 2px 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.courier-select-wrap {
  position: relative;
  display: block;
}

.courier-select-wrap > select {
  display: none;
}

.courier-select-wrap::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 23px;
  width: 8px;
  height: 8px;
  border-right: 2px solid #1f3e2b;
  border-bottom: 2px solid #1f3e2b;
  pointer-events: none;
  transform: translateY(-65%) rotate(45deg);
  transition: transform 160ms ease, border-color 160ms ease;
}

.courier-select-wrap.open::after {
  border-color: var(--accent);
  transform: translateY(-35%) rotate(225deg);
}

.courier-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 46px;
  padding: 0 46px 0 16px;
  border-radius: 13px;
  border: 1px solid rgba(36,118,79,0.28);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(246,249,243,0.92));
  color: var(--ink);
  font-weight: 850;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72), 0 8px 18px rgba(25,45,20,0.06);
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease, transform 160ms ease;
}

.courier-select-trigger:hover {
  border-color: rgba(36,118,79,0.42);
  background:
    linear-gradient(180deg, rgba(255,255,255,1), rgba(241,248,238,0.98));
}

.courier-select-trigger:focus,
.courier-select-wrap.open .courier-select-trigger {
  border-color: rgba(36,118,79,0.62);
  box-shadow: 0 0 0 3px rgba(36,118,79,0.14), 0 10px 24px rgba(25,60,35,0.08);
  outline: none;
}

.courier-select-trigger span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.courier-select-menu {
  display: grid;
  gap: 4px;
  max-height: 0;
  margin-top: 0;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: rgba(250,252,247,0.98);
  box-shadow: 0 0 0 rgba(25,45,20,0);
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  scrollbar-width: thin;
  transition:
    max-height 220ms ease,
    margin-top 180ms ease,
    padding 180ms ease,
    opacity 160ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.courier-select-wrap.open .courier-select-menu {
  max-height: 168px;
  margin-top: 7px;
  padding: 6px;
  border-color: rgba(36,118,79,0.24);
  box-shadow: 0 16px 34px rgba(25,45,20,0.16);
  opacity: 1;
  pointer-events: auto;
  overflow-y: auto;
}

.courier-select-option {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  text-align: left;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.courier-select-option:hover {
  background: rgba(36,118,79,0.10);
  border-color: rgba(36,118,79,0.18);
  transform: translateX(1px);
}

.courier-select-option.active {
  background: linear-gradient(135deg, #24764f, #1d6a55);
  border-color: rgba(36,118,79,0.50);
  color: #fff;
}

.modal-actions.assign-courier-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-top: 8px;
}

.modal-actions.assign-courier-actions .ghost-button,
.modal-actions.assign-courier-actions .primary-button {
  width: 100%;
  min-height: 43px;
  border-radius: 12px;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.segmented-actions {
  display: grid;
  grid-template-columns: repeat(2,1fr);
  gap: 6px;
  margin-top: 14px;
}

.segmented-actions button {
  min-height: 35px;
  border-radius: var(--r-sm);
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.55);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background 140ms, box-shadow 140ms;
}

.segmented-actions button:hover { background: rgba(255,255,255,0.90); box-shadow: var(--shadow-xs); }
.segmented-actions button.active-status { background: rgba(40,160,80,0.18); border-color: rgba(40,160,80,0.40); color: #0c4020; }

/* Animation */
@keyframes slideIn {
  from { opacity: 0; transform: translateX(14px); }
  to   { opacity: 1; transform: translateX(0); }
}
.panel-slide-in { animation: slideIn 180ms ease; }

/* ── Status pills ────────────────────────────────────────── */
.status-pill {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  border-radius: var(--r-pill);
  padding: 0 10px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.status-new, .status-confirmed { background: rgba(40,160,80,0.18); color: #0a4018; border: 1px solid rgba(40,160,80,0.28); }
.status-in-delivery             { background: rgba(40,100,200,0.16); color: #0a2460; border: 1px solid rgba(40,100,200,0.28); }
.status-delivered               { background: rgba(20,130,60,0.18);  color: #062e14; border: 1px solid rgba(20,130,60,0.28); }
.status-cancelled               { background: rgba(180,40,40,0.14);  color: #5a0a0a; border: 1px solid rgba(180,40,40,0.24); }
.status-problem                 { background: rgba(190,110,20,0.16); color: #673500; border: 1px solid rgba(190,110,20,0.28); }
.status-unfinished              { background: rgba(110,110,120,0.18); color: #33343a; border: 1px solid rgba(110,110,120,0.30); }
.shift-resolve { display: inline-flex; gap: 6px; margin-top: 6px; }
.shift-resolve-btn { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 7px; border: 1px solid transparent; cursor: pointer; }
.shift-resolve-btn.ok { background: rgba(20,130,60,0.14); color: #062e14; border-color: rgba(20,130,60,0.28); }
.shift-resolve-btn.danger { background: rgba(180,40,40,0.12); color: #5a0a0a; border-color: rgba(180,40,40,0.24); }
.shift-resolve-btn:disabled { opacity: 0.5; cursor: default; }

/* ── Dashboard grid ──────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 320px minmax(0,1fr);
  gap: 14px;
  align-items: stretch;
}

.dashboard-grid > .panel {
  height: 100%;
}

.dashboard-page { gap: 14px; }

.dashboard-page .panel { padding: 18px; }

.status-bars { display: grid; gap: 10px; }

.status-bar-row {
  display: grid;
  grid-template-columns: 100px 1fr 28px;
  align-items: center;
  gap: 10px;
}

.status-bar-label { font-size: 12px; font-weight: 700; color: var(--muted); }

.status-bar-track {
  height: 7px;
  border-radius: 4px;
  background: rgba(0,0,0,0.08);
  overflow: hidden;
}

.status-bar-fill { height: 100%; border-radius: 4px; transition: width 400ms ease; }
.status-bar-fill.col-new         { background: #b09020; }
.status-bar-fill.col-confirmed   { background: #28a050; }
.status-bar-fill.col-delivery    { background: #2864c8; }
.status-bar-fill.col-delivered   { background: #14823c; }
.status-bar-fill.col-cancelled   { background: #b82020; }
.status-bar-count { font-size: 12px; font-weight: 900; text-align: right; }

.dashboard-footnote {
  display: flex;
  gap: 16px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(0,0,0,0.08);
  font-size: 12px;
  color: var(--muted);
}
.dashboard-footnote strong { color: var(--ink); }

.dashboard-ops-strip {
  display: grid;
  grid-template-columns: 1.25fr repeat(4, minmax(150px, 1fr));
  gap: 10px;
}

.dashboard-ops-strip article {
  min-height: 86px;
  padding: 14px;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 8px;
  background: rgba(255,255,255,0.48);
  box-shadow: 0 10px 24px rgba(25,45,20,0.06);
}

.dashboard-ops-strip span,
.dashboard-card-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-ops-strip strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.05;
}

.dashboard-ops-strip small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-shift-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-shift-card.open {
  background: linear-gradient(135deg, rgba(42,112,48,0.16), rgba(255,255,255,0.62));
}

.dashboard-shift-card.closed {
  background: linear-gradient(135deg, rgba(180,40,40,0.10), rgba(255,255,255,0.62));
}

.dashboard-grid-wide { grid-template-columns: minmax(0,1.05fr) minmax(360px,0.8fr); }
.dashboard-grid-main { grid-template-columns: minmax(0,1fr) minmax(360px,0.6fr); }

.status-bar-fill.col-preparing { background: #7a58b8; }
.status-bar-fill.col-problem   { background: #b06a14; }

.dashboard-alerts { display: grid; gap: 10px; }

.dashboard-alert {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.45);
}

.dashboard-alert strong { font-size: 13px; color: var(--ink); }
.dashboard-alert span { font-size: 12px; color: var(--muted); line-height: 1.45; }
.dashboard-alert.danger { border-color: rgba(180,40,40,0.26); background: rgba(180,40,40,0.08); }
.dashboard-alert.warn   { border-color: rgba(176,106,20,0.28); background: rgba(176,106,20,0.09); }
.dashboard-alert.info   { border-color: rgba(40,100,200,0.24); background: rgba(40,100,200,0.08); }

.dashboard-chart { height: 220px; }

.dashboard-top-products {
  display: grid;
  gap: 8px;
}

.dashboard-product-row {
  display: grid;
  grid-template-columns: 24px minmax(0,1fr) 54px 78px;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.dashboard-product-row:last-child { border-bottom: 0; }
.dashboard-product-row > span:first-child {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(42,112,48,0.12);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}
.dashboard-product-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.dashboard-product-row small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}
.dashboard-product-row b {
  color: var(--ink);
  font-size: 13px;
  text-align: right;
}

.recent-orders { display: grid; gap: 0; }

.recent-order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.recent-order-row:last-child { border-bottom: 0; }

.recent-order-main { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.recent-order-id   { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-order-client { font-size: 12px; color: var(--muted); white-space: nowrap; }
.recent-order-meta   { display: grid; justify-items: end; gap: 1px; flex-shrink: 0; }
.recent-order-meta strong { font-size: 13px; }
.recent-order-meta small  { color: var(--muted); font-size: 11px; }

/* ── Login ───────────────────────────────────────────────── */
.login-page {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(360px,440px);
  gap: 24px;
  width: min(1100px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 32px 0;
  align-items: stretch;   /* однакова висота обох карток */
  align-content: center;  /* і блок вертикально по центру екрана */
}

.login-visual {
  min-height: 560px;
  padding: 44px;
  border-radius: var(--r-lg);
  border: 1px solid rgba(255,255,255,0.30);
  background: linear-gradient(145deg, #0f2010 0%, #1a3c18 55%, #2a5824 100%);
  box-shadow: var(--shadow-lg);
  display: grid;
  align-content: end;
  gap: 16px;
}

.login-visual h1   { font-size: 50px; line-height: 1; color: #c8f0a8; }
.login-visual p    { max-width: 500px; color: rgba(180,230,150,0.65); font-size: 17px; line-height: 1.55; }

.login-metrics { display: flex; flex-wrap: wrap; gap: 8px; }

.login-metrics span, .soft-chip {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: var(--r-pill);
  padding: 0 12px;
  background: rgba(80,200,80,0.18);
  border: 1px solid rgba(100,220,100,0.25);
  color: #90e870;
  font-size: 12px;
  font-weight: 800;
}

/* Плашка категорії на картках каталогу — темно-зелений текст для читабельності */
.catalog-card .soft-chip {
  background: rgba(36,118,79,0.12);
  border-color: rgba(36,118,79,0.24);
  color: #1a5018;
}

.login-card { padding: 32px; border-radius: var(--r-lg); }

.login-form { display: grid; gap: 14px; margin-top: 22px; }

.login-form label, .modal-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.login-form input, .login-form select,
.search-field input,
.modal-card input, .modal-card select, .modal-card textarea {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.70);
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.55);
  color: var(--ink);
  outline: none;
}

.login-form input, .login-form select { height: 44px; padding: 0 14px; }
.modal-card input, .modal-card select { height: 42px; padding: 0 12px; }
.modal-card textarea { padding: 10px 12px; resize: vertical; height: 110px; min-height: 80px; max-height: 260px; }

.login-form input:focus, .login-form select:focus,
.modal-card input:focus, .modal-card select:focus, .modal-card textarea:focus,
.search-field:focus-within {
  border-color: rgba(42,112,48,0.60);
  background: rgba(255,255,255,0.80);
  box-shadow: 0 0 0 3px rgba(42,112,48,0.16);
}

.form-note        { color: var(--muted); font-size: 12px; line-height: 1.45; }
.form-note.error  { color: #b82020; min-height: 16px; }

/* ── Modals ──────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(10,26,6,0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal-backdrop[hidden] { display: none; }

.modal-card {
  position: relative;
  width: min(520px,100%);
  max-height: 90vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(255,255,255,0.80);
  border-radius: var(--r-lg);
  padding: 28px;
  background: rgba(255,255,255,0.88);
  backdrop-filter: var(--blur-md);
  box-shadow: var(--glass-inner), var(--shadow-lg);
  display: grid;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(36,118,79,0.40) transparent;
}
.modal-card::-webkit-scrollbar { width: 10px; }
.modal-card::-webkit-scrollbar-track { background: transparent; }
.modal-card::-webkit-scrollbar-thumb {
  background: rgba(36,118,79,0.32);
  border: 3px solid transparent;
  background-clip: padding-box;
  border-radius: 999px;
}
.modal-card::-webkit-scrollbar-thumb:hover { background: rgba(36,118,79,0.55); background-clip: padding-box; }

.modal-card .eyebrow { font-size: 12px; }
.modal-card form     { display: grid; gap: 13px; }

.modal-card-wide { width: min(740px,100%); }

.checkbox-label { display: flex !important; flex-direction: row !important; align-items: center; gap: 10px !important; text-transform: none !important; letter-spacing: 0 !important; }
.checkbox-label input[type="checkbox"] { width: 16px; height: 16px; flex-shrink: 0; }

.modal-actions { display: flex; gap: 10px; padding-top: 4px; }

.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border: 1px solid rgba(255,255,255,0.70);
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.55);
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: background 140ms;
}
.modal-close:hover { background: rgba(255,255,255,0.95); color: var(--ink); }

/* Code modal */
.code-modal {
  position: relative;
  width: min(420px,100%);
  border: 1px solid rgba(255,255,255,0.80);
  border-radius: var(--r-lg);
  padding: 28px;
  background: rgba(255,255,255,0.88);
  backdrop-filter: var(--blur-md);
  box-shadow: var(--glass-inner), var(--shadow-lg);
}

.code-modal h2   { margin-top: 6px; font-size: 22px; }
.modal-copy      { margin-top: 10px; color: var(--muted); line-height: 1.5; }

.code-form { display: grid; gap: 12px; margin-top: 18px; }

.code-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.code-form input {
  width: 100%;
  height: 52px;
  border: 1px solid rgba(255,255,255,0.70);
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.55);
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-align: center;
  outline: none;
}

.code-form input:focus {
  border-color: rgba(42,112,48,0.60);
  box-shadow: 0 0 0 3px rgba(42,112,48,0.16);
  background: rgba(255,255,255,0.85);
}

/* ── Modern auth (login) card ────────────────────────────── */
.auth-card {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: center;   /* контент по центру по вертикалі — рівняється з лівою карткою */
  gap: 4px;
  padding: 44px 38px;
  background: linear-gradient(170deg, rgba(255,255,255,0.92), rgba(236,247,230,0.72));
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-inner), var(--shadow-lg);
}
/* М’яке зелене сяйво у кутку картки */
.auth-card::before {
  content: "";
  position: absolute;
  top: -90px; right: -70px;
  width: 240px; height: 240px;
  background: radial-gradient(circle, var(--green-glow), transparent 70%);
  pointer-events: none;
}

.auth-head { position: relative; display: grid; gap: 8px; }

.auth-badge {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  background: var(--mint);
  border: 1px solid rgba(100,220,100,0.30);
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.auth-head h2 { font-size: 27px; line-height: 1.15; letter-spacing: -0.01em; }
.auth-sub     { color: var(--muted); font-size: 14px; line-height: 1.5; max-width: 38ch; }

.auth-form { gap: 18px; margin-top: 26px; }

.auth-form .field { display: grid; gap: 8px; }
.auth-form .field-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
/* Підказка та значення поля — звичайний регістр (не успадковуємо uppercase від label) */
.auth-form .field-hint {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
  min-height: 16px;
  text-transform: none;
  letter-spacing: 0;
  transition: color 160ms;
}
.auth-form .phone-input { text-transform: none; letter-spacing: 0; }

/* Поле телефону з адорнментами */
.phone-input {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 54px;
  padding: 0 16px;
  border: 1.5px solid rgba(36,118,79,0.30);
  border-radius: var(--r-md);
  background: #ffffff;
  box-shadow: var(--shadow-xs);
  transition: border-color 160ms, box-shadow 160ms, background 160ms;
}
.phone-input:focus-within {
  border-color: rgba(42,112,48,0.60);
  background: rgba(255,255,255,0.85);
  box-shadow: 0 0 0 3px rgba(42,112,48,0.16);
}
.phone-input.is-valid   { border-color: rgba(42,112,48,0.55); }
.phone-input.is-invalid { border-color: rgba(200,70,70,0.55); box-shadow: 0 0 0 3px rgba(200,70,70,0.12); }

.auth-form .phone-input input {
  flex: 1;
  height: 100%;
  border: none;
  border-radius: 0;
  background: transparent;
  outline: none;
  box-shadow: none;
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.auth-form .phone-input input:focus { box-shadow: none; background: transparent; }
.auth-form .phone-input input::placeholder { color: rgba(74,94,64,0.55); font-weight: 600; letter-spacing: normal; }

/* Зелена галочка з’являється, коли номер коректний */
.phone-check {
  display: grid;
  place-items: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 160ms, transform 160ms;
}
.phone-input.is-valid .phone-check { opacity: 1; transform: scale(1); }

.auth-form .form-note { text-align: center; }

.auth-submit {
  width: 100%;
  min-height: 52px;
  font-size: 15px;
  letter-spacing: 0.01em;
}
.auth-submit.is-loading { pointer-events: none; opacity: 0.7; }
.auth-submit.is-loading span::after {
  content: "";
  display: inline-block;
  width: 14px; height: 14px;
  margin-left: 8px;
  vertical-align: -2px;
  border: 2px solid rgba(255,255,255,0.55);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin 700ms linear infinite;
}
@keyframes auth-spin { to { transform: rotate(360deg); } }

/* ── Catalog filters ─────────────────────────────────────── */
.catalog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: var(--blur-sm);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 120ms ease, box-shadow 140ms ease;
}
.filter-chip:hover { background: rgba(255,255,255,0.92); transform: translateY(-1px); box-shadow: var(--shadow-xs); }
.filter-chip.active {
  background: linear-gradient(135deg, #24764f, #1d6a55);
  border-color: rgba(36,118,79,0.50);
  color: #fff;
}
.filter-chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: 9px;
  background: rgba(25,45,20,0.10);
  font-size: 11px;
  font-weight: 900;
}
.filter-chip.active .filter-chip-count { background: rgba(255,255,255,0.26); color: #fff; }

/* ── Categories modal ────────────────────────────────────── */
.modal-card .modal-title { font-size: 20px; font-weight: 900; line-height: 1.2; }
.category-list {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(36,118,79,0.40) transparent;
}
.category-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  background: rgba(255,255,255,0.55);
}
.category-row strong { font-weight: 800; }

/* ── Promotions (discounts) ──────────────────────────────── */
.promo-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.promo-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.promo-discount-badge {
  display: inline-flex; align-items: center; min-height: 22px; padding: 0 9px;
  border-radius: var(--r-pill); background: linear-gradient(135deg, #24764f, #1d6a55);
  color: #fff; font-size: 12px; font-weight: 900;
}
.promo-min-badge {
  display: inline-flex; align-items: center; min-height: 22px; padding: 0 9px;
  border-radius: var(--r-pill); background: rgba(36,118,79,0.12); border: 1px solid rgba(36,118,79,0.24);
  color: #1a5018; font-size: 12px; font-weight: 800;
}
.promo-state-badge {
  display: inline-flex; align-items: center; min-height: 22px; padding: 0 9px;
  border-radius: var(--r-pill); font-size: 12px; font-weight: 800;
}
.promo-state-badge.on  { background: rgba(20,130,60,0.16); color: #062e14; border: 1px solid rgba(20,130,60,0.26); }
.promo-state-badge.off { background: rgba(120,120,120,0.16); color: #444; border: 1px solid rgba(120,120,120,0.28); }
.promo-card.promo-inactive { opacity: 0.7; }

/* Order modal: акція + розбивка суми */
.oc-promo { display: grid; gap: 6px; margin-top: 14px; }
.oc-promo-hint { color: #a82020; font-size: 12px; font-weight: 700; }
.oc-total-line { display: flex; align-items: center; justify-content: space-between; font-size: 14px; color: var(--muted); }
.oc-total-line.oc-total-final { margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--glass-border); color: var(--ink); font-size: 16px; }
.oc-total-line.oc-total-final strong { font-size: 18px; font-weight: 900; }
.oc-discount-line { color: #1a7a40; font-weight: 800; }

/* Order detail: рядки знижки */
.total-line.muted-line { color: var(--muted); font-weight: 600; }
.total-line.discount-line { color: #1a7a40; font-weight: 800; }

/* ── Catalog grid ────────────────────────────────────────── */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(250px,1fr));
  gap: 16px;
}

.catalog-card {
  border: 1px solid rgba(255,255,255,0.70);
  border-radius: var(--r-lg);
  background: var(--glass);
  backdrop-filter: var(--blur-sm);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 160ms, transform 160ms;
  outline: none;
}

.catalog-card:hover, .catalog-card:focus-visible {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.catalog-cover { position: relative; height: 200px; overflow: hidden; }
.catalog-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 240ms; }
.catalog-card:hover .catalog-cover img { transform: scale(1.05); }

.catalog-cover-placeholder {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(80,200,80,0.20), rgba(40,150,60,0.15));
}
.catalog-cover-placeholder span { font-size: 52px; font-weight: 900; color: var(--accent); line-height: 1; }

.catalog-avail-badge {
  position: absolute;
  top: 10px; right: 10px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 900;
}

.avail-yes { background: rgba(20,100,40,0.85); color: #b0f8c0; }
.avail-no  { background: rgba(120,20,20,0.82); color: #ffc0c0; }

.catalog-card-body { display: grid; gap: 5px; padding: 14px 16px; }
.catalog-card-body h3 { font-size: 15px; line-height: 1.3; font-weight: 800; }
.catalog-card-body p  { font-size: 12px; color: var(--muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.catalog-price { font-size: 16px; font-weight: 900; color: var(--ink); margin-top: 2px; }

/* Product detail modal */
.product-detail-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  align-items: start;
}

.product-detail-image {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--r-md);
  overflow: hidden;
  background: linear-gradient(135deg, rgba(80,200,80,0.20), rgba(40,150,60,0.15));
  display: grid;
  place-items: center;
}

.product-detail-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-detail-image span { font-size: 72px; font-weight: 900; color: var(--accent); line-height: 1; }

.product-detail-info { display: grid; gap: 12px; align-content: start; }
.product-detail-info h2 { font-size: 24px; line-height: 1.2; font-weight: 900; }
.detail-desc { color: var(--muted); line-height: 1.55; font-size: 14px; }

/* Product detail drawer (slides in from the right) */
.product-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 5, 0.32);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 220ms ease;
  z-index: 30;
}
.product-drawer-backdrop[hidden] { display: none; }
.product-drawer-backdrop.open { opacity: 1; }

.product-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(460px, 94vw);
  padding: 28px;
  background: var(--glass-strong);
  backdrop-filter: var(--blur-md);
  border-left: 1px solid var(--glass-border);
  box-shadow: -14px 0 48px rgba(20, 50, 10, 0.22);
  z-index: 35;
  transform: translateX(100%);
  transition: transform 260ms cubic-bezier(0.22, 0.8, 0.24, 1);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(36,118,79,0.40) transparent;
}
.product-drawer.open { transform: translateX(0); }
.product-drawer::-webkit-scrollbar { width: 10px; }
.product-drawer::-webkit-scrollbar-thumb {
  background: rgba(36,118,79,0.32);
  border: 3px solid transparent;
  background-clip: padding-box;
  border-radius: 999px;
}
.product-drawer .product-detail-layout {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  gap: 18px;
}
.product-drawer .product-detail-image { max-width: 280px; margin: 0 auto; }
.product-drawer .product-detail-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
/* Ціна + кнопки притиснуті донизу панелі */
.product-drawer .detail-meta { margin-top: auto; padding-top: 16px; }
.product-drawer .detail-desc { font-size: 16px; line-height: 1.6; color: var(--ink); }
.product-drawer .product-detail-info > .eyebrow {
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: rgba(36,118,79,0.12);
  border: 1px solid rgba(36,118,79,0.22);
  color: #1a5018;
  font-weight: 800;
}

.detail-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid rgba(0,0,0,0.08);
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.detail-price { font-size: 26px; font-weight: 900; }
.catalog-avail { font-size: 12px; font-weight: 900; }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.available   { color: var(--accent); font-weight: 900; }
.unavailable { color: #a02020; font-weight: 900; }

/* ── Categories, Promotions ──────────────────────────────── */
.category-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 12px; }

.category-card {
  min-height: 140px;
  padding: 18px;
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  background: var(--glass);
  backdrop-filter: var(--blur-sm);
}

.category-card h3 { font-size: 16px; }
.category-card p  { color: var(--muted); font-size: 13px; }

.category-card .nav-icon {
  margin-bottom: 16px;
  background: rgba(80,200,80,0.16);
  color: var(--accent);
}

.promo-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }

.promo-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  min-height: 170px;
  padding: 18px;
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  background: var(--glass);
  backdrop-filter: var(--blur-sm);
}

.promo-card h3 { font-size: 17px; }
.promo-card p  { color: var(--muted); line-height: 1.45; font-size: 13px; }

.promo-art {
  display: grid;
  place-items: center;
  width: 68px; height: 68px;
  border-radius: var(--r-md);
  background: rgba(80,200,80,0.16);
  color: var(--accent);
  flex: 0 0 auto;
}
.promo-art svg { width: 30px; height: 30px; }

/* ── Data tables ─────────────────────────────────────────── */
.data-table { display: grid; border: 1px solid rgba(255,255,255,0.65); border-radius: var(--r-md); overflow: hidden; }

.table-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 16px;
  background: rgba(255,255,255,0.52);
  border-bottom: 1px solid rgba(255,255,255,0.65);
}

.table-row > * { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-row > .row-actions { flex: 0 0 auto; }
.table-row select { width: 100%; max-width: 130px; }

.table-row:last-child { border-bottom: 0; }
.table-head { min-height: 40px; background: rgba(255,255,255,0.35); color: var(--muted); font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.05em; }

.shifts-table .table-row {
  display: grid;
  grid-template-columns: 100px 140px minmax(150px, 1fr) minmax(150px, 1fr) minmax(150px, 1fr) 110px 110px;
  gap: 14px;
}

.shifts-table .table-row > * {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shifts-table .table-row > :nth-child(6) {
  text-align: right;
}

.shifts-table .row-actions {
  justify-content: flex-end;
}

/* ── Roles ───────────────────────────────────────────────── */
.role-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.role-panel { min-height: 220px; }
.role-panel .nav-icon { margin-bottom: 16px; background: rgba(80,200,80,0.16); color: var(--accent); }

/* ── Misc ────────────────────────────────────────────────── */
.empty-state { padding: 32px 0; text-align: center; color: var(--muted); }
.orders-list { display: grid; gap: 10px; }
.card-actions { display: flex; gap: 8px; margin-top: 12px; }
.row-actions  { display: flex; gap: 8px; }
.error-page   { display: grid; min-height: 100vh; place-items: center; padding: 24px; }

.product-strip {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 10px;
}

.product-mini {
  display: flex;
  gap: 10px;
  min-height: 68px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.65);
  border-radius: var(--r-md);
  background: rgba(255,255,255,0.52);
}

.product-art {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  flex: 0 0 auto;
  border-radius: var(--r-sm);
  background: rgba(80,200,80,0.16);
  color: var(--accent);
  font-weight: 900;
}

.product-mini span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }

/* ── Create order overlay ────────────────────────────────── */
.order-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--bg);
  background-image: radial-gradient(circle, rgba(30,80,20,0.07) 1px, transparent 1px);
  background-size: 26px 26px;
}

.order-overlay[hidden] { display: none; }

.order-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: rgba(10,20,8,0.94);
  backdrop-filter: var(--blur-md);
  border-bottom: 1px solid rgba(80,160,60,0.18);
  box-shadow: 0 4px 24px rgba(10,30,5,0.24);
}

.oc-header-eyebrow {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(180,230,150,0.55);
  margin: 0 0 2px;
}

.oc-header-title { font-size: 19px; color: #c8f0a8; margin: 0; font-weight: 900; }

.oc-header-close {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(200,240,170,0.18);
  background: rgba(255,255,255,0.07);
  color: rgba(200,240,170,0.75);
  font-size: 20px;
  cursor: pointer;
  transition: background 140ms;
}
.oc-header-close:hover { background: rgba(255,255,255,0.14); color: #c8f0a8; }

.order-overlay-body {
  display: grid;
  grid-template-columns: 1fr 360px;
  overflow: hidden;
  height: 100%;
}

/* Right cart sidebar */
.order-overlay-cart {
  border-left: 1px solid rgba(255,255,255,0.60);
  background: rgba(255,255,255,0.55);
  backdrop-filter: var(--blur-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.oc-cart-inner { display: flex; flex-direction: column; height: 100%; overflow: hidden; }

.oc-cart-top {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.oc-cart-divider { height: 1px; background: rgba(0,0,0,0.08); }

.oc-form { display: grid; gap: 10px; }

.oc-form label {
  display: grid;
  gap: 5px;
  font-size: 11px;
  font-weight: 900;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.oc-form input {
  height: 40px;
  border: 1px solid rgba(255,255,255,0.75);
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.65);
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
  outline: none;
  transition: border-color 140ms, box-shadow 140ms, background 140ms;
}

.oc-form input:focus {
  border-color: rgba(42,112,48,0.55);
  background: rgba(255,255,255,0.92);
  box-shadow: 0 0 0 3px rgba(42,112,48,0.14);
}

.oc-empty-hint { text-align: center; color: var(--muted); font-size: 13px; padding: 20px 0; }

.oc-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(0,0,0,0.07);
  font-size: 13px;
}

.oc-item-name   { flex: 1; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-item-qty    { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.oc-item-qty span { font-weight: 900; min-width: 18px; text-align: center; }
.oc-item-price  { font-weight: 900; min-width: 60px; text-align: right; flex-shrink: 0; }

.oc-qty-btn {
  width: 26px; height: 26px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(255,255,255,0.75);
  background: rgba(255,255,255,0.65);
  color: var(--ink);
  cursor: pointer;
  font-size: 15px;
  font-weight: 900;
  display: grid;
  place-items: center;
  line-height: 1;
  transition: background 120ms, border-color 120ms;
}

.oc-qty-btn:hover { background: rgba(80,200,80,0.20); border-color: rgba(42,112,48,0.40); }

.oc-total {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 0 0;
  border-top: 2px solid rgba(0,0,0,0.10);
  font-size: 14px;
  font-weight: 800;
}

.oc-total[hidden] { display: none; }
.oc-total .oc-total-final strong { font-size: 20px; font-weight: 900; }

.oc-cart-bottom {
  padding: 14px 20px 20px;
  border-top: 1px solid rgba(0,0,0,0.08);
  display: grid;
  gap: 8px;
  background: rgba(255,255,255,0.40);
  flex-shrink: 0;
}

/* Submit button */
.oc-submit-btn {
  width: 100%;
  min-height: 50px;
  border-radius: var(--r-pill);
  border: 1px solid #0a1e06;
  background: linear-gradient(160deg, #2e7a28, #1a5018);
  color: #b8f0a0;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  letter-spacing: 0.02em;
  box-shadow: 0 3px 0 #081604, 0 6px 18px rgba(10,50,5,0.32);
  transition: box-shadow 140ms, transform 120ms, background 140ms;
}

.oc-submit-btn:hover:not(:disabled) {
  background: linear-gradient(160deg, #368030, #1e5c1c);
  box-shadow: 0 4px 0 #081604, 0 8px 22px rgba(10,50,5,0.38);
  transform: translateY(-2px);
}

.oc-submit-btn:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 1px 0 #081604, 0 2px 6px rgba(10,50,5,0.20);
}

.oc-submit-btn:disabled { opacity: 0.55; cursor: wait; }

/* Right catalog area */
.order-overlay-catalog { overflow-y: auto; padding: 22px 24px; }

.oc-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(210px,1fr));
  gap: 16px;
}

/* Catalog cards in overlay */
.oc-card {
  border: 1px solid rgba(255,255,255,0.72);
  border-radius: var(--r-lg);
  background: var(--glass);
  backdrop-filter: blur(10px);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: box-shadow 160ms, transform 160ms;
}

.oc-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }

.oc-card-cover { height: 155px; overflow: hidden; flex-shrink: 0; position: relative; }
.oc-card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 240ms; }
.oc-card:hover .oc-card-cover img { transform: scale(1.05); }

.oc-card-cover.catalog-cover-placeholder {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(80,200,80,0.18), rgba(40,150,60,0.12));
}
.oc-card-cover.catalog-cover-placeholder span { font-size: 50px; font-weight: 900; color: var(--accent); }

.oc-unavail-badge {
  position: absolute;
  top: 8px; left: 8px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 900;
  background: rgba(120,20,20,0.84);
  color: #ffc0c0;
}

.oc-card-body { padding: 12px 14px 8px; flex: 1; }
.oc-card-type { font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 0 0 4px; }
.oc-card-body h4 { margin: 0 0 6px; font-size: 14px; font-weight: 800; line-height: 1.3; }
.oc-card-price { font-size: 16px; font-weight: 900; }

.oc-card-footer { padding: 0 12px 12px; }

/* Inherits all primary-button styles — only overrides width */
.oc-add-full-btn {
  width: 100%;
  min-height: 42px;
  padding: 0 18px;
  border-radius: var(--r-pill);
  border: 1px solid #0e3210;
  background: linear-gradient(160deg, #2e7a28, #1a5018);
  color: #b8f0a0;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 0 #081a04, 0 4px 14px rgba(20,80,10,0.30);
  transition: box-shadow 140ms, transform 120ms, background 140ms;
}

.oc-add-full-btn:hover {
  background: linear-gradient(160deg, #368030, #1e5c1c);
  box-shadow: 0 3px 0 #081a04, 0 6px 20px rgba(20,80,10,0.38);
  transform: translateY(-1px);
}

.oc-add-full-btn:active { transform: translateY(1px); box-shadow: 0 1px 0 #081a04; }

.oc-unavail-text { display: block; text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding: 10px 0; }

/* Card inline qty */
.oc-card-qty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(42,112,48,0.45);
  background: rgba(80,200,80,0.16);
  padding: 0 4px;
}

.oc-card-qty-btn {
  width: 32px; height: 32px;
  border-radius: var(--r-pill);
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 120ms;
}
.oc-card-qty-btn:hover { background: rgba(42,112,48,0.16); }

.oc-card-qty-count { font-size: 15px; font-weight: 900; color: var(--accent); min-width: 28px; text-align: center; }

/* ── Skeleton loader ─────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}

.skeleton-sidebar {
  width: 248px;
  background: rgba(10,20,8,0.90);
  border-right: 1px solid rgba(80,160,60,0.14);
}

.skeleton-main { padding: 22px; display: grid; gap: 18px; align-content: start; }

.skeleton-topbar,
.skeleton-block {
  border-radius: var(--r-md);
  background: linear-gradient(90deg, rgba(255,255,255,0.45) 25%, rgba(255,255,255,0.70) 50%, rgba(255,255,255,0.45) 75%);
  background-size: 600px 100%;
  animation: shimmer 1.2s infinite linear;
}

.skeleton-topbar  { height: 72px; }
.skeleton-blocks  { display: grid; gap: 14px; }
.skeleton-block   { height: 120px; }
.skeleton-block.tall { height: 340px; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1180px) {
  .orders-page {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .orders-page .workspace-grid,
  .orders-page .detail-panel {
    height: auto;
  }

  .orders-page .kanban-cards {
    max-height: 52vh;
  }

  .workspace-grid,
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto;
    align-items: center;
  }

  .main-nav { display: flex; overflow-x: auto; }
  .nav-item { flex: 0 0 auto; }
  .detail-panel { position: static; }
  .product-strip, .category-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .product-detail-layout { grid-template-columns: 200px 1fr; gap: 16px; }
}

@media (max-width: 820px) {
  .login-page { grid-template-columns: 1fr; }
  .login-visual { min-height: 280px; }

  .topbar, .top-actions, .panel-head, .promo-card {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar, .top-actions, .panel-head { display: grid; }
  .search-field { width: 100%; }
  .kpi-grid, .product-strip, .category-grid, .promo-grid, .role-grid { grid-template-columns: 1fr; }
  .product-detail-layout { grid-template-columns: 1fr; }
  .product-detail-image { aspect-ratio: 16/9; }
  .table-row { flex-wrap: wrap; gap: 6px; min-height: 0; padding: 12px; }
  .shifts-table { overflow-x: auto; }
  .shifts-table .table-row {
    min-width: 860px;
    grid-template-columns: 90px 130px 150px 150px 150px 100px 100px;
    flex-wrap: nowrap;
  }

  .order-overlay-body { grid-template-columns: 1fr; }
  .order-overlay-cart { max-height: 50vh; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.60); }
}

@media (max-width: 560px) {
  .main-panel, .sidebar { padding: 14px; }
  .login-page { width: min(100% - 20px, 1120px); padding: 10px 0; }
  .login-card, .login-visual, .panel, .detail-panel { padding: 16px; }
  .login-visual h1 { font-size: 36px; }
  .page-title h1 { font-size: 24px; }
  .sidebar { display: grid; gap: 10px; }
  .brand small, .nav-item span:last-child, .logout-button span:last-child { display: none; }
  .segmented-actions { grid-template-columns: 1fr; }
  .dashboard-grid,
  .dashboard-grid-wide,
  .dashboard-grid-main,
  .dashboard-ops-strip { grid-template-columns: 1fr; }
  .kanban-board { grid-template-columns: repeat(2,minmax(140px,1fr)); }
}

/* ── Modern polish pass ─────────────────────────────────── */
:root {
  --bg: #f4f7f1;
  --ink: #172016;
  --muted: #65705f;
  --line: rgba(32, 48, 28, 0.12);
  --teal: #1d6a55;
  --accent: #24764f;
  --mint: rgba(36, 118, 79, 0.10);
  --green-glow: rgba(36, 118, 79, 0.22);
  --glass: rgba(255, 255, 255, 0.74);
  --glass-strong: rgba(255, 255, 255, 0.94);
  --glass-border: rgba(255, 255, 255, 0.86);
  --shadow-xs: 0 1px 2px rgba(20, 32, 18, 0.05), 0 4px 12px rgba(20, 32, 18, 0.06);
  --shadow-sm: 0 2px 8px rgba(20, 32, 18, 0.06), 0 12px 28px rgba(20, 32, 18, 0.08);
  --shadow-md: 0 12px 36px rgba(20, 32, 18, 0.12);
  --shadow-lg: 0 24px 70px rgba(20, 32, 18, 0.18);
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
}

body {
  background-color: var(--bg);
  background-image:
    linear-gradient(135deg, rgba(36, 118, 79, 0.08), transparent 34%),
    radial-gradient(circle at 82% 12%, rgba(218, 148, 55, 0.12), transparent 28%),
    radial-gradient(circle, rgba(28, 42, 24, 0.055) 1px, transparent 1px);
  background-size: auto, auto, 24px 24px;
}

.sidebar {
  background: #10170f;
  border-right-color: rgba(255,255,255,0.08);
  box-shadow: 10px 0 30px rgba(16, 23, 15, 0.16);
}

.brand-mark {
  background: linear-gradient(135deg, #2f8f62, #d9963a);
  color: #fffaf0;
  box-shadow: 0 10px 24px rgba(47, 143, 98, 0.28);
}

.brand strong { color: #f3f8ef; }
.brand small, .profile-chip small { color: rgba(237, 246, 230, 0.56); }

.nav-item {
  border-radius: 12px;
  color: rgba(237, 246, 230, 0.66);
  font-weight: 760;
}

.nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: #fbfff6;
}

.nav-item.active {
  background: rgba(255,255,255,0.13);
  border-color: rgba(255,255,255,0.12);
  color: #ffffff;
  box-shadow: none;
}

.nav-item.active .nav-icon,
.profile-chip > span {
  background: rgba(217, 150, 58, 0.18);
  color: #ffd99c;
}

.profile-chip {
  border-radius: 14px;
  border-color: rgba(255,255,255,0.10);
}

.main-panel { padding: 28px; }
.topbar { margin-bottom: 24px; }
.page-title h1 { font-size: 32px; letter-spacing: 0; }
.page-title p, .eyebrow { color: var(--muted); letter-spacing: 0.04em; }

.panel, .login-card, .detail-panel, .catalog-card, .category-card, .promo-card {
  border-color: rgba(255,255,255,0.82);
  box-shadow: var(--glass-inner), var(--shadow-sm);
}

.panel, .detail-panel { border-radius: 16px; }

.primary-button,
.oc-submit-btn,
.oc-add-full-btn {
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #277a55, #1f5f4f);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(31, 95, 79, 0.22);
  letter-spacing: 0;
}

.primary-button:hover:not(:disabled),
.oc-submit-btn:hover:not(:disabled),
.oc-add-full-btn:hover {
  background: linear-gradient(135deg, #2d8b62, #216a58);
  box-shadow: 0 14px 28px rgba(31, 95, 79, 0.26);
  transform: translateY(-1px);
}

.primary-button:active:not(:disabled),
.oc-submit-btn:active:not(:disabled),
.oc-add-full-btn:active {
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(31, 95, 79, 0.18);
}

.ghost-button,
.icon-button {
  border-radius: 12px;
  background: rgba(255,255,255,0.78);
  border-color: rgba(25, 42, 22, 0.10);
  box-shadow: var(--shadow-xs);
}

.ghost-button:hover,
.icon-button:hover {
  background: #ffffff;
  transform: translateY(-1px);
}

.search-field,
.login-form input,
.login-form select,
.modal-card input,
.modal-card select,
.modal-card textarea,
.oc-form input,
.oc-form textarea,
.oc-search {
  border-color: rgba(25, 42, 22, 0.12);
  background: rgba(255,255,255,0.84);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.86);
}

.login-form input:focus,
.login-form select:focus,
.modal-card input:focus,
.modal-card select:focus,
.modal-card textarea:focus,
.oc-form input:focus,
.oc-form textarea:focus,
.oc-search:focus-within,
.search-field:focus-within {
  border-color: rgba(36, 118, 79, 0.46);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(36, 118, 79, 0.12);
}

.login-page { width: min(1120px, calc(100% - 40px)); gap: 28px; }

.login-visual {
  position: relative;
  overflow: hidden;
  border: 0;
  background:
    radial-gradient(70% 55% at 78% 22%, rgba(242,180,65,0.40), transparent 42%),
    radial-gradient(90% 70% at 12% 88%, rgba(40,170,120,0.38), transparent 60%),
    radial-gradient(120% 90% at 85% 10%, rgba(150,230,130,0.20), transparent 55%),
    linear-gradient(160deg, #0d1f12 0%, #133a2b 52%, #1b5a43 100%);
}
/* Тонка сітка-перспектива */
.login-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 54px 54px;
  -webkit-mask-image: radial-gradient(120% 100% at 50% 0%, #000 35%, transparent 78%);
          mask-image: radial-gradient(120% 100% at 50% 0%, #000 35%, transparent 78%);
}
/* Маршрут доставки з пінами поверх сцени */
.login-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: no-repeat 50% 14% / 84% auto
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 420 200'%3E%3Cpath d='M30 168 C 150 150, 150 60, 270 48 C 330 42, 362 58, 392 34' fill='none' stroke='%23fef6e6' stroke-opacity='0.55' stroke-width='3.2' stroke-linecap='round' stroke-dasharray='1 12'/%3E%3Ccircle cx='30' cy='168' r='10' fill='%23ffffff' fill-opacity='0.95'/%3E%3Ccircle cx='30' cy='168' r='4' fill='%231b5a43'/%3E%3Cpath d='M392 12 c-13 0-24 11-24 24 0 17 24 38 24 38 s24-21 24-38 c0-13-11-24-24-24z' fill='%23f2b441'/%3E%3Ccircle cx='392' cy='36' r='8' fill='%23133a2b'/%3E%3C/svg%3E");
}
.login-visual > * { position: relative; z-index: 1; }

.login-card {
  padding: 36px;
  border-radius: 18px;
}

.login-card h2 { font-size: 26px; line-height: 1.18; }
.login-form { gap: 16px; }
.login-form input, .login-form select { height: 48px; border-radius: 12px; }
.login-form .primary-button { width: 100%; min-height: 48px; }

.modal-backdrop {
  background: rgba(16, 23, 15, 0.42);
  backdrop-filter: blur(14px);
}

.modal-card,
.code-modal {
  border-radius: 18px;
  background: rgba(255,255,255,0.94);
  border-color: rgba(255,255,255,0.92);
}

.modal-close,
.detail-close-btn,
.oc-header-close {
  border-radius: 11px;
  border-color: rgba(25, 42, 22, 0.10);
  background: rgba(255,255,255,0.78);
  color: var(--muted);
}

.modal-close:hover,
.detail-close-btn:hover,
.oc-header-close:hover {
  background: #ffffff;
  color: var(--ink);
}

.order-overlay {
  z-index: 40;
  inset: 0;
  width: min(1280px, calc(100vw - 32px));
  height: min(860px, calc(100vh - 32px));
  margin: auto;
  border-radius: 22px;
  overflow: hidden;
  background: rgba(246, 249, 243, 0.98);
  background-image:
    linear-gradient(135deg, rgba(36, 118, 79, 0.08), transparent 38%),
    radial-gradient(circle at 95% 8%, rgba(217, 150, 58, 0.16), transparent 28%);
  box-shadow:
    0 0 0 100vmax rgba(16, 23, 15, 0.46),
    0 30px 100px rgba(16, 23, 15, 0.34);
}

.order-overlay-header {
  padding: 18px 22px;
  background: rgba(255,255,255,0.82);
  border-bottom-color: rgba(25, 42, 22, 0.10);
  box-shadow: none;
}

.oc-header-eyebrow { color: var(--muted); }
.oc-header-title { color: var(--ink); font-size: 22px; }
.order-overlay-body { grid-template-columns: minmax(0, 1fr) 390px; }
.order-overlay-catalog { padding: 22px; }

.oc-catalog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.oc-catalog-head h3 {
  margin-top: 3px;
  font-size: 20px;
  line-height: 1.2;
}

.oc-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(340px, 40vw);
  height: 42px;
  border: 1px solid rgba(25, 42, 22, 0.12);
  border-radius: 12px;
  padding: 0 12px;
  color: var(--muted);
}

.oc-search input {
  width: 100%;
  border: 0;
  background: transparent;
  outline: none;
  color: var(--ink);
}

.order-overlay-cart {
  border-left-color: rgba(25, 42, 22, 0.10);
  background: rgba(255,255,255,0.72);
}

.oc-cart-top { padding: 22px; gap: 18px; }
.oc-form { gap: 12px; }
.oc-form input { height: 44px; border-radius: 12px; }
.oc-form textarea {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  border-radius: 12px;
  padding: 12px;
  color: var(--ink);
  outline: none;
}

.oc-item-row {
  min-height: 52px;
  padding: 10px 0;
}

.oc-qty-btn,
.oc-card-qty-btn {
  border-radius: 10px;
}

.oc-total {
  padding: 16px 0 0;
  border-top-color: rgba(25, 42, 22, 0.12);
}

.oc-cart-bottom {
  padding: 16px 22px 22px;
  background: rgba(255,255,255,0.76);
}

.oc-card {
  border-radius: 16px;
  border-color: rgba(25, 42, 22, 0.10);
  background: rgba(255,255,255,0.80);
}

.oc-card:hover,
.catalog-card:hover,
.catalog-card:focus-visible {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.oc-card[hidden] { display: none; }
.oc-card-cover { height: 150px; }
.oc-card-footer { padding: 0 14px 14px; }
.oc-add-full-btn { min-height: 40px; font-size: 13px; }

.kanban-board {
  background: rgba(255,255,255,0.42);
  border-color: rgba(255,255,255,0.74);
}

.kanban-card {
  background: rgba(255,255,255,0.78);
  border-color: rgba(25, 42, 22, 0.08);
}

.kanban-card.active {
  border-color: rgba(36, 118, 79, 0.34);
  background: rgba(239, 249, 241, 0.96);
  box-shadow: 0 0 0 3px rgba(36, 118, 79, 0.11), var(--shadow-xs);
}

@media (max-width: 1180px) {
  .order-overlay {
    width: calc(100vw - 24px);
    height: calc(100vh - 24px);
  }
  .order-overlay-body { grid-template-columns: 1fr; }
  .order-overlay-cart {
    max-height: 42vh;
    border-left: 0;
    border-top: 1px solid rgba(25, 42, 22, 0.10);
  }
}

@media (max-width: 820px) {
  .main-panel { padding: 18px; }
  .login-page { width: min(100% - 24px, 680px); padding: 18px 0; }
  .login-card { padding: 24px; }
  .oc-catalog-head { align-items: stretch; flex-direction: column; }
  .oc-search { width: 100%; }
  .order-overlay {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }
}

/* ── Softer contrast pass ───────────────────────────────── */
:root {
  --bg: #e7ece0;
  --ink: #182116;
  --muted: #5d6857;
  --surface: #eef3e9;
  --surface-strong: #f5f7f1;
  --surface-muted: #e1e8da;
  --outline: rgba(35, 49, 30, 0.18);
  --outline-strong: rgba(35, 49, 30, 0.28);
  --glass: rgba(238, 243, 233, 0.86);
  --glass-strong: rgba(245, 247, 241, 0.94);
  --glass-border: var(--outline);
  --shadow-xs: 0 1px 2px rgba(18, 28, 15, 0.06), 0 5px 14px rgba(18, 28, 15, 0.07);
  --shadow-sm: 0 2px 8px rgba(18, 28, 15, 0.07), 0 14px 30px rgba(18, 28, 15, 0.09);
  --shadow-md: 0 14px 38px rgba(18, 28, 15, 0.14);
}

body {
  background-color: var(--bg);
  background-image:
    linear-gradient(135deg, rgba(36, 118, 79, 0.075), transparent 34%),
    radial-gradient(circle at 82% 12%, rgba(169, 118, 48, 0.11), transparent 28%),
    radial-gradient(circle, rgba(24, 33, 22, 0.06) 1px, transparent 1px);
}

.panel,
.login-card,
.detail-panel,
.catalog-card,
.category-card,
.promo-card,
.role-panel,
.dashboard-card,
.stat-card {
  background: var(--glass);
  border: 1px solid var(--outline);
  box-shadow: var(--glass-inner), var(--shadow-sm);
}

.panel.full,
.kanban-board,
.data-table,
.tabs,
.product-mini,
.table-row,
.recent-order-row {
  border-color: var(--outline);
}

.panel-head,
.detail-head,
.items-list,
.oc-cart-divider {
  border-color: rgba(35, 49, 30, 0.14);
}

.ghost-button,
.icon-button,
.tabs button.active,
.modal-close,
.detail-close-btn,
.oc-header-close {
  background: var(--surface-strong);
  border-color: var(--outline);
}

.ghost-button:hover,
.icon-button:hover,
.modal-close:hover,
.detail-close-btn:hover,
.oc-header-close:hover {
  background: #fbfcf7;
  border-color: var(--outline-strong);
}

.search-field,
.login-form input,
.login-form select,
.modal-card input,
.modal-card select,
.modal-card textarea,
.oc-form input,
.oc-form textarea,
.oc-search,
.code-form input,
.assign-courier select,
.table-row select {
  background: var(--surface-strong);
  border-color: var(--outline);
}

.login-form input:focus,
.login-form select:focus,
.modal-card input:focus,
.modal-card select:focus,
.modal-card textarea:focus,
.oc-form input:focus,
.oc-form textarea:focus,
.code-form input:focus,
.oc-search:focus-within,
.search-field:focus-within {
  background: #fbfcf7;
  border-color: rgba(36, 118, 79, 0.56);
  box-shadow: 0 0 0 4px rgba(36, 118, 79, 0.13);
}

.modal-card,
.code-modal {
  background: var(--surface-strong);
  border-color: var(--outline-strong);
}

.modal-backdrop {
  background: rgba(18, 28, 15, 0.48);
}

.order-overlay {
  background: var(--surface);
  border: 1px solid rgba(245, 247, 241, 0.42);
}

.order-overlay-header,
.order-overlay-cart,
.oc-cart-bottom {
  background: rgba(232, 238, 224, 0.92);
}

.order-overlay-header {
  border-bottom-color: var(--outline);
}

.order-overlay-cart {
  border-left-color: var(--outline);
}

.oc-card,
.kanban-card,
.catalog-card {
  background: rgba(245, 247, 241, 0.84);
  border-color: var(--outline);
}

.oc-card:hover,
.kanban-card:hover,
.catalog-card:hover,
.catalog-card:focus-visible {
  border-color: var(--outline-strong);
}

.kanban-board {
  background: rgba(225, 232, 218, 0.62);
  border-color: var(--outline);
}

.kanban-card.active {
  background: rgba(232, 242, 230, 0.96);
  border-color: rgba(36, 118, 79, 0.46);
}

.table-row {
  background: rgba(245, 247, 241, 0.76);
  border-bottom-color: var(--outline);
}

.table-head {
  background: rgba(225, 232, 218, 0.78);
}

.catalog-cover-placeholder,
.product-detail-image,
.product-art,
.promo-art,
.category-card .nav-icon,
.role-panel .nav-icon {
  background: linear-gradient(135deg, rgba(36, 118, 79, 0.13), rgba(169, 118, 48, 0.10));
}

/* ── Loading states ─────────────────────────────────────── */
.route-loader {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 82px;
  background: rgba(232, 238, 224, 0.96);
  border-color: rgba(35, 49, 30, 0.24);
}

.route-loader h2 {
  margin-top: 3px;
  font-size: 20px;
}

.route-loader-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(36, 118, 79, 0.18);
  border-top-color: #24764f;
  animation: loaderSpin 760ms linear infinite;
  flex: 0 0 auto;
}

@keyframes loaderSpin {
  to { transform: rotate(360deg); }
}

.skeleton-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}

.skeleton-card {
  min-height: 260px;
  border-radius: 16px;
  border: 1px solid rgba(35, 49, 30, 0.16);
  background:
    linear-gradient(90deg, rgba(232,238,224,0.88) 25%, rgba(245,247,241,0.95) 50%, rgba(232,238,224,0.88) 75%);
  background-size: 620px 100%;
  animation: shimmer 1.1s infinite linear;
}

.catalog-cover,
.product-detail-image,
.promo-card {
  background:
    linear-gradient(90deg, rgba(225,232,218,0.88) 25%, rgba(245,247,241,0.96) 50%, rgba(225,232,218,0.88) 75%);
  background-size: 520px 100%;
  animation: shimmer 1.2s infinite linear;
}

.catalog-cover-placeholder,
.product-detail-image.catalog-cover-placeholder,
.catalog-cover.media-loaded,
.product-detail-image.media-loaded,
.promo-card.media-loaded,
.promo-card:has(.promo-art) {
  animation: none;
}

.async-img {
  opacity: 0;
  transition: opacity 180ms ease;
}

.async-img.is-loaded {
  opacity: 1;
}

.promo-img {
  width: 96px;
  height: 96px;
  border-radius: 14px;
  object-fit: cover;
  flex: 0 0 auto;
}

/* ── Topbar contrast fix ────────────────────────────────── */
.top-actions {
  --topbar-control-height: 44px;
  padding: 8px;
  border: 1px solid rgba(35, 49, 30, 0.16);
  border-radius: 18px;
  background: rgba(225, 232, 218, 0.78);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.52), var(--shadow-xs);
}

.search-field {
  height: var(--topbar-control-height);
  background: rgba(247, 249, 243, 0.96);
  border-color: rgba(35, 49, 30, 0.22);
  color: #33412e;
}

.search-field input {
  color: #182116;
}

.search-field input::placeholder {
  color: rgba(61, 75, 55, 0.70);
}

.top-actions .icon-button {
  width: var(--topbar-control-height);
  height: var(--topbar-control-height);
  min-height: var(--topbar-control-height);
  background: rgba(247, 249, 243, 0.96);
  border-color: rgba(35, 49, 30, 0.22);
  color: #172016;
}

.topbar-action {
  display: contents;
}

.topbar-action .ghost-button,
.topbar-action .primary-button {
  height: var(--topbar-control-height);
  min-height: var(--topbar-control-height);
  padding: 0 16px;
  border-radius: 14px;
}

.topbar-action .ghost-button {
  background: linear-gradient(135deg, #24764f, #1d6a55);
  border-color: rgba(36,118,79,0.55);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), var(--shadow-xs);
}

.topbar-action .ghost-button:hover {
  background: linear-gradient(135deg, #2a8056, #21745d);
  border-color: rgba(36,118,79,0.70);
}

.profile-chip {
  min-height: var(--topbar-control-height);
  height: var(--topbar-control-height);
  min-width: 228px;
  border-radius: 16px;
  border-color: rgba(35, 49, 30, 0.24);
  background: linear-gradient(135deg, rgba(247, 249, 243, 0.98), rgba(232, 238, 224, 0.98));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.62), var(--shadow-xs);
}

.profile-chip > span {
  background: #ead39d;
  color: #5b4214;
}

.profile-chip strong {
  color: #182116;
}

.profile-chip small {
  color: #68715f;
}

.shifts-page { display: grid; gap: 18px; }

.status-open   { background: rgba(40,160,80,0.18); color: #0a4018; border: 1px solid rgba(40,160,80,0.30); }
.status-closed { background: rgba(0,0,0,0.06);     color: var(--muted); border: 1px solid var(--line); }

.shift-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 22px 24px;
  border-radius: var(--r-lg);
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: var(--blur-sm);
  box-shadow: var(--glass-inner), var(--shadow-sm);
  overflow: hidden;
}

.shift-hero.open  { border-color: rgba(40,160,80,0.40); }
.shift-hero.closed { background: rgba(240,240,235,0.65); }

.shift-hero-glow {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, #2a7030, #60c050);
}

.shift-hero-main { display: flex; align-items: center; gap: 16px; min-width: 0; }

.shift-hero-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--muted);
}
.shift-hero.open .shift-hero-dot {
  background: #2fa04a;
  box-shadow: 0 0 0 4px rgba(47,160,74,0.20);
  animation: shiftPulse 2s ease-in-out infinite;
}
@keyframes shiftPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(47,160,74,0.20); }
  50%      { box-shadow: 0 0 0 7px rgba(47,160,74,0.08); }
}

.shift-hero h2 { font-size: 22px; font-weight: 800; margin-top: 2px; }
.shift-hero-meta { color: var(--muted); font-size: 13px; margin-top: 4px; }

.shift-hero-meta-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.shift-hero-meta-grid span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(36,118,79,0.08);
  border: 1px solid rgba(36,118,79,0.26);
  line-height: 1.25;
  white-space: nowrap;
}

.shift-hero-meta-grid span:first-child {
  background: rgba(36,118,79,0.12);
  border-color: rgba(36,118,79,0.34);
  color: var(--ink);
  font-size: 14px;
}

.shift-hero-meta-grid strong {
  color: var(--ink);
  font-weight: 900;
}

.shift-detail-badges {
  gap: 8px;
}

.shift-detail-badges span {
  box-sizing: border-box;
  min-height: 28px;
  padding: 5px 10px;
  background: rgba(36,118,79,0.10);
  border-color: rgba(36,118,79,0.30);
  color: #31523a;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.58);
}

.shift-detail-date-badge,
.shift-detail-status-badge {
  background: rgba(36,118,79,0.16);
  border-color: rgba(36,118,79,0.38);
  color: var(--ink);
}

.shift-detail-status-badge {
  min-width: 78px;
  justify-content: center;
}

.shift-detail-status-badge.is-closed {
  background: rgba(36,118,79,0.11);
  border-color: rgba(36,118,79,0.26);
  color: #4f5f4d;
}

.shift-detail-status-badge.is-open {
  background: rgba(45,160,80,0.18);
  border-color: rgba(45,160,80,0.42);
  color: #0a4018;
}

.shift-hero-side {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.shift-hero-count { text-align: center; line-height: 1; }
.shift-hero-count strong { display: block; font-size: 26px; font-weight: 900; color: var(--ink); }
.shift-hero-count small  { color: var(--muted); font-size: 11px; font-weight: 700; }

.shift-close-summary {
  display: grid;
  align-content: center;
  gap: 4px;
  min-width: 180px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(36,118,79,0.22);
  background: rgba(36,118,79,0.08);
}

.shift-close-summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.shift-close-summary strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.shift-close-summary small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.shift-close-cta {
  min-width: 142px;
  border: 1px solid rgba(180,40,40,0.28);
  border-radius: 12px;
  background: rgba(255,245,242,0.92);
  color: #9b1c1c;
  font-weight: 900;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: background 140ms, border-color 140ms, transform 140ms;
}

.shift-close-cta:hover {
  background: rgba(255,232,226,0.98);
  border-color: rgba(180,40,40,0.44);
  transform: translateY(-1px);
}

.shift-close-modal-card {
  width: min(520px, 100%);
}

.shift-close-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-top: 8px;
}

.shift-close-actions .ghost-button,
.shift-close-actions .primary-button {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 15px;
  white-space: normal;
  text-align: center;
}

.shift-close-warning {
  margin: 10px 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.shift-close-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0;
}

.shift-close-facts span {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(35,49,30,0.12);
  background: rgba(225,232,218,0.52);
}

.shift-close-facts strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
}

.shift-close-facts small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.danger-button {
  background: linear-gradient(135deg, #b52525, #8f1717);
  border-color: rgba(150,20,20,0.50);
  color: #fff;
}

.danger-button:hover:not(:disabled) {
  background: linear-gradient(135deg, #c42a2a, #991919);
}

.shift-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-inner), var(--shadow-xs);
}

.shift-banner-info { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink); }
.shift-banner-info svg { color: var(--teal); }

.shift-banner.ok   { background: rgba(40,160,80,0.12); border-color: rgba(40,160,80,0.28); }
.shift-banner.warn { background: rgba(190,140,20,0.14); border-color: rgba(190,140,20,0.32); }
.shift-banner.warn .shift-banner-info svg { color: #8a5a00; }

.shift-row { cursor: pointer; transition: background 120ms; }
.shift-row:hover { background: rgba(255,255,255,0.78); }
.shift-orders-body { margin-top: 14px; max-height: 60vh; overflow: auto; }

@media (max-width: 720px) {
  .shift-hero { flex-direction: column; align-items: flex-start; }
  .shift-hero-side { width: 100%; flex-direction: column; }
  .shift-close-summary,
  .shift-close-cta { width: 100%; }
  .shift-close-facts { grid-template-columns: 1fr; }
  .shift-close-actions { grid-template-columns: 1fr; }
  .shift-banner { flex-direction: column; align-items: stretch; }
  .shift-banner .primary-button, .shift-banner .ghost-button { width: 100%; }
}

.image-upload { display: grid; gap: 6px; }
.image-upload-caption {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Custom select (cselect) ─────────────────────────────── */
.cselect { position: relative; display: block; }
.cselect input[type="hidden"] { display: none; }

.cselect-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 42px;
  padding: 0 40px 0 12px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(255,255,255,0.70);
  background: rgba(255,255,255,0.55);
  color: var(--ink);
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.cselect-trigger:hover { border-color: rgba(42,112,48,0.45); background: rgba(255,255,255,0.72); }
.cselect.open .cselect-trigger,
.cselect-trigger:focus-visible {
  border-color: rgba(42,112,48,0.60);
  background: rgba(255,255,255,0.85);
  box-shadow: 0 0 0 3px rgba(42,112,48,0.16);
  outline: none;
}
.cselect-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cselect::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid #1f3e2b;
  border-bottom: 2px solid #1f3e2b;
  pointer-events: none;
  transform: translateY(-65%) rotate(45deg);
  transition: transform 160ms ease, border-color 160ms ease;
}
.cselect.open::after { border-color: var(--accent); transform: translateY(-35%) rotate(225deg); }

.cselect-menu {
  display: grid;
  gap: 4px;
  max-height: 0;
  margin-top: 0;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: rgba(250,252,247,0.98);
  box-shadow: 0 0 0 rgba(25,45,20,0);
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  transition:
    max-height 220ms ease,
    margin-top 180ms ease,
    padding 180ms ease,
    opacity 160ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}
.cselect.open .cselect-menu {
  max-height: 220px;
  margin-top: 7px;
  padding: 6px;
  border-color: rgba(36,118,79,0.24);
  box-shadow: 0 16px 34px rgba(25,45,20,0.16);
  opacity: 1;
  pointer-events: auto;
  overflow-y: auto;
}
.cselect-option {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}
.cselect-option:hover { background: rgba(36,118,79,0.10); border-color: rgba(36,118,79,0.18); transform: translateX(1px); }
.cselect-option.active { background: linear-gradient(135deg, #24764f, #1d6a55); border-color: rgba(36,118,79,0.50); color: #fff; }

/* ── Confirm dialog ──────────────────────────────────────── */
.confirm-backdrop { opacity: 0; transition: opacity 180ms ease; }
.confirm-backdrop.open { opacity: 1; }
.confirm-card {
  width: min(420px, 100%);
  text-align: left;
  transform: translateY(8px) scale(0.97);
  opacity: 0;
  transition: transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 200ms ease;
}
.confirm-backdrop.open .confirm-card { transform: translateY(0) scale(1); opacity: 1; }
.confirm-message { color: var(--ink); font-size: 15px; line-height: 1.5; }

.image-dropzone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 150px;
  padding: 16px;
  border: 1.5px dashed rgba(80, 120, 60, 0.40);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: border-color 140ms, background 140ms;
}
.image-dropzone:hover,
.image-dropzone:focus-visible { border-color: var(--accent); background: rgba(255, 255, 255, 0.70); outline: none; }
.image-dropzone.dragover { border-color: var(--accent); background: var(--mint); }

.image-dropzone-hint {
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
  color: var(--muted);
}
.image-dropzone-hint svg { width: 26px; height: 26px; color: var(--accent); }
.image-dropzone-hint strong { font-size: 14px; color: var(--ink); font-weight: 800; }
.image-dropzone-hint small { font-size: 12px; }
.image-format-warning {
  max-width: 340px;
  color: #a82020 !important;
  font-weight: 900;
  line-height: 1.35;
}

.image-dropzone-preview { position: relative; width: 100%; }
.image-dropzone-preview img {
  display: block;
  width: 160px;
  height: 160px;
  margin: 0 auto;
  object-fit: cover;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}

.image-dropzone-clear {
  position: absolute;
  top: -8px; right: calc(50% - 88px);
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass-strong);
  color: #a02020;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
}
.image-dropzone-clear:hover { background: rgba(255, 220, 220, 0.85); }

.shift-detail-page, .shift-compare-page { display: grid; gap: 18px; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  font-size: 13px;
  font-weight: 800;
  color: var(--teal);
}
.back-link:hover { text-decoration: underline; }

.shift-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.chart-box {
  position: relative;
  height: 260px;
  width: 100%;
}
.chart-box-lg { height: 360px; }
.chart-box canvas { max-width: 100%; }

.compare-pick {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.compare-pick-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.52);
  font-size: 13px;
  cursor: pointer;
}
.compare-pick-item input { width: 16px; height: 16px; flex-shrink: 0; }

.compare-hero {
  display: grid;
  grid-template-columns: minmax(260px, 0.82fr) minmax(0, 1.18fr);
  align-items: stretch;
  gap: 18px;
  padding: 20px;
  border-color: rgba(36,118,79,0.24);
  background:
    linear-gradient(135deg, rgba(36,118,79,0.10), rgba(255,255,255,0.58)),
    var(--glass);
}

.compare-hero h2 {
  margin-top: 4px;
  font-size: 24px;
  font-weight: 900;
}

.compare-hero-copy {
  max-width: 560px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.compare-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.compare-summary-strip article {
  display: grid;
  align-content: center;
  min-height: 92px;
  padding: 12px 14px;
  border: 1px solid rgba(35,49,30,0.12);
  border-radius: 8px;
  background: rgba(255,255,255,0.52);
  box-shadow: 0 10px 22px rgba(25,45,20,0.06);
}

.compare-summary-strip span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.compare-summary-strip strong {
  margin-top: 6px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
  line-height: 1.05;
}

.compare-summary-strip small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.compare-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 14px;
  align-items: start;
}

.compare-chart-panel,
.compare-picker-panel {
  height: 100%;
}

.compare-chart-head {
  align-items: center;
  gap: 16px;
}

.compare-metric-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(35,49,30,0.13);
  border-radius: 14px;
  background: rgba(255,255,255,0.58);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.52);
}

.compare-metric-switch button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.compare-metric-switch button span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--metric-color);
  opacity: 0.46;
}

.compare-metric-switch button.active {
  background: rgba(255,255,255,0.92);
  border-color: rgba(35,49,30,0.12);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}

.compare-metric-switch button.active span {
  opacity: 1;
}

.compare-chart-frame {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(35,49,30,0.10);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.46), rgba(236,242,231,0.42));
}

.compare-chart-frame .chart-box-lg {
  height: 410px;
}

.compare-picker-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.compare-picker-panel .compare-pick {
  grid-template-columns: 1fr;
  max-height: 510px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}

.compare-shift-card {
  position: relative;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid rgba(35,49,30,0.12);
  border-radius: 8px;
  background: rgba(255,255,255,0.48);
  cursor: pointer;
  transition: background 140ms, border-color 140ms, box-shadow 140ms, transform 140ms;
}

.compare-shift-card:hover {
  background: rgba(255,255,255,0.75);
  border-color: rgba(36,118,79,0.22);
  transform: translateY(-1px);
}

.compare-shift-card.selected {
  background: rgba(36,118,79,0.10);
  border-color: rgba(36,118,79,0.34);
  box-shadow: 0 10px 24px rgba(25,60,35,0.08);
}

.compare-shift-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.compare-shift-check {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1px solid rgba(35,49,30,0.20);
  background: rgba(255,255,255,0.78);
}

.compare-shift-card.selected .compare-shift-check {
  border-color: rgba(36,118,79,0.52);
  background: #24764f;
}

.compare-shift-card.selected .compare-shift-check::after {
  content: "";
  display: block;
  width: 9px;
  height: 5px;
  margin: 6px auto 0;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
}

.compare-shift-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.compare-shift-main strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.compare-shift-main small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.compare-shift-metrics {
  display: grid;
  justify-items: end;
  gap: 2px;
}

.compare-shift-metrics b {
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
}

.compare-shift-metrics small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

@media (min-width: 961px) {
  .shift-detail-grid > .panel {
    max-height: calc(100vh - 150px);
    overflow-y: auto;
  }
}

@media (max-width: 960px) {
  .shift-detail-grid { grid-template-columns: 1fr; }
  .compare-hero,
  .compare-workspace { grid-template-columns: 1fr; }
  .compare-summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .compare-picker-panel .compare-pick { max-height: none; }
}

@media (max-width: 640px) {
  .compare-summary-strip { grid-template-columns: 1fr; }
  .compare-chart-head { align-items: flex-start; }
  .compare-metric-switch {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }
  .compare-chart-frame .chart-box-lg { height: 320px; }
}

.compare-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 5, 0.30);
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms;
  z-index: 55;
}
.compare-backdrop.open { opacity: 1; visibility: visible; }

.compare-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(360px, 92vw);
  padding: 20px;
  background: var(--glass-strong);
  backdrop-filter: var(--blur-md);
  border-left: 1px solid var(--glass-border);
  box-shadow: -12px 0 44px rgba(20, 50, 10, 0.20);
  z-index: 60;
  transform: translateX(100%);
  transition: transform 240ms ease;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}
.compare-drawer.open { transform: translateX(0); }

.compare-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.compare-drawer-head h3 { font-size: 18px; font-weight: 800; margin-top: 4px; }
.compare-drawer-hint { color: var(--muted); font-size: 13px; }
.compare-drawer-list { display: grid; gap: 8px; }

.compare-drawer-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: background 140ms, border-color 140ms;
}
.compare-drawer-item:hover { background: rgba(255, 255, 255, 0.80); }
.compare-drawer-item.active {
  border-color: var(--dot, var(--accent));
  background: color-mix(in srgb, var(--dot, var(--accent)) 14%, transparent);
}
.compare-drawer-item.loading { opacity: 0.6; pointer-events: none; }

.cdi-dot { width: 12px; height: 12px; border-radius: 50%; background: rgba(0, 0, 0, 0.15); flex-shrink: 0; }
.compare-drawer-item.active .cdi-dot { background: var(--dot, var(--accent)); }
.cdi-main { display: flex; flex-direction: column; min-width: 0; }
.cdi-main small { color: var(--muted); font-size: 12px; }
