:root {
  /* =========================================
     DESIGN SYSTEM TOKENS (ERP UI v1)
     ========================================= */
  /* Typography */
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --fs-12: 12px;
  --fs-14: 14px;
  --fs-16: 16px;
  --fs-18: 18px;
  --fs-24: 24px;
  --fs-32: 32px;
  --fw-400: 400;
  --fw-500: 500;
  --fw-600: 600;
  --fw-700: 700;

  /* Radius */
  --r-8: 8px;
  --r-12: 12px;
  --r-16: 16px;
  --r-20: 20px;

  /* Spacing */
  --s-4: 4px;
  --s-8: 8px;
  --s-12: 12px;
  --s-16: 16px;
  --s-20: 20px;
  --s-24: 24px;
  --s-32: 32px;

  /* Component sizes */
  --input-h: 40px;
  --btn-h: 40px;

  /* Colors (Light) */
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #4f46e5;
  --primary-2: #6366f1;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #22c55e;
  --border: rgba(15, 23, 42, 0.10);
  --shadow: 0 14px 40px rgba(15, 23, 42, 0.10);

  /* Legacy aliases (keep existing UI working) */
  --bg-elevated: rgba(255, 255, 255, 0.9);
  --bg-card: var(--surface);
  --bg-sidebar: var(--surface);
  --bg-topbar: var(--surface);
  --bg-input: var(--surface);
  --text-muted: var(--muted);
  --primary-soft: rgba(79, 70, 229, 0.12);
  --primary-strong: var(--primary);
  --shadow-soft: var(--shadow);
  --radius-lg: var(--r-20);
  --radius-md: var(--r-16);
  --radius-sm: var(--r-12);
  --transition-fast: 0.15s ease-out;
  --sidebar-width: 260px;
}

/* =========================================
   DARK THEME - Enterprise Premium Design
   ========================================= */
html[data-theme="dark"],
body.theme-dark {
  /* Backgrounds - layered depth */
  --bg: #0D0F12;
  --surface: #14181F;
  --surface-2: #1A1F28;
  --surface-elevated: #1A1F28;
  
  /* Text hierarchy - improved contrast/readability */
  --text: #E8EAEF;
  --muted: #9CA3B8;
  --text-placeholder: #6B7280;
  
  /* Primary - action only */
  --primary: #6366F1;
  --primary-2: #818CF8;
  --primary-soft: rgba(99, 102, 241, 0.18);
  --primary-strong: #6366F1;
  
  /* Status colors - WCAG-friendly */
  --success: #34D399;
  --warning: #FBBF24;
  --danger: #F87171;
  --info: #60A5FA;
  
  /* Status soft backgrounds */
  --success-soft: rgba(52, 211, 153, 0.15);
  --warning-soft: rgba(251, 191, 36, 0.15);
  --danger-soft: rgba(248, 113, 113, 0.15);
  --info-soft: rgba(96, 165, 250, 0.15);
  
  /* Borders & dividers - lighter for visibility */
  --border: #374151;
  --border-divider: #4B5563;
  
  /* Table specific */
  --table-header-bg: #1A1F28;
  --table-row-hover: #1F2430;
  --table-row-stripe: rgba(26, 31, 40, 0.6);
  
  /* Input specific */
  --input-bg: #111827;
  --input-border: #374151;
  --input-focus-border: #6366F1;
  
  /* Shadows - subtle depth */
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 2px 12px rgba(0, 0, 0, 0.35);
  --shadow-elevated: 0 8px 32px rgba(0, 0, 0, 0.5);

  /* Legacy aliases for compatibility */
  --bg-elevated: #1A1F28;
  --bg-card: #14181F;
  --bg-sidebar: #0F1216;
  --bg-topbar: #0F1216;
  --bg-input: #111827;
  --text-muted: #9CA3B8;
}

/* Dark mode checklist card colors - use palette tokens */
html[data-theme="dark"] .checklist-card--global,
body.theme-dark .checklist-card--global {
  border-left-color: var(--primary);
}

html[data-theme="dark"] .checklist-card--daily,
body.theme-dark .checklist-card--daily {
  border-left-color: var(--info);
}

html[data-theme="dark"] .checklist-card--weekly,
body.theme-dark .checklist-card--weekly {
  border-left-color: var(--primary-2);
}

html[data-theme="dark"] .checklist-card--monthly,
body.theme-dark .checklist-card--monthly {
  border-left-color: var(--primary);
}

html[data-theme="dark"] .checklist-card--order,
body.theme-dark .checklist-card--order {
  border-left-color: var(--info);
}

html[data-theme="dark"] .checklist-card--product,
body.theme-dark .checklist-card--product {
  border-left-color: var(--success);
}

html[data-theme="dark"] .checklist-card--customer,
body.theme-dark .checklist-card--customer {
  border-left-color: var(--warning);
}

html[data-theme="dark"] .checklist-card--global.selected,
html[data-theme="dark"] .checklist-card--daily.selected,
html[data-theme="dark"] .checklist-card--weekly.selected,
html[data-theme="dark"] .checklist-card--monthly.selected,
body.theme-dark .checklist-card--global.selected,
body.theme-dark .checklist-card--daily.selected,
body.theme-dark .checklist-card--weekly.selected,
body.theme-dark .checklist-card--monthly.selected {
  background: var(--primary-soft);
}

html[data-theme="dark"] .checklist-card--order.selected,
body.theme-dark .checklist-card--order.selected {
  background: var(--info-soft);
}

html[data-theme="dark"] .checklist-card--product.selected,
body.theme-dark .checklist-card--product.selected {
  background: var(--success-soft);
}

html[data-theme="dark"] .checklist-card--customer.selected,
body.theme-dark .checklist-card--customer.selected {
  background: var(--warning-soft);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background: radial-gradient(circle at top left, #f9fafb 0, #e5e7eb 45%, #e0f2fe 100%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

body.theme-dark {
  background: var(--bg);
}

html[data-theme="dark"] body {
  background: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

/* =========================================
   COMPONENTS (shared)
   ========================================= */
.page-header,
.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-12);
  margin-bottom: var(--s-12);
}

.page-header h1,
.page-title {
  font-size: var(--fs-24);
  font-weight: var(--fw-700);
  letter-spacing: -0.02em;
  margin: 0;
}

.page-subtitle {
  font-size: var(--fs-14);
  color: var(--muted);
  margin-top: var(--s-4);
}

.toolbar,
.table-controls,
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-8);
  flex-wrap: wrap;
  margin-bottom: var(--s-8);
}

.search-input {
  height: var(--input-h);
  padding: 0 var(--s-12);
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  font-size: var(--fs-14);
  color: var(--text);
  min-width: 220px;
}

.search-input::placeholder {
  color: color-mix(in srgb, var(--muted) 75%, transparent);
}

.btn {
  height: var(--btn-h);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-8);
  padding: 0 var(--s-16);
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: var(--fs-14);
  font-weight: var(--fw-600);
  cursor: pointer;
  transition: transform var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast);
  user-select: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--primary);
  color: #fff;
}

.btn--secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn--danger {
  background: var(--danger);
  color: #fff;
}

.icon-btn {
  height: 34px;
  width: 34px;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-btn:hover {
  background: color-mix(in srgb, var(--surface-2) 65%, transparent);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: var(--fs-12);
  font-weight: var(--fw-600);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
  color: var(--text);
}

.badge--success { background: rgba(34, 197, 94, 0.14); color: color-mix(in srgb, var(--success) 70%, #0f172a); border-color: rgba(34, 197, 94, 0.25); }
.badge--warning { background: rgba(245, 158, 11, 0.14); color: color-mix(in srgb, var(--warning) 70%, #0f172a); border-color: rgba(245, 158, 11, 0.25); }
.badge--danger  { background: rgba(239, 68, 68, 0.14); color: color-mix(in srgb, var(--danger) 70%, #0f172a); border-color: rgba(239, 68, 68, 0.25); }
.badge--info    { background: rgba(99, 102, 241, 0.14); color: color-mix(in srgb, var(--primary) 70%, #0f172a); border-color: rgba(99, 102, 241, 0.25); }

.empty {
  padding: var(--s-24);
  text-align: center;
  color: var(--muted);
}

/* Segmented control (Liste / Kanban) */
.segmented {
  display: inline-flex;
  padding: 2px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
  border: 1px solid var(--border);
}
.segmented__btn {
  border: none;
  background: transparent;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: var(--fs-12);
  font-weight: var(--fw-500);
  cursor: pointer;
  color: var(--muted);
}
.segmented__btn.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.5);
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.tab-btn {
  padding: 12px 20px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
  margin-bottom: -1px;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.tab-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.action-bar {
  display: flex;
  gap: var(--s-8);
  flex-wrap: wrap;
  margin: var(--s-12) 0;
}

.delivery-card {
  border: 1px solid var(--border);
  border-radius: var(--r-16);
  padding: 20px;
  margin-top: 16px;
  background: var(--surface);
}

.delivery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--s-8);
  font-size: var(--fs-14);
}

.totals-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  align-items: center;
}

.header-total {
  background: var(--surface);
  padding: 20px 24px;
  border-radius: var(--r-16);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  min-width: 180px;
  text-align: right;
}

/* Topbar redesign */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-12);
  padding: var(--s-8) var(--s-16);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-left {
  min-width: 0;
}
.topbar-title {
  font-size: var(--fs-18);
  font-weight: var(--fw-600);
}
.topbar-breadcrumb {
  font-size: var(--fs-12);
  color: var(--muted);
  margin-top: 2px;
}
.topbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
}
.topbar-search {
  position: relative;
  max-width: 420px;
  width: 100%;
  display: flex;
  align-items: center;
}
.topbar-search-input {
  width: 100%;
  height: 36px;
  padding: 0 var(--s-12);
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  font-size: var(--fs-14);
}
.topbar-search-input::placeholder {
  color: color-mix(in srgb, var(--muted) 70%, transparent);
}
.topbar-search-dropdown {
  position: absolute;
  top: 40px;
  left: 0;
  right: 0;
  background: var(--surface);
  border-radius: var(--r-12);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  max-height: 320px;
  overflow-y: auto;
  padding: var(--s-8);
}
.topbar-search-dropdown.hidden {
  display: none;
}
.topbar-search-icon {
  position: absolute;
  right: 8px;
  height: 28px;
  width: 28px;
  border-radius: 999px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: none;
}
.search-group-title {
  font-size: var(--fs-12);
  font-weight: var(--fw-600);
  color: var(--muted);
  margin: 4px 0;
}
.search-item {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 4px 6px;
  border-radius: var(--r-8);
  font-size: var(--fs-14);
  cursor: pointer;
}
.search-item:hover {
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
}
.search-empty {
  font-size: var(--fs-12);
  color: var(--muted);
  padding: 4px 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--s-8);
}

.theme-switch {
  position: relative;
  width: 56px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  cursor: pointer;
}
.theme-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25);
  transition: transform 0.2s ease-out;
}
.theme-switch.is-on .theme-switch-thumb {
  transform: translateX(24px);
}
.theme-switch-icon {
  font-size: 14px;
  z-index: 1;
}

.topbar-menu {
  position: relative;
}
.topbar-quick-btn {
  height: 32px;
  padding-inline: 10px;
  font-size: var(--fs-12);
}
.user-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 4px 10px;
  cursor: pointer;
  font-size: var(--fs-12);
}
.user-menu-avatar {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--primary-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 180px;
  background: var(--surface);
  border-radius: var(--r-12);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  padding: 4px;
  z-index: 100;
  max-height: 400px;
  overflow-y: auto;
}
.dropdown.hidden {
  display: none;
}
.dropdown-item {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 6px 8px;
  border-radius: var(--r-8);
  font-size: var(--fs-13);
  cursor: pointer;
}
.dropdown-item:hover:not(:disabled) {
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
}
.dropdown-item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.dropdown-item--label {
  font-weight: var(--fw-600);
  color: var(--muted);
  cursor: default;
}

/* Mobile Header - Clean 2-row layout */
@media (max-width: 768px) {
  .topbar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    gap: 0 8px;
    align-items: center;
    padding: 8px 12px;
  }
  
  /* Row 1: [hamburger] [title] [overflow] */
  .topbar .nav-drawer-trigger {
    grid-column: 1;
    grid-row: 1;
    order: 0;
  }
  
  .topbar-left {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    overflow: hidden;
  }
  
  .topbar-title {
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .topbar-breadcrumb {
    display: none;
  }
  
  .topbar-right {
    grid-column: 3;
    grid-row: 1;
    gap: 4px;
    display: flex;
    align-items: center;
  }
  
  /* Row 2: search bar full width */
  .topbar-center {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    padding-top: 8px;
  }
  
  .topbar-search {
    max-width: none;
  }
  
  .topbar-search-input {
    display: block;
    height: 40px;
  }
  
  .topbar-search-icon {
    display: none;
  }
  
  /* Hide these on mobile - they go in overflow menu */
  .topbar .theme-switch,
  .topbar .topbar-quick-btn,
  .topbar .user-menu-btn,
  .topbar .topbar-menu:not(:last-child) {
    display: none;
  }
  
  /* Only show overflow menu container */
  .topbar .topbar-menu:last-child {
    display: block;
  }
  
  /* Show overflow menu button on mobile */
  .topbar-overflow-btn {
    display: inline-flex !important;
  }
}

/* Overflow menu button - hidden on desktop */
.topbar-overflow-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-8);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 18px;
  color: var(--text);
}

.topbar-overflow-btn:hover {
  background: var(--surface-2);
}

/* Overflow dropdown menu */
.topbar-overflow-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-12);
  box-shadow: var(--shadow-soft);
  padding: 4px;
  z-index: 100;
}

.topbar-overflow-menu.hidden {
  display: none;
}

.topbar-overflow-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-radius: var(--r-8);
  font-size: var(--fs-14);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.topbar-overflow-item:hover {
  background: var(--surface-2);
}

.topbar-overflow-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.topbar-overflow-label {
  padding: 8px 12px 4px;
  font-size: var(--fs-12);
  color: var(--muted);
  font-weight: var(--fw-600);
}

.alert {
  padding: var(--s-8) var(--s-12);
  border-radius: var(--r-12);
  margin-bottom: var(--s-8);
  font-size: var(--fs-14);
}
.alert--danger {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: color-mix(in srgb, var(--danger) 80%, #0f172a);
}

/* Kanban board */
.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-16);
  align-items: flex-start;
}
@media (max-width: 960px) {
  .kanban {
    display: flex;
    overflow-x: auto;
    gap: var(--s-12);
    padding-bottom: var(--s-8);
  }
  .kanban-column {
    min-width: 260px;
    flex: 0 0 auto;
  }
}
.kanban-column {
  background: var(--surface);
  border-radius: var(--r-16);
  box-shadow: var(--shadow-soft);
  padding: var(--s-12);
}
.kanban-column__header {
  font-size: var(--fs-14);
  font-weight: var(--fw-600);
  margin-bottom: var(--s-8);
}
.kanban-column__body {
  display: flex;
  flex-direction: column;
  gap: var(--s-8);
}
.kanban-card {
  border-radius: var(--r-12);
  border: 1px solid var(--border);
  padding: var(--s-8);
  background: color-mix(in srgb, var(--surface-2) 60%, transparent);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kanban-card__header {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-12);
  color: var(--muted);
}
.kanban-card__title {
  font-weight: var(--fw-600);
  color: var(--text);
}
.kanban-card__body {
  font-size: var(--fs-12);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kanban-card__customer {
  font-weight: var(--fw-500);
}
.kanban-card__total {
  font-weight: var(--fw-600);
}
.kanban-card__footer {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.kanban-card__chips {
  margin-top: 2px;
}
.kanban-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: var(--fs-10);
  border: 1px solid var(--border);
}
.kanban-chip--warning {
  background: rgba(245, 158, 11, 0.12);
  color: color-mix(in srgb, var(--warning) 70%, #0f172a);
}
.kanban-chip--danger {
  background: rgba(239, 68, 68, 0.16);
  color: color-mix(in srgb, var(--danger) 70%, #0f172a);
}

/* ===========================
   Orders Page Mobile Styles
   =========================== */

/* Desktop orders filters - pills left, search right */
.orders-desktop-filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* Pills horizontal scroll container (desktop) */
.orders-pills-scroll {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 0;
}

/* Desktop search input - larger and aligned */
.orders-search-desktop {
  min-width: 280px;
  max-width: 350px;
  height: 38px;
  font-size: 14px;
}

.orders-filters-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.orders-filters-row .search-input {
  min-width: 150px;
  flex: 1;
}

/* Mobile Filters Container */
.orders-filters-mobile {
  padding: 12px;
  border-bottom: none;
}

.orders-search-row-mobile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.orders-search-row-mobile .search-input {
  width: 100%;
  box-sizing: border-box;
}

/* Mobile Status Tabs (wrapping) */
.orders-status-tabs-mobile {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.orders-status-tab {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  color: var(--text);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.orders-status-tab:hover {
  background: var(--border);
}

.orders-status-tab.is-active {
  background: var(--primary) !important;
  color: white !important;
  border-color: var(--primary) !important;
}

.orders-status-tab.is-active:hover,
.orders-status-tab.is-active:focus,
.orders-status-tab.is-active:active {
  background: var(--primary) !important;
  color: white !important;
}

/* Mobile Kanban Tabs */
.kanban-mobile-tabs {
  display: none;
}

.kanban-mobile-column {
  display: none;
}

/* Mobile List Items */
.orders-mobile-list {
  display: none;
}

.orders-mobile-item {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.orders-mobile-item:last-child {
  border-bottom: none;
}

.orders-mobile-item__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.orders-mobile-item__orderNo {
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  font-size: 14px;
}

.orders-mobile-item__date {
  font-size: 12px;
  color: var(--muted);
}

.orders-mobile-item__customer {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 6px;
}

.orders-mobile-item__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.orders-mobile-item__total {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.orders-mobile-item__badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.orders-mobile-item__badges .badge {
  font-size: 10px;
  padding: 2px 6px;
}

.orders-mobile-item__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.orders-mobile-item__actions .btn {
  font-size: 12px;
  padding: 6px 10px;
}

.orders-mobile-item__icons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 768px) {
  /* Pills: horizontal scroll, no wrap */
  .orders-pills-scroll {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    padding-bottom: 8px;
    margin-bottom: 12px;
    scrollbar-width: thin;
  }
  
  .orders-pills-scroll::-webkit-scrollbar {
    height: 4px;
  }
  
  .orders-pills-scroll::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
  }
  
  .orders-pills-scroll .btn {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  
  /* Filters stack vertically */
  .orders-filters-row {
    flex-direction: column;
    gap: 8px;
  }
  
  .orders-filters-row .search-input {
    width: 100%;
    min-width: 0;
  }
  
  /* Mobile list visible, table hidden */
  .orders-mobile-list {
    display: block;
  }
  
  /* Hide desktop table on mobile */
  #orders-view .table-wrap {
    display: none;
  }
  
  /* Mobile Kanban: Tabs + Single column */
  .kanban-mobile-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .kanban-mobile-tab {
    flex: 1;
    min-width: 70px;
    padding: 10px 8px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
  }
  
  .kanban-mobile-tab:hover {
    background: var(--border);
  }
  
  .kanban-mobile-tab.is-active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
  }
  
  .kanban-mobile-tab__count {
    display: inline-block;
    min-width: 18px;
    padding: 2px 5px;
    margin-left: 4px;
    font-size: 10px;
    font-weight: 600;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
  }
  
  .kanban-mobile-tab.is-active .kanban-mobile-tab__count {
    background: rgba(255,255,255,0.3);
  }
  
  .kanban-mobile-column {
    display: block;
  }
  
  /* Hide desktop kanban on mobile */
  .kanban {
    display: none !important;
  }
  
  /* Kanban card adjustments for mobile */
  .kanban-mobile-column .kanban-card {
    margin-bottom: 8px;
  }
  
  .kanban-mobile-column .kanban-card__footer {
    flex-wrap: wrap;
    gap: 6px;
  }
  
  .kanban-mobile-column .kanban-card__footer .btn {
    font-size: 12px;
    padding: 6px 10px;
  }
}

/* ===========================
   Order Detail Mobile Styles
   =========================== */

/* Desktop table (hidden on mobile) */
.order-detail-table-desktop {
  display: block;
}

/* Mobile list (hidden on desktop) */
.order-detail-mobile-list {
  display: none;
}

.order-detail-mobile-item {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  background: var(--surface);
}

.order-detail-mobile-item:last-child {
  margin-bottom: 0;
}

.order-detail-mobile-item__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.order-detail-mobile-item__price {
  font-weight: 600;
  color: var(--text);
}

.order-detail-mobile-item__name {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 8px;
}

.order-detail-mobile-item__row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
}

.order-detail-mobile-item__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

@media (max-width: 768px) {
  /* Hide desktop tables, show mobile lists */
  .order-detail-table-desktop {
    display: none;
  }
  
  .order-detail-mobile-list {
    display: block;
  }
  
  /* Order detail page header adjustments */
  .page-header .header-total {
    text-align: left;
    margin-top: 12px;
  }
  
  /* Reduce totals row spacing */
  .totals-row {
    gap: 8px;
    padding: 12px;
    font-size: 13px;
  }
  
  /* Delivery card compact */
  .delivery-card {
    margin-bottom: 12px;
    padding: 12px;
  }
  
  .delivery-header {
    margin-bottom: 8px;
  }
  
  /* Action bar compact */
  .action-bar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0;
  }
  
  .action-bar .btn {
    font-size: 12px;
    padding: 8px 12px;
  }
  
  /* Tabs horizontal scroll */
  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    padding-bottom: 8px;
  }
  
  .tabs .tab-btn {
    flex: 0 0 auto;
    font-size: 13px;
    padding: 8px 12px;
  }
  
  /* Production progress grid compact */
  #tab-production .card > div:first-of-type > div:first-child {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
}

/* ===========================
   Global Mobile List Item Styles (Shared)
   =========================== */

/* Generic mobile list item card */
.mobile-list-item {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  background: var(--surface);
}

.mobile-list-item:last-child {
  margin-bottom: 0;
}

.mobile-list-item__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}

.mobile-list-item__title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.mobile-list-item__subtitle {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 6px;
}

.mobile-list-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.mobile-list-item__meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.mobile-list-item__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  gap: 8px;
}

.mobile-list-item__actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.mobile-list-item--danger {
  border-left: 3px solid var(--danger);
}

.mobile-list-item--warning {
  border-left: 3px solid var(--warning);
}

/* Mobile table container (hidden by default, shown on mobile) */
.mobile-table-list {
  display: none;
}

/* Desktop table wrapper */
.desktop-table-wrap {
  display: block;
}

/* ===========================
   Categories Page Mobile
   =========================== */
.categories-page-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.category-products-mobile-list,
.category-critical-mobile-list {
  display: none;
}

.category-products-desktop-table,
.category-critical-desktop-table {
  display: block;
}

/* ===========================
   Notifications Tabs
   =========================== */
.notifications-tabs-card {
  padding: 0 !important;
}

.notifications-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
}

.notifications-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 12px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.notifications-tab:hover {
  background: var(--surface-2);
  color: var(--text);
}

.notifications-tab.is-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--surface);
}

.notifications-tab .badge {
  font-size: 11px;
  padding: 2px 6px;
}

/* ===========================
   Checklists Layout
   =========================== */
.checklists-layout {
  display: flex;
  gap: 16px;
}

.checklists-list-pane {
  flex: 1;
  min-width: 0;
}

.checklists-detail-pane {
  width: 400px;
  flex-shrink: 0;
}

.checklists-detail-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

/* Checklist inline detail (mobilde kartın altında açılır) */
.checklist-inline-detail {
  display: none; /* Varsayılan: desktop'ta gizli */
}

/* Desktop detail panel */
.checklists-desktop-detail {
  display: flex; /* Desktop'ta görünür */
}

/* ===========================
   Products Page Mobile
   =========================== */
.products-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.products-mobile-list {
  display: none;
}

.products-desktop-table {
  display: block;
}

/* ===========================
   Materials Page Mobile
   =========================== */
.materials-mobile-list {
  display: none;
}

.materials-desktop-table {
  display: block;
}

/* ===========================
   Stock Movements Page Mobile
   =========================== */
.stock-mobile-list {
  display: none;
}

.stock-desktop-table {
  display: block;
}

/* ===========================
   Customers Page Mobile
   =========================== */
.customers-filters {
  display: flex;
  flex-direction: row;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.customers-mobile-list {
  display: none;
}

.customers-desktop-table {
  display: block;
}

.products-filters {
  display: flex;
  flex-direction: row;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

/* ===========================
   Critical Stock Page Mobile
   =========================== */
.critical-controls-top {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.critical-controls-sub {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.critical-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.critical-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.critical-mobile-list {
  display: none;
}

.critical-desktop-table {
  display: block;
}

.blocked-orders-mobile-list {
  display: none;
}

.blocked-orders-desktop-table {
  display: block;
}

/* ===========================
   Reports Page Mobile
   =========================== */
.reports-page .tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.reports-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* Rapor özet kartları — desktop & mobil */
.report-summary-card-wrap {
  margin-bottom: 16px;
  padding: 0;
  overflow: hidden;
}

.report-summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  padding: 16px;
}

.report-summary-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  background: var(--bg-card, #f8fafc);
  border-radius: 10px;
  border: 1px solid var(--border);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.report-summary-card:hover {
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  border-color: var(--border);
}

.report-summary-card__label {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.35;
  font-weight: 500;
}

.report-summary-card__value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.report-summary-card__hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Rapor açılır/kapanır bloklar — desktop'ta her zaman açık, mobilde toggle */
.report-collapse__header {
  display: none;
}

.report-collapse__body {
  display: block;
}

/* Desktop: filtreler ile özet kartları arasında boşluk, filtre alanına nefes alanı */
.reports-page .report-collapse--filters {
  margin-bottom: 28px;
}

.reports-page .report-collapse--filters .report-collapse__body {
  padding: 18px 20px;
  background: var(--bg-card, #f8fafc);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.reports-page .report-collapse--summary {
  margin-top: 4px;
}

.reports-mobile-list {
  display: none;
}

.reports-desktop-table {
  display: block;
}

/* ===========================
   Stock Movements Page Mobile
   =========================== */
.stock-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ===========================
   Mobile Breakpoint Overrides (<=768px)
   =========================== */
@media (max-width: 768px) {
  /* ---- Categories Page ---- */
  .categories-page-layout {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }
  
  .category-row {
    flex-wrap: wrap;
  }
  
  .category-actions {
    width: 100%;
    margin-top: 8px;
    justify-content: flex-end;
  }
  
  .category-products-mobile-list,
  .category-critical-mobile-list {
    display: block;
  }
  
  .category-products-desktop-table,
  .category-critical-desktop-table {
    display: none;
  }
  
  /* ---- Notifications/Notes Tabs ---- */
  .notifications-tabs {
    flex-wrap: wrap;
  }
  
  .notifications-tab {
    flex: 1 1 33.33%;
    min-width: 0;
    padding: 12px 8px;
    font-size: 12px;
    text-align: center;
  }
  
  .notifications-tab span:first-child {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .notifications-tab .badge {
    font-size: 10px;
    padding: 1px 4px;
    margin-left: 4px;
  }
  
  /* ---- Checklists Layout Mobile ---- */
  .checklists-layout {
    flex-direction: column;
    gap: 16px;
  }
  
  .checklists-list-pane {
    width: 100%;
  }
  
  .checklists-detail-pane {
    width: 100%;
    min-width: 0 !important;
  }
  
  .checklists-detail-empty {
    display: none;
  }
  
  .checklist-detail-panel {
    min-width: 0 !important;
    width: 100% !important;
  }
  
  .checklist-list {
    max-height: none;
    overflow: visible;
  }
  
  .checklist-card {
    padding: 12px;
  }
  
  /* Mobilde: inline detay göster, desktop detay paneli gizle */
  .checklist-inline-detail {
    display: block;
    margin-top: 8px;
    margin-bottom: 16px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  }
  
  .checklists-desktop-detail {
    display: none !important;
  }
  
  /* ---- Products Page ---- */
  .products-summary-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  /* ---- Customers Page ---- */
  .customers-filters {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  
  .customers-filters .search-input,
  .customers-filters .field-select {
    width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
  }
  
  .customers-mobile-list {
    display: block;
  }
  
  .customers-desktop-table {
    display: none;
  }
  
  /* ---- Products Page ---- */
  .products-filters {
    flex-direction: column;
    gap: 8px;
  }
  
  .products-filters .search-input,
  .products-filters .field-select {
    width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
  }
  
  .products-mobile-list {
    display: block;
  }
  
  .products-desktop-table {
    display: none;
  }
  
  /* ---- Materials Page ---- */
  .materials-mobile-list {
    display: block;
  }
  
  .materials-desktop-table {
    display: none;
  }
  
  /* ---- Stock Movements Page ---- */
  .stock-filters {
    flex-direction: column;
    gap: 8px;
  }
  
  .stock-filters .search-input,
  .stock-filters .field-select {
    width: 100% !important;
    min-width: 0 !important;
  }
  
  .stock-mobile-list {
    display: block;
    min-width: 0;
    overflow-x: hidden;
  }
  
  .stock-mobile-list .mobile-list-item {
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  .stock-mobile-list .mobile-list-item__title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .stock-desktop-table {
    display: none;
  }
  
  /* ---- Critical Stock Page ---- */
  .critical-controls-top,
  .critical-controls-sub {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .critical-controls-top .btn,
  .critical-controls-sub .btn {
    flex: 1;
    min-width: calc(50% - 4px);
    text-align: center;
  }
  
  .critical-filters {
    flex-direction: column;
    gap: 8px;
  }
  
  .critical-filters .search-input,
  .critical-filters .field-select {
    width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
  }
  
  .critical-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .critical-mobile-list {
    display: block;
  }
  
  .critical-desktop-table {
    display: none;
  }
  
  /* Blocked orders table mobile */
  .blocked-orders-mobile-list {
    display: block;
  }
  
  .blocked-orders-desktop-table {
    display: none;
  }
  
  /* ---- Reports Page ---- */
  .reports-page .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    padding-bottom: 8px;
  }
  
  .reports-page .tabs .tab-btn {
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 12px;
    padding: 8px 12px;
  }
  
  .reports-filters {
    flex-direction: column;
    gap: 8px;
  }
  
  .reports-mobile-list {
    display: block;
  }
  
  .reports-desktop-table {
    display: none;
  }
  
  .reports-filters .field-input,
  .reports-filters .field-select,
  .reports-filters input[type="date"],
  .reports-filters select {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    box-sizing: border-box;
  }
  
  .reports-filters .form-group {
    width: 100%;
    min-width: 0;
  }
  
  .report-collapse {
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 12px;
    overflow: hidden;
    background: var(--surface);
  }
  
  .report-collapse__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    background: var(--bg-card, #f8fafc);
    border: none;
    cursor: pointer;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
  }
  
  .report-collapse__header:hover {
    background: var(--surface-2, #f1f5f9);
  }
  
  .report-collapse__arrow {
    flex-shrink: 0;
    margin-left: 8px;
    font-size: 12px;
    color: var(--text-muted);
  }
  
  .report-collapse__arrow::after {
    content: '▲';
  }
  
  .report-collapse.is-closed .report-collapse__arrow::after {
    content: '▼';
  }
  
  .report-collapse.is-closed .report-collapse__body {
    display: none !important;
  }
  
  .report-collapse__body {
    padding: 12px 14px;
    border-top: 1px solid var(--border);
  }
  
  .report-collapse__body .reports-filters {
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }
  
  .report-collapse__body .reports-filters .form-group {
    width: 100%;
    min-width: 0;
  }
  
  .report-collapse__body .reports-filters .field-input,
  .report-collapse__body .reports-filters .field-select,
  .report-collapse__body .reports-filters input[type="date"],
  .report-collapse__body .reports-filters input[type="text"],
  .report-collapse__body .reports-filters select {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    box-sizing: border-box;
  }
  
  .report-collapse__body .report-summary-card-wrap {
    margin-bottom: 0;
  }
  
  .report-summary-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 12px;
  }
  
  .report-summary-card {
    padding: 12px 14px;
    min-height: 72px;
  }
  
  .report-summary-card__label {
    font-size: 11px;
  }
  
  .report-summary-card__value {
    font-size: 18px;
  }
  
  .report-summary-card__hint {
    font-size: 10px;
  }
  
  .reports-mobile-list {
    display: block;
  }
  
  .reports-desktop-table {
    display: none;
  }
  
  /* ---- Generic table controls mobile ---- */
  .table-controls {
    flex-direction: column;
    gap: 8px;
  }
  
  .table-controls .search-input {
    width: 100%;
    min-width: 0 !important;
  }
  
  .table-controls select {
    width: 100%;
    min-width: 0 !important;
  }
  
  /* Stack horizontal becomes vertical on mobile */
  .stack-horizontal {
    flex-wrap: wrap;
  }
}

/* Very small screens */
@media (max-width: 480px) {
  .products-summary-grid,
  .critical-stats-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .mobile-list-item__meta {
    flex-direction: column;
    gap: 4px;
  }
  
  .critical-controls-top .btn,
  .critical-controls-sub .btn {
    min-width: 100%;
  }
}

/* Order workflow stepper */
.order-stepper {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}
.order-step {
  flex: 1;
  text-align: center;
  font-size: var(--fs-10);
  padding: 4px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 80%, transparent);
  color: var(--muted);
}
.order-step.is-active {
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-weight: var(--fw-600);
}

/* Row highlights */
.row-danger {
  background: rgba(239, 68, 68, 0.06);
}
.row-warning {
  background: rgba(245, 158, 11, 0.06);
}

.print-hide { display: block; }
.print-only { display: none; }

@media print {
  body { background: #fff !important; }
  .sidebar, .topbar, .action-bar, .tabs, .print-hide { display: none !important; }
  .content, .card, .page-header { box-shadow: none !important; border: none !important; }
  .print-only { display: block !important; }
  a { color: #000; text-decoration: none; }
}

.empty-title {
  font-size: var(--fs-16);
  font-weight: var(--fw-700);
  color: var(--text);
  margin-bottom: var(--s-8);
}

.empty-desc {
  font-size: var(--fs-14);
  margin-bottom: var(--s-12);
}

.skeleton {
  border-radius: var(--r-12);
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--surface-2) 80%, transparent) 0%,
    color-mix(in srgb, var(--surface-2) 40%, transparent) 50%,
    color-mix(in srgb, var(--surface-2) 80%, transparent) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

input,
select,
textarea {
  font-family: inherit;
}

/* Login page styling */
.login-page {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 32px 16px;
  background: linear-gradient(135deg, #4c1d95 0%, #3730a3 25%, #1e3a8a 50%, #1e40af 75%, #1e3a8a 100%);
}

body.theme-dark .login-page {
  background: linear-gradient(135deg, #312e81 0%, #1e1b4b 25%, #1e1b4b 50%, #0f172a 75%, #020617 100%);
}

.login-blur-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.85;
  mix-blend-mode: screen;
  pointer-events: none;
  animation: float 20s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(30px, -30px) scale(1.1);
  }
  66% {
    transform: translate(-20px, 20px) scale(0.9);
  }
}

.login-blob-1 {
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, #7c3aed 0%, #6d28d9 30%, #5b21b6 60%, #4c1d95 100%);
  top: -200px;
  left: -150px;
  animation-delay: 0s;
}

.login-blob-2 {
  width: 750px;
  height: 750px;
  background: radial-gradient(circle, #2563eb 0%, #1d4ed8 30%, #1e40af 60%, #1e3a8a 100%);
  bottom: -250px;
  right: -200px;
  animation-delay: -7s;
}

.login-blob-3 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #ea580c 0%, #f97316 30%, #fb923c 60%, #f59e0b 100%);
  bottom: 8%;
  right: 12%;
  animation-delay: -14s;
}

.login-blob-4 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #db2777 0%, #ec4899 30%, #f472b6 60%, #fb7185 100%);
  top: 15%;
  right: 3%;
  animation-delay: -10s;
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  border-radius: 26px;
  background: linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.9),
      rgba(248, 250, 252, 0.8)
    );
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow:
    0 26px 80px rgba(15, 23, 42, 0.3),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.9);
  padding: 28px 30px 30px;
  backdrop-filter: blur(24px);
  z-index: 1;
}

body.theme-dark .login-card {
  background: linear-gradient(
      135deg,
      rgba(15, 23, 42, 0.98),
      rgba(15, 23, 42, 0.92)
    );
  border-color: rgba(148, 163, 184, 0.25);
}

.login-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.login-card-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.login-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.login-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
  border: 1px solid rgba(148, 163, 184, 0.35);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.login-close {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(248, 250, 252, 0.8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

body.theme-dark .login-close {
  background: rgba(15, 23, 42, 0.8);
}

.login-close:hover {
  transform: translateY(-1px) scale(1.03);
}

/* Form group spacing is handled inline in forms */

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="email"],
.form-group input[type="url"],
.form-group input[type="date"],
.form-group input[type="datetime-local"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 14px;
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}

.input-underline-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(148, 163, 184, 0.7);
  padding-bottom: 6px;
}

.input-underline {
  border: none;
  outline: none;
  flex: 1;
  background: transparent;
  font-size: 14px;
  padding: 0;
  color: var(--text);
}

.input-underline::placeholder {
  color: rgba(148, 163, 184, 0.9);
}

.input-icon {
  font-size: 15px;
  color: rgba(148, 163, 184, 0.95);
  margin-left: 8px;
}

.login-remember-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0 18px;
  font-size: 13px;
}

.login-remember-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
}

.login-link {
  color: var(--primary-strong);
  font-weight: 500;
  cursor: pointer;
}

.btn-primary {
  width: 100%;
  padding: 11px 14px;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  letter-spacing: 0.06em;
  font-size: 13px;
  text-transform: uppercase;
  background: #0f172a;
  color: white;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.45);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast),
    background var(--transition-fast);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 24px 55px rgba(15, 23, 42, 0.6);
}

.login-bottom-text {
  margin-top: 14px;
  font-size: 13px;
  text-align: center;
  color: var(--text-muted);
}

.login-bottom-text span {
  color: var(--primary-strong);
  font-weight: 500;
  cursor: pointer;
}

/* App Shell */
.app-shell {
  display: flex;
  min-height: 100vh;
  background: radial-gradient(circle at top left, #f9fafb 0, #e5e7eb 40%, #e0f2fe 100%);
}

body.theme-dark .app-shell {
  background: radial-gradient(circle at top left, #020617 0, #020617 40%, #0f172a 100%);
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 4px 10px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.sidebar-logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #ec4899);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
}

.sidebar-nav {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  transition: background var(--transition-fast), color var(--transition-fast),
    transform var(--transition-fast);
}

.sidebar-item-icon {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(148, 163, 184, 0.16);
}

.sidebar-item.active {
  background: var(--primary-soft);
  color: var(--primary-strong);
  transform: translateY(-1px);
}

.sidebar-footer {
  margin-top: auto;
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.85;
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 56px;
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
}

.topbar-left {
  font-weight: 600;
  letter-spacing: -0.02em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pill {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
}

.btn-ghost {
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 6px 10px;
  background: transparent;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12px;
}

.btn-ghost-danger {
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--danger);
}

.content {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
  background: var(--bg);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.card {
  background: var(--surface);
  border-radius: var(--r-16);
  border: 1px solid var(--border);
  padding: 24px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.card-main-number {
  font-size: 22px;
  font-weight: 700;
  margin-top: 4px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 0;
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
}

/* btn-sm ile btn--primary/ghost kombinasyonları */
.btn-sm.btn--primary {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.btn-sm.btn--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn-sm-primary {
  background: var(--primary);
  border-color: transparent;
  color: white;
}

.btn-sm-danger {
  background: var(--danger);
  border-color: transparent;
  color: white;
}

.table-wrapper {
  background: var(--surface);
  border-radius: var(--r-16);
  border: 1px solid var(--border);
  padding: 0;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-wrapper table,
.table-wrap table {
  min-width: 520px;
}

.card:has(table.data-table) {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.card:has(table.data-table) table.data-table {
  min-width: 520px;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.table-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.search-input {
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 14px;
  min-width: 220px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  background: var(--surface-2);
}

tbody tr {
  transition: background 0.15s ease;
}

tbody tr:hover {
  background: var(--surface-2);
}

tbody tr:last-child td {
  border-bottom: none;
}

.badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
}

.badge-success {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.badge-warning {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}

.badge-info {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 6px;
}

.field-label {
  font-size: 12px;
  color: var(--text-muted);
}

.field-input,
.field-select,
.field-textarea {
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 14px;
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.field-textarea {
  min-height: 70px;
  resize: vertical;
}

.field-error {
  font-size: 11px;
  color: var(--danger);
  margin-top: 4px;
}

.page-split {
  display: grid;
  grid-template-columns: 2fr 1.5fr;
  gap: 24px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

@media (max-width: 960px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .page-split {
    grid-template-columns: 1fr;
  }
  
  /* Category page responsive */
  .categories-page-layout {
    grid-template-columns: 1fr !important;
  }
  
  #category-detail-panel {
    position: static !important;
    max-height: none !important;
  }
}

.page-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.stack-vertical {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stack-horizontal {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pill-soft {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(148, 163, 184, 0.18);
  color: var(--text-muted);
}

.text-muted {
  color: var(--text-muted);
}

.text-right {
  text-align: right;
}

.text-sm {
  font-size: 12px;
}

.text-danger {
  color: var(--danger);
}

.text-success {
  color: var(--success);
}

.text-warning {
  color: var(--warning);
}

.text-info {
  color: var(--primary);
}

/* Dropdown menu */
.dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  margin-top: 4px;
  z-index: 10;
}

.dropdown-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

.dropdown-menu-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  min-width: 200px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  z-index: 1001;
  position: absolute;
  animation: slideUp 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-item-modal {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  border-radius: 6px;
  font-size: 14px;
  transition: background 0.2s;
}

.dropdown-item-modal:hover {
  background: var(--surface-2);
}

.dropdown-item-modal:active {
  background: var(--surface-3);
  min-width: 160px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.dropdown-item:hover {
  background: var(--surface-2);
}

/* =========================================
   NOTES & CHECKLISTS UI COMPONENTS (B3)
   ========================================= */

/* Notes List & Cards */
.notes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding: 8px;
}

.note-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-12);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
}

.note-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.1);
  transform: translateY(-1px);
}

.note-card.selected {
  border-color: var(--primary);
  border-width: 2px;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
  background: var(--primary-soft);
}

.note-card:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.note-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 6px;
}

.note-card-preview {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.note-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

/* Note Preview Panel */
.notes-split-pane {
  display: flex;
  gap: 16px;
  height: calc(100vh - 200px);
  min-height: 600px;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

.notes-list-pane {
  width: 400px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  padding-right: 16px;
}

.notes-preview-pane {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-12);
  border: 1px solid var(--border);
  padding: 24px;
  overflow: hidden;
  overflow-x: hidden;
  max-height: calc(100vh - 300px);
  max-width: 100%;
  box-sizing: border-box;
}

.note-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.note-preview-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.3;
}

.note-preview-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.note-preview-content {
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  margin-bottom: 24px;
  flex: 0 1 auto;
  min-height: 0;
  max-height: 250px;
  max-width: 100%;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  box-sizing: border-box;
}

#note-preview-edit-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

#note-preview-edit-form .form-group {
  display: flex;
  flex-direction: column;
}

#note-preview-edit-form textarea {
  font-family: inherit;
  resize: vertical;
  max-height: 300px;
  max-width: 100%;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  box-sizing: border-box;
}

.note-preview-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* Checklist List & Cards */
.checklist-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding: 8px;
}

.checklist-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-12);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
}

/* GLOBAL Checklists - Goal Period Colors */
.checklist-card--global {
  border-left: 4px solid #6366f1;
}

.checklist-card--daily {
  border-left: 4px solid #3b82f6;
}

.checklist-card--weekly {
  border-left: 4px solid #8b5cf6;
}

.checklist-card--monthly {
  border-left: 4px solid #6366f1;
}

/* CONTEXTUAL Checklists - Context Type Colors */
.checklist-card--order {
  border-left: 4px solid #3b82f6;
}

.checklist-card--product {
  border-left: 4px solid #22c55e;
}

.checklist-card--customer {
  border-left: 4px solid #f59e0b;
}

.checklist-card--contextual {
  border-left: 4px solid #64748b;
}

.checklist-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.checklist-card--global:hover,
.checklist-card--daily:hover,
.checklist-card--weekly:hover,
.checklist-card--monthly:hover {
  border-left-width: 5px;
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.15);
}

.checklist-card--order:hover {
  border-left-width: 5px;
  box-shadow: 0 2px 12px rgba(59, 130, 246, 0.15);
}

.checklist-card--product:hover {
  border-left-width: 5px;
  box-shadow: 0 2px 12px rgba(34, 197, 94, 0.15);
}

.checklist-card--customer:hover {
  border-left-width: 5px;
  box-shadow: 0 2px 12px rgba(245, 158, 11, 0.15);
}

.checklist-card.selected {
  border-width: 2px;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
  background: var(--primary-soft);
}

.checklist-card--global.selected,
.checklist-card--daily.selected,
.checklist-card--weekly.selected,
.checklist-card--monthly.selected {
  background: rgba(99, 102, 241, 0.08);
  border-color: #6366f1;
}

.checklist-card--order.selected {
  background: rgba(59, 130, 246, 0.08);
  border-color: #3b82f6;
}

.checklist-card--product.selected {
  background: rgba(34, 197, 94, 0.08);
  border-color: #22c55e;
}

.checklist-card--customer.selected {
  background: rgba(245, 158, 11, 0.08);
  border-color: #f59e0b;
}

.checklist-card:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.checklist-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.checklist-progress-bar {
  background: var(--surface-2);
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
  margin-top: 8px;
}

.checklist-progress-fill {
  background: var(--primary);
  height: 100%;
  transition: width 0.3s ease;
}

.checklist-progress-percentage {
  transition: color 0.2s ease;
}

/* Checklist Detail Panel */
.checklist-detail-panel {
  width: 400px;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  padding-left: 16px;
  display: flex;
  flex-direction: column;
}

.checklist-detail-content {
  background: var(--surface);
  border-radius: var(--r-12);
  border: 1px solid var(--border);
  padding: 20px;
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.checklist-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.checklist-detail-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.checklist-items-list {
  flex: 1;
  overflow-y: auto;
  margin-top: 16px;
}

.checklist-item-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-8);
  margin-bottom: 8px;
  background: var(--surface);
  transition: all 0.15s ease;
  position: relative;
}

.checklist-item-row:hover {
  border-color: var(--primary);
  box-shadow: 0 1px 4px rgba(79, 70, 229, 0.1);
}

.checklist-item-row.completed {
  opacity: 0.7;
}

.checklist-item-checkbox {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
  accent-color: var(--primary);
}

.checklist-item-checkbox:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.checklist-item-content {
  flex: 1;
  min-width: 0;
}

.checklist-item-title {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 4px;
}

.checklist-item-row.completed .checklist-item-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.checklist-item-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.checklist-item-delete {
  padding: 4px 8px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.checklist-item-row:hover .checklist-item-delete {
  opacity: 1;
}

.checklist-item-row.completed .checklist-item-delete {
  display: none;
}

/* Mobile Drawer/Sheet */
.mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.mobile-drawer.open {
  transform: translateX(0);
}

.mobile-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.mobile-drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

/* Empty States */
.empty-state-icon {
  font-size: 48px;
  opacity: 0.3;
  margin-bottom: 16px;
}

.empty-state-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.empty-state-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* Toolbar Improvements */
.notes-toolbar,
.checklist-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--surface);
  border-radius: var(--r-12);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.toolbar-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.toolbar-filters {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-pill {
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-pill:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.filter-pill.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Checklist detail panel (existing) */
#checklist-detail-panel {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

@media (max-width: 768px) {
  .notes-split-pane {
    flex-direction: column;
    height: auto;
    min-height: auto;
  }
  
  .notes-list-pane {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-right: 0;
    padding-bottom: 16px;
    max-height: 400px;
  }
  
  .notes-preview-pane {
    display: none !important;
  }
  
  .notes-preview-pane.mobile-open {
    display: flex !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    background: var(--bg);
    border-radius: 0;
    border: none;
    padding: 16px;
  }
  
  .checklist-detail-panel {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border);
    padding-left: 0;
    padding-top: 16px;
  }
  
  #checklist-detail-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    z-index: 1000;
    background: var(--bg);
    padding: 16px;
    border-left: none;
  }
  
  .checklist-detail-content {
    position: relative;
    top: 0;
    max-height: 100%;
  }
  
  .notes-toolbar,
  .checklist-toolbar {
    padding: 12px;
  }
  
  .toolbar-row {
    flex-direction: column;
    gap: 8px;
  }
  
  .toolbar-row > * {
    width: 100%;
  }
}

/* Goal Summary Panel */
.goal-summary-panel {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--surface);
  border-radius: var(--r-12);
  border: 1px solid var(--border);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.goal-summary-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 120px;
}

.goal-summary-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.goal-summary-value {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

@media (max-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.mt-2 {
  margin-top: 8px;
}

.mt-3 {
  margin-top: 12px;
}

.mt-4 {
  margin-top: 16px;
}

.divider {
  height: 1px;
  width: 100%;
  background: var(--border);
  margin: 6px 0;
}

/* Toasts & Modals */
#toast-container {
  position: fixed;
  top: 70px;
  right: 14px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toast {
  min-width: 220px;
  max-width: 320px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 8px 10px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.28);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.toast-success {
  border-left: 3px solid var(--success);
}

.toast-error {
  border-left: 3px solid var(--danger);
}

.toast-info {
  border-left: 3px solid var(--primary);
}

.toast-title {
  font-weight: 600;
  margin-bottom: 2px;
}

.toast-close {
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000; /* Modal her şeyin üstünde olmalı (mobile panels z-index: 1000) */
  padding: 16px;
  overflow-y: auto;
}

.modal-backdrop.hidden {
  display: none;
}

.modal {
  width: 100%;
  max-width: min(700px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.65);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-card);
}

@media (max-width: 768px) {
  .modal-backdrop {
    padding: 8px;
    align-items: flex-start;
    padding-top: 16px;
  }
  
  .modal {
    max-width: 100%;
    max-height: calc(100vh - 16px);
    border-radius: 16px 16px 0 0;
  }
  
  .modal-header {
    padding: 16px 20px;
  }
  
  .modal-body {
    padding: 20px;
  }
  
  .modal-footer {
    padding: 16px 20px;
  }
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.form-row:last-child {
  margin-bottom: 0;
}

.confirm-modal .modal-footer {
  justify-content: space-between;
}

/* =========================================
   C-UI-1: Mobile nav drawer + responsive
   Breakpoints: mobile <=768, tablet 769–1024, desktop >=1025
   ========================================= */

body.nav-drawer-open {
  overflow: hidden;
}

.nav-drawer-trigger {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 20px;
}

.nav-drawer-overlay {
  display: none;
}

.sidebar-toggle {
  display: none;
}

@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
  }

  #app,
  .app-shell {
    max-width: 100%;
  }

  .content {
    max-width: 100%;
  }

  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: var(--sidebar-width);
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    border-right: 1px solid var(--border);
  }

  .app-shell.nav-open .sidebar {
    transform: translateX(0);
  }

  .app-shell.nav-open .nav-drawer-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(0, 0, 0, 0.35);
    cursor: pointer;
  }

  .nav-drawer-trigger {
    display: inline-flex;
  }

  .sidebar-toggle {
    display: inline-flex;
  }

  .app-main {
    min-height: calc(100vh - 56px);
  }

  .content {
    padding: 14px;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .table-controls,
  .toolbar,
  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .table-controls .search-input,
  .toolbar .search-input,
  .table-toolbar .search-input {
    min-width: 0;
    width: 100%;
  }

  .topbar-right {
    flex-wrap: wrap;
    gap: 6px;
  }

  .form-row,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .btn,
  .field-input,
  .field-select {
    min-height: 44px;
  }

  .form-group input[type="text"],
  .form-group input[type="number"],
  .form-group input[type="email"],
  .form-group input[type="url"],
  .form-group input[type="date"],
  .form-group input[type="datetime-local"],
  .form-group select {
    min-height: 44px;
  }

  .modal {
    max-width: calc(100vw - 24px);
  }

  .dashboard-card {
    overflow: visible;
  }

  .card {
    min-width: 0;
  }

  /* Notifications & Notes responsive */
  .note-card,
  .checklist-card {
    padding: 16px !important;
  }
  
  .card-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .card-title-row .btn {
    width: 100%;
  }
  
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .section-header h1 {
    font-size: 20px !important;
  }
  
  /* Page header mobile - keep actions inline but wrap nicely */
  .page-header {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .page-header .stack-horizontal {
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    justify-content: flex-end;
  }
  
  /* Segmented control on mobile - slightly smaller */
  .page-header .segmented {
    flex-shrink: 0;
  }
  
  .page-header .segmented__btn {
    padding: 6px 12px;
    font-size: 12px;
  }
  
  /* Primary action button stays visible */
  .page-header .btn--primary {
    flex-shrink: 0;
    white-space: nowrap;
  }
  
  .table-controls .stack-horizontal {
    width: 100%;
  }
  
  .table-controls .btn {
    flex: 1;
    min-width: 0;
  }
  
  /* Tabs on mobile - horizontal scroll if needed */
  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .tabs::-webkit-scrollbar {
    display: none;
  }
  
  .tab-btn {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 10px 14px;
    font-size: 13px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .content {
    padding: 18px;
  }
}

/* =========================================
   DASHBOARD - MATERIO STYLE
   ========================================= */

/* D3: Dashboard page wrapper — no horizontal scroll */
.dashboard-page {
  overflow-x: hidden;
}

/* D3: Acil Durum — compact emergency panel, only on mobile (<=768) */
.acil-durum {
  display: none;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.acil-durum__title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 8px;
}
.acil-durum__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.acil-durum__item {
  text-align: center;
  padding: 8px;
  background: var(--surface);
  border-radius: var(--r-12);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
}
.acil-durum__item:hover {
  background: var(--surface-2);
}
.acil-durum__value {
  display: block;
  font-size: 18px;
  font-weight: 600;
}
.acil-durum__label {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  padding: 24px;
}

.dashboard-card {
  background: var(--surface);
  border-radius: var(--r-16);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.dashboard-card--award {
  grid-column: span 4;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  color: white;
  border: none;
}

.dashboard-card--full {
  grid-column: span 12;
}

.dashboard-card__header {
  padding: 20px 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.dashboard-card__header-split {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dashboard-card__title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.dashboard-card--award .dashboard-card__title {
  color: white;
}

.dashboard-card__subtitle {
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
}

.dashboard-card--award .dashboard-card__subtitle {
  color: rgba(255, 255, 255, 0.9);
}

.dashboard-card__link {
  color: var(--primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.dashboard-card__link:hover {
  text-decoration: underline;
}

.dashboard-card__body {
  padding: 20px 24px 24px;
}

.dashboard-divider {
  height: 1px;
  background: var(--border);
  margin: 0 24px;
}

.dashboard-divider-vertical {
  width: 1px;
  background: var(--border);
  margin: 0;
}

/* Award Card */
.dashboard-award {
  position: relative;
  padding: 24px;
  min-height: 280px;
}

.dashboard-award__content {
  position: relative;
  z-index: 2;
}

.dashboard-award__title {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 8px;
}

.dashboard-award__subtitle {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 16px;
}

.dashboard-award__amount {
  font-size: 32px;
  font-weight: 700;
  margin: 16px 0;
}

.dashboard-award__progress {
  font-size: 14px;
  margin-bottom: 20px;
  opacity: 0.9;
}

.dashboard-award__trophy {
  position: absolute;
  right: 24px;
  bottom: 24px;
  font-size: 80px;
  opacity: 0.3;
  z-index: 1;
}

/* Stats Grid */
.dashboard-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 16px;
}

.dashboard-stat {
  display: flex;
  align-items: center;
  gap: 16px;
}

.dashboard-stat__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dashboard-stat__icon--primary {
  background: var(--primary);
  color: white;
}

.dashboard-stat__icon--success {
  background: var(--success);
  color: white;
}

.dashboard-stat__icon--warning {
  background: var(--warning);
  color: white;
}

.dashboard-stat__icon--info {
  background: #3b82f6;
  color: white;
}

.dashboard-stat__content {
  flex: 1;
}

.dashboard-stat__label {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 4px;
}

.dashboard-stat__value {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

/* D3: Today snapshot — 4 columns; stat as link */
.dashboard-stats-grid.dashboard-today-snapshot {
  grid-template-columns: repeat(4, 1fr);
}
.dashboard-stat--link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  border-radius: var(--r-12);
  padding: 4px;
  margin: -4px;
}
.dashboard-stat--link:hover {
  background: var(--surface-2);
}

/* D3: Focus list */
.dashboard-focus-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dashboard-focus-item {
  display: block;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: var(--r-12);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
}
.dashboard-focus-item:hover {
  background: var(--border);
}

/* D3: Trends collapse (mobile: start closed) */
.dashboard-trends-body.is-closed {
  display: none;
}
.dashboard-trends-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

/* Chart */
.dashboard-chart {
  margin: 16px 0;
}

.dashboard-bar-chart {
  width: 100%;
  height: 200px;
}

.dashboard-chart-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 20px 0;
}

.dashboard-chart-value {
  font-size: 32px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.dashboard-chart-text {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
  flex: 1;
}

/* Earning */
.dashboard-earning-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.dashboard-earning-amount {
  font-size: 28px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.dashboard-earning-growth {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 16px;
  font-weight: 500;
}

.dashboard-earning-subtitle {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 24px;
}

.dashboard-earning-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.dashboard-earning-item {
  display: flex;
  align-items: center;
  gap: 16px;
}

.dashboard-earning-item__avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
}

.dashboard-earning-item__avatar--primary {
  background: rgba(79, 70, 229, 0.12);
  color: var(--primary);
}

.dashboard-earning-item__avatar--info {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
}

.dashboard-earning-item__avatar--secondary {
  background: rgba(148, 163, 184, 0.12);
  color: var(--muted);
}

.dashboard-earning-item__content {
  flex: 1;
}

.dashboard-earning-item__title {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--text);
}

.dashboard-earning-item__subtitle {
  font-size: 13px;
  color: var(--muted);
}

.dashboard-earning-item__amount {
  text-align: right;
}

.dashboard-earning-item__amount h6 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--text);
}

.dashboard-progress {
  width: 80px;
  height: 6px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}

.dashboard-progress__bar {
  height: 100%;
  border-radius: 999px;
}

.dashboard-progress__bar--primary {
  background: var(--primary);
}

.dashboard-progress__bar--info {
  background: #3b82f6;
}

.dashboard-progress__bar--secondary {
  background: var(--muted);
}

/* Small Cards Grid */
.dashboard-card-grid {
  grid-column: span 4;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.dashboard-card--small {
  padding: 0;
}

.dashboard-card--small .dashboard-card__body {
  padding: 20px;
  text-align: center;
}

.dashboard-small-value {
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--text);
}

.dashboard-small-chart {
  margin: 12px 0;
  height: 80px;
}

.dashboard-small-label {
  font-size: 14px;
  font-weight: 500;
  margin: 0;
  color: var(--muted);
}

.dashboard-small-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dashboard-small-icon--primary {
  background: var(--primary);
  color: white;
}

.dashboard-small-icon--secondary {
  background: rgba(148, 163, 184, 0.12);
  color: var(--muted);
}

.dashboard-small-title {
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 12px;
  color: var(--text);
}

.dashboard-small-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.dashboard-small-subtitle {
  font-size: 12px;
  color: var(--muted);
}

/* Countries List */
.dashboard-countries-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dashboard-country-item {
  display: flex;
  align-items: center;
  gap: 16px;
}

.dashboard-country-item__avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: white;
}

.dashboard-country-item__avatar--success {
  background: var(--success);
}

.dashboard-country-item__avatar--error {
  background: var(--error);
}

.dashboard-country-item__avatar--warning {
  background: var(--warning);
}

.dashboard-country-item__content {
  flex: 1;
}

.dashboard-country-item__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.dashboard-country-item__header h6 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.dashboard-country-item__change {
  font-size: 14px;
  font-weight: 500;
}

.dashboard-country-item__name {
  font-size: 13px;
  color: var(--muted);
}

.dashboard-country-item__sales {
  text-align: right;
}

.dashboard-country-item__sales h6 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--text);
}

/* Transactions List */
.dashboard-transactions-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dashboard-transaction-item {
  display: flex;
  align-items: center;
  gap: 16px;
}

.dashboard-transaction-item__icon {
  flex-shrink: 0;
}

.dashboard-transaction-item__icon-bg {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.dashboard-transaction-item__icon-bg--success {
  background: rgba(34, 197, 94, 0.12);
}

.dashboard-transaction-item__icon-bg--error {
  background: rgba(239, 68, 68, 0.12);
}

.dashboard-transaction-item__content {
  flex: 1;
}

.dashboard-transaction-item__title {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--text);
}

.dashboard-transaction-item__subtitle {
  font-size: 13px;
  color: var(--muted);
}

.dashboard-transaction-item__amount {
  font-size: 16px;
  font-weight: 600;
}

/* Table */
.dashboard-table {
  width: 100%;
  border-collapse: collapse;
}

.dashboard-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.dashboard-table td {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.dashboard-table tbody tr:hover {
  background: var(--surface-2);
  cursor: pointer;
}

.dashboard-table-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dashboard-table-user__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.dashboard-table-user__name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
}

.dashboard-table-user__handle {
  font-size: 13px;
  color: var(--muted);
}

.dashboard-table-role {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
}

.dashboard-table-role__icon {
  font-size: 18px;
}

.dashboard-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  text-transform: capitalize;
}

.dashboard-badge--success {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}

.dashboard-badge--warning {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}

.dashboard-badge--info {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}

.dashboard-badge--error {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.dashboard-badge--secondary {
  background: rgba(148, 163, 184, 0.12);
  color: var(--muted);
}

/* Settings Tabs */
.settings-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.settings-tab-btn {
  padding: 12px 20px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
  margin-bottom: -1px;
}

.settings-tab-btn:hover {
  color: var(--text);
}

.settings-tab-btn.is-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Settings Grid Layout */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.settings-grid .card {
  margin-bottom: 0;
}

@media (max-width: 900px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

/* Settings mobile tabs */
@media (max-width: 768px) {
  .settings-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .settings-tabs::-webkit-scrollbar {
    display: none;
  }
  
  .settings-tab-btn {
    padding: 10px 14px;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
  }
}

/* Advanced section collapsible */
.advanced-section summary {
  list-style: none;
  padding: 12px 0;
}

.advanced-section summary::-webkit-details-marker {
  display: none;
}

.advanced-section summary::before {
  content: '▶ ';
  font-size: 10px;
  margin-right: 6px;
}

.advanced-section[open] summary::before {
  content: '▼ ';
}

/* Export buttons grid */
.export-buttons .btn {
  justify-content: flex-start;
  text-align: left;
}

/* Critical Stock Table Highlights */
.row-danger {
  background-color: rgba(239, 68, 68, 0.08) !important;
}

.row-danger:hover {
  background-color: rgba(239, 68, 68, 0.12) !important;
}

.row-warning {
  background-color: rgba(245, 158, 11, 0.08) !important;
}

.row-warning:hover {
  background-color: rgba(245, 158, 11, 0.12) !important;
}

/* Sticky column for tables */
.data-table th[style*="sticky"],
.data-table td[style*="sticky"] {
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
}

/* Dashboard Production Status */
.dashboard-production-status {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dashboard-production-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.dashboard-production-stat-row:last-child {
  border-bottom: none;
}

.dashboard-production-stat-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  flex: 1;
}

.dashboard-production-stat-value {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin: 0 12px;
}

/* Dashboard Critical Items */
.dashboard-critical-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dashboard-critical-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.dashboard-critical-item:last-child {
  border-bottom: none;
}

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: repeat(6, 1fr);
  }
  
  .dashboard-card[style*="span 12"] {
    grid-column: span 6 !important;
  }
  
  .dashboard-card[style*="span 8"] {
    grid-column: span 6 !important;
  }
  
  .dashboard-card[style*="span 4"] {
    grid-column: span 3 !important;
  }
}

@media (max-width: 768px) {
  /* Acil Durum - already good, show on mobile */
  .acil-durum {
    display: block;
  }
  
  /* Dashboard page - prevent ALL horizontal overflow */
  .dashboard-page {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
  }
  
  /* Main grid - single column on mobile */
  .dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0 12px;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
  }
  
  /* All cards - full width, no overflow */
  .dashboard-card {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    grid-column: auto !important;
    box-sizing: border-box;
  }
  
  .dashboard-card[style*="span"] {
    grid-column: auto !important;
    width: 100% !important;
  }
  
  /* Today Snapshot - 2 columns on mobile for better readability */
  .dashboard-stats-grid.dashboard-today-snapshot {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  /* Stat cards - smaller icons and text on mobile */
  .dashboard-stat {
    gap: 12px;
  }
  
  .dashboard-stat__icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    flex-shrink: 0;
  }
  
  .dashboard-stat__icon svg {
    width: 20px;
    height: 20px;
  }
  
  .dashboard-stat__label {
    font-size: 12px;
  }
  
  .dashboard-stat__value {
    font-size: 18px !important;
  }
  
  .dashboard-stat--link {
    padding: 8px;
    margin: -8px;
  }
  
  /* Critical items - vertical stack */
  .dashboard-critical-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .dashboard-critical-item > div:last-child {
    width: 100%;
    justify-content: space-between;
  }
  
  /* Transaction items - ensure buttons are tappable */
  .dashboard-transaction-item {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .dashboard-transaction-item .btn {
    flex-shrink: 0;
    min-width: 60px;
  }
  
  /* Notifications split - single column */
  .dashboard-notifications-split {
    display: flex !important;
    flex-direction: column !important;
    gap: 0;
  }
  
  .dashboard-notifications-split > div {
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
    margin-bottom: 16px;
  }
  
  .dashboard-notifications-split > div:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
  }
  
  .dashboard-notifications-split .dashboard-divider-vertical {
    display: none;
  }
  
  /* Card body grids - single column */
  .dashboard-card__body[style*="grid-template-columns"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px;
  }
  
  .dashboard-card__body[style*="grid-template-columns"] > div {
    border-right: none !important;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
  }
  
  .dashboard-card__body[style*="grid-template-columns"] > div:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
  
  /* Table wrap - horizontal scroll only if needed */
  .dashboard-page .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -12px;
    padding: 0 12px;
  }
  
  .dashboard-page .table-wrap table {
    min-width: 280px;
  }
  
  /* Trends section - starts collapsed on mobile */
  .dashboard-trends .dashboard-card__header {
    margin-bottom: 0;
  }
  
  .dashboard-trends-body.is-closed {
    display: none;
  }
  
  /* Trendler kapalıyken dikey ortalama (yukarıdan aşağı) */
  .dashboard-trends.trends-collapsed {
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  
  .dashboard-trends.trends-collapsed .dashboard-card__header {
    margin: 0;
  }
  
  .dashboard-trends-toggle {
    font-size: 13px;
    color: var(--primary);
  }
  
  /* Focus list items - larger tap targets */
  .dashboard-focus-item {
    padding: 14px 12px;
    font-size: 14px;
  }
  
  /* Card headers - wrap if needed */
  .dashboard-card__header-split {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .dashboard-card__title {
    font-size: 15px;
  }
  
  .dashboard-card__link {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  /* Acil Durum - single column on very small screens */
  .acil-durum__grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .acil-durum {
    padding-left: 12px;
    padding-right: 12px;
  }
  
  .acil-durum__item {
    padding: 12px;
  }
  
  .acil-durum__value {
    font-size: 24px;
  }

  /* Dashboard grid - tighter padding */
  .dashboard-grid {
    padding: 0 12px;
    gap: 12px;
  }
  
  /* Today Snapshot - single column on very small screens */
  .dashboard-stats-grid.dashboard-today-snapshot {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .dashboard-stat {
    padding: 8px 0;
  }
  
  .dashboard-stat__icon {
    width: 36px;
    height: 36px;
  }
  
  .dashboard-stat__icon svg {
    width: 18px;
    height: 18px;
  }
  
  .dashboard-stat__label {
    font-size: 11px;
  }
  
  .dashboard-stat__value {
    font-size: 16px !important;
  }
  
  .dashboard-award__amount {
    font-size: 24px !important;
  }
  
  .dashboard-production-stat-value {
    font-size: 16px;
  }
  
  /* Card title smaller */
  .dashboard-card__title {
    font-size: 14px;
  }
  
  /* Transaction items - stack vertically */
  .dashboard-transaction-item {
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
  }
  
  .dashboard-transaction-item__icon {
    flex-shrink: 0;
  }
  
  .dashboard-transaction-item__icon-bg {
    width: 28px;
    height: 28px;
    font-size: 14px;
    border-radius: 6px;
  }
  
  .dashboard-transaction-item__content {
    flex: 1;
    min-width: 0;
  }
  
  .dashboard-transaction-item__amount {
    position: absolute;
    right: 0;
    top: 0;
    font-size: 13px;
  }
  
  .dashboard-transaction-item {
    position: relative;
    padding-right: 50px;
  }
  
  .dashboard-transaction-item .btn {
    align-self: flex-end;
  }
  
  .dashboard-critical-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 0;
  }
  
  .dashboard-critical-item > div:last-child {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
  }
  
  .dashboard-stats-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Notifications & Notes */
.notification-unread {
  background: var(--surface) !important;
  border-left: 4px solid var(--primary) !important;
  font-weight: 500;
}

.notification-item {
  transition: background 0.15s ease;
}

.notification-item:hover {
  background: var(--surface-2) !important;
}

.note-card {
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.note-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.1);
}

.checklist-card {
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.checklist-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.1);
}

/* Detail List */
.detail-list {
  display: grid;
  gap: 16px;
}

.detail-list dt {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 4px;
}

.detail-list dd {
  font-size: 14px;
  color: var(--text);
  margin: 0;
}

/* Category Tree */
.category-tree {
  list-style: none;
  padding: 0;
  margin: 0;
}

.category-item {
  margin-bottom: 8px;
}

/* Category row styles are now inline in categories.js for better control */

.category-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.category-actions {
  display: flex;
  gap: 4px;
}

.category-row {
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.category-row:hover {
  background: var(--surface-2);
  border-color: var(--border) !important;
}

#category-detail-panel {
  position: sticky;
  top: 24px;
  height: fit-content;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

/* Form Actions */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* Card Headings */
.card h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 20px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.tab-btn {
  padding: 12px 20px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
  margin-bottom: -1px;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.tab-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Reports (D2): no horizontal body scroll on narrow, filters stack */
@media (max-width: 480px) {
  .reports-page {
    overflow-x: hidden;
  }
  .reports-filters {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
}

/* Order Summary */
.order-summary {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.summary-row {
  display: flex;
  justify-content: flex-end;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}

.alert--danger {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert--warning {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert--success {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.alert--info {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Settings */
.settings-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
  overflow-x: auto;
}

.settings-tab-btn {
  padding: 12px 20px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
  margin-bottom: -1px;
  white-space: nowrap;
}

.settings-tab-btn:hover {
  color: var(--text);
}

.settings-tab-btn.is-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.settings-tag-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.settings-tag-row .field-input {
  flex: 1;
}

/* Veri Yönetimi (C2) */
.data-mgmt-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  margin-bottom: 20px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.data-mgmt-hint {
  font-size: var(--fs-14);
  color: var(--muted);
}

.data-mgmt-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.data-mgmt-section:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.data-mgmt-heading {
  font-size: var(--fs-16);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

/* Kurulum Sihirbazı (C3-1) */
.wizard-shell {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wizard-header {
  margin-bottom: 24px;
}

.wizard-title {
  font-size: var(--fs-24);
  font-weight: 600;
  color: var(--text);
  margin: 0 0 20px 0;
}

.wizard-stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-14);
  color: var(--muted);
}

.wizard-step.is-active {
  color: var(--primary);
  font-weight: 600;
}

.wizard-step.is-done {
  color: var(--success);
}

.wizard-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface-2);
  font-size: 12px;
  flex-shrink: 0;
}

.wizard-step.is-active .wizard-step-num {
  background: var(--primary);
  color: #fff;
}

.wizard-step.is-done .wizard-step-num {
  background: var(--success);
  color: #fff;
}

.wizard-step-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 480px) {
  .wizard-step-title { display: none; }
  .wizard-stepper { gap: 6px; }
}

.wizard-body {
  flex: 1;
  margin-bottom: 24px;
}

.wizard-footer {
  display: flex;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.wizard-footer.hidden {
  display: none;
}

.wizard-footer .hidden {
  display: none;
}

.wizard-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wizard-checklist li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}

.wizard-checklist li.is-done {
  color: var(--success);
}

.wizard-checklist li:last-child {
  border-bottom: none;
}

/* C4 Simulation */
.sim-checklist { list-style: none; margin: 0; padding: 0; }
.sim-checklist .sim-step { padding: 10px 0; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sim-checklist .sim-step:last-child { border-bottom: none; }
.sim-step-title { flex: 1; font-weight: 500; }
.sim-step-status { color: var(--muted); }
.sim-step.is-done .sim-step-status { color: var(--success); }
.sim-step.is-fail .sim-step-status { color: var(--danger); }
.sim-step-detail { width: 100%; font-size: 12px; color: var(--muted); margin-top: 4px; }

.seed-row { margin: 10px 0; font-size: 14px; }
.seed-row .seed-label { color: var(--muted); margin-right: 6px; }
.seed-row--locked { padding: 8px 0; border-bottom: 1px solid var(--border); }

.required { color: var(--danger); }

.text-sm {
  font-size: 12px;
}

/* Action Bar */
.action-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 24px 0;
}

/* Segmented Control */
.segmented {
  display: inline-flex;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
}

.segmented__btn {
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.segmented__btn:hover:not(.is-active):not(:disabled) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.5);
}

.segmented__btn.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.segmented__btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Utilities */
.text-high-emphasis {
  font-weight: 600;
  color: var(--text);
}

.text-success {
  color: var(--success);
}

.text-error {
  color: var(--error);
}

.btn--sm {
  padding: 8px 16px;
  font-size: 14px;
}

.btn--block {
  width: 100%;
}

/* Responsive */
@media (max-width: 1400px) {
  .dashboard-grid {
    grid-template-columns: repeat(8, 1fr);
  }
  
  .dashboard-card--award {
    grid-column: span 4;
  }
  
  .dashboard-card-grid {
    grid-column: span 4;
  }
}

@media (max-width: 960px) {
  .dashboard-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 16px;
  }
  
  .dashboard-card--award,
  .dashboard-card-grid {
    grid-column: span 4;
  }
  
  .dashboard-stats-grid {
    grid-template-columns: 1fr;
  }
  
  .dashboard-card-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================
   DARK THEME - Component Overrides
   Premium Enterprise Design
   ========================================= */

/* Cards & Panels */
html[data-theme="dark"] .card,
body.theme-dark .card {
  background: #161A22;
  border: 1px solid #3A4256;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .card:hover,
body.theme-dark .card:hover {
  border-color: #4A5568;
}

/* Sidebar */
html[data-theme="dark"] .sidebar,
body.theme-dark .sidebar {
  background: #12151B;
  border-right: 1px solid #3A4256;
}

html[data-theme="dark"] .sidebar .nav-item:hover,
body.theme-dark .sidebar .nav-item:hover {
  background: #1E2430;
}

html[data-theme="dark"] .sidebar .nav-item.active,
body.theme-dark .sidebar .nav-item.active {
  background: rgba(108, 92, 231, 0.15);
  color: #6C5CE7;
}

/* Topbar */
html[data-theme="dark"] .topbar,
body.theme-dark .topbar {
  background: #12151B;
  border-bottom: 1px solid #3A4256;
}

/* User menu button - admin text visible */
html[data-theme="dark"] .user-menu-btn,
body.theme-dark .user-menu-btn {
  color: #E6E8EE;
  border-color: #3A4256;
}

html[data-theme="dark"] .user-menu-btn:hover,
body.theme-dark .user-menu-btn:hover {
  background: #1E2430;
}

/* Tables - Premium styling */
html[data-theme="dark"] table,
body.theme-dark table {
  border-collapse: separate;
  border-spacing: 0;
}

html[data-theme="dark"] th,
body.theme-dark th {
  background: #1B2130;
  color: #A9B0C2;
  font-weight: 600;
  border-bottom: 1px solid #3A4256;
}

html[data-theme="dark"] td,
body.theme-dark td {
  border-bottom: 1px solid #3A4256;
}

html[data-theme="dark"] tr:hover td,
body.theme-dark tr:hover td {
  background: #20263A;
}

html[data-theme="dark"] tbody tr:nth-child(even) td,
body.theme-dark tbody tr:nth-child(even) td {
  background: rgba(30, 36, 48, 0.3);
}

html[data-theme="dark"] tbody tr:nth-child(even):hover td,
body.theme-dark tbody tr:nth-child(even):hover td {
  background: #20263A;
}

/* Inputs, Selects, Search */
html[data-theme="dark"] .search-input,
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
body.theme-dark .search-input,
body.theme-dark input[type="text"],
body.theme-dark input[type="number"],
body.theme-dark input[type="email"],
body.theme-dark input[type="password"],
body.theme-dark input[type="date"],
body.theme-dark select,
body.theme-dark textarea {
  background: #1A2030;
  border: 1px solid #3A4256;
  color: #E6E8EE;
}

html[data-theme="dark"] .search-input::placeholder,
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder,
body.theme-dark .search-input::placeholder,
body.theme-dark input::placeholder,
body.theme-dark textarea::placeholder {
  color: #6E768C;
}

html[data-theme="dark"] .search-input:focus,
html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus,
body.theme-dark .search-input:focus,
body.theme-dark input:focus,
body.theme-dark select:focus,
body.theme-dark textarea:focus {
  border-color: #6C5CE7;
  outline: none;
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}

/* Buttons - Primary action only */
html[data-theme="dark"] .btn--primary,
body.theme-dark .btn--primary {
  background: #6C5CE7;
  border-color: #6C5CE7;
  color: #F0F1F5;
}

html[data-theme="dark"] .btn--primary:hover,
body.theme-dark .btn--primary:hover {
  background: #7D6CF0;
  border-color: #7D6CF0;
  color: #F0F1F5;
}

html[data-theme="dark"] .btn--ghost,
body.theme-dark .btn--ghost {
  background: transparent;
  border-color: #3A4256;
  color: #A9B0C2;
}

html[data-theme="dark"] .btn--ghost:hover,
body.theme-dark .btn--ghost:hover {
  background: #1E2430;
  border-color: #4A5568;
  color: #E6E8EE;
}

html[data-theme="dark"] .btn--danger,
body.theme-dark .btn--danger {
  background: #E74C3C;
  border-color: #E74C3C;
}

html[data-theme="dark"] .btn--danger:hover,
body.theme-dark .btn--danger:hover {
  background: #c0392b;
  border-color: #c0392b;
}

/* Badges - Status colors with soft backgrounds */
html[data-theme="dark"] .badge,
body.theme-dark .badge {
  font-weight: 500;
}

html[data-theme="dark"] .badge--success,
body.theme-dark .badge--success {
  background: rgba(46, 204, 113, 0.15);
  color: #2ECC71;
  border: 1px solid rgba(46, 204, 113, 0.3);
}

html[data-theme="dark"] .badge--warning,
body.theme-dark .badge--warning {
  background: rgba(245, 166, 35, 0.15);
  color: #F5A623;
  border: 1px solid rgba(245, 166, 35, 0.3);
}

html[data-theme="dark"] .badge--danger,
body.theme-dark .badge--danger {
  background: rgba(231, 76, 60, 0.15);
  color: #E74C3C;
  border: 1px solid rgba(231, 76, 60, 0.3);
}

html[data-theme="dark"] .badge--info,
body.theme-dark .badge--info {
  background: rgba(77, 163, 255, 0.15);
  color: #4DA3FF;
  border: 1px solid rgba(77, 163, 255, 0.3);
}

html[data-theme="dark"] .badge--primary,
body.theme-dark .badge--primary {
  background: rgba(108, 92, 231, 0.15);
  color: #6C5CE7;
  border: 1px solid rgba(108, 92, 231, 0.3);
}

/* Badge variants without double dash */
html[data-theme="dark"] .badge-success,
body.theme-dark .badge-success {
  background: rgba(46, 204, 113, 0.15);
  color: #2ECC71;
}

html[data-theme="dark"] .badge-warning,
body.theme-dark .badge-warning {
  background: rgba(245, 166, 35, 0.15);
  color: #F5A623;
}

html[data-theme="dark"] .badge-danger,
body.theme-dark .badge-danger {
  background: rgba(231, 76, 60, 0.15);
  color: #E74C3C;
}

html[data-theme="dark"] .badge-info,
body.theme-dark .badge-info {
  background: rgba(77, 163, 255, 0.15);
  color: #4DA3FF;
}

/* Status text colors */
html[data-theme="dark"] .text-success,
body.theme-dark .text-success {
  color: #2ECC71;
}

html[data-theme="dark"] .text-warning,
body.theme-dark .text-warning {
  color: #F5A623;
}

html[data-theme="dark"] .text-danger,
body.theme-dark .text-danger {
  color: #E74C3C;
}

html[data-theme="dark"] .text-info,
body.theme-dark .text-info {
  color: #4DA3FF;
}

html[data-theme="dark"] .text-muted,
body.theme-dark .text-muted {
  color: #A9B0C2;
}

/* Modals & Overlays */
html[data-theme="dark"] .modal,
html[data-theme="dark"] .modal-content,
body.theme-dark .modal,
body.theme-dark .modal-content {
  background: #161A22;
  border: 1px solid #3A4256;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .modal-backdrop,
body.theme-dark .modal-backdrop {
  background: rgba(15, 17, 21, 0.85);
}

html[data-theme="dark"] .modal-header,
body.theme-dark .modal-header {
  border-bottom: 1px solid #3A4256;
}

html[data-theme="dark"] .modal-footer,
body.theme-dark .modal-footer {
  border-top: 1px solid #3A4256;
}

/* Dropdown menus */
html[data-theme="dark"] .dropdown-menu,
body.theme-dark .dropdown-menu {
  background: #161A22;
  border: 1px solid #3A4256;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .dropdown-item:hover,
body.theme-dark .dropdown-item:hover {
  background: #1E2430;
}

/* Tabs & Tab panels */
html[data-theme="dark"] .tab,
html[data-theme="dark"] .notifications-tab,
body.theme-dark .tab,
body.theme-dark .notifications-tab {
  color: #A9B0C2;
  border-color: transparent;
}

html[data-theme="dark"] .tab:hover,
html[data-theme="dark"] .notifications-tab:hover,
body.theme-dark .tab:hover,
body.theme-dark .notifications-tab:hover {
  color: #E6E8EE;
  background: #1E2430;
}

html[data-theme="dark"] .tab.active,
html[data-theme="dark"] .notifications-tab.active,
body.theme-dark .tab.active,
body.theme-dark .notifications-tab.active {
  color: #6C5CE7;
  border-bottom-color: #6C5CE7;
  background: rgba(108, 92, 231, 0.1);
}

/* Kanban columns */
html[data-theme="dark"] .kanban-column,
body.theme-dark .kanban-column {
  background: #161A22;
  border: 1px solid #3A4256;
}

html[data-theme="dark"] .kanban-column-header,
body.theme-dark .kanban-column-header {
  background: #1B2130;
  border-bottom: 1px solid #3A4256;
}

html[data-theme="dark"] .kanban-card,
body.theme-dark .kanban-card {
  background: #1E2430;
  border: 1px solid #3A4256;
}

html[data-theme="dark"] .kanban-card:hover,
body.theme-dark .kanban-card:hover {
  border-color: #6C5CE7;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Mobile list items */
html[data-theme="dark"] .mobile-list-item,
body.theme-dark .mobile-list-item {
  background: #161A22;
  border: 1px solid #3A4256;
}

html[data-theme="dark"] .mobile-list-item:hover,
body.theme-dark .mobile-list-item:hover {
  background: #1E2430;
}

/* Stat cards */
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .dashboard-card,
body.theme-dark .stat-card,
body.theme-dark .dashboard-card {
  background: #161A22;
  border: 1px solid #3A4256;
}

/* Charts - ensure readability */
html[data-theme="dark"] .chart-container,
body.theme-dark .chart-container {
  background: #161A22;
}

/* Scrollbar styling */
html[data-theme="dark"] ::-webkit-scrollbar,
body.theme-dark ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

html[data-theme="dark"] ::-webkit-scrollbar-track,
body.theme-dark ::-webkit-scrollbar-track {
  background: #0F1115;
}

html[data-theme="dark"] ::-webkit-scrollbar-thumb,
body.theme-dark ::-webkit-scrollbar-thumb {
  background: #3A4256;
  border-radius: 4px;
}

html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover,
body.theme-dark ::-webkit-scrollbar-thumb:hover {
  background: #4A5568;
}

/* Links */
html[data-theme="dark"] a.link,
html[data-theme="dark"] .link,
body.theme-dark a.link,
body.theme-dark .link {
  color: #6C5CE7;
}

html[data-theme="dark"] a.link:hover,
html[data-theme="dark"] .link:hover,
body.theme-dark a.link:hover,
body.theme-dark .link:hover {
  color: #7D6CF0;
}

/* Dividers */
html[data-theme="dark"] hr,
html[data-theme="dark"] .divider,
body.theme-dark hr,
body.theme-dark .divider {
  border-color: #4A5568;
}

/* Table controls bar */
html[data-theme="dark"] .table-controls,
body.theme-dark .table-controls {
  border-bottom-color: #3A4256;
}

/* Pills / Filter buttons */
html[data-theme="dark"] .orders-pills-scroll .btn,
body.theme-dark .orders-pills-scroll .btn {
  border-color: #3A4256;
}

html[data-theme="dark"] .orders-pills-scroll .btn--primary,
body.theme-dark .orders-pills-scroll .btn--primary {
  background: #6C5CE7;
  border-color: #6C5CE7;
}

/* Notification badges */
html[data-theme="dark"] .notification-badge,
body.theme-dark .notification-badge {
  background: #E74C3C;
  color: #E6E8EE;
}

/* Progress bars */
html[data-theme="dark"] .progress,
body.theme-dark .progress {
  background: #1E2430;
}

html[data-theme="dark"] .progress-bar,
body.theme-dark .progress-bar {
  background: #6C5CE7;
}

/* Tooltip */
html[data-theme="dark"] .tooltip,
body.theme-dark .tooltip {
  background: #1E2430;
  color: #E6E8EE;
  border: 1px solid #3A4256;
}

/* Empty state */
html[data-theme="dark"] .empty-state,
body.theme-dark .empty-state {
  color: #6E768C;
}

/* Loading spinner */
html[data-theme="dark"] .spinner,
body.theme-dark .spinner {
  border-color: #252B3A;
  border-top-color: #6C5CE7;
}

/* Checkbox and radio */
html[data-theme="dark"] input[type="checkbox"],
html[data-theme="dark"] input[type="radio"],
body.theme-dark input[type="checkbox"],
body.theme-dark input[type="radio"] {
  accent-color: #6C5CE7;
}

/* Notes & Notifications panels */
html[data-theme="dark"] .note-card,
html[data-theme="dark"] .notification-item,
body.theme-dark .note-card,
body.theme-dark .notification-item {
  background: #161A22;
  border: 1px solid #3A4256;
}

html[data-theme="dark"] .note-card:hover,
html[data-theme="dark"] .notification-item:hover,
body.theme-dark .note-card:hover,
body.theme-dark .notification-item:hover {
  background: #1E2430;
}

/* Preview panes */
html[data-theme="dark"] .notes-preview-pane,
html[data-theme="dark"] .checklist-detail-panel,
body.theme-dark .notes-preview-pane,
body.theme-dark .checklist-detail-panel {
  background: #161A22;
  border-left: 1px solid #3A4256;
}

/* Detail sections */
html[data-theme="dark"] .detail-section,
body.theme-dark .detail-section {
  border-bottom: 1px solid #3A4256;
}

/* Quick actions */
html[data-theme="dark"] .quick-action-btn,
body.theme-dark .quick-action-btn {
  background: #1E2430;
  border: 1px solid #3A4256;
  color: #A9B0C2;
}

html[data-theme="dark"] .quick-action-btn:hover,
body.theme-dark .quick-action-btn:hover {
  background: #3A4256;
  color: #E6E8EE;
}

/* Confirm dialogs */
html[data-theme="dark"] .confirm-dialog,
body.theme-dark .confirm-dialog {
  background: #161A22;
  border: 1px solid #3A4256;
}

/* Timeline */
html[data-theme="dark"] .timeline-item::before,
body.theme-dark .timeline-item::before {
  background: #3A4256;
}

html[data-theme="dark"] .timeline-dot,
body.theme-dark .timeline-dot {
  background: #6C5CE7;
  border-color: #161A22;
}

/* Code/pre blocks */
html[data-theme="dark"] pre,
html[data-theme="dark"] code,
body.theme-dark pre,
body.theme-dark code {
  background: #1A2030;
  color: #E6E8EE;
}

/* Material color code (filament) swatch and code text */
.color-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
  border: 1px solid var(--border);
  vertical-align: middle;
  margin-right: 6px;
}
.color-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  opacity: 0.8;
  margin-left: 6px;
}

/* Report print (browser print-to-PDF) */
@media print {
  .no-print,
  .tab-btn,
  .btn,
  .reports-filters input,
  .reports-filters select,
  .reports-filters label,
  #cust-report-generate,
  #cust-report-pdf,
  #cust-report-preview .card .report-header + div .btn,
  nav,
  .sidebar,
  .page-header button,
  .section-actions {
    display: none !important;
  }
  body {
    padding: 10mm;
    font-size: 11px;
  }
  .report-header {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #ccc;
  }
  table {
    page-break-inside: auto;
  }
  thead {
    display: table-header-group;
  }
  tr {
    page-break-inside: avoid;
    page-break-after: auto;
  }
}

/* Invoice Preview Styles */
.invoice-preview-container {
  max-width: 100%;
  padding: 16px;
  background: white;
}

.invoice-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border);
}

.invoice-preview-company {
  flex: 1;
}

.invoice-preview-company-name {
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 8px;
  color: var(--text);
}

.invoice-preview-company-address {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
  line-height: 1.4;
}

.invoice-preview-company-contact {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 2px;
}

.invoice-preview-title-section {
  text-align: right;
}

.invoice-preview-title {
  font-size: 22px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 12px;
  color: var(--text);
}

.invoice-preview-meta {
  font-size: 11px;
  color: var(--muted);
}

.invoice-preview-meta div {
  margin-bottom: 4px;
}

.invoice-preview-recipient {
  margin-bottom: 24px;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-8);
}

.invoice-preview-recipient-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 8px;
  color: var(--text);
}

.invoice-preview-recipient-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.invoice-preview-recipient-address {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
  line-height: 1.4;
}

.invoice-preview-recipient-contact {
  font-size: 11px;
  color: var(--muted);
}

.invoice-preview-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 2px solid var(--border);
}

.invoice-preview-totals {
  flex: 1;
}

.invoice-preview-payment-info {
  text-align: right;
  padding-left: 24px;
}

.invoice-preview-balance-info {
  display: flex;
  justify-content: flex-end;
  gap: 24px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
