/* ==========================================================================
   VINDE CAFÉ OS — Design System
   ========================================================================== */

:root {
  /* Palette — Vinde Café green, from the brand logo */
  --espresso-950: #0E2419;
  --espresso-900: #163C29;
  --espresso-800: #1E4C34;
  --espresso-700: #2A5F41;
  --coffee-600: #2E6B48;
  --coffee-500: #3C8259;
  --coffee-400: #5A9C74;
  --cream-50: #FBF7F0;
  --cream-100: #F6EFE4;
  --cream-200: #EFE4D3;
  --beige-300: #E5D6BE;
  --sage-700: #4C5A41;
  --sage-600: #647255;
  --sage-500: #7C8B6C;
  --sage-100: #E7EBDF;
  --gold-500: #B8923F;
  --gold-100: #F3E9CE;
  --white: #FFFFFF;
  --danger-600: #A23E28;
  --danger-100: #F4DFD7;
  --warning-600: #B37A1F;
  --warning-100: #F5E7CB;
  --success-600: #4F7042;
  --success-100: #E3ECDC;
  --info-600: #3E6B8B;
  --info-100: #DCE9F0;

  --text-primary: #16241D;
  --text-secondary: #5E6B61;
  --text-tertiary: #8D978F;
  --text-inverse: #F6EFE4;
  --border-subtle: #E2E7E0;
  --border-strong: #C7D0C5;
  --surface: #FFFFFF;
  --surface-muted: #FAFAF7;
  --surface-sunken: #F0F4EF;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(14, 36, 25, 0.06), 0 1px 1px rgba(14,36,25,0.04);
  --shadow-md: 0 4px 14px rgba(14, 36, 25, 0.08), 0 1px 3px rgba(14,36,25,0.06);
  --shadow-lg: 0 12px 32px rgba(14, 36, 25, 0.12), 0 2px 8px rgba(14,36,25,0.06);

  --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --sidebar-w: 264px;
  --topbar-h: 68px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--cream-100);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; margin: 0; color: var(--espresso-900); }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
ul { list-style: none; margin: 0; padding: 0; }
input, select, textarea { font-family: inherit; font-size: 14px; }
::selection { background: var(--gold-100); }

:focus-visible {
  outline: 2px solid var(--coffee-500);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; }

/* ==========================================================================
   Layout Shell
   ========================================================================== */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--espresso-950), var(--espresso-900));
  color: var(--text-inverse);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 40;
  transition: transform .25s ease;
}
.sidebar-brand {
  display: flex; align-items: center; justify-content: center;
  padding: 24px 22px 18px;
  border-bottom: 1px solid rgba(246,239,228,0.08);
}
.brand-logo-full {
  width: 100%; max-width: 152px; height: auto;
  display: block; border-radius: 14px;
}
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(145deg, var(--gold-500), var(--coffee-500));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; color: var(--espresso-950);
  font-size: 18px;
  flex-shrink: 0;
}
.brand-mark-box {
  width: 44px; height: 44px; border-radius: 11px;
  flex-shrink: 0; overflow: hidden;
}
.brand-mark-box .brand-logo-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-mark-box.logo-fallback {
  background: linear-gradient(145deg, var(--gold-500), var(--coffee-500));
  display: flex; align-items: center; justify-content: center;
}
.brand-mark-box.logo-fallback::after {
  content: 'V'; font-family: var(--font-display); font-weight: 700; color: var(--espresso-950); font-size: 19px;
}
.sidebar-brand .brand-text { align-items: center; gap: 12px; }
.brand-text .brand-name { font-family: var(--font-display); font-size: 17px; font-weight: 600; color: var(--cream-50); letter-spacing: .2px; }
.brand-text .brand-tag { font-size: 11px; color: var(--beige-300); opacity: .7; font-style: italic; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 12px; }
.nav-section-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: rgba(246,239,228,0.35); padding: 14px 12px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: rgba(246,239,228,0.72);
  font-size: 13.5px; font-weight: 500;
  margin-bottom: 2px;
  transition: background .15s, color .15s;
  position: relative;
}
.nav-item .nav-icon { width: 18px; height: 18px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.nav-item:hover { background: rgba(246,239,228,0.06); color: var(--cream-50); }
.nav-item.active { background: rgba(246,239,228,0.1); color: var(--gold-100); }
.nav-item.active::before {
  content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px;
  background: var(--gold-500); border-radius: 0 4px 4px 0;
}
.nav-badge {
  margin-left: auto; font-size: 10.5px; font-weight: 700; padding: 1px 7px;
  border-radius: var(--radius-pill); background: var(--danger-600); color: white;
}
.sidebar-footer { padding: 14px 20px; border-top: 1px solid rgba(246,239,228,0.08); }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--coffee-500);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: white;
  flex-shrink: 0;
}
.user-chip .u-name { font-size: 13px; font-weight: 600; color: var(--cream-50); }
.user-chip .u-role { font-size: 11px; color: rgba(246,239,228,0.5); }
.user-chip .icon-btn { width: 30px; height: 30px; background: transparent; border-color: rgba(246,239,228,0.18); color: rgba(246,239,228,0.7); flex-shrink: 0; }
.user-chip .icon-btn:hover { background: rgba(246,239,228,0.1); color: var(--cream-50); }

.main-col { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h); flex-shrink: 0;
  background: rgba(251,247,240,0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; gap: 16px;
  padding: 0 28px; position: sticky; top: 0; z-index: 30;
}
.menu-toggle { display: none; }
.topbar-search {
  flex: 1; max-width: 420px; position: relative;
}
.topbar-search input {
  width: 100%; padding: 9px 14px 9px 36px; border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle); background: var(--surface);
  font-size: 13px; color: var(--text-primary);
}
.topbar-search input::placeholder { color: var(--text-tertiary); }
.topbar-search .search-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-tertiary); }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); max-height: 420px; overflow-y: auto; z-index: 50;
}
.search-group-label { padding: 8px 14px 4px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-tertiary); }
.search-result-item { padding: 9px 14px; display: flex; flex-direction: column; gap: 1px; }
.search-result-item:hover { background: var(--surface-muted); cursor: pointer; }
.search-result-item .sr-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.search-result-item .sr-sub { font-size: 11.5px; color: var(--text-secondary); }
.search-empty { padding: 18px 14px; font-size: 12.5px; color: var(--text-tertiary); text-align: center; }

.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.icon-btn {
  width: 38px; height: 38px; border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle); background: var(--surface);
  display: flex; align-items: center; justify-content: center; color: var(--text-secondary);
  position: relative; transition: background .15s;
}
.icon-btn:hover { background: var(--surface-muted); }
.icon-btn .dot { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger-600); border: 1.5px solid var(--surface); }

.page-content { padding: 28px 32px 60px; max-width: 1400px; width: 100%; margin: 0 auto; }

.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-header h1 { font-size: 26px; }
.page-header .page-sub { color: var(--text-secondary); font-size: 13.5px; margin-top: 4px; }
.page-header-actions { display: flex; gap: 10px; }

.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-tertiary); margin-bottom: 8px; }
.breadcrumb a:hover { color: var(--coffee-600); }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 600;
  border: 1px solid transparent; transition: all .15s ease; white-space: nowrap;
}
.btn-primary { background: var(--espresso-900); color: var(--cream-50); }
.btn-primary:hover { background: var(--espresso-800); }
.btn-secondary { background: var(--surface); color: var(--text-primary); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-muted); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--surface-sunken); color: var(--text-primary); }
.btn-danger { background: var(--danger-600); color: white; }
.btn-danger:hover { filter: brightness(1.08); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 7px; }
.btn-lg { padding: 12px 22px; font-size: 14.5px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-icon-only { padding: 8px; }

/* ==========================================================================
   Cards / Surfaces
   ========================================================================== */
.card {
  background: var(--surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px 22px; }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 0; }
.card-header h3 { font-size: 15.5px; }
.card-header .card-header-sub { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }

.kpi-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 22px; }
@media (max-width: 1300px) { .kpi-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }

.kpi-card {
  background: var(--surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
  padding: 16px 18px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.kpi-card .kpi-label { font-size: 11.5px; color: var(--text-secondary); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi-card .kpi-value { font-family: var(--font-display); font-size: 24px; font-weight: 600; color: var(--espresso-900); margin-top: 8px; }
.kpi-card .kpi-delta { font-size: 11.5px; font-weight: 600; margin-top: 6px; display: flex; align-items: center; gap: 4px; }
.kpi-delta.up { color: var(--success-600); }
.kpi-delta.down { color: var(--danger-600); }
.kpi-card .kpi-icon { position: absolute; top: 14px; right: 16px; opacity: .55; color: var(--coffee-500); }

.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 1100px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ==========================================================================
   Status Badges
   ========================================================================== */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px;
  border-radius: var(--radius-pill); font-size: 11.5px; font-weight: 700; letter-spacing: .01em;
  white-space: nowrap;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-neutral { background: var(--surface-sunken); color: var(--text-secondary); }
.badge-info { background: var(--info-100); color: var(--info-600); }
.badge-success { background: var(--success-100); color: var(--success-600); }
.badge-warning { background: var(--warning-100); color: var(--warning-600); }
.badge-danger { background: var(--danger-100); color: var(--danger-600); }
.badge-gold { background: var(--gold-100); color: var(--gold-500); }
.badge-sage { background: var(--sage-100); color: var(--sage-700); }

/* ==========================================================================
   Tables
   ========================================================================== */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table thead th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-tertiary); font-weight: 700; padding: 10px 16px; border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}
.data-table tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr.clickable:hover { background: var(--surface-muted); cursor: pointer; }
.data-table .cell-strong { font-weight: 600; color: var(--text-primary); }
.data-table .cell-muted { color: var(--text-secondary); }
.table-toolbar { display: flex; align-items: center; gap: 10px; padding: 16px 22px; flex-wrap: wrap; }
.table-toolbar .spacer { flex: 1; }

.filter-input, .filter-select {
  padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-subtle);
  background: var(--surface-muted); font-size: 13px; color: var(--text-primary);
}
.filter-input { min-width: 200px; }
.search-with-icon { position: relative; }
.search-with-icon input { padding-left: 32px; }
.search-with-icon svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-tertiary); }

/* ==========================================================================
   Forms
   ========================================================================== */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.form-grid.cols-1 { grid-template-columns: 1fr; }
@media (max-width: 720px) { .form-grid, .form-grid.cols-3 { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.span-2 { grid-column: span 2; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text-primary); }
.field .hint { font-size: 11px; color: var(--text-tertiary); }
.field .error-msg { font-size: 11.5px; color: var(--danger-600); font-weight: 600; }
.input, select.input, textarea.input {
  padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-subtle);
  background: var(--surface); color: var(--text-primary); width: 100%;
  transition: border-color .15s;
}
.input:focus { border-color: var(--coffee-500); }
.input.invalid { border-color: var(--danger-600); background: var(--danger-100); }
textarea.input { resize: vertical; min-height: 80px; }
.checkbox-row { display: flex; align-items: center; gap: 9px; }
.checkbox-row input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--coffee-600); }

/* ==========================================================================
   Modal / Drawer
   ========================================================================== */
.overlay {
  position: fixed; inset: 0; background: rgba(43,27,16,0.45); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 24px;
  animation: fadeIn .15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px; max-height: 88vh; display: flex; flex-direction: column;
  animation: slideUp .18s ease;
}
.modal.modal-lg { max-width: 820px; }
.modal.modal-xl { max-width: 1080px; }
@keyframes slideUp { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border-subtle); }
.modal-header h3 { font-size: 16.5px; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border-subtle); }

.drawer-overlay { position: fixed; inset: 0; background: rgba(43,27,16,0.35); z-index: 90; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 460px; max-width: 92vw;
  background: var(--surface); box-shadow: var(--shadow-lg); z-index: 95; display: flex; flex-direction: column;
  animation: slideLeft .2s ease;
}
@keyframes slideLeft { from { transform: translateX(24px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ==========================================================================
   Tabs
   ========================================================================== */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-subtle); margin-bottom: 20px; overflow-x: auto; }
.tab-btn {
  padding: 11px 16px; font-size: 13px; font-weight: 600; color: var(--text-secondary);
  border-bottom: 2px solid transparent; white-space: nowrap; background: none; border-radius: 0;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--coffee-600); border-bottom-color: var(--coffee-600); }

.segmented { display: flex; gap: 2px; background: var(--surface-muted); border-radius: var(--radius-sm); padding: 3px; }
.segmented-btn {
  padding: 6px 12px; font-size: 12.5px; font-weight: 600; color: var(--text-secondary);
  border-radius: calc(var(--radius-sm) - 2px); background: none; white-space: nowrap;
}
.segmented-btn:hover { color: var(--text-primary); }
.segmented-btn.active { color: var(--coffee-600); background: var(--surface); box-shadow: var(--shadow-sm); }

.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, var(--espresso-950), var(--espresso-900)); padding: 24px;
}
.login-card {
  width: 100%; max-width: 340px; background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 36px 30px; text-align: center;
}
.login-logo { width: 56px; height: 56px; object-fit: contain; margin: 0 auto 14px; display: block; }
.login-card h1 { font-size: 20px; margin-bottom: 4px; }
.login-sub { font-size: 13px; color: var(--text-secondary); margin-bottom: 22px; }
.login-card form { display: flex; flex-direction: column; gap: 12px; }
.login-card .input { text-align: center; letter-spacing: .04em; }
.login-error { min-height: 16px; font-size: 12.5px; color: var(--danger-600); font-weight: 600; }

.rev-margin-summary { display: flex; gap: 28px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-subtle); flex-wrap: wrap; }
.rev-margin-summary > div { display: flex; flex-direction: column; gap: 4px; }
.rms-label { font-size: 11.5px; color: var(--text-tertiary); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.rms-value { font-size: 16px; font-weight: 700; color: var(--text-primary); }

/* ==========================================================================
   Toasts
   ========================================================================== */
.toast-root { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--espresso-900); color: var(--cream-50); padding: 12px 18px; border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 10px;
  min-width: 260px; animation: toastIn .2s ease;
}
.toast.success { background: var(--success-600); }
.toast.error { background: var(--danger-600); }
.toast.warning { background: var(--warning-600); color: var(--espresso-950); }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ==========================================================================
   Empty / Loading States
   ========================================================================== */
.empty-state { text-align: center; padding: 56px 24px; color: var(--text-secondary); }
.empty-state .empty-icon { font-size: 34px; margin-bottom: 12px; opacity: .6; }
.empty-state h4 { font-size: 15px; color: var(--text-primary); margin-bottom: 6px; }
.empty-state p { font-size: 13px; max-width: 340px; margin: 0 auto; }

.skeleton { background: linear-gradient(90deg, var(--surface-sunken) 25%, var(--cream-200) 37%, var(--surface-sunken) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ==========================================================================
   Alerts
   ========================================================================== */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--radius-md); font-size: 12.5px; font-weight: 500; border: 1px solid transparent; }
.alert-warning { background: var(--warning-100); color: var(--warning-600); border-color: #EAD4A0; }
.alert-danger { background: var(--danger-100); color: var(--danger-600); border-color: #E7BFAE; }
.alert-info { background: var(--info-100); color: var(--info-600); border-color: #C6DCE8; }
.alert-success { background: var(--success-100); color: var(--success-600); border-color: #C9DBBE; }

/* ==========================================================================
   Progress
   ========================================================================== */
.progress-track { width: 100%; height: 8px; border-radius: var(--radius-pill); background: var(--surface-sunken); overflow: hidden; }
.progress-fill { height: 100%; border-radius: var(--radius-pill); background: var(--sage-600); transition: width .3s ease; }
.progress-fill.warn { background: var(--warning-600); }
.progress-fill.danger { background: var(--danger-600); }

/* ==========================================================================
   Charts (custom SVG)
   ========================================================================== */
.chart-legend { display: flex; gap: 16px; font-size: 12px; color: var(--text-secondary); flex-wrap: wrap; }
.chart-legend .legend-item { display: flex; align-items: center; gap: 6px; }
.legend-swatch { width: 10px; height: 10px; border-radius: 3px; }

/* ==========================================================================
   Kanban (Pipeline)
   ========================================================================== */
.kanban-board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.kanban-col { flex: 0 0 268px; background: var(--surface-sunken); border-radius: var(--radius-lg); padding: 12px; min-height: 200px; }
.kanban-col.drag-over { outline: 2px dashed var(--coffee-500); outline-offset: -4px; background: var(--cream-200); }
.kanban-col-header { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 12px; }
.kanban-col-title { font-size: 12.5px; font-weight: 700; color: var(--text-primary); }
.kanban-count { font-size: 11px; font-weight: 700; color: var(--text-tertiary); background: var(--surface); padding: 1px 8px; border-radius: var(--radius-pill); }
.kanban-col-value { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }
.kanban-card {
  background: var(--surface); border-radius: var(--radius-md); padding: 12px 13px; margin-bottom: 10px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border-subtle); cursor: grab;
}
.kanban-card:active { cursor: grabbing; }
.kanban-card.dragging { opacity: .4; }
.kanban-card .kc-title { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 3px; }
.kanban-card .kc-sub { font-size: 11.5px; color: var(--text-secondary); margin-bottom: 8px; }
.kanban-card .kc-meta { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--text-tertiary); }
.kanban-card .kc-value { font-weight: 700; color: var(--coffee-600); }

/* ==========================================================================
   Event / Customer Cards
   ========================================================================== */
.event-mini-card { display: flex; align-items: center; gap: 14px; padding: 13px 6px; border-bottom: 1px solid var(--border-subtle); }
.event-mini-card:last-child { border-bottom: none; }
.event-date-box {
  width: 50px; height: 50px; border-radius: var(--radius-md); background: var(--surface-sunken);
  display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0;
}
.event-date-box .d-num { font-family: var(--font-display); font-size: 17px; font-weight: 700; color: var(--espresso-900); line-height: 1; }
.event-date-box .d-mon { font-size: 9.5px; text-transform: uppercase; color: var(--text-secondary); font-weight: 700; }
.event-mini-info { flex: 1; min-width: 0; }
.event-mini-info .em-title { font-size: 13.5px; font-weight: 700; color: var(--text-primary); }
.event-mini-info .em-sub { font-size: 11.5px; color: var(--text-secondary); margin-top: 2px; }

.alert-list { display: flex; flex-direction: column; gap: 8px; }

/* ==========================================================================
   Checklist
   ========================================================================== */
.checklist-group { margin-bottom: 20px; }
.checklist-group-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-secondary); margin-bottom: 10px; }
.checklist-item {
  display: flex; align-items: flex-start; gap: 11px; padding: 10px 4px; border-bottom: 1px solid var(--border-subtle);
}
.checklist-item:last-child { border-bottom: none; }
.checklist-item input[type=checkbox] { width: 19px; height: 19px; margin-top: 1px; accent-color: var(--sage-600); flex-shrink: 0; }
.checklist-item .ci-label { font-size: 13.5px; color: var(--text-primary); flex: 1; }
.checklist-item.done .ci-label { text-decoration: line-through; color: var(--text-tertiary); }
.checklist-item .ci-note { font-size: 11.5px; color: var(--text-tertiary); margin-top: 3px; }

/* ==========================================================================
   Utility
   ========================================================================== */
.flip { transform: scaleX(-1); }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; } .gap-14 { gap: 14px; } .gap-18 { gap: 18px; }
.mt-4 {margin-top:4px;} .mt-8 {margin-top:8px;} .mt-12{margin-top:12px;} .mt-16{margin-top:16px;} .mt-20{margin-top:20px;} .mt-24{margin-top:24px;}
.mb-8{margin-bottom:8px;} .mb-12{margin-bottom:12px;} .mb-16{margin-bottom:16px;}
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-sm { font-size: 12.5px; }
.text-xs { font-size: 11.5px; }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }
.divider { height: 1px; background: var(--border-subtle); margin: 16px 0; }
.pill-tab-group { display: flex; gap: 4px; background: var(--surface-sunken); padding: 4px; border-radius: var(--radius-pill); }
.pill-tab { padding: 7px 14px; border-radius: var(--radius-pill); font-size: 12.5px; font-weight: 600; color: var(--text-secondary); }
.pill-tab.active { background: var(--surface); color: var(--espresso-900); box-shadow: var(--shadow-sm); }
.avatar-stack { display: flex; }
.avatar-stack .stack-avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--coffee-500); color: white; font-size: 10.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid var(--surface); margin-left: -8px; }
.avatar-stack .stack-avatar:first-child { margin-left: 0; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 980px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-col { margin-left: 0; }
  .menu-toggle { display: flex; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .page-content { padding: 18px 16px 90px; }
  .sidebar-scrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 39; }
  .sidebar-scrim.show { display: block; }
}
@media (max-width: 600px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr !important; }
  .field.span-2 { grid-column: span 1; }
  .modal { max-width: 100%; }
}

/* Print (Proposal) */
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .main-col { margin-left: 0 !important; }
  body { background: white; }
}
