/* === RemoCloud Design System v2.0 ===
   Tone: Professional, calm, data-dense. Inspired by Linear, Stripe, Vercel.
   Palette: Zinc neutrals + Amber accent (value, investment, real estate)
   Fonts: Geist (display) + Inter (body)
*/

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

:root {
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);
  --text-3xl:  clamp(2.5rem,   1rem    + 4vw,    5rem);

  --space-1: 0.25rem;  --space-2: 0.5rem;   --space-3: 0.75rem;
  --space-4: 1rem;     --space-6: 1.5rem;   --space-8: 2rem;
  --space-10: 2.5rem;  --space-12: 3rem;    --space-16: 4rem;
  --space-20: 5rem;    --space-24: 6rem;    --space-32: 8rem;

  --color-bg:            oklch(0.985 0.001 240);
  --color-surface:       oklch(1.000 0.000 0);
  --color-surface-2:     oklch(0.970 0.002 240);
  --color-border:        oklch(0.920 0.003 240);
  --color-text:          oklch(0.145 0.010 240);
  --color-text-muted:    oklch(0.450 0.010 240);
  --color-text-faint:    oklch(0.650 0.008 240);
  --color-primary:       oklch(0.720 0.180 55);
  --color-primary-hover: oklch(0.640 0.180 55);
  --color-primary-light: oklch(0.960 0.050 55);
  --color-success:       oklch(0.640 0.150 145);
  --color-warning:       oklch(0.750 0.150 75);
  --color-error:         oklch(0.580 0.200 25);
  --color-info:          oklch(0.580 0.150 230);

  --radius-sm: 0.375rem;  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;   --radius-xl: 1rem;

  --shadow-sm: 0 1px 2px rgba(30, 20, 5, 0.06);
  --shadow-md: 0 4px 12px rgba(30, 20, 5, 0.08);
  --shadow-lg: 0 12px 32px rgba(30, 20, 5, 0.12);

  --font-display: 'Geist', 'Inter', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'Geist Mono', 'JetBrains Mono', monospace;

  --transition: 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary {
  background-color: var(--color-primary);
  color: #fff;
}
.btn-primary:hover {
  background-color: var(--color-primary-hover);
  color: #fff;
}
:root {
  /* Sidebar */
  --sidebar-width: 240px;
  --sidebar-bg: oklch(0.100 0.008 240);
  --sidebar-text: oklch(0.750 0.005 240);
  --sidebar-text-active: oklch(1.000 0.000 0);
  --sidebar-item-active: var(--color-primary);
}


[data-theme="dark"] {
  --color-bg:            oklch(0.090 0.005 240);
  --color-surface:       oklch(0.130 0.006 240);
  --color-surface-2:     oklch(0.170 0.006 240);
  --color-border:        oklch(0.240 0.008 240);
  --color-text:          oklch(0.940 0.003 240);
  --color-text-muted:    oklch(0.620 0.008 240);
  --color-text-faint:    oklch(0.420 0.008 240);
  --color-primary:       oklch(0.780 0.180 55);
  --color-primary-hover: oklch(0.840 0.160 55);
  --color-primary-light: oklch(0.200 0.060 55);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.30);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.40);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.50);
}

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--color-text);
}
a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-hover); }
img { max-width: 100%; height: auto; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* === SKIP LINK (accessibility) === */
.skip-link {
  position: absolute; top: -100%; left: var(--space-4);
  background: var(--color-primary); color: #fff;
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-md);
  font-weight: 600; z-index: 9999;
  transition: top var(--transition);
}
.skip-link:focus { top: var(--space-4); }

/* === LAYOUT === */
.app-layout {
  display: flex; height: 100dvh; overflow: hidden;
}
.app-main {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
  min-width: 0;
}
.app-content {
  flex: 1; overflow-y: auto; padding: var(--space-8);
  background: var(--color-bg);
}

/* === SIDEBAR === */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid oklch(0.2 0.008 240);
}
.sidebar-logo {
  height: 64px; display: flex; align-items: center;
  padding: 0 var(--space-6);
  border-bottom: 1px solid oklch(0.2 0.008 240);
}
.sidebar-logo-text {
  font-family: var(--font-display);
  font-size: 1.125rem; font-weight: 700;
  color: #fff; letter-spacing: -0.01em;
}
.sidebar-logo-text span { color: var(--color-primary); }
.sidebar-tenant {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid oklch(0.2 0.008 240);
  font-size: var(--text-xs); color: var(--sidebar-text);
}
.sidebar-nav { flex: 1; padding: var(--space-4) var(--space-3); display: flex; flex-direction: column; gap: var(--space-1); }
.sidebar-link {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm); font-weight: 500;
  color: var(--sidebar-text);
  transition: background var(--transition), color var(--transition);
  min-height: 44px;
  text-decoration: none;
}
.sidebar-link:hover { background: oklch(0.18 0.008 240); color: #fff; }
.sidebar-link.active { background: var(--color-primary); color: #fff; }
.sidebar-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-footer { padding: var(--space-4) var(--space-3); border-top: 1px solid oklch(0.2 0.008 240); }

/* === TOPBAR === */
.topbar {
  height: 64px; background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--space-8); flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.topbar-title { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: var(--space-3); }

/* === BUTTONS === */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--space-2); padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md); font-size: var(--text-sm);
  font-weight: 500; font-family: inherit;
  border: 1px solid transparent;
  transition: all var(--transition);
  min-height: 44px; white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
}
.btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-hover); color: #fff; }
.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn-secondary:hover { background: var(--color-surface-2); }
.btn-ghost { background: transparent; color: var(--color-text-muted); }
.btn-ghost:hover { background: var(--color-surface-2); color: var(--color-text); }
.btn-danger { background: var(--color-error); color: #fff; }
.btn-danger:hover { opacity: 0.9; }
.btn-sm { padding: var(--space-1) var(--space-3); min-height: 36px; font-size: var(--text-xs); }
.btn-lg { padding: var(--space-3) var(--space-6); min-height: 52px; font-size: var(--text-base); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* === CARDS === */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-4); }
.card-title { font-family: var(--font-display); font-size: var(--text-base); font-weight: 600; }

/* === KPI CARDS === */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-4); }
.kpi-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}
.kpi-label { font-size: var(--text-xs); font-weight: 500; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--space-2); }
.kpi-value { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 700; color: var(--color-text); letter-spacing: -0.02em; }
.kpi-delta { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: var(--space-1); }
.kpi-delta.up { color: var(--color-success); }
.kpi-delta.down { color: var(--color-error); }

/* === FORMS === */
.form-group { display: flex; flex-direction: column; gap: var(--space-1); }
.form-label { font-size: var(--text-sm); font-weight: 500; color: var(--color-text); }
.form-input {
  width: 100%; padding: var(--space-2) var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm); color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition);
  min-height: 44px;
}
.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15);
}
.form-input::placeholder { color: var(--color-text-faint); }
.form-error { font-size: var(--text-xs); color: var(--color-error); }
.form-hint { font-size: var(--text-xs); color: var(--color-text-muted); }

/* === TABLES === */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-xl); border: 1px solid var(--color-border); }
table { width: 100%; border-collapse: collapse; background: var(--color-surface); }
thead { background: var(--color-surface-2); }
th {
  padding: var(--space-3) var(--space-4);
  text-align: left; font-size: var(--text-xs);
  font-weight: 600; color: var(--color-text-muted);
  text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 1px solid var(--color-border);
}
td {
  padding: var(--space-4);
  font-size: var(--text-sm); color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  font-variant-numeric: tabular-nums;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--color-surface-2); }

/* === BADGES === */
.badge {
  display: inline-flex; align-items: center;
  padding: 0.125rem var(--space-2);
  border-radius: 9999px;
  font-size: var(--text-xs); font-weight: 500;
}
.badge-success { background: rgba(100, 180, 100, 0.12); color: var(--color-success); }
.badge-warning { background: rgba(200, 160, 50, 0.12); color: var(--color-warning); }
.badge-error   { background: rgba(200, 60, 40, 0.12); color: var(--color-error); }
.badge-info    { background: rgba(60, 120, 200, 0.12); color: var(--color-info); }
.badge-neutral { background: var(--color-surface-2); color: var(--color-text-muted); }

/* === EMPTY STATE === */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: var(--space-16) var(--space-8);
  text-align: center; gap: var(--space-4);
}
.empty-state-icon { width: 48px; height: 48px; color: var(--color-text-faint); }
.empty-state-title { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 600; }
.empty-state-desc { font-size: var(--text-sm); color: var(--color-text-muted); max-width: 320px; }

/* === SKELETON LOADER === */
.skeleton {
  background: linear-gradient(90deg, var(--color-surface-2) 25%, var(--color-border) 50%, var(--color-surface-2) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}
@keyframes skeleton-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* === MODAL === */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: var(--space-4);
}
.modal {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 520px;
  max-height: 90dvh; overflow-y: auto;
}
.modal-header {
  padding: var(--space-6) var(--space-6) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 600; }
.modal-body { padding: var(--space-6); }
.modal-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--color-border);
  display: flex; justify-content: flex-end; gap: var(--space-3);
}

/* === TOAST === */
.toast-container { position: fixed; bottom: var(--space-6); right: var(--space-6); z-index: 100; display: flex; flex-direction: column; gap: var(--space-2); }
.toast {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
  display: flex; align-items: center; gap: var(--space-3);
  min-width: 280px; max-width: 400px;
}
.toast-success { border-left: 3px solid var(--color-success); }
.toast-error   { border-left: 3px solid var(--color-error); }
.toast-info    { border-left: 3px solid var(--color-info); }

/* === AVATAR === */
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-sm); font-weight: 600;
  flex-shrink: 0;
}

/* === SEARCH INPUT === */
.search-wrapper { position: relative; }
.search-wrapper svg { position: absolute; left: var(--space-3); top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--color-text-faint); pointer-events: none; }
.search-input { padding-left: calc(var(--space-3) + 16px + var(--space-2)); }

/* === STATUS DOT === */
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-dot.active { background: var(--color-success); box-shadow: 0 0 0 2px rgba(100, 180, 100, 0.2); }
.status-dot.pending { background: var(--color-warning); }
.status-dot.inactive { background: var(--color-text-faint); }

/* === THEME TOGGLE === */
.theme-toggle {
  width: 44px; height: 44px; border-radius: var(--radius-md);
  background: transparent; border: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-muted); cursor: pointer;
  transition: all var(--transition);
}
.theme-toggle:hover { background: var(--color-surface-2); color: var(--color-text); }

/* === DIVIDER === */
.divider { height: 1px; background: var(--color-border); margin: var(--space-4) 0; }

/* === GRID HELPERS === */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); }

/* === MOBILE === */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .sidebar.mobile-open {
    display: flex; position: fixed; top: 0; left: 0; bottom: 0; z-index: 40;
  }
  .app-content { padding: var(--space-4); }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar { padding: 0 var(--space-4); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .mobile-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    display: flex; justify-content: space-around;
    padding: var(--space-2) 0 calc(var(--space-2) + env(safe-area-inset-bottom));
    z-index: 30;
  }
  .mobile-nav-item {
    display: flex; flex-direction: column; align-items: center;
    gap: 2px; padding: var(--space-2) var(--space-3);
    font-size: 10px; color: var(--color-text-muted);
    min-width: 44px; min-height: 44px;
    border-radius: var(--radius-md);
    transition: color var(--transition);
    text-decoration: none;
  }
  .mobile-nav-item.active { color: var(--color-primary); }
  .mobile-nav-item svg { width: 22px; height: 22px; }
}
@media (min-width: 769px) { .mobile-nav { display: none; } }

/* === FULLCALENDAR OVERRIDES === */
.fc .fc-toolbar-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text);
}
.fc .fc-button-primary {
  background-color: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-sm);
}
.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.fc .fc-button-primary:hover {
  background-color: var(--color-surface-2);
  border-color: var(--color-border);
  color: var(--color-text);
}
.fc-theme-standard th {
  padding: 10px 0;
  background-color: var(--color-surface-2);
  font-weight: 600;
  color: var(--color-text-muted);
}
.fc-theme-standard td, .fc-theme-standard th {
  border-color: var(--color-border);
}
.fc-event {
  cursor: pointer;
  border: none !important;
  padding: 2px 4px;
  font-size: 0.8rem;
}

/* === SPINNER === */
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === LOADING OVERLAY === */
.loading-center {
  display: flex; align-items: center; justify-content: center;
  min-height: 200px;
}

/* === MESSAGES (Django) === */
.message-success {
  background: rgba(100, 180, 100, 0.08);
  border: 1px solid var(--color-success);
  color: var(--color-success);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}
.message-error {
  background: rgba(200, 60, 40, 0.08);
  border: 1px solid var(--color-error);
  color: var(--color-error);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}
.message-info {
  background: rgba(60, 120, 200, 0.08);
  border: 1px solid var(--color-info);
  color: var(--color-info);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}

/* === TOGGLE SWITCH === */
.toggle-switch {
  position: relative; display: inline-flex;
  width: 44px; height: 24px;
  border-radius: 9999px;
  cursor: pointer;
  transition: background var(--transition);
  border: none;
  flex-shrink: 0;
}
.toggle-switch.on { background: var(--color-primary); }
.toggle-switch.off { background: var(--color-border); }
.toggle-knob {
  position: absolute; top: 2px;
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition);
}
.toggle-switch.on .toggle-knob { transform: translateX(20px); }
.toggle-switch.off .toggle-knob { transform: translateX(2px); }

/* === DROPDOWN MENU === */
.dropdown {
  position: absolute; right: 0; top: calc(100% + 4px);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  z-index: 20;
  overflow: hidden;
}
.dropdown-item {
  display: block; width: 100%;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm); color: var(--color-text);
  background: none; border: none;
  text-align: left; cursor: pointer;
  transition: background var(--transition);
}
.dropdown-item:hover { background: var(--color-surface-2); }
.dropdown-item.danger { color: var(--color-error); }

/* === FILTER TABS === */
.filter-tabs {
  display: flex;
  background: var(--color-surface-2);
  border-radius: var(--radius-lg);
  padding: 4px;
  gap: 2px;
}
.filter-tab {
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm); font-weight: 500;
  color: var(--color-text-muted);
  background: none; border: none;
  cursor: pointer;
  transition: all var(--transition);
  min-height: 36px;
}
.filter-tab.active {
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
}
.filter-tab:hover:not(.active) { color: var(--color-text); }

/* === AI INSIGHT CARD === */
.ai-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.ai-card-header {
  background: var(--color-primary);
  padding: var(--space-3) var(--space-4);
  display: flex; align-items: center; gap: var(--space-2);
  color: #fff;
}
.ai-card-header svg { width: 18px; height: 18px; flex-shrink: 0; }
.ai-card-title { font-size: var(--text-sm); font-weight: 600; }
.ai-card-body { padding: var(--space-4); font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.6; }

/* === SECTION HEADER === */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--space-6);
}
.section-title {
  font-family: var(--font-display);
  font-size: var(--text-lg); font-weight: 700;
  color: var(--color-text);
}
.section-subtitle { font-size: var(--text-sm); color: var(--color-text-muted); margin-top: 2px; }

/* === MATCH SCORE BADGE === */
.match-score {
  display: inline-flex; align-items: center;
  padding: 2px var(--space-2);
  background: var(--color-success);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs); font-weight: 700;
}

/* === RECORDING BAR === */
.recording-bar {
  position: fixed; bottom: var(--space-4); left: 50%; transform: translateX(-50%);
  background: var(--color-error);
  color: #fff;
  padding: var(--space-3) var(--space-6);
  border-radius: 9999px;
  box-shadow: var(--shadow-lg);
  z-index: 50;
  display: flex; align-items: center; gap: var(--space-4);
}

/* === NOTIFICATION BELL === */
.notif-bell {
  position: fixed; bottom: var(--space-6); right: var(--space-6); z-index: 50;
}
.notif-bell-btn {
  position: relative; width: 44px; height: 44px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  box-shadow: var(--shadow-md);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--color-text-muted);
}
.notif-bell-btn:hover { background: var(--color-surface-2); color: var(--color-text); }
.notif-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--color-error); color: #fff;
  font-size: 10px; font-weight: 700;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.notif-dropdown {
  position: absolute; bottom: 52px; right: 0;
  width: 320px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  max-height: 400px; overflow-y: auto;
}
.notif-item {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  transition: background var(--transition);
}
.notif-item:hover { background: var(--color-surface-2); }
.notif-item.unread { background: var(--color-primary-light); }
.notif-item:last-child { border-bottom: none; }

/* === PWA BANNER === */
.pwa-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--color-primary);
  color: #fff;
  padding: var(--space-4);
  z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4);
  animation: slide-up 0.4s ease-out;
}
@keyframes slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* === ONBOARDING WIZARD === */
.onboarding-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: var(--space-4);
}
.onboarding-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  max-width: 440px; width: 100%;
  padding: var(--space-6);
  position: relative;
}
.onboarding-progress {
  display: flex; gap: 6px; margin-bottom: var(--space-6);
}
.onboarding-step {
  flex: 1; height: 4px; border-radius: 9999px;
  background: var(--color-border);
  transition: background var(--transition);
}
.onboarding-step.done { background: var(--color-primary); }
.onboarding-icon {
  width: 56px; height: 56px;
  background: var(--color-primary-light);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto var(--space-4);
  color: var(--color-primary);
}
.onboarding-icon svg { width: 28px; height: 28px; }

/* ============================================================
   WARSTWA KOMPATYBILNOŚCI DARK THEME (v2.1)
   Mapuje stare klasy jasnego motywu (bg-white, text-gray-800, itd.)
   używane w starszych stronach (offers/clients/finance/...)
   na ciemne odpowiedniki design systemu (#0f172a base + slate text).
   Dzięki temu strony dziedziczące base.html są spójne z nowymi
   dashboardami bez konieczności przepisywania każdego pliku.

   Zasada działania: narzędzia Tailwind generują klasy o wysokiej
   specyficzności; tu nadpisujemy je scope'ując do body (specificy 0,0,1 + klasa).
   ============================================================ */

/* --- Tła powierzchni: white/light → ciemne glass --- */
body .bg-white { background-color: rgba(255,255,255,0.04) !important; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
body .bg-gray-50,
body .bg-zinc-50 { background-color: rgba(255,255,255,0.025) !important; }
body .bg-gray-100,
body .bg-zinc-100 { background-color: rgba(255,255,255,0.05) !important; }
body .bg-gray-200,
body .bg-zinc-200 { background-color: rgba(255,255,255,0.08) !important; }

/* --- Tekst: ciemny na jasnym → jasny na ciemnym --- */
body .text-gray-900,
body .text-zinc-900 { color: #ffffff !important; }
body .text-gray-800,
body .text-zinc-800 { color: #f1f5f9 !important; }
body .text-gray-700,
body .text-zinc-700 { color: #e2e8f0 !important; }
body .text-gray-600,
body .text-zinc-600 { color: #cbd5e1 !important; }
body .text-gray-500,
body .text-zinc-500 { color: #94a3b8 !important; }
body .text-gray-400,
body .text-zinc-400 { color: #64748b !important; }

/* --- Obramowania: jasne → ciemne --- */
body .border-gray-50,
body .border-zinc-50 { border-color: rgba(255,255,255,0.05) !important; }
body .border-gray-100,
body .border-zinc-100 { border-color: rgba(255,255,255,0.08) !important; }
body .border-gray-200,
body .border-zinc-200 { border-color: rgba(255,255,255,0.10) !important; }
body .border-gray-300,
body .border-zinc-300,
body .border-zinc-350 { border-color: rgba(255,255,255,0.15) !important; }
body .divide-gray-100 > * + *,
body .divide-zinc-100 > * + * { border-color: rgba(255,255,255,0.08) !important; }
body .divide-gray-200 > * + *,
body .divide-zinc-200 > * + * { border-color: rgba(255,255,255,0.10) !important; }

/* --- Hover states: jasne → ciemne --- */
body .hover\:bg-gray-50:hover,
body .hover\:bg-zinc-50:hover { background-color: rgba(255,255,255,0.06) !important; }
body .hover\:bg-gray-100:hover,
body .hover\:bg-zinc-100:hover { background-color: rgba(255,255,255,0.08) !important; }
body .hover\:bg-gray-200:hover,
body .hover\:bg-zinc-200:hover { background-color: rgba(255,255,255,0.12) !important; }
body .hover\:text-gray-900:hover,
body .hover\:text-zinc-900:hover { color: #ffffff !important; }
body .hover\:text-gray-700:hover,
body .hover\:text-zinc-700:hover { color: #e2e8f0 !important; }

/* --- Placeholdery i inputy --- */
body input::placeholder, body textarea::placeholder { color: #64748b !important; }
body input[type="text"], body input[type="email"], body input[type="password"],
body input[type="number"], body input[type="tel"], body input[type="search"],
body input[type="date"], body textarea, body select {
  color: #f1f5f9 !important;
}

/* --- Drobne korekty: focus rings i shadow-sm na dark --- */
body .shadow-sm { box-shadow: 0 1px 2px 0 rgba(0,0,0,0.3) !important; }

/* --- Akcent brand — wyrównanie starego indigo do #6366f1 --- */
body .bg-indigo-600 { background-color: #6366f1 !important; }
body .bg-indigo-700 { background-color: #4f46e5 !important; }
body .hover\:bg-indigo-600:hover,
body .hover\:bg-indigo-700:hover { background-color: #4f46e5 !important; }
