* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --primary-light: #dbeafe;
  --sidebar-bg: #111827;
  --sidebar-text: #d1d5db;
  --bg: #f3f4f6;
  --card: #ffffff;
  --border: #e5e7eb;
  --text: #1f2937;
  --text-muted: #6b7280;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --info: #0891b2;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
}

html, body { height: 100%; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

/* ─── Login ─────────────────────────────────────────────── */
.login-body {
  background: linear-gradient(135deg, #111827 0%, #1e40af 100%);
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
}
.login-wrapper { width: 100%; max-width: 420px; padding: 20px; }
.login-card {
  background: var(--card); border-radius: 16px; padding: 40px 36px;
  box-shadow: 0 20px 50px rgba(0,0,0,.3);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.logo-badge {
  width: 64px; height: 64px; border-radius: 16px; background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; font-size: 26px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(37,99,235,.4); margin-bottom: 12px;
}
.login-logo h1 { font-size: 22px; margin-bottom: 4px; }
.login-logo p { color: var(--text-muted); font-size: 12px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-error { background: #fef2f2; color: var(--danger); padding: 10px; border-radius: 8px; font-size: 13px; }
.login-hint { text-align: center; color: var(--text-muted); font-size: 12px; margin-top: 24px; }

/* ─── Layout ────────────────────────────────────────────── */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 260px; background: var(--sidebar-bg); color: var(--sidebar-text);
  display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
  transition: transform .25s ease;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px; padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand .logo-badge { width: 42px; height: 42px; font-size: 17px; margin-bottom: 0; }
.brand-text { display: flex; flex-direction: column; }
.brand-text strong { color: #fff; font-size: 15px; }
.brand-text span { font-size: 11px; color: #9ca3af; }

.sidebar-close-btn {
  display: none;
  margin-left: auto;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 22px;
  line-height: 1;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.sidebar-close-btn:hover {
  background: rgba(255,255,255,0.25);
  transform: scale(1.05);
}
.sidebar-close-btn:active {
  background: rgba(255,255,255,0.35);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  z-index: 45;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.sidebar-backdrop.open {
  display: block;
  opacity: 1;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.nav-section { margin-bottom: 6px; }
.nav-section-title { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: #6b7280; padding: 10px 12px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px;
  color: var(--sidebar-text); text-decoration: none; cursor: pointer; font-size: 13px; margin-bottom: 2px;
  transition: background .15s;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; font-weight: 600; }
.nav-item .nav-icon { width: 20px; text-align: center; font-size: 15px; }
.sidebar-footer { padding: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-user { display: flex; flex-direction: column; margin-bottom: 10px; }
.sidebar-user strong { color: #fff; font-size: 13px; }
.sidebar-user span { font-size: 11px; color: #9ca3af; }

.main { flex: 1; margin-left: 260px; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  background: var(--card); border-bottom: 1px solid var(--border); padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 40;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-left h2 { font-size: 18px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-user { text-align: right; }
.topbar-user strong { display: block; font-size: 13px; }
.topbar-user span { font-size: 11px; color: var(--text-muted); text-transform: capitalize; }

.content { padding: 24px; flex: 1; }

.app-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  background: var(--card);
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: auto;
}
.app-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.app-footer a:hover {
  text-decoration: underline;
}

.sidebar-footer-copy {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,.06);
  text-align: center;
  font-size: 11px;
  color: #6b7280;
}
.sidebar-footer-copy a {
  color: #9ca3af;
  text-decoration: none;
  font-weight: 600;
}
.sidebar-footer-copy a:hover {
  color: #fff;
  text-decoration: underline;
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); z-index: 50; }
  .sidebar.open { transform: translateX(0); box-shadow: 8px 0 25px rgba(0,0,0,0.3); }
  .sidebar-close-btn { display: flex; }
  .main { margin-left: 0; }
}

/* ─── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px; border: 1px solid transparent;
  font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s; text-decoration: none;
  background: var(--primary); color: #fff;
}
.btn:hover { background: var(--primary-dark); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-secondary { background: var(--card); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg); }
.btn-success { background: var(--success); }
.btn-success:hover { background: #15803d; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b91c1c; }
.btn-warning { background: var(--warning); }
.btn-warning:hover { background: #b45309; }
.btn-info { background: var(--info); color: #fff; }
.btn-info:hover { background: #0e7490; }
.btn-ghost { background: transparent; color: var(--sidebar-text); border: 1px solid rgba(255,255,255,.2); }
.btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
.icon-btn {
  background: none; border: none; font-size: 18px; cursor: pointer; color: var(--text-muted);
  position: relative; padding: 6px; border-radius: 8px; line-height: 1;
}
.icon-btn:hover { background: var(--bg); color: var(--text); }
.notif-badge {
  position: absolute; top: -2px; right: -2px; background: var(--danger); color: #fff;
  border-radius: 50%; font-size: 10px; min-width: 16px; height: 16px; display: flex;
  align-items: center; justify-content: center; padding: 0 4px;
}

/* ─── Cards / grids ─────────────────────────────────────── */
.card {
  background: var(--card); border-radius: var(--radius); border: 1px solid var(--border);
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px;
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-header h3 { font-size: 16px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .grid-2 { grid-template-columns: 1fr; } .grid-4 { grid-template-columns: 1fr; } }

.stat-card {
  background: var(--card); border-radius: var(--radius); border: 1px solid var(--border);
  box-shadow: var(--shadow); padding: 18px; display: flex; align-items: center; gap: 14px;
}
.stat-icon {
  width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.stat-icon.blue { background: var(--primary-light); }
.stat-icon.green { background: #dcfce7; }
.stat-icon.orange { background: #ffedd5; }
.stat-icon.red { background: #fee2e2; }
.stat-icon.cyan { background: #cffafe; }
.stat-icon.purple { background: #ede9fe; }
.stat-value { font-size: 22px; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--text-muted); }

/* ─── Tables ───────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; padding: 10px 12px; background: #f9fafb; color: var(--text-muted);
  font-size: 11px; text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:hover td { background: #f9fafb; }
td .actions { display: flex; gap: 6px; white-space: nowrap; }
.money { text-align: right; font-variant-numeric: tabular-nums; }
th.money, th.text-right, td.text-right { text-align: right; }
th.text-center, td.text-center { text-align: center; }
th.text-left, td.text-left { text-align: left; }

/* ─── Badges ───────────────────────────────────────────── */
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600;
  white-space: nowrap;
}
.badge.blue { background: var(--primary-light); color: var(--primary-dark); }
.badge.green { background: #dcfce7; color: #15803d; }
.badge.orange { background: #ffedd5; color: #b45309; }
.badge.red { background: #fee2e2; color: #b91c1c; }
.badge.gray { background: #f3f4f6; color: #374151; }
.badge.cyan { background: #cffafe; color: #0e7490; }
.badge.purple { background: #ede9fe; color: #6d28d9; }

.status-label { text-transform: capitalize; }

/* ─── Forms ────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 5px; }
input, select, textarea {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; font-family: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
textarea { min-height: 70px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.form-row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 700px) { .form-row, .form-row-3, .form-row-4 { grid-template-columns: 1fr; } }

/* ─── Modal ────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 20px; overflow-y: auto;
}
.modal {
  background: var(--card); border-radius: 14px; width: 100%; max-width: 680px;
  box-shadow: 0 24px 60px rgba(0,0,0,.3); animation: slideUp .2s ease;
}
.modal.wide { max-width: 900px; }
@keyframes slideUp { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 16px; }
.modal-body { padding: 22px; }
.modal-footer { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-muted); }

/* ─── Toast ────────────────────────────────────────────── */
.toast-area { position: fixed; top: 70px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #111827; color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 13px;
  box-shadow: 0 10px 30px rgba(0,0,0,.2); animation: slideUp .2s ease; max-width: 340px;
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--info); }

/* ─── Notifications panel ──────────────────────────────── */
.notif-panel {
  position: fixed; top: 64px; right: 24px; width: 360px; max-height: 480px; overflow-y: auto;
  background: var(--card); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.18);
  border: 1px solid var(--border); z-index: 90;
}
.notif-item { padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; }
.notif-item:hover { background: #f9fafb; }
.notif-item.unread { background: var(--primary-light); }
.notif-item h4 { font-size: 13px; margin-bottom: 2px; }
.notif-item p { font-size: 12px; color: var(--text-muted); }
.notif-item small { font-size: 11px; color: #9ca3af; }

/* ─── Misc ─────────────────────────────────────────────── */
.loading { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px; color: var(--text-muted); }
.spinner { width: 34px; height: 34px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; margin-bottom: 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; color: var(--text-muted); padding: 40px 0; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mt-2 { margin-top: 16px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.text-green { color: var(--success); }
.text-red { color: var(--danger); }
.text-right { text-align: right; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.flex-wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.chip { display: inline-block; padding: 2px 8px; background: #f3f4f6; border-radius: 6px; font-size: 12px; margin: 2px; }
.priority-high { color: var(--danger); font-weight: 600; }
.priority-normal { color: var(--text-muted); }
.priority-urgent { color: #7c3aed; font-weight: 700; }
.chart-bar { display: flex; align-items: flex-end; gap: 8px; height: 140px; padding: 10px 0; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.chart-bar-fill { width: 100%; background: var(--primary); border-radius: 6px 6px 0 0; min-height: 2px; transition: height .4s; }
.chart-bar-fill:hover { background: var(--primary-dark); }
.chart-label { font-size: 10px; color: var(--text-muted); }
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.timeline-item { position: relative; margin-bottom: 14px; }
.timeline-item::before {
  content: ''; position: absolute; left: -18px; top: 5px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--primary); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--primary-light);
}
.timeline-item .time { font-size: 11px; color: var(--text-muted); }
.signature-box {
  border: 1px dashed var(--border); border-radius: 8px; padding: 14px; min-height: 70px;
  font-style: italic; color: var(--text-muted); background: #fafafa;
}
.kanban { display: grid; grid-template-columns: repeat(4, minmax(280px, 1fr)); gap: 16px; overflow-x: auto; padding-bottom: 8px; }
.kanban-col { background: #f8fafc; border-radius: 12px; border: 1px solid var(--border); padding: 14px; min-width: 260px; }
.kanban-col h4 { font-size: 13px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.kanban-card {
  background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05); cursor: pointer; transition: all .15s ease;
}
.kanban-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.1); border-color: var(--primary); }
.kanban-card .kb-num { font-weight: 700; font-size: 14px; }
.kanban-card .kb-cust { font-size: 13px; color: var(--text); margin-top: 4px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tab {
  padding: 9px 16px; font-size: 13px; font-weight: 600; color: var(--text-muted); cursor: pointer;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.stat-mini { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.stat-mini:last-child { border-bottom: none; }

/* ─── Searchable picker (customers / suppliers) ─────────── */
.picker { position: relative; width: 100%; }
.picker:focus-within { z-index: 500; }
.picker input { width: 100%; }
.picker-list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; min-width: 260px; z-index: 1000;
  background: #ffffff; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 14px 35px rgba(0,0,0,.22); max-height: 260px; overflow-y: auto; display: none;
}
.picker-item { padding: 9px 12px; cursor: pointer; font-size: 13px; border-bottom: 1px solid var(--border); }
.picker-item:hover { background: var(--primary-light); }
.picker-item small { color: var(--text-muted); }
.picker-empty { padding: 10px 12px; color: var(--text-muted); font-size: 13px; }
.btn-ghost-inline { background: none; border: 1px solid var(--border); color: var(--text-muted); padding: 8px 14px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.btn-ghost-inline:hover { background: var(--bg); color: var(--text); }

/* ─── Sticky Notes ───────────────────────────────────────── */
.sticky-board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  align-items: start;
}
.sticky-card {
  position: relative;
  border-radius: 12px;
  padding: 16px 18px 12px;
  border: 1px solid;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  min-height: 180px;
  justify-content: space-between;
  word-break: break-word;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.sticky-card:hover {
  transform: translateY(-3px) rotate(-0.3deg);
  box-shadow: 0 10px 22px rgba(0,0,0,0.1);
}
.sticky-pin {
  position: absolute;
  top: -10px;
  right: 14px;
  font-size: 20px;
  cursor: pointer;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.25));
  transition: transform 0.15s ease, opacity 0.15s ease;
  opacity: 0.35;
  user-select: none;
}
.sticky-pin:hover {
  transform: scale(1.25);
  opacity: 1;
}
.sticky-pin.active {
  opacity: 1;
}
.sticky-card.is-pinned {
  box-shadow: 0 6px 16px rgba(0,0,0,0.09), 0 0 0 2px rgba(245,158,11,0.3);
}
.sticky-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}
.sticky-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
  flex: 1;
}
.sticky-actions {
  display: flex;
  gap: 4px;
  opacity: 0.6;
  transition: opacity 0.15s ease;
}
.sticky-card:hover .sticky-actions {
  opacity: 1;
}
.sticky-action-btn {
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 6px;
  padding: 3px 6px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s;
}
.sticky-action-btn:hover {
  background: #ffffff;
  transform: scale(1.1);
}
.sticky-card-body {
  flex: 1;
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  margin-bottom: 12px;
}
.sticky-todo-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  padding: 2px 0;
  margin-bottom: 3px;
  user-select: none;
}
.sticky-todo-item input[type="checkbox"] {
  margin-top: 3px;
  cursor: pointer;
}
.sticky-todo-item.completed span {
  text-decoration: line-through;
  opacity: 0.6;
}
.sticky-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px dashed rgba(0,0,0,0.12);
  font-size: 11px;
}
.sticky-color-dots {
  display: flex;
  gap: 5px;
  align-items: center;
}
.color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  cursor: pointer;
  border: 1px solid rgba(0,0,0,0.2);
  transition: transform 0.15s ease;
}
.color-dot:hover, .color-dot.active {
  transform: scale(1.28);
  border-color: rgba(0,0,0,0.6);
  box-shadow: 0 0 0 2px #fff;
}
.color-dot-yellow { background: #fde047; }
.color-dot-green  { background: #86efac; }
.color-dot-blue   { background: #7dd3fc; }
.color-dot-purple { background: #d8b4fe; }
.color-dot-pink   { background: #fda4af; }
.color-dot-orange { background: #fdba74; }

.filter-pill {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-pill:hover {
  background: var(--bg);
}
.filter-pill.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

/* ─── Sticky Notes Drawer ────────────────────────────────── */
.sticky-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 1000;
  backdrop-filter: blur(2px);
}
.sticky-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 380px;
  max-width: 90vw;
  background: var(--card);
  box-shadow: -8px 0 25px rgba(0,0,0,0.15);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.sticky-drawer.open {
  transform: translateX(0);
}
.sticky-drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fafafa;
}
.sticky-quick-add {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 8px;
  background: #fff;
}
.sticky-quick-add input {
  flex: 1;
}
.sticky-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sticky-drawer-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sticky-drawer-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: #fafafa;
}
.sticky-modal-colors .modal-color-label {
  cursor: pointer;
}
.sticky-modal-colors .modal-color-label input {
  display: none;
}
.sticky-modal-colors .modal-color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-block;
  border: 2px solid transparent;
  transition: all 0.15s;
}
.sticky-modal-colors .modal-color-label input:checked + .modal-color-swatch {
  border-color: #0f172a;
  transform: scale(1.18);
  box-shadow: 0 0 0 2px #fff;
}

/* ─── Order Calendar ────────────────────────────────────────── */
.cal-grid-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 768px) {
  #calendarViewport {
    overflow-x: auto;
  }
}
