/* ========================================
   CSS Custom Properties
   ======================================== */
:root {
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-primary-light: #dbeafe;
  --color-accent: #f59e0b;
  --color-bg: #f1f5f9;
  --color-surface: #ffffff;
  --color-sidebar: #0f172a;
  --color-sidebar-hover: #1e293b;
  --color-sidebar-text: #94a3b8;
  --color-sidebar-active: #e2e8f0;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-border: #e2e8f0;
  --color-success: #16a34a;
  --color-warning: #f59e0b;
  --color-danger: #dc2626;
  --color-info: #2563eb;
  --sidebar-width: 260px;
  --header-height: 60px;
  --radius: 8px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  --transition: 200ms ease;
}

/* ========================================
   Reset & Base
   ======================================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

.hidden {
  display: none !important;
}

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

/* ========================================
   Login Page
   ======================================== */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
  padding: 20px;
}

.login-card {
  background: var(--color-surface);
  border-radius: 12px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  transition: transform 0.3s ease;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo .logo-icon {
  font-size: 48px;
  color: var(--color-primary);
  margin-bottom: 8px;
  display: inline-block;
}

.login-logo h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text);
  margin-top: 4px;
}

.login-subtitle {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  margin-top: 4px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.input-wrapper {
  position: relative;
}

.input-wrapper .input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: var(--color-text-muted);
}

.input-wrapper input,
.form-group .input-wrapper input,
.form-group .input-wrapper input:not([type="checkbox"]):not([type="radio"]) {
  width: 100%;
  padding: 10px 12px 10px 42px;
  font-size: 0.9375rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: inherit;
}

.input-wrapper input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

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

.login-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--color-danger);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.875rem;
}

.login-footer {
  margin-top: 24px;
  text-align: center;
}

.demo-creds {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

/* Shake animation */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.shake {
  animation: shake 0.5s ease;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius);
  transition: all var(--transition);
}

.btn-primary {
  background: #2563eb;
  color: #fff;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-block {
  width: 100%;
}

/* ========================================
   App Layout
   ======================================== */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

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

/* ========================================
   Sidebar
   ======================================== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--color-sidebar);
  color: var(--color-sidebar-text);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
}

/* Desktop sidebar slim mode — icons only */
.sidebar-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  color: var(--color-sidebar-text);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  font-size: 0.75rem;
  transition: color 0.15s, background 0.15s;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-collapse-btn:hover {
  background: var(--color-sidebar-hover);
  color: #fff;
}
.sidebar-collapse-btn .material-icons-outlined {
  font-size: 18px;
}
.sidebar-collapse-btn .collapse-label {
  transition: opacity 0.15s;
}

.sidebar.slim {
  width: 64px;
  overflow: hidden;
}
.sidebar.slim ~ .main-wrapper {
  margin-left: 64px;
}
.sidebar.slim .sidebar-brand,
.sidebar.slim .sidebar-company,
.sidebar.slim .sidebar-onboarding-link,
.sidebar.slim .nav-divider,
.sidebar.slim .nav-label,
.sidebar.slim .nav-alert-badge,
.sidebar.slim .user-details,
.sidebar.slim .sidebar-shortcuts-btn,
.sidebar.slim .sidebar-close-btn,
.sidebar.slim .collapse-label {
  display: none;
}
.sidebar.slim .sidebar-header {
  justify-content: center;
  padding: 12px 8px;
}
.sidebar.slim .sidebar-nav {
  overflow-y: auto;
  padding: 4px 0;
}
.sidebar.slim .nav-item {
  justify-content: center;
  padding: 10px 8px;
  gap: 0;
}
.sidebar.slim .nav-item .material-icons-outlined {
  font-size: 22px;
}
.sidebar.slim .sidebar-footer {
  padding: 8px;
}
.sidebar.slim .user-info {
  justify-content: center;
}
.sidebar.slim .sidebar-collapse-btn {
  padding: 10px 8px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-header .logo-icon {
  font-size: 28px;
  color: var(--color-accent);
  display: inline-block;
  vertical-align: middle;
}

.sidebar-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.sidebar-close-btn {
  margin-left: auto;
  color: var(--color-sidebar-text);
  padding: 4px;
}

.sidebar-company {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.company-badge {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.company-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.company-name {
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.company-id {
  font-size: 0.75rem;
  color: var(--color-sidebar-text);
}

.sidebar-onboarding-link {
  display: block;
  padding: 8px 20px 12px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  text-decoration: none;
  transition: background var(--transition);
}
.sidebar-onboarding-link:hover {
  background: var(--color-sidebar-hover);
}
.sidebar-onboarding-bar {
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}
.sidebar-onboarding-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.sidebar-onboarding-text {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6875rem;
  color: var(--color-sidebar-text);
  font-weight: 500;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
}

.nav-divider {
  padding: 16px 20px 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-sidebar-text);
  opacity: 0.6;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  font-size: 0.875rem;
  color: var(--color-sidebar-text);
  transition: all var(--transition);
  text-decoration: none;
}

.nav-item:hover {
  background: var(--color-sidebar-hover);
  color: var(--color-sidebar-active);
}

.nav-item.active {
  background: var(--color-sidebar-hover);
  color: #fff;
  border-right: 3px solid var(--color-primary);
}

.nav-item .material-icons-outlined {
  font-size: 20px;
}

.nav-item {
  position: relative;
}

.nav-alert-badge {
  margin-left: auto;
  background: var(--color-danger);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 16px 20px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.user-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-name {
  color: #fff;
  font-weight: 500;
  font-size: 0.875rem;
}

.user-role {
  font-size: 0.75rem;
  color: var(--color-sidebar-text);
}

.sidebar-overlay {
  display: none;
}

/* ========================================
   Header
   ======================================== */
.app-header {
  height: var(--header-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.menu-toggle {
  display: none;
  color: var(--color-text);
  padding: 4px;
  cursor: pointer;
  background: none;
  border: none;
}

.menu-toggle .material-icons-outlined {
  font-size: 24px;
}

.header-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-btn {
  position: relative;
  padding: 8px;
  border-radius: var(--radius);
  color: var(--color-text-muted);
  transition: all var(--transition);
}

.header-btn:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

.notification-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-danger);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========================================
   Notification Panel
   ======================================== */
.notification-panel {
  position: fixed;
  top: var(--header-height);
  right: 24px;
  width: 380px;
  max-height: calc(100vh - var(--header-height) - 24px);
  background: var(--color-surface);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transform: translateY(-10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.notification-panel.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.notification-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border);
}

.notification-panel-header h3 {
  font-size: 0.9375rem;
  font-weight: 600;
}

.notification-panel-body {
  overflow-y: auto;
  max-height: 400px;
  padding: 6px 0;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 18px;
  font-size: 0.8125rem;
  color: var(--color-text);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background var(--transition);
  line-height: 1.4;
}

.notification-item:hover {
  background: var(--color-bg);
}

.notification-danger {
  border-left-color: var(--color-danger);
}

.notification-danger .notification-item-icon {
  color: var(--color-danger);
}

.notification-warning {
  border-left-color: var(--color-warning);
}

.notification-warning .notification-item-icon {
  color: var(--color-warning);
}

.notification-info {
  border-left-color: var(--color-primary);
}

.notification-info .notification-item-icon {
  color: var(--color-primary);
}

.notification-item-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.notification-item-text {
  flex: 1;
}

.notification-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 20px;
  color: var(--color-text-muted);
  text-align: center;
}

.notification-empty .material-icons-outlined {
  font-size: 36px;
  color: var(--color-success);
  opacity: 0.5;
}

.notification-empty p {
  font-size: 0.875rem;
}

@media (max-width: 480px) {
  .notification-panel {
    right: 8px;
    left: 8px;
    width: auto;
  }
}

/* ========================================
   Main Content
   ======================================== */
.main-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.page-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ========================================
   Stats Grid (Dashboard)
   ======================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  position: relative;
}

.stat-card-clickable {
  cursor: pointer;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.15s;
}

.stat-card-clickable:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

.stat-card-clickable:active {
  transform: translateY(0);
}

.stat-card-alert {
  border-color: var(--color-danger);
  animation: pulse-border 2s ease-in-out infinite;
}

@keyframes pulse-border {
  0%, 100% { border-color: var(--color-danger); }
  50% { border-color: #fca5a5; }
}

.stat-arrow {
  margin-left: auto;
  color: var(--color-text-muted);
  font-size: 20px;
  opacity: 0.4;
  transition: opacity 0.2s, transform 0.2s;
}

.stat-card-clickable:hover .stat-arrow {
  opacity: 1;
  transform: translateX(2px);
}

.drill-title-icon {
  font-size: 24px;
  vertical-align: middle;
  margin-right: 4px;
}

.drill-title-icon.blue { color: #2563eb; }
.drill-title-icon.green { color: #16a34a; }
.drill-title-icon.orange { color: #d97706; }
.drill-title-icon.red { color: #dc2626; }

.badge-lg {
  font-size: 0.9rem;
  padding: 4px 12px;
}

.badge-sm {
  font-size: 0.7rem;
  padding: 2px 6px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon .material-icons-outlined {
  font-size: 24px;
}

.stat-icon.blue {
  background: #dbeafe;
  color: #2563eb;
}

.stat-icon.green {
  background: #dcfce7;
  color: #16a34a;
}

.stat-icon.orange {
  background: #fef3c7;
  color: #d97706;
}

.stat-icon.red {
  background: #fef2f2;
  color: #dc2626;
}

.stat-icon.purple {
  background: #f3e8ff;
  color: #7c3aed;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

/* ========================================
   Dashboard Grid
   ======================================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

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

.dashboard-period-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.dashboard-period-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 8px;
  background: var(--color-bg);
  border-radius: var(--radius);
  text-align: center;
}

.dashboard-period-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}

.dashboard-period-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

/* ========================================
   Monthly Chart Bars
   ======================================== */
.chart-bar-container {
  display: flex;
  gap: 4px;
  align-items: flex-end;
  padding: 8px 0;
}

.chart-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.chart-bar-value {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
  white-space: nowrap;
}

.chart-bar-track {
  width: 100%;
  max-width: 40px;
  background: var(--color-border);
  border-radius: 4px 4px 0 0;
  height: 140px;
  position: relative;
  overflow: hidden;
}

.chart-bar-label {
  font-size: 0.65rem;
  color: var(--color-text-muted);
  margin-top: 4px;
  white-space: nowrap;
}

/* ========================================
   Cards
   ======================================== */
.card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
}

.card-header h3 {
  font-size: 0.9375rem;
  font-weight: 600;
}

.card-link {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-primary);
}

.card-link:hover {
  text-decoration: underline;
}

.card-body {
  padding: 16px 20px;
}

/* ========================================
   Schedule Items
   ======================================== */
.schedule-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.875rem;
}

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

.schedule-time {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
  min-width: 45px;
}

.schedule-detail {
  color: var(--color-text-muted);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========================================
   Stock Bars
   ======================================== */
.stock-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.stock-label {
  font-size: 0.8125rem;
  font-weight: 500;
  min-width: 85px;
}

.stock-bar-wrapper {
  flex: 1;
  height: 8px;
  background: var(--color-bg);
  border-radius: 4px;
  overflow: hidden;
}

.stock-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.stock-actions-cell {
  display: flex;
  gap: 4px;
  white-space: nowrap;
}

.price-vat-note {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--color-text-muted);
}

.vat-preview {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin: 0;
  padding: 4px 0;
}

.stock-count {
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
  min-width: 50px;
  text-align: right;
}

/* ========================================
   Badges
   ======================================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-blue {
  background: #dbeafe;
  color: #2563eb;
}

.badge-green {
  background: #dcfce7;
  color: #16a34a;
}

.badge-orange {
  background: #fef3c7;
  color: #d97706;
}

.badge-red {
  background: #fef2f2;
  color: #dc2626;
}

.badge-purple {
  background: #f3e8ff;
  color: #7c3aed;
}

.badge-yellow {
  background: #fef9c3;
  color: #a16207;
}

.badge-teal {
  background: #ccfbf1;
  color: #0f766e;
}

.badge-grey {
  background: #f1f5f9;
  color: #475569;
}

/* ========================================
   Tables
   ======================================== */
.table-responsive {
  overflow-x: auto;
  padding: 0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table thead th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.data-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

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

.data-table tbody tr:hover {
  background: var(--color-bg);
}

/* ========================================
   Sortable Table Headers
   ======================================== */
.sortable-th {
  cursor: pointer;
  user-select: none;
  transition: color var(--transition);
}

.sortable-th:hover {
  color: var(--color-primary);
}

.sortable-th.sorted {
  color: var(--color-primary);
}

.sort-icon {
  font-size: 14px !important;
  vertical-align: middle;
  margin-left: 2px;
  opacity: 0.35;
  transition: opacity var(--transition);
}

.sortable-th:hover .sort-icon,
.sortable-th.sorted .sort-icon {
  opacity: 1;
}

/* ========================================
   Page Header
   ======================================== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
}

/* ========================================
   Filters Bar
   ======================================== */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 8px 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
}

.filters-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  width: 100%;
  padding-bottom: 2px;
}

.filters-secondary {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.filters-scroll::-webkit-scrollbar {
  height: 0;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: 6px;
  background: var(--color-bg);
  color: var(--color-text-muted);
  border: 1px solid transparent;
  white-space: nowrap;
  transition: all var(--transition);
  font-family: inherit;
  cursor: pointer;
}

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

.filter-btn.active {
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.filter-count {
  font-size: 0.6875rem;
  background: rgba(0,0,0,0.08);
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 600;
}

.filter-btn.active .filter-count {
  background: rgba(37,99,235,0.15);
}

.filter-btn-danger {
  color: #dc2626;
  border-color: rgba(220,38,38,0.3);
}

.filter-btn-danger:hover {
  background: #fef2f2;
  border-color: #dc2626;
}

.filter-btn-danger.active {
  background: #fef2f2;
  color: #dc2626;
  border-color: #dc2626;
}

.filter-btn-danger .filter-count {
  background: rgba(220,38,38,0.12);
  color: #dc2626;
}

/* Stack view for orders */
.order-stack-view {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
}

.order-stack-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0;
  cursor: pointer;
  transition: box-shadow var(--transition), border-color var(--transition);
  background: var(--color-surface);
}

.order-stack-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.order-stack-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
  border-radius: var(--radius) var(--radius) 0 0;
}

.order-stack-header strong {
  font-size: 0.9rem;
}

.order-stack-body {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.order-stack-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--color-text);
}

.order-stack-row .material-icons-outlined {
  font-size: 16px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.search-box {
  position: relative;
  min-width: 200px;
}

.search-box .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--color-text-muted);
}

.search-box input {
  width: 100%;
  padding: 7px 12px 7px 36px;
  font-size: 0.8125rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: inherit;
}

.search-box input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

/* ========================================
   Clickable Table Rows
   ======================================== */
.clickable-row {
  cursor: pointer;
}

.order-outstanding {
  background: #fff8f8;
}

.order-outstanding td:first-child {
  border-left: 3px solid #dc2626;
}

.table-empty {
  text-align: center;
  padding: 40px 16px !important;
  color: var(--color-text-muted);
  font-style: italic;
}

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

.btn-icon {
  padding: 6px;
  border-radius: 6px;
  color: var(--color-text-muted);
  transition: all var(--transition);
  background: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.btn-icon:hover {
  background: var(--color-bg);
  color: var(--color-primary);
}

.btn-icon .material-icons-outlined {
  font-size: 18px;
}

/* ========================================
   Back Button
   ======================================== */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  color: var(--color-text-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  transition: all var(--transition);
  cursor: pointer;
  font-family: inherit;
}

.btn-back:hover {
  color: var(--color-text);
  border-color: var(--color-text-muted);
}

.btn-back .material-icons-outlined {
  font-size: 18px;
}

/* ========================================
   Button Variants
   ======================================== */
.btn-secondary {
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

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

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8125rem;
}

/* ========================================
   Order Form
   ======================================== */
.order-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.order-form select,
.order-form input[type="text"],
.order-form input[type="email"],
.order-form input[type="tel"],
.order-form input[type="date"],
.order-form input[type="number"],
.order-form input[type="password"],
.order-form input[type="url"],
.order-form textarea,
.form-input,
.form-control,
.form-select,
select.form-input,
select.form-control,
select.form-select,
textarea.form-input,
textarea.form-control,
textarea.form-textarea,
.form-group input:not([type="checkbox"]):not([type="radio"]),
.form-group select,
.form-group textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  font-size: 0.9375rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}

/* Override: inputs with icons need left padding for the icon */
.input-wrapper input,
.form-group .input-wrapper input,
.form-group .input-wrapper input:not([type="checkbox"]):not([type="radio"]) {
  padding-left: 48px !important;
}

.order-form select:focus,
.order-form input[type="text"]:focus,
.order-form input[type="email"]:focus,
.order-form input[type="tel"]:focus,
.order-form input[type="date"]:focus,
.order-form input[type="number"]:focus,
.order-form input[type="password"]:focus,
.order-form input[type="url"]:focus,
.order-form textarea:focus,
.form-input:focus,
.form-control:focus,
.form-select:focus,
select.form-input:focus,
select.form-control:focus,
select.form-select:focus,
textarea.form-input:focus,
textarea.form-control:focus,
textarea.form-textarea:focus,
.form-group input:not([type="checkbox"]):not([type="radio"]):focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.order-form textarea,
textarea.form-input,
textarea.form-control,
textarea.form-textarea {
  resize: vertical;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 500;
}

.checkbox-label-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 12px 16px;
  font-size: 0.9375rem;
  font-weight: 500;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  transition: all var(--transition);
}

.checkbox-label-inline:has(input:checked) {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.checkbox-label input[type="checkbox"],
.checkbox-label-inline input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
  flex-shrink: 0;
  margin: 0 6px 0 0;
  vertical-align: middle;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 8px;
}

/* ========================================
   Customer Toggle
   ======================================== */
.customer-toggle {
  display: flex;
  gap: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  width: fit-content;
}

.toggle-btn {
  padding: 8px 18px;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: inherit;
  background: var(--color-bg);
  color: var(--color-text-muted);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}

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

/* ========================================
   Radio Group (Placement)
   ======================================== */
.radio-group {
  display: flex;
  gap: 12px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  flex: 1;
  font-size: 0.9375rem;
  font-weight: 500;
}

.radio-label:has(input:checked) {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.radio-label input[type="radio"] {
  accent-color: var(--color-primary);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin: 0 6px 0 0;
  vertical-align: middle;
}

.radio-label span,
.checkbox-label span,
.checkbox-label-inline span {
  line-height: 1;
}

/* Global radio & checkbox vertical centering */
input[type="radio"],
input[type="checkbox"] {
  margin: 0;
  vertical-align: middle;
}

label:has(input[type="radio"]),
label:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
}

.radio-hint {
  width: 100%;
  padding-left: 24px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 400;
}

/* ========================================
   Header Actions Row (Detail View)
   ======================================== */
.header-actions-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ========================================
   Invoice Button & Status
   ======================================== */
.btn-purple {
  background: #7c3aed;
  color: #fff;
}

.btn-purple:hover {
  background: #6d28d9;
}

.invoice-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9375rem;
  color: var(--color-success);
}

.invoice-sent-icon {
  font-size: 20px;
}

/* ========================================
   Pagination
   ======================================== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--color-border);
  font-size: 0.8125rem;
}
.pagination-info {
  color: var(--color-text-muted);
}
.pagination-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
}
.pagination-btn {
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  font-size: 0.8125rem;
  padding: 0 4px;
}
.pagination-btn:hover:not(:disabled):not(.active) {
  background: var(--color-bg);
}
.pagination-btn.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.pagination-btn .material-icons-outlined {
  font-size: 18px;
}
.pagination-ellipsis {
  padding: 0 4px;
  color: var(--color-text-muted);
}
.pagination-size {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}
.pagination-size select {
  padding: 4px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.8125rem;
  cursor: pointer;
}
.stat-card-clickable {
  cursor: pointer;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.stat-card-clickable:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-color: var(--color-primary);
}
.stat-card-clickable.stat-active {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

/* ========================================
   Todo List
   ======================================== */
.todo-list {
  padding: 0;
}
.todo-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
  transition: background 0.15s ease;
}
.todo-card:hover {
  background: var(--color-bg);
}
.todo-card-check {
  padding-top: 2px;
}
.todo-card-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--color-primary);
}
.todo-card-body {
  flex: 1;
  min-width: 0;
}
.todo-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.todo-title {
  font-weight: 600;
  font-size: 0.9375rem;
}
.todo-desc {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.4;
}
.todo-done {
  opacity: 0.7;
}
.todo-delete {
  opacity: 0;
  transition: opacity 0.15s;
  color: var(--color-text-muted);
}
.todo-card:hover .todo-delete {
  opacity: 1;
}
.todo-done-section {
  border-top: 2px solid var(--color-border);
}
.todo-done-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  user-select: none;
}
.todo-done-header:hover {
  color: var(--color-text);
}

/* ========================================
   Toast Notification
   ======================================== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: #fff;
  padding: 14px 24px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 10000;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   Order Detail
   ======================================== */
.order-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-update {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-update select {
  padding: 6px 10px;
  font-size: 0.8125rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: inherit;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.detail-value {
  font-size: 0.9375rem;
  color: var(--color-text);
}

.order-notes {
  font-size: 0.9375rem;
  color: var(--color-text);
  line-height: 1.6;
}

/* ========================================
   Status Timeline
   ======================================== */
.status-timeline {
  display: flex;
  align-items: flex-start;
  gap: 0;
  overflow-x: auto;
  padding: 8px 0;
}

.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 100px;
  position: relative;
}

.timeline-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 16px;
  left: calc(50% + 20px);
  width: calc(100% - 40px);
  height: 2px;
  background: var(--color-border);
}

.timeline-step.completed:not(:last-child)::after {
  background: var(--color-success);
}

.timeline-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  color: var(--color-text-muted);
  z-index: 1;
  transition: all 0.3s ease;
}

.timeline-dot .material-icons-outlined {
  font-size: 16px;
}

.timeline-step.completed .timeline-dot {
  background: var(--color-success);
  border-color: var(--color-success);
  color: #fff;
}

.timeline-step.current .timeline-dot {
  background: var(--color-success);
  border-color: var(--color-success);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(22,163,74,0.2);
}

.timeline-step.skipped .timeline-dot {
  background: #fef2f2;
  border-color: var(--color-border);
  color: var(--color-text-muted);
  opacity: 0.4;
}

.timeline-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-align: center;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.timeline-step.completed .timeline-label {
  color: var(--color-success);
}

.timeline-step.current .timeline-label {
  color: var(--color-success);
  font-weight: 700;
}

/* Clickable milestone timeline — next step is the call to action */
.clickable-timeline .timeline-step.next-clickable {
  cursor: pointer;
}

.clickable-timeline .timeline-step.next-clickable .timeline-dot {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  animation: pulse-next 2s ease-in-out infinite;
}

.clickable-timeline .timeline-step.next-clickable:hover .timeline-dot {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  transform: scale(1.2);
  box-shadow: 0 0 0 5px rgba(37,99,235,0.25);
}

.clickable-timeline .timeline-step.next-clickable .timeline-label {
  color: var(--color-primary);
  font-weight: 700;
}

.clickable-timeline .timeline-step.cancel-step {
  cursor: pointer;
  flex: 0;
  min-width: 80px;
}

.clickable-timeline .timeline-step.cancel-step .timeline-dot {
  background: var(--color-bg);
  border-color: var(--color-border);
  color: var(--color-text-muted);
}

.clickable-timeline .timeline-step.cancel-step:hover .timeline-dot {
  background: var(--color-danger);
  border-color: var(--color-danger);
  color: #fff;
  transform: scale(1.2);
}

.clickable-timeline .timeline-step.cancel-step:hover .timeline-label {
  color: var(--color-danger);
}

@keyframes pulse-next {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37,99,235,0); }
  50% { box-shadow: 0 0 0 6px rgba(37,99,235,0.2); }
}

/* ========================================
   Placeholder Pages
   ======================================== */
.placeholder-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 80px 20px;
  text-align: center;
  color: var(--color-text-muted);
}

.placeholder-icon {
  font-size: 64px;
  opacity: 0.3;
}

.placeholder-page h2 {
  color: var(--color-text);
  font-size: 1.25rem;
}

.placeholder-page p {
  font-size: 0.875rem;
  max-width: 400px;
}

/* ========================================
   Responsive: Tablet (< 1024px)
   ======================================== */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .stat-card {
    padding: 16px;
    gap: 12px;
  }

  .stat-value {
    font-size: 1.25rem;
    word-break: break-word;
  }

  .stat-label {
    font-size: 0.75rem;
  }

  .stat-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
  }

  .stat-icon .material-icons-outlined {
    font-size: 20px;
  }

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

  .dashboard-period-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .dashboard-period-grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }

  .dashboard-period-value {
    font-size: 1.15rem;
    word-break: break-word;
  }

  .dashboard-period-card {
    padding: 12px 6px;
  }
}

/* ========================================
   Responsive: Mobile (< 768px)
   ======================================== */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
  }

  .sidebar-overlay.visible {
    opacity: 1;
    pointer-events: auto;
  }

  .main-wrapper {
    margin-left: 0;
  }

  .menu-toggle {
    display: flex;
  }

  .sidebar-close-btn {
    display: flex !important;
  }

  .sidebar-collapse-btn {
    display: none;
  }

  .main-content {
    padding: 16px;
  }

  .app-header {
    padding: 0 16px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .stat-card {
    padding: 14px;
  }

  .stat-value {
    font-size: 1.25rem;
  }

  .login-card {
    padding: 28px 24px;
  }


  /* Orders responsive */
  .filters-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filters-scroll {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .search-box {
    min-width: 0;
  }

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

  .card-body,
  .order-form {
    overflow: hidden;
  }

  .form-group {
    overflow: visible;
  }

  .order-form input,
  .order-form select,
  .order-form textarea,
  .form-group input,
  .form-group select {
    max-width: 100%;
    box-sizing: border-box;
  }

  .radio-group {
    flex-direction: column;
  }

  .toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .chart-bar-value {
    font-size: 0.55rem;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    margin-bottom: 2px;
    max-height: 50px;
    overflow: hidden;
  }

  .chart-bar-track {
    height: 100px;
  }

  .chart-bar-label {
    font-size: 0.55rem;
  }

  .dashboard-period-value {
    font-size: 1.1rem;
    white-space: nowrap;
  }

  .status-update {
    flex-direction: column;
    align-items: stretch;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

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

  .status-timeline {
    flex-wrap: wrap;
    overflow-x: visible;
    gap: 4px 0;
    padding-bottom: 8px;
  }

  .timeline-step {
    min-width: 0;
    flex: 0 0 25%;
  }

  .timeline-step:not(:last-child)::after {
    display: none;
  }

  .timeline-dot {
    width: 28px;
    height: 28px;
  }

  .timeline-dot .material-icons-outlined {
    font-size: 14px;
  }

  .timeline-label {
    font-size: 0.5625rem;
  }
}

/* ========================================
   Responsive: Dashboard period cards (< 600px)
   ======================================== */
@media (max-width: 600px) {
  .dashboard-period-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ========================================
   Responsive: Small Mobile (< 480px)
   ======================================== */
@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .schedule-item {
    gap: 6px;
  }

  .schedule-detail {
    flex: 1;
    min-width: 0;
  }
}

/* ========================================
   Stats Grid Variant (3 columns)
   ======================================== */
.stats-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.stats-grid-5 {
  grid-template-columns: repeat(5, 1fr);
}

.stats-grid-5 .stat-card {
  padding: 12px;
}
.stats-grid-5 .stat-value {
  font-size: 1.25rem;
}

/* ========================================
   Deliveries & Collections — Controls
   ======================================== */
.jobs-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.jobs-date-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.date-input {
  padding: 7px 12px;
  font-size: 0.875rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
  color: var(--color-text);
  font-family: inherit;
}

.date-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.date-today-btn {
  margin-left: 4px;
}

.jobs-filters {
  display: flex;
  align-items: center;
  gap: 10px;
}

.driver-select {
  padding: 7px 12px;
  font-size: 0.875rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
  color: var(--color-text);
  font-family: inherit;
  min-width: 160px;
}

.driver-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

/* ========================================
   Deliveries & Collections — Tabs
   ======================================== */
.jobs-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 0;
}

.jobs-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--color-text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all var(--transition);
}

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

.jobs-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}

/* ========================================
   Deliveries & Collections — Job Cards
   ======================================== */
.jobs-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.job-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.job-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}

.job-card-overdue {
  border-left: 5px solid #dc2626;
  border-color: #fca5a5;
  background: #fff5f5;
}

.job-card-overdue .job-card-header {
  background: #fef2f2;
  border-bottom-color: #fecaca;
}

.job-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
}

.job-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.job-order-id {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--color-text);
}

.job-time-slot {
  font-size: 0.6875rem;
  padding: 2px 8px;
}

.job-card-body {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.job-card-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--color-text);
  line-height: 1.4;
}

.job-card-icon {
  font-size: 18px;
  color: var(--color-text-muted);
  flex-shrink: 0;
  margin-top: 1px;
}

.job-card-notes {
  color: var(--color-text-muted);
  font-style: italic;
}

.job-card-fail {
  color: var(--color-danger);
}

.btn-edit-reason {
  display: inline-flex;
  align-items: center;
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  margin-left: auto;
  flex-shrink: 0;
  transition: color var(--transition), background var(--transition);
}

.btn-edit-reason:hover {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.fail-reason-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 8px;
}

.fail-reason-row p {
  flex: 1;
}

.fail-reason-row .btn {
  flex-shrink: 0;
}

.job-vehicle-tag {
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--color-bg);
  color: var(--color-text-muted);
  padding: 1px 8px;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  margin-left: 4px;
}

.job-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
}

.job-actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.job-status-select {
  padding: 5px 10px;
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1.5px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
  color: var(--color-text);
  font-family: inherit;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.job-status-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.job-completed-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-success);
}

.job-rescheduled-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-warning);
}

/* ========================================
   Deliveries — Empty State
   ======================================== */
.jobs-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  text-align: center;
  color: var(--color-text-muted);
}

.jobs-empty .material-icons-outlined {
  font-size: 48px;
  opacity: 0.3;
}

.jobs-empty p {
  font-size: 0.9375rem;
}

.jobs-date-heading {
  padding: 12px 0 6px;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.jobs-date-heading:first-child {
  padding-top: 0;
}

.jobs-nav-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
  min-width: 180px;
  text-align: center;
}

/* ========================================
   Deliveries — Detail Reassign Row
   ======================================== */
.reassign-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

/* ========================================
   Button Variants — Success & Danger
   ======================================== */
.btn-success {
  background: var(--color-success);
  color: #fff;
}

.btn-success:hover {
  background: #15803d;
}

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

.btn-danger:hover {
  background: #b91c1c;
}

/* ========================================
   Modal
   ======================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-overlay.visible {
  opacity: 1;
}

.modal {
  background: var(--color-surface);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  transform: translateY(10px);
  transition: transform 0.2s ease;
}

.modal-overlay.visible .modal {
  transform: translateY(0);
}

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

.modal-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

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

.modal-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-body .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-body .form-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
}

.modal-body textarea,
.modal-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.9375rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  color: var(--color-text);
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.modal-body textarea:focus,
.modal-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.modal-body textarea {
  resize: vertical;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
}

/* ========================================
   Responsive: Deliveries (< 768px)
   ======================================== */
@media (max-width: 768px) {
  .stats-grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .stats-grid-5 {
    grid-template-columns: repeat(5, 1fr);
  }

  .jobs-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .jobs-date-nav {
    justify-content: center;
  }

  .jobs-filters {
    justify-content: stretch;
  }

  .driver-select {
    width: 100%;
    min-width: 0;
  }

  .jobs-tabs {
    overflow-x: auto;
  }

  .job-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .reassign-row {
    flex-direction: column;
    align-items: stretch;
  }

  .modal {
    max-width: 100%;
    margin: 0 10px;
  }

  .job-detail-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .stats-grid-3 {
    grid-template-columns: 1fr;
  }

  .stats-grid-5 {
    grid-template-columns: repeat(3, 1fr);
  }

  .jobs-tab {
    padding: 8px 12px;
    font-size: 0.8125rem;
  }
}

/* ========================================
   Inventory — Stock Table
   ======================================== */
.td-truncate {
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-link {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
}

.order-link:hover {
  text-decoration: underline;
}

/* ========================================
   Inventory — Leaflet Map
   ======================================== */
.skip-map {
  width: 100%;
  height: 500px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  overflow: hidden;
  background: var(--color-bg);
}

.map-legend {
  display: flex;
  gap: 20px;
  padding: 8px 0;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.map-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.map-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.map-dot-blue { background: #2563eb; }
.map-dot-orange { background: #d97706; }
.map-dot-green { background: #16a34a; }

.map-pin-icon {
  background: transparent !important;
  border: none !important;
}

.map-pin {
  width: 32px;
  height: 32px;
  border-radius: 50% 50% 50% 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-45deg);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.map-pin .material-icons-outlined {
  transform: rotate(45deg);
}

/* Late order map pins */
.map-pin-late {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #dc2626;
  border: 2px solid #fff;
  box-shadow: 0 0 0 3px rgba(220,38,38,0.4), 0 2px 4px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.map-pin-expired {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #d97706;
  border: 2px solid #fff;
  box-shadow: 0 0 0 3px rgba(217,119,6,0.4), 0 2px 4px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.map-pin-urgent {
  animation: map-pin-pulse 1.2s ease-in-out infinite;
}

@keyframes map-pin-pulse {
  0%   { transform: scale(1);   box-shadow: 0 0 0 3px rgba(220,38,38,0.4), 0 2px 4px rgba(0,0,0,0.3); }
  50%  { transform: scale(1.25); box-shadow: 0 0 0 8px rgba(220,38,38,0.2), 0 2px 8px rgba(0,0,0,0.3); }
  100% { transform: scale(1);   box-shadow: 0 0 0 3px rgba(220,38,38,0.4), 0 2px 4px rgba(0,0,0,0.3); }
}

.map-popup {
  font-family: 'Inter', sans-serif;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.map-popup strong {
  font-weight: 600;
}

/* ── Adjust Stock Modal ── */
.adjust-stock-current {
  text-align: center;
  margin-bottom: 12px;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.adjust-stock-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.adjust-stock-input {
  width: 80px;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 600;
  padding: 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  -moz-appearance: textfield;
}

.adjust-stock-input::-webkit-outer-spin-button,
.adjust-stock-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.adjust-stock-dec,
.adjust-stock-inc {
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.adjust-stock-note {
  text-align: center;
  font-size: 0.85rem;
  margin-top: 12px;
  min-height: 20px;
}

/* ========================================
   Responsive: Inventory (< 768px)
   ======================================== */
@media (max-width: 768px) {
  .skip-map {
    height: 350px;
  }

  .td-truncate {
    max-width: 150px;
  }
}

@media (max-width: 480px) {
  .skip-map {
    height: 280px;
  }
}

/* Hide sidebar close button on desktop */
@media (min-width: 769px) {
  .md-hide {
    display: none;
  }
}

/* ========================================
   Settings Page
   ======================================== */
.settings-map {
  width: 100%;
  height: 400px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  overflow: hidden;
  background: var(--color-bg);
  margin-top: 16px;
}

.settings-help {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.settings-location-label {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.settings-section-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.order-form input:disabled,
.order-form select:disabled,
.order-form textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--color-border);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Distance cell in orders table ── */
.distance-cell {
  white-space: nowrap;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
}

.distance-cell .material-icons-outlined {
  color: var(--color-primary);
  margin-right: 2px;
}

/* ========================================
   Responsive: Settings (< 768px)
   ======================================== */
@media (max-width: 768px) {
  .settings-map {
    height: 300px;
  }
}

@media (max-width: 480px) {
  .settings-map {
    height: 250px;
  }
}

/* ========================================
   Permits
   ======================================== */
.permit-warning-banner {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: var(--color-danger);
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
}

.permit-row-expiring {
  background: #fffbeb !important;
}

.permit-row-expiring:hover {
  background: #fef3c7 !important;
}

.days-remaining {
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
}

.days-remaining-ok {
  color: var(--color-success);
}

.days-remaining-warning {
  color: var(--color-warning);
}

.days-remaining-danger {
  color: var(--color-danger);
}

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

.expired-permit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.875rem;
  gap: 12px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s;
}

.expired-permit-row:hover {
  background: rgba(0, 0, 0, 0.03);
}

.expired-permit-row:last-child {
  border-bottom: none;
}

.expired-permit-danger {
  color: var(--color-danger);
}

.expired-permit-info {
  flex: 1;
  min-width: 0;
}

.expired-permit-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.stat-card-warning {
  border-color: var(--color-warning);
  animation: pulse-border-warning 2s ease-in-out infinite;
}

.stat-card-clickable {
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.stat-card-clickable:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.stat-card-active {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

@keyframes pulse-border-warning {
  0%, 100% { border-color: var(--color-warning); }
  50% { border-color: #fde68a; }
}

/* ========================================
   Invoicing
   ======================================== */
.invoice-preview {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

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

.invoice-company h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.invoice-company p {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.invoice-title-block {
  text-align: right;
}

.invoice-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.invoice-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: right;
}

.invoice-meta > div {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.invoice-meta .detail-label {
  font-size: 0.75rem;
  min-width: 70px;
  text-align: right;
}

.invoice-meta .detail-value {
  font-size: 0.875rem;
  min-width: 90px;
  text-align: right;
}

.invoice-bill-to {
  margin-bottom: 24px;
}

.invoice-bill-to h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.invoice-bill-to p {
  font-size: 0.9375rem;
  line-height: 1.5;
}

.invoice-line-items {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 0.875rem;
}

.invoice-line-items thead th {
  text-align: left;
  padding: 10px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.invoice-line-items tbody td {
  padding: 12px;
  border-bottom: 1px solid var(--color-border);
}

.invoice-totals {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  margin-bottom: 24px;
}

.invoice-totals-row {
  display: flex;
  gap: 24px;
  font-size: 0.9375rem;
}

.invoice-totals-row span:first-child {
  min-width: 100px;
  text-align: right;
  color: var(--color-text-muted);
}

.invoice-totals-row span:last-child {
  min-width: 90px;
  text-align: right;
}

.invoice-totals-total {
  font-weight: 700;
  font-size: 1.125rem;
  border-top: 2px solid var(--color-text);
  padding-top: 8px;
}

.invoice-totals-total span:first-child {
  color: var(--color-text);
}

.invoice-bank {
  background: var(--color-bg);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
}

.invoice-bank h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 10px;
}

.invoice-bank-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.invoice-bank-grid > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.invoice-bank-grid .detail-label {
  font-size: 0.75rem;
}

.invoice-bank-grid .detail-value {
  font-size: 0.9375rem;
  font-weight: 500;
}

.invoice-footer {
  border-top: 1px solid var(--color-border);
  padding-top: 16px;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.invoice-paid-stamp,
.invoice-unpaid-stamp {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-30deg);
  font-size: 10rem;
  font-weight: 900;
  opacity: 0.08;
  pointer-events: none;
  letter-spacing: 16px;
}

.invoice-paid-stamp {
  color: var(--color-success);
}

.invoice-unpaid-stamp {
  color: var(--color-danger);
}

.row-unpaid {
  background: #fffbeb !important;
}

.row-unpaid:hover {
  background: #fef3c7 !important;
}

/* ── Responsive: Invoicing ── */
@media (max-width: 768px) {
  .invoice-preview {
    padding: 20px;
  }

  .invoice-header {
    flex-direction: column;
    gap: 16px;
  }

  .invoice-title-block {
    text-align: left;
  }

  .invoice-meta {
    text-align: left;
  }

  .invoice-meta > div {
    justify-content: flex-start;
  }

  .invoice-title {
    font-size: 1.5rem;
  }

  .invoice-paid-stamp,
  .invoice-unpaid-stamp {
    font-size: 6rem;
  }
}

@media (max-width: 480px) {
  .invoice-preview {
    padding: 16px;
  }

  .invoice-bank-grid {
    grid-template-columns: 1fr 1fr;
  }

  .invoice-paid-stamp,
  .invoice-unpaid-stamp {
    font-size: 4rem;
  }
}

/* ========================================
   Scheduling
   ======================================== */
.schedule-view-tabs {
  display: flex;
  gap: 4px;
}

.schedule-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.schedule-nav-title {
  font-size: 1rem;
  font-weight: 600;
  min-width: 260px;
  text-align: center;
}

.schedule-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.schedule-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.schedule-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.bg-blue { background: #2563eb; }
.bg-green { background: #16a34a; }
.bg-orange { background: #d97706; }
.bg-red { background: #dc2626; }
.bg-purple { background: #7c3aed; }
.bg-teal { background: #0d9488; }
.bg-pink { background: #db2777; }

/* ── Event pills (shared) ── */
.schedule-event {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.schedule-event-blue { background: #dbeafe; color: #1d4ed8; }
.schedule-event-green { background: #dcfce7; color: #15803d; }
.schedule-event-orange { background: #fef3c7; color: #92400e; }
.schedule-event-red { background: #fef2f2; color: #b91c1c; }
.schedule-event-purple { background: #f3e8ff; color: #6d28d9; }
.schedule-event-teal { background: #ccfbf1; color: #0f766e; }
.schedule-event-pink { background: #fce7f3; color: #be185d; }

.schedule-event-completed {
  opacity: 0.5;
  text-decoration: line-through;
}

.schedule-drop-highlight {
  background: rgba(37, 99, 235, 0.08) !important;
  outline: 2px dashed var(--color-primary);
  outline-offset: -2px;
}

[draggable="true"] {
  cursor: grab;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-user-drag: element;
}
[draggable="true"]:active {
  cursor: grabbing;
}
.schedule-dragging {
  opacity: 0.4;
  transform: scale(0.95);
}

.schedule-event-failed {
  opacity: 0.5;
  text-decoration: line-through;
}

.schedule-event-overdue {
  border: 2px solid #dc2626;
  font-weight: 600;
  animation: overdueFlash 2s ease-in-out 3;
}

@keyframes overdueFlash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.schedule-event-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.schedule-event-time {
  margin-left: auto;
  font-size: 0.6875rem;
  opacity: 0.7;
}

/* ── Day View ── */
.schedule-day-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.schedule-day-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--radius);
  border-left: 4px solid transparent;
  transition: background var(--transition);
}

.schedule-day-item:hover {
  background: var(--color-bg);
}

.schedule-day-item.schedule-event-blue { border-left-color: #2563eb; background: #eff6ff; }
.schedule-day-item.schedule-event-green { border-left-color: #16a34a; background: #f0fdf4; }
.schedule-day-item.schedule-event-orange { border-left-color: #d97706; background: #fffbeb; }
.schedule-day-item.schedule-event-red { border-left-color: #dc2626; background: #fef2f2; }
.schedule-day-item.schedule-event-purple { border-left-color: #7c3aed; background: #faf5ff; }
.schedule-day-item.schedule-event-teal { border-left-color: #0d9488; background: #f0fdfa; }
.schedule-day-item.schedule-event-pink { border-left-color: #db2777; background: #fdf2f8; }

.schedule-day-item.schedule-event-completed {
  opacity: 0.5;
}

.schedule-day-item.schedule-event-failed {
  opacity: 0.5;
}

.schedule-day-item.schedule-event-overdue {
  border-left-width: 5px;
  border-left-color: #dc2626;
  background: #fef2f2;
  font-weight: 600;
}

.schedule-day-item-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.schedule-day-item.schedule-event-blue .schedule-day-item-icon { color: #2563eb; }
.schedule-day-item.schedule-event-green .schedule-day-item-icon { color: #16a34a; }
.schedule-day-item.schedule-event-orange .schedule-day-item-icon { color: #d97706; }
.schedule-day-item.schedule-event-red .schedule-day-item-icon { color: #dc2626; }
.schedule-day-item.schedule-event-purple .schedule-day-item-icon { color: #7c3aed; }
.schedule-day-item.schedule-event-teal .schedule-day-item-icon { color: #0d9488; }
.schedule-day-item.schedule-event-pink .schedule-day-item-icon { color: #db2777; }

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

.schedule-day-item-label {
  font-size: 0.9375rem;
  font-weight: 600;
}

.schedule-day-item-detail {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

/* ── Week View ── */
.schedule-week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  padding: 0 !important;
  min-width: 0;
}

.schedule-week-day {
  background: var(--color-surface);
  min-height: 160px;
  display: flex;
  flex-direction: column;
}

.schedule-week-day-today {
  background: #eff6ff;
}

.schedule-week-day-weekend {
  background: var(--color-bg);
}

.schedule-week-day-today.schedule-week-day-weekend {
  background: #eff6ff;
}

.schedule-week-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 10px 6px;
  border-bottom: 1px solid var(--color-border);
  height: 42px;
  box-sizing: border-box;
}

.schedule-week-day-name {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
}

.schedule-week-day-num {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
}

.schedule-week-day-num.today-num {
  background: var(--color-primary);
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  line-height: 1;
}

.schedule-week-day-events {
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.schedule-week-empty {
  color: var(--color-border);
  text-align: center;
  padding: 8px;
  font-size: 0.875rem;
}

/* ── Month scroll wrapper ── */
.schedule-month-scroll-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.schedule-month-scroll-wrapper .schedule-month-header-row,
.schedule-month-scroll-wrapper .schedule-month-row {
  min-width: 700px;
}

/* ── Month View ── */
.schedule-month-grid {
  padding: 0 !important;
}

.schedule-month-header-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--color-border);
}

.schedule-month-header-cell {
  padding: 10px;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
}

.schedule-month-body {
  display: flex;
  flex-direction: column;
}

.schedule-month-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--color-border);
}

.schedule-month-row:last-child {
  border-bottom: none;
}

.schedule-month-cell {
  min-height: 100px;
  padding: 6px;
  border-right: 1px solid var(--color-border);
  background: var(--color-surface);
}

.schedule-month-cell:last-child {
  border-right: none;
}

.schedule-month-cell-other {
  background: var(--color-bg);
}

.schedule-month-cell-other .schedule-month-cell-date {
  opacity: 0.35;
}

.schedule-month-cell-today {
  background: #eff6ff;
}

.schedule-month-cell-weekend {
  background: #f8fafc;
}

.schedule-month-cell-today.schedule-month-cell-weekend {
  background: #eff6ff;
}

.schedule-month-cell-date {
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--color-text);
}

.schedule-month-cell-today .schedule-month-cell-date {
  color: var(--color-primary);
}

.schedule-month-cell-events {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.schedule-month-event {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 0.6875rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-month-event-more {
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  padding: 1px 5px;
  font-weight: 500;
}

/* ── Week scroll wrapper ── */
.schedule-week-scroll-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.schedule-week-scroll-wrapper .schedule-week-grid {
  min-width: 980px;
}

/* ── Stacked week layout ── */
.schedule-week-stacked {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: none;
  border-radius: 0;
  overflow: visible;
  padding: 0 !important;
  min-width: 0;
}

.schedule-week-stacked .schedule-week-day {
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  min-height: auto;
}

.schedule-week-stacked .schedule-week-day-header {
  background: var(--color-bg);
  border-radius: var(--radius) var(--radius) 0 0;
}

/* ── Responsive: Scheduling ── */
@media (max-width: 1100px) {
  .schedule-week-day-header {
    padding: 10px 14px 6px;
  }

  .schedule-week-day-events {
    padding: 6px 14px 10px;
  }
}

@media (max-width: 768px) {
  .schedule-nav-title {
    min-width: 0;
    font-size: 0.875rem;
  }

  .schedule-month-cell {
    min-height: 60px;
    padding: 4px;
  }

  .schedule-month-event {
    font-size: 0.625rem;
  }

  .schedule-month-cell-date {
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .schedule-legend {
    gap: 10px;
    font-size: 0.75rem;
  }

  .schedule-month-cell {
    min-height: 50px;
    padding: 2px;
  }

  .schedule-month-event {
    font-size: 0.5625rem;
    padding: 1px 3px;
  }

  .schedule-month-header-cell {
    font-size: 0.625rem;
    padding: 6px 2px;
  }
}

/* ========================================
   Onboarding
   ======================================== */
.onboarding-progress-card {
  display: flex;
  align-items: center;
  gap: 32px;
  background: var(--color-card);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 20px;
}

.onboarding-ring-wrap {
  flex-shrink: 0;
}

.onboarding-progress-info {
  flex: 1;
}

.onboarding-progress-info h3 {
  margin: 0 0 12px;
  font-size: 1.125rem;
}

.onboarding-progress-bar {
  height: 8px;
  background: var(--color-border);
  border-radius: 4px;
  overflow: hidden;
}

.onboarding-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.onboarding-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  transition: background var(--transition);
}

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

.onboarding-item:hover {
  background: var(--color-hover);
}

.onboarding-item-icon {
  flex-shrink: 0;
}

.onboarding-item-icon .material-icons-outlined {
  font-size: 22px;
}

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

.onboarding-item-label {
  font-weight: 600;
  font-size: 0.9375rem;
}

.onboarding-item-done .onboarding-item-label {
  color: var(--color-text-muted);
}

.onboarding-item-desc {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.onboarding-item-action {
  flex-shrink: 0;
}

.onboarding-complete-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #ecfdf5;
  border: 1.5px solid #86efac;
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
  color: #166534;
}

.onboarding-incomplete-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fef3c7;
  border: 1.5px solid #fcd34d;
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
  color: #92400e;
}

/* Sidebar onboarding badge */
.nav-item-onboarding {
  position: relative;
}

.onboarding-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 20px;
  padding: 0 6px;
  font-size: 0.6875rem;
  font-weight: 700;
  border-radius: 10px;
  margin-left: auto;
}

.onboarding-badge-incomplete {
  background: #fef3c7;
  color: #92400e;
}

.onboarding-badge-complete {
  background: #dcfce7;
  color: #166534;
}

@media (max-width: 768px) {
  .onboarding-progress-card {
    flex-direction: column;
    text-align: center;
    padding: 20px;
    gap: 16px;
  }
}

/* ========================================
   Icon Picker
   ======================================== */
.icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}

.icon-picker-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  border: 1.5px solid var(--color-border);
  cursor: pointer;
  transition: all var(--transition);
  background: var(--color-bg);
  color: var(--color-text-muted);
}

.icon-picker-item:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.icon-picker-item.selected {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #fff;
}

.icon-picker-item .material-icons-outlined {
  font-size: 20px;
}

@media (max-width: 480px) {
  .icon-picker-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* ========================================
   Clickable Calendar Events
   ======================================== */
.schedule-clickable {
  cursor: pointer;
}

.schedule-day-item.schedule-clickable:hover {
  filter: brightness(0.95);
  transform: translateX(2px);
}

.schedule-event.schedule-clickable:hover {
  filter: brightness(0.9);
  transform: scale(1.02);
}

.schedule-month-event.schedule-clickable:hover {
  filter: brightness(0.9);
}

/* Event detail modal grid */
.event-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ========================================
   GDPR Page
   ======================================== */
.gdpr-section-card {
  margin-bottom: 12px;
}

.gdpr-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  transition: background var(--transition);
}

.gdpr-section-header:hover {
  background: var(--color-bg);
}

.gdpr-items-list {
  padding: 0;
}

.gdpr-item {
  padding: 14px 20px;
  border-bottom: 1px solid var(--color-border);
}

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

.gdpr-item-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.gdpr-item-icon {
  font-size: 20px;
  margin-top: 2px;
  flex-shrink: 0;
}

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

.gdpr-item-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.gdpr-item-desc {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin: 0 0 6px;
  line-height: 1.5;
}

.gdpr-item-action {
  font-size: 0.82rem;
  color: var(--color-primary);
  background: var(--color-primary-light);
  padding: 6px 10px;
  border-radius: var(--radius);
  margin-top: 6px;
  line-height: 1.4;
}

.gdpr-resource-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--color-bg);
  border-radius: var(--radius);
  color: var(--color-primary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background var(--transition);
}

.gdpr-resource-link:hover {
  background: var(--color-primary-light);
}

.gdpr-expand-icon {
  color: var(--color-text-muted);
  transition: transform var(--transition);
}

/* ── Global Search Overlay ── */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}
.search-overlay.visible {
  opacity: 1;
  visibility: visible;
}
.search-overlay-content {
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl, 0 25px 50px rgba(0,0,0,0.25));
  width: 90%;
  max-width: 640px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.search-overlay-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
}
.search-overlay-header input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 1.1rem;
  color: var(--color-text);
}
.search-overlay-close {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  cursor: pointer;
}
.search-overlay-results {
  overflow-y: auto;
  padding: 8px 0;
}
.search-hint {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}
.search-no-results {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-text-muted);
}
.search-category {
  padding: 4px 0;
}
.search-category-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}
.search-category-header .material-icons-outlined {
  font-size: 16px;
}
.search-count {
  margin-left: auto;
  font-weight: 400;
}
.search-result-item {
  display: block;
  padding: 10px 20px;
  text-decoration: none;
  color: var(--color-text);
  cursor: pointer;
  transition: background 0.15s;
}
.search-result-item:hover {
  background: var(--color-bg-hover, rgba(0,0,0,0.04));
}
.search-result-main {
  font-weight: 600;
  font-size: 0.9rem;
}
.search-result-sub {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* Customer Rating */
.customer-rating {
  display: flex;
  align-items: center;
  gap: 2px;
}
.customer-rating-interactive .rating-star {
  cursor: pointer;
  transition: transform 0.15s ease;
}
.customer-rating-interactive .rating-star:hover {
  transform: scale(1.2);
}
.rating-star .material-icons-outlined {
  font-size: 24px;
  color: var(--color-border);
}
.rating-star-filled .material-icons-outlined {
  color: var(--color-warning);
}
.rating-value {
  margin-left: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
}

/* Customer Comments */
.comments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.comment-item {
  padding: 12px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.comment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.comment-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.75rem;
}
.comment-author {
  font-weight: 600;
  color: var(--color-text);
}
.comment-date {
  color: var(--color-text-muted);
}
.comment-text {
  font-size: 0.875rem;
  color: var(--color-text);
  line-height: 1.5;
}
.comment-item .btn-icon {
  opacity: 0;
  transition: opacity 0.15s ease;
}
.comment-item:hover .btn-icon {
  opacity: 1;
}

/* ========================================
   Weather Forecast Bar
   ======================================== */
.weather-bar {
  margin-bottom: 16px;
}
.weather-bar-inner {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 12px;
}
.weather-bar-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 0.85rem;
  color: var(--color-text);
}
.weather-location {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}
.weather-loading, .weather-error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
@keyframes weatherSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.weather-spin {
  animation: weatherSpin 1s linear infinite;
  font-size: 18px;
}
.weather-warnings {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.weather-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 0.8125rem;
  font-weight: 500;
}
.weather-warning-danger {
  background: var(--color-danger);
  color: #fff;
}
.weather-warning-warning {
  background: var(--color-warning);
  color: #000;
}
.weather-days {
  display: flex;
  gap: 4px;
  overflow-x: auto;
}
.weather-day {
  flex: 1;
  min-width: 64px;
  text-align: center;
  padding: 8px 4px;
  border-radius: var(--radius);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  font-size: 0.75rem;
}
.weather-day-today {
  border-color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 8%, var(--color-bg));
}
.weather-day-name {
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}
.weather-day-num {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--color-text);
  margin-bottom: 4px;
}
.weather-day-icon .material-icons-outlined {
  font-size: 22px;
}
.weather-clear .weather-day-icon { color: #f59e0b; }
.weather-cloud .weather-day-icon { color: #94a3b8; }
.weather-rain .weather-day-icon { color: #3b82f6; }
.weather-snow .weather-day-icon { color: #7dd3fc; }
.weather-fog .weather-day-icon { color: #9ca3af; }
.weather-storm .weather-day-icon { color: #dc2626; }
.weather-day-temps {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 0.75rem;
}
.weather-high { font-weight: 600; color: var(--color-text); }
.weather-low { color: var(--color-text-muted); }
.weather-day-wind, .weather-day-rain {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  margin-top: 2px;
  font-size: 0.675rem;
  color: var(--color-text-muted);
}

/* ========================================
   Keyboard Shortcuts
   ======================================== */
.sidebar-shortcuts-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color 0.15s;
  border-top: 1px solid var(--color-border);
}
.sidebar-shortcuts-btn:hover {
  color: var(--color-primary);
}
.shortcuts-category {
  margin-bottom: 20px;
}
.shortcuts-category:last-child {
  margin-bottom: 0;
}
.shortcuts-category-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--color-border);
}
.shortcuts-list {
  display: flex;
  flex-direction: column;
}
.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}
.shortcut-row:not(:last-child) {
  border-bottom: 1px solid color-mix(in srgb, var(--color-border) 50%, transparent);
}
.shortcut-action {
  font-size: 0.875rem;
  color: var(--color-text);
}
.shortcut-keys {
  display: flex;
  align-items: center;
  gap: 4px;
}
.shortcut-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text);
  box-shadow: 0 1px 0 var(--color-border);
}
.shortcut-then {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  padding: 0 2px;
}

/* ========================================
   Bulk Actions Bar
   ======================================== */
.bulk-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--color-primary) 10%, var(--color-surface));
  border: 1px solid var(--color-primary);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.bulk-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--color-text);
}
.bulk-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.order-select-cb {
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.bulk-select-all-row {
  display: flex;
  align-items: center;
  padding: 8px 4px;
  margin-bottom: 8px;
}
.bulk-select-all-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
}
.bulk-select-all-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* ========================================
   Export Filters
   ======================================== */
.export-filters-row {
  margin-bottom: 16px;
  padding: 12px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
}

/* ========================================
   Today's Briefing Report
   ======================================== */
.report-date-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.report-company {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text);
}
.report-date {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.report-date-right {
  display: flex;
  gap: 24px;
}
.report-stat-mini {
  text-align: center;
}
.report-stat-num {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}
.report-stat-num.text-danger {
  color: var(--color-danger);
}
.report-stat-lbl {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}
.report-section {
  margin-bottom: 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.report-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 0.875rem;
}
.report-section-danger {
  background: var(--color-danger);
  color: #fff;
}
.report-section-blue {
  background: var(--color-primary);
  color: #fff;
}
.report-section-green {
  background: var(--color-success);
  color: #fff;
}
.report-section-orange {
  background: var(--color-warning);
  color: #000;
}
.report-section-purple {
  background: #7c3aed;
  color: #fff;
}
.report-section-body {
  padding: 12px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.report-table th {
  text-align: left;
  padding: 6px 8px;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
}
.report-table td {
  padding: 8px 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--color-border) 50%, transparent);
  vertical-align: middle;
}
.report-table tr:last-child td {
  border-bottom: none;
}
.report-empty {
  text-align: center;
  padding: 16px;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}
.report-alert-group {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--color-border) 50%, transparent);
}
.report-alert-group:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.report-alert-group > strong {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8125rem;
  color: var(--color-text);
}
.report-alert-row {
  padding: 4px 0;
  font-size: 0.8125rem;
  color: var(--color-text);
}
.report-alert-row .badge {
  font-size: 0.675rem;
  margin-right: 4px;
}
.report-footer {
  text-align: center;
  padding: 16px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
  margin-top: 8px;
}

/* Print styles for Today's Briefing */
@media print {
  .sidebar, .app-header, .no-print-hide, .notification-panel, .modal-overlay, #sidebarOverlay {
    display: none !important;
  }
  .main-content {
    margin-left: 0 !important;
    padding: 10px !important;
  }
  body {
    background: white !important;
    color: #000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .page-content {
    max-width: 100% !important;
  }
  .report-section {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .report-date-banner {
    border: 1px solid #ccc !important;
  }
  .report-section, .report-section-header {
    border: 1px solid #ddd !important;
  }
  .stats-grid {
    gap: 8px !important;
  }
  .stat-card {
    border: 1px solid #ddd !important;
    box-shadow: none !important;
  }
  .card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

/* ========================================
   User Manual TOC & Layout
   ======================================== */
.manual-toc {
  width: 260px;
  min-width: 260px;
  height: 100%;
  overflow-y: auto;
  border-right: 1px solid var(--color-border);
  background: var(--color-bg-secondary, #f9fafb);
  padding: 16px 0;
  flex-shrink: 0;
}

.manual-content {
  flex: 1;
  min-width: 0;
  padding: 32px 48px;
  overflow-y: auto;
  height: 100%;
}

.manual-toc-toggle {
  display: none;
}

@media (max-width: 768px) {
  .manual-toc-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--color-bg-secondary, #f9fafb);
    border: none;
    border-bottom: 1px solid var(--color-border);
    width: 100%;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
  }
  .manual-toc-toggle:hover {
    background: var(--color-bg);
  }
  .manual-page-wrapper {
    flex-direction: column !important;
    height: auto !important;
    overflow: visible !important;
  }
  .manual-toc {
    display: none;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    max-height: 50vh;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }
  .manual-toc.manual-toc-open {
    display: block;
  }
  .manual-content {
    height: auto !important;
    padding: 16px !important;
    overflow-y: visible !important;
  }
}

/* ========================================
   Settings Toggle Labels
   ======================================== */
.toggle-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 0;
}

.toggle-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--color-primary);
  cursor: pointer;
  flex-shrink: 0;
}

/* ========================================
   Driver Job Sheet — Mobile-First
   ======================================== */
.driver-sheet {
  max-width: 600px;
  margin: 0 auto;
  padding: 12px;
}

.driver-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--color-surface);
  border-radius: var(--radius);
  border: 1.5px solid var(--color-border);
  margin-bottom: 16px;
}

.driver-sheet-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.driver-sheet-title h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}

.driver-sheet-title p {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin: 2px 0 0;
}

.driver-sheet-progress {
  font-size: 1rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.driver-sheet-progress strong {
  color: var(--color-success);
  font-size: 1.25rem;
}

.driver-sheet-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-muted);
}

.driver-sheet-empty h3 {
  margin: 16px 0 4px;
  font-size: 1.5rem;
  color: var(--color-text);
}

.driver-job-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  border: 2px solid var(--color-border);
  margin-bottom: 12px;
  overflow: hidden;
  transition: opacity 0.3s;
}

.driver-job-card.done {
  opacity: 0.55;
  border-color: var(--color-success);
}

.driver-job-type {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 0.875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.driver-job-type .material-icons-outlined {
  font-size: 20px;
}

.driver-job-time {
  margin-left: auto;
  font-weight: 600;
  font-size: 0.8125rem;
  opacity: 0.7;
  text-transform: capitalize;
}

.driver-job-body {
  padding: 12px 16px;
}

.driver-job-order {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.driver-job-customer {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.driver-job-customer .material-icons-outlined {
  font-size: 20px;
  color: var(--color-text-muted);
}

.driver-job-address {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 6px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

.driver-job-address .material-icons-outlined {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.driver-job-skip {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.driver-job-skip .material-icons-outlined {
  font-size: 18px;
  color: var(--color-text-muted);
}

.driver-job-notes {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  font-style: italic;
  margin-top: 6px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.driver-job-notes .material-icons-outlined {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.driver-job-done {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-success);
  background: #dcfce7;
}

.driver-job-done .material-icons-outlined {
  font-size: 22px;
}

.driver-job-actions {
  padding: 12px 16px 16px;
}

.driver-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 18px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 1.125rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.driver-btn:active {
  transform: scale(0.97);
}

.driver-btn .material-icons-outlined {
  font-size: 26px;
}

.driver-btn-dispatch {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

.driver-btn-dispatch:hover {
  background: #1d4ed8;
  box-shadow: 0 6px 16px rgba(37,99,235,0.4);
}

.driver-btn-success {
  background: #16a34a;
  color: #fff;
  box-shadow: 0 4px 12px rgba(22,163,74,0.3);
}

.driver-btn-success:hover {
  background: #15803d;
  box-shadow: 0 6px 16px rgba(22,163,74,0.4);
}

/* ── Simple Orders Page ── */
.simple-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.simple-controls .search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0 10px;
  min-width: 200px;
}

.simple-controls .search-box .material-icons-outlined {
  font-size: 18px;
  color: var(--color-text-muted);
}

.simple-controls .search-box .form-input {
  border: none;
  background: transparent;
  padding: 8px 4px;
  font-size: 0.85rem;
  flex: 1;
  outline: none;
}

.simple-orders-table {
  table-layout: auto;
  width: 100%;
}
.simple-orders-table td,
.simple-orders-table th {
  padding: 6px 2px;
  font-size: 0.8rem;
  white-space: nowrap;
}
.simple-orders-table td:first-child,
.simple-orders-table th:first-child {
  padding-left: 6px;
  padding-right: 2px;
}
/* Customer column — allow wrapping to save width */
.simple-orders-table td:nth-child(2),
.simple-orders-table th:nth-child(2) {
  white-space: normal;
  max-width: 140px;
}

.simple-orders-table .simple-toggle-cell {
  text-align: center;
  white-space: nowrap;
  padding-left: 0;
}

.simple-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 2px solid var(--color-border);
  border-radius: 50%;
  background: var(--color-surface);
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--color-text-muted);
  margin: 0 3px;
  padding: 0;
  vertical-align: middle;
}

.simple-toggle .material-icons-outlined {
  font-size: 18px;
}

.simple-toggle-on {
  border-color: var(--color-success);
  background: #dcfce7;
  color: var(--color-success);
}

.simple-toggle-amber {
  border-color: #d97706;
  background: #fef3c7;
  color: #d97706;
}

@media (hover: hover) and (pointer: fine) {
  .simple-toggle:hover:not(.simple-toggle-disabled) {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--color-primary-light);
    transform: scale(1.1);
  }
  .simple-toggle-on:hover:not(.simple-toggle-disabled) {
    border-color: var(--color-danger);
    color: var(--color-danger);
    background: #fee2e2;
  }
}

.simple-toggle-on.simple-toggle-paid {
  border-color: #16a34a;
  background: #dcfce7;
  color: #16a34a;
}

.simple-toggle-unpaid {
  border-color: #dc2626;
  background: #fee2e2;
  color: #dc2626;
}

.simple-toggle-disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.simple-address-cell {
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.simple-detail-row td {
  padding: 0 !important;
  background: var(--color-bg);
}

.simple-detail-content {
  padding: 12px 16px;
}

.simple-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 0.85rem;
}

.simple-order-cancelled {
  opacity: 0.4;
}

.simple-order-cancelled td,
.simple-order-cancelled .simple-order-card-body,
.simple-order-cancelled .simple-order-card-header strong {
  text-decoration: line-through;
}

.simple-row-clickable {
  cursor: pointer;
}

.simple-data-row .simple-row-clickable:hover {
  cursor: pointer;
}

.simple-toggle-cancel {
  border-color: var(--color-border);
  color: var(--color-text-muted);
}

.simple-toggle-cancel:hover {
  border-color: var(--color-danger) !important;
  color: var(--color-danger) !important;
  background: #fee2e2 !important;
}

.simple-toggle-cancel-active {
  border-color: var(--color-danger);
  background: #fee2e2;
  color: var(--color-danger);
}

.simple-toggle-cancel-active:hover {
  border-color: var(--color-success) !important;
  color: var(--color-success) !important;
  background: #dcfce7 !important;
}

.simple-mobile-detail {
  padding: 10px 14px;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
}

.simple-order-card .simple-row-clickable {
  cursor: pointer;
}

.simple-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
}

/* Delivered & collected row highlight */
tr.simple-data-row.simple-row-complete {
  background: #f0fdf4;
}
.simple-order-card.simple-row-complete {
  background: #f0fdf4;
}

/* Unpaid row highlight — overrides complete */
tr.simple-data-row.simple-row-unpaid {
  background: #fff1f2;
}
.simple-order-card.simple-row-unpaid {
  background: #fff1f2;
}

/* Expanded row highlight — header row */
tr.simple-data-row.simple-row-expanded {
  background: #2563eb !important;
  color: #fff;
}
tr.simple-data-row.simple-row-expanded td {
  color: #fff;
  position: relative;
}
tr.simple-data-row.simple-row-expanded .simple-row-clickable {
  cursor: pointer;
}
tr.simple-data-row.simple-row-expanded .simple-row-clickable::after {
  content: 'click to collapse';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.65rem;
  opacity: 0;
  color: rgba(255,255,255,0.7);
  transition: opacity 0.15s;
  pointer-events: none;
}
tr.simple-data-row.simple-row-expanded .simple-row-clickable:last-of-type:hover::after {
  opacity: 1;
}
/* Detail area uses subtle background */
.simple-detail-row td {
  background: var(--color-bg-card, #fff) !important;
}
/* Mobile expanded card */
.simple-order-card.simple-row-expanded {
  border: 2px solid #2563eb;
}
.simple-order-card.simple-row-expanded .simple-order-card-header {
  background: #2563eb;
  color: #fff;
  margin: -1px -1px 0 -1px;
  padding: 10px 14px;
  border-radius: 6px 6px 0 0;
}
.simple-order-card.simple-row-expanded .simple-order-card-header strong,
.simple-order-card.simple-row-expanded .simple-order-card-header span {
  color: #fff;
}

/* Simple mode: hide search, notifications, keyboard shortcuts */
body.simple-mode #globalSearchBtn,
body.simple-mode #notificationBtn,
body.simple-mode #notificationBadge,
body.simple-mode #keyboardShortcutsBtn {
  display: none !important;
}

.simple-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}
.simple-pagination-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}
.simple-pagination-btns .btn[disabled] {
  opacity: 0.35;
  pointer-events: none;
}
.simple-pagination-pages {
  min-width: 50px;
  text-align: center;
  font-weight: 600;
}

.simple-legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 12px;
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.simple-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.simple-legend-item .material-icons-outlined {
  font-size: 18px;
}

/* Mobile card view for simple orders */
.simple-order-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 0;
}

.simple-order-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.simple-order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.simple-order-card-body {
  padding: 10px 14px;
  font-size: 0.85rem;
}

.simple-order-toggles {
  display: flex;
  justify-content: space-around;
  padding: 10px 14px;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
}

.simple-order-toggles .simple-toggle {
  width: auto;
  height: auto;
  border-radius: var(--radius);
  padding: 6px 12px;
  gap: 6px;
  border-width: 1px;
}

.simple-order-toggles .simple-toggle-label {
  font-size: 0.75rem;
  font-weight: 500;
}

.simple-order-card.simple-order-cancelled {
  opacity: 0.4;
}

tr.simple-data-row.simple-row-delivery-late {
  background: #fef2f2 !important;
  border-left: 4px solid #dc2626;
}
tr.simple-data-row.simple-row-delivery-late.simple-row-expanded {
  background: #2563eb !important;
}
.simple-order-card.simple-row-delivery-late {
  background: #fef2f2;
  border-left: 4px solid #dc2626;
}

.simple-controls .filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

@media (max-width: 768px) {
  .simple-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .simple-controls .filter-tabs {
    gap: 8px;
  }
  .simple-controls .search-box {
    min-width: unset;
  }
  .simple-order-toggles {
    gap: 6px;
    padding: 8px 10px;
  }
  .simple-order-toggles .simple-toggle {
    padding: 6px 6px;
    gap: 3px;
    flex: 1;
    justify-content: center;
    min-width: 0;
    overflow: hidden;
  }
  .simple-order-toggles .simple-toggle .material-icons-outlined {
    font-size: 15px;
    flex-shrink: 0;
  }
  .simple-order-toggles .simple-toggle-label {
    font-size: 0.6rem;
    white-space: nowrap;
  }
  .simple-order-toggles .simple-toggle[data-action="delivered"],
  .simple-order-toggles .simple-toggle[data-action="collected"] {
    flex: 1.3;
  }
  .simple-legend {
    gap: 10px;
    font-size: 0.75rem;
  }
}

.simple-pay-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.simple-pay-modal {
  background: var(--color-surface, #fff);
  border-radius: var(--radius, 8px);
  padding: 24px;
  min-width: 260px;
  max-width: 320px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

/* Modal form inputs — distinguish from modal background */
.simple-pay-modal .form-input,
.simple-pay-modal .form-group input:not([type="checkbox"]):not([type="radio"]),
.simple-pay-modal .form-group select,
.simple-pay-modal .form-group textarea {
  background: var(--color-bg, #f5f5f5);
  border: 1.5px solid var(--color-border);
}

/* Fix Safari date inputs overflowing containers */
input[type="date"] {
  min-width: 0 !important;
  max-width: 100%;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.form-row .form-group,
.form-row > div {
  min-width: 0;
  overflow: hidden;
}

/* Stack form rows inside modals on narrow screens */
.simple-pay-modal .form-row {
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 540px) {
  .simple-pay-modal .form-row {
    grid-template-columns: 1fr;
  }
}
