/* © Private - All Rights Reserved */
/* Parking Installation Manager — Minimalist Stylesheet */

/* ============================================================
   CSS Variables - Light theme (default)
   ============================================================ */
:root {
  /* Backgrounds */
  --bg-base: #fafafa;
  --bg-surface: #ffffff;
  --bg-elevated: #ffffff;
  --bg-hover: #f5f5f5;
  --bg-active: #ebebeb;

  /* Text */
  --text-primary: #18181b;
  --text-secondary: #52525b;
  --text-muted: #a1a1aa;
  --text-inverse: #ffffff;

  /* Borders */
  --border-subtle: #e4e4e7;
  --border-default: #d4d4d8;
  --border-strong: #a1a1aa;

  /* Accent (deep blue) */
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #dbeafe;
  --accent-muted: #eff6ff;

  /* Semantic */
  --success: #16a34a;
  --success-soft: #dcfce7;
  --warning: #d97706;
  --warning-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Heebo', 'Rubik', system-ui, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.875rem;   /* 14px */
  --text-base: 0.9375rem; /* 15px - slightly larger for Hebrew readability */
  --text-lg: 1.0625rem;  /* 17px */
  --text-xl: 1.25rem;    /* 20px */
  --text-2xl: 1.5rem;    /* 24px */
  --text-3xl: 1.875rem;  /* 30px */

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Radii */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-full: 9999px;

  /* Shadows - subtle */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 8px 24px rgba(0, 0, 0, 0.08);

  /* Transitions */
  --transition-fast: 120ms ease;
  --transition-base: 180ms ease;
}

/* ============================================================
   Dark theme
   ============================================================ */
[data-theme="dark"] {
  --bg-base: #0a0a0a;
  --bg-surface: #141414;
  --bg-elevated: #1c1c1c;
  --bg-hover: #242424;
  --bg-active: #2c2c2c;

  --text-primary: #fafafa;
  --text-secondary: #d4d4d8;
  --text-muted: #71717a;
  --text-inverse: #18181b;

  --border-subtle: #27272a;
  --border-default: #3f3f46;
  --border-strong: #52525b;

  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-soft: rgba(59, 130, 246, 0.15);
  --accent-muted: rgba(59, 130, 246, 0.08);

  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.15);
  --warning: #eab308;
  --warning-soft: rgba(234, 179, 8, 0.15);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.15);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.5), 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 8px 24px rgba(0, 0, 0, 0.6);
}

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

html {
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

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

/* ============================================================
   Auth pages (login)
   ============================================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.auth-container {
  width: 100%;
  max-width: 400px;
  position: relative;
}

.auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-md);
}

.auth-header {
  text-align: center;
  margin-bottom: var(--space-8);
}

.auth-header h1 {
  font-size: var(--text-2xl);
  font-weight: 600;
  margin: 0 0 var(--space-2);
  letter-spacing: -0.02em;
}

.auth-header p {
  margin: 0;
  font-size: var(--text-sm);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.auth-footer {
  margin-top: var(--space-8);
  text-align: center;
  font-size: var(--text-xs);
}

/* ============================================================
   Form fields
   ============================================================ */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.field label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-base);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.field input:disabled {
  background: var(--bg-hover);
  color: var(--text-muted);
  cursor: not-allowed;
}

.error-message {
  padding: var(--space-3);
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  background: var(--bg-hover);
  text-decoration: none;
}

.btn:active {
  background: var(--bg-active);
}

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

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-inverse);
}

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

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--text-inverse);
}

.btn-block {
  width: 100%;
}

.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: var(--text-lg);
  transition: background var(--transition-fast);
}

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

/* ============================================================
   Theme toggle (auth page)
   ============================================================ */
.theme-toggle {
  position: absolute;
  top: var(--space-4);
  left: var(--space-4);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: var(--text-lg);
}

.theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-light { display: none; }
[data-theme="dark"] .theme-icon-dark { display: inline; }

/* ============================================================
   App shell
   ============================================================ */
.app-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-6);
  height: 56px;
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.app-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  font-size: var(--text-base);
  white-space: nowrap;
}

.app-brand-mark {
  color: var(--accent);
  font-size: var(--text-xl);
}

.app-nav {
  display: flex;
  gap: var(--space-1);
  flex: 1;
}

.app-nav a {
  padding: var(--space-2) var(--space-4);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all var(--transition-fast);
}

.app-nav a:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  text-decoration: none;
}

.app-nav a.active {
  background: var(--accent-muted);
  color: var(--accent);
}

.app-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  position: relative;
}

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.user-menu-btn:hover {
  background: var(--bg-hover);
}

.user-menu-btn .caret {
  font-size: 10px;
  color: var(--text-muted);
}

.user-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 180px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-1);
  z-index: 50;
}

.user-menu button {
  width: 100%;
  text-align: right;
  padding: var(--space-2) var(--space-3);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.user-menu button:hover {
  background: var(--bg-hover);
}

/* ============================================================
   Main content
   ============================================================ */
.app-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
}

.loading-state {
  text-align: center;
  padding: var(--space-16);
  color: var(--text-muted);
}

/* Page sections */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-8);
  gap: var(--space-4);
}

.page-title {
  font-size: var(--text-3xl);
  font-weight: 600;
  margin: 0 0 var(--space-1);
  letter-spacing: -0.02em;
}

.page-subtitle {
  color: var(--text-muted);
  margin: 0;
  font-size: var(--text-sm);
}

/* Cards */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.card + .card {
  margin-top: var(--space-4);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-6);
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-4);
  opacity: 0.4;
}

.empty-state h3 {
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--text-secondary);
  margin: 0 0 var(--space-2);
}

.empty-state p {
  margin: 0 0 var(--space-6);
  font-size: var(--text-sm);
}

/* ============================================================
   Toast notifications
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  left: var(--space-6);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
  animation: toast-in 200ms ease;
  pointer-events: auto;
  max-width: 360px;
}

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

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

/* ============================================================
   Mobile responsive
   ============================================================ */
@media (max-width: 768px) {
  .app-header-inner {
    padding: 0 var(--space-4);
    gap: var(--space-3);
  }

  .app-nav {
    gap: 0;
  }

  .app-nav a {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
  }

  .app-brand-name {
    display: none;
  }

  .app-main {
    padding: var(--space-6) var(--space-4);
  }

  .page-title {
    font-size: var(--text-2xl);
  }

  .user-menu-btn {
    padding: var(--space-2);
  }

  #user-name {
    display: none;
  }
}

/* ============================================================
   Forms — extended
   ============================================================ */
.form-card {
  max-width: 720px;
  margin: 0 auto;
}

.form-section {
  padding-bottom: var(--space-6);
  margin-bottom: var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
}
.form-section:last-of-type { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.form-section-title {
  font-size: var(--text-base);
  font-weight: 600;
  margin: 0 0 var(--space-4);
  color: var(--text-primary);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
@media (max-width: 600px) {
  .field-row { grid-template-columns: 1fr; }
}

.field .required { color: var(--danger); }
.field-hint {
  display: block;
  margin-top: var(--space-1);
  color: var(--text-muted);
  font-size: var(--text-xs);
}

.field textarea {
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
}

.form-actions {
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-subtle);
}
.form-actions .btn-danger { margin-left: auto; }

@media (max-width: 600px) {
  .form-actions {
    flex-direction: column-reverse;
  }
  .form-actions .btn { width: 100%; }
  .form-actions .btn-danger { margin-left: 0; }
}

/* ============================================================
   Stats grid
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}
.stat-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-2);
}
.stat-value {
  font-size: var(--text-3xl);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1;
}
.stat-value.muted { color: var(--text-muted); }

/* ============================================================
   Cards — extended
   ============================================================ */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}
.card-title {
  font-size: var(--text-base);
  font-weight: 600;
  margin: 0;
}
.card-link {
  font-size: var(--text-sm);
  color: var(--accent);
}
.card-link:hover { text-decoration: none; }

.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
@media (max-width: 600px) {
  .card-grid { grid-template-columns: 1fr; }
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.info-row {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
  padding-bottom: var(--space-2);
  border-bottom: 1px dashed var(--border-subtle);
}
.info-row:last-child { border-bottom: none; padding-bottom: 0; }
.info-label { color: var(--text-muted); }
.info-value { color: var(--text-primary); font-weight: 500; }

.notes-text {
  white-space: pre-wrap;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.breadcrumb {
  display: inline-block;
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.breadcrumb:hover { color: var(--accent); text-decoration: none; }

/* ============================================================
   Filter bar
   ============================================================ */
.filter-card {
  display: flex;
  gap: var(--space-4);
  align-items: center;
  flex-wrap: wrap;
  padding: var(--space-3) var(--space-4);
}
.filter-input {
  flex: 1;
  min-width: 240px;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-sm);
}
.filter-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.filter-chips {
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
}
.chip-btn {
  padding: var(--space-2) var(--space-3);
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  cursor: pointer;
  font-weight: 500;
  transition: all var(--transition-fast);
}
.chip-btn:hover { background: var(--bg-hover); }
.chip-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-inverse);
}

/* ============================================================
   Tables
   ============================================================ */
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  text-align: right;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-subtle);
}
.data-table td {
  padding: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-sm);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr.clickable { cursor: pointer; }
.data-table tr.clickable:hover { background: var(--bg-hover); }
.row-actions {
  text-align: left;
}
.action-link {
  font-size: var(--text-sm);
  color: var(--accent);
}

/* ============================================================
   Chips (status)
   ============================================================ */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  white-space: nowrap;
}
.chip.success { background: var(--success-soft); color: var(--success); }
.chip.warning { background: var(--warning-soft); color: var(--warning); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.chip.muted { background: var(--bg-hover); color: var(--text-secondary); }
.chip.accent { background: var(--accent-muted); color: var(--accent); }

/* ============================================================
   Modal
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-4);
  animation: fadeIn 150ms ease;
  overflow-y: auto;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  max-width: 480px;
  width: 100%;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  animation: scaleIn 150ms ease;
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-content {
  padding: var(--space-6);
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.modal-title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin: 0 0 var(--space-3);
  flex-shrink: 0;
}
.modal-body {
  color: var(--text-secondary);
  margin: 0 0 var(--space-6);
  line-height: 1.6;
}
.modal-actions {
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
  flex-shrink: 0;
  margin-top: auto;
  padding-top: var(--space-3);
  position: sticky;
  bottom: 0;
  background: var(--bg-elevated);
  z-index: 5;
}


/* ============================================================
   Spec Form
   ============================================================ */
.elevators-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
}

.elevator-form {
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

.elevator-form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-base);
}

.btn-icon {
  background: transparent;
  border: 1px solid var(--border-default);
  padding: 4px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--text-xs);
  color: var(--text-secondary);
}
.btn-icon:hover { background: var(--bg-hover); }
.btn-danger-text {
  color: var(--danger);
  border-color: var(--danger);
}
.btn-danger-text:hover { background: var(--danger-soft); }

.system-fields {
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  margin: var(--space-2) 0 var(--space-3);
  border-right: 3px solid var(--accent);
}

.field-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-3);
}
@media (max-width: 700px) {
  .field-row-3 { grid-template-columns: 1fr; }
}

.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}
@media (max-width: 600px) {
  .checkbox-grid { grid-template-columns: 1fr; }
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}
.checkbox-item:hover { background: var(--bg-hover); }
.checkbox-item input[type="checkbox"] {
  cursor: pointer;
}

/* ============================================================
   Spec Summary (read-only display on site detail)
   ============================================================ */
.spec-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--bg-base);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
}
.spec-summary-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.spec-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.elevators-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}
@media (max-width: 760px) {
  .elevators-list { grid-template-columns: 1fr; }
}

.elevator-card {
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3);
}
.elevator-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-subtle);
}
.elevator-card-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.elevator-card-body .info-row {
  border-bottom: 1px dashed var(--border-subtle);
  padding-bottom: var(--space-2);
}
.elevator-card-body .info-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* ============================================================
   Shuttle per-floor lengths
   ============================================================ */
.shuttle-lengths-section {
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  margin: var(--space-2) 0 var(--space-3);
  border-right: 3px solid #d97706;
}
.floor-lengths-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: var(--space-2);
}
.floor-length-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.floor-length-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 500;
}
.floor-length-item input {
  padding: 6px 8px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: var(--text-sm);
  text-align: center;
}
.floor-length-item input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-muted);
}

/* Acoustic components section */
.acoustic-components-section {
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  margin: var(--space-2) 0 var(--space-3);
  border-right: 3px solid #ec4899;
}

/* ============================================================
   Tasks Section
   ============================================================ */
.time-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

.time-summary-card {
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  border-right: 4px solid transparent;
}
.time-summary-card.mech { border-right-color: #2563eb; }
.time-summary-card.ctrl { border-right-color: #d97706; }
.time-summary-card.int { border-right-color: #16a34a; }
.time-summary-card.total {
  border-right-color: var(--accent);
  background: var(--accent-muted);
}

.ts-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}
.ts-value {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.ts-value small {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-muted);
  margin-right: 4px;
}

.phase-section {
  margin-bottom: var(--space-5);
}
.phase-section:last-child { margin-bottom: 0; }

.phase-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-base);
  border-right: 4px solid;
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.phase-task-count {
  margin-right: auto;
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 500;
}

.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.task-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  gap: var(--space-3);
}
.task-item:hover { background: var(--bg-hover); }

.task-item-main {
  flex: 1;
  min-width: 0;
}
.task-item-name {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
}
.task-item-notes {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

.task-item-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.task-days {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

@media (max-width: 600px) {
  .task-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .task-item-meta {
    width: 100%;
    justify-content: space-between;
  }
}

/* ============================================================
   Teams Page
   ============================================================ */
.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-3);
}

.team-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-right: 4px solid;
  border-radius: var(--radius-md);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.team-card.inactive { opacity: 0.55; }

.team-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-subtle);
}
.team-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: var(--text-base);
}
.team-color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}
.team-priority {
  font-size: var(--text-xs);
  color: var(--text-muted);
  background: var(--bg-base);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.team-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--text-sm);
}
.team-info-row {
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
}
.team-info-label { color: var(--text-muted); }

.team-card-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-subtle);
}
.team-card-actions .btn {
  flex: 1;
  font-size: var(--text-xs);
  padding: 6px;
}

/* Color picker */
.color-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 6px;
}
.color-swatch {
  height: 36px;
  border: 2px solid #ccc;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #333;
  transition: all 0.15s;
}
.color-swatch:hover { transform: scale(1.05); }
.color-swatch.active {
  border-width: 3px;
  border-color: #000;
  transform: scale(1.08);
}

/* ============================================================
   Weekly Board
   ============================================================ */
.board-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.board-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.week-nav {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.week-label {
  font-weight: 600;
  font-size: var(--text-sm);
  background: var(--bg-base);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
  text-align: center;
  min-width: 160px;
}
.week-label-num {
  font-weight: 700;
  font-size: 13px;
  color: #1e40af;
  line-height: 1.2;
}
.week-label-range {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 1px;
}

.board-controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.chip-stat {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  background: var(--bg-base);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}
.chip-stat strong { color: var(--text-primary); }
.mode-toggle { display: flex; gap: 4px; }
.mode-toggle .btn { font-size: var(--text-xs); padding: 4px 10px; }

/* Toolbar: stats grouped on the title row, actions decluttered below */
.board-stats { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }
.board-controls .mode-toggle { margin: 0; }
.board-controls-sep {
  width: 1px; align-self: stretch; min-height: 20px;
  background: var(--border-subtle); margin: 0 var(--space-1);
}
.board-add-btn { margin-inline-start: auto; }

/* Send dropdown menu */
.board-menu { position: relative; }
.board-menu-list[hidden] { display: none; }
.board-menu-list {
  position: absolute; top: calc(100% + 4px); inset-inline-end: 0;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  z-index: 50; min-width: 210px; padding: 4px;
  display: flex; flex-direction: column; gap: 2px;
}
.board-menu-item {
  text-align: right; background: none; border: none; cursor: pointer;
  padding: 8px 12px; border-radius: var(--radius-sm);
  font-size: var(--text-sm); color: var(--text-primary); white-space: nowrap;
}
.board-menu-item:hover { background: var(--bg-hover); }

/* Board table */
.board-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: visible;
  box-shadow: var(--shadow-sm);
}
@media (max-width: 900px) {
  .board-wrap { overflow-x: auto; }
}
.board-table {
  width: 100%;
  border-collapse: separate; /* needed for sticky borders */
  border-spacing: 0;
  table-layout: fixed;
  min-width: 720px;
}
.board-table th, .board-table td {
  border: 1px solid var(--border-subtle);
  padding: 0;
  vertical-align: middle;
  text-align: center;
}
.board-table thead th {
  background: var(--bg-base);
  font-weight: 700;
  padding: 8px 4px;
  font-size: var(--text-sm);
  /* Sticky to viewport - day header stays visible as user scrolls page down.
     Pinned just BELOW the sticky app navbar (56px tall) so it doesn't hide
     behind it. Note: must apply to the TH (cell), not the TR, because <tr>
     sticky is not supported in all browsers. */
  position: sticky;
  top: 56px;
  z-index: 20;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.board-table thead {
  position: relative;
  z-index: 10;
}
.board-table .site-col {
  width: 180px;
  text-align: right;
}
.board-table .day-col { width: auto; }
.day-name { font-size: var(--text-sm); font-weight: 700; }
.day-date { font-size: var(--text-xs); color: var(--text-muted); margin-top: 2px; }

.site-cell {
  text-align: right !important;
  padding: 8px 12px !important;
  font-weight: 700;
  font-size: var(--text-sm);
  background: var(--bg-base);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.board-cell {
  height: auto;
  min-height: 56px;
  cursor: pointer;
  transition: background 0.1s;
  padding: 4px 6px !important;
  vertical-align: middle !important;
  text-align: center;
}
.board-cell.empty {
  background: var(--bg-surface);
}
.board-cell.empty:hover {
  background: var(--bg-hover);
}
.board-cell.team {
  font-weight: 700;
  color: #000;
}
.cell-team-name {
  font-size: var(--text-sm);
  font-weight: 700;
  text-align: center;
}
.cell-note {
  font-size: var(--text-xs);
  margin-top: 2px;
  opacity: 0.85;
  font-weight: 500;
  text-align: center;
  white-space: pre-line;
  word-break: break-word;
}
.cell-note-only {
  font-size: var(--text-xs);
  font-weight: 600;
  color: #000;
  padding: 4px;
  text-align: center;
  white-space: pre-line;
  word-break: break-word;
}

/* View mode - disable cell hover/cursor */
.board-cell:not(.empty) {
  cursor: pointer;
}

/* Site picker modal */
.site-pick-list {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-base);
}
.site-pick-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.1s;
}
.site-pick-item:last-child { border-bottom: none; }
.site-pick-item:hover { background: var(--bg-hover); }

/* Assign modal */
.assign-summary {
  background: var(--bg-base);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--text-sm);
}

/* btn-icon */
.btn-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 18px;
  color: var(--text-secondary);
}
.btn-icon:hover { background: var(--bg-hover); }

/* ============================================================
   v0.6.1 - Multiple rows per site, clipboard, holidays
   ============================================================ */
.site-cell-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
}
.site-cell-address {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-row-btn {
  width: 22px;
  height: 22px;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
}
.site-row-btn:hover { background: var(--accent-muted); color: var(--accent); }
.site-row-btn.remove:hover { background: var(--danger-soft); color: var(--danger); }
.row-remove-cell {
  width: 30px;
  background: var(--bg-base);
  padding: 0 !important;
}

/* Selected & copied cells — Excel-like visual feedback */
.board-cell.selected {
  outline: 3px solid #2563eb;
  outline-offset: -3px;
  position: relative;
  z-index: 2;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.5);
}
.board-cell.copied {
  outline: 3px dashed #d97706;
  outline-offset: -3px;
  animation: marching-ants 0.8s linear infinite;
}
@keyframes marching-ants {
  to { outline-offset: -1px; }
}

/* Clipboard bar */
.clipboard-bar {
  margin-top: var(--space-2);
  padding: 6px 12px;
  background: var(--bg-base);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
}
.clipboard-status { flex: 1; color: var(--text-muted); }
.clipboard-status.active { color: #d97706; font-weight: 600; }
.btn-sm { font-size: var(--text-xs); padding: 3px 8px; }

/* Clipboard status sitting inline in the toolbar (where "+ add site" used to be) */
.board-clipboard-inline {
  margin-top: 0;
  margin-inline-start: auto;
  max-width: 360px;
}
.board-clipboard-inline .clipboard-status { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* "+ add site" as a slim full-width bar, frozen at the top of the board */
.board-add-bar {
  display: block;
  width: 100%;
  height: 34px;
  line-height: 32px;
  padding: 0;
  font-size: var(--text-sm);
  border: 1px solid var(--border-subtle);
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  position: sticky;
  top: 56px;
  z-index: 22;
}
/* When the add-site bar is present (edit mode), the days header freezes just
   below it (56px navbar + 34px bar). In view mode it freezes at 56px. */
.board-wrap.has-add-bar .board-table thead th { top: 90px; }

/* Holiday header */
.board-table .day-col {
  /* No position here: the thead th sticky rule must win so the day header
     freezes. Sticky also serves as the containing block for the holiday badge. */
}
.board-table .day-col[data-edit-holiday] {
  cursor: pointer;
}
.board-table .day-col[data-edit-holiday]:hover {
  background: var(--accent-muted) !important;
}
.board-table .day-col[data-edit-holiday]:not(.is-holiday)::after {
  content: '🕎 +';
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 9px;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.15s;
}
.board-table .day-col[data-edit-holiday]:hover::after {
  opacity: 0.8;
}
.board-table .day-col.is-holiday {
  cursor: pointer;
}
.day-holiday {
  font-size: 11px;
  font-weight: 700;
  margin-top: 3px;
  color: #000;
  background: rgba(0,0,0,0.08);
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-block;
}

/* Holidays modal */
.holidays-list {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-3);
}
.holiday-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-sm);
}
.holiday-item:last-child { border-bottom: none; }
.holiday-item small { color: #555; }

/* ============================================================
   v0.7 - Teams list (vertical, draggable)
   ============================================================ */
.teams-list-header {
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}

.teams-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.team-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all 0.15s;
  cursor: default;
}
.team-row:hover { background: var(--bg-hover); }
.team-row.inactive { opacity: 0.55; }
.team-row.dragging { opacity: 0.4; }

.team-row.drag-over-top { box-shadow: 0 -3px 0 var(--accent) inset; }
.team-row.drag-over-bottom { box-shadow: 0 3px 0 var(--accent) inset; }

.team-row-grip {
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: -2px;
  cursor: grab;
  user-select: none;
  font-size: 14px;
  padding: 0 2px;
}
.team-row[draggable="true"] .team-row-grip:hover {
  color: var(--text-primary);
}

.team-row-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.team-row-name {
  font-weight: 700;
  font-size: var(--text-base);
  min-width: 80px;
}

.team-row-leader {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.team-row-phone {
  font-size: var(--text-sm);
  color: var(--accent);
}

.team-row-priority-input {
  margin-right: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.team-row-priority-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.team-priority-input {
  width: 60px;
  padding: 4px 8px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: var(--text-sm);
  text-align: center;
}

.team-row-action {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.team-row-action:hover { background: var(--bg-hover); }
.team-row-action.danger:hover { background: var(--danger-soft); color: var(--danger); }

.team-add-row {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: var(--space-2);
  align-items: stretch;
}
.team-add-name {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  font-size: var(--text-sm);
  color: var(--text-primary);
}
.team-add-priority {
  width: 90px;
  padding: 8px 12px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  font-size: var(--text-sm);
  text-align: center;
  color: var(--text-primary);
}
.team-add-name:focus, .team-add-priority:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.teams-inactive-section {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
}
.teams-inactive-section summary {
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: 600;
  padding: 6px 0;
}

@media (max-width: 700px) {
  .team-row { flex-wrap: wrap; gap: 8px; }
  .team-row-priority-input { order: 10; width: 100%; margin-right: 0; }
  .team-row-leader, .team-row-phone { font-size: var(--text-xs); }
}

/* ============================================================
   v0.7 - Transports
   ============================================================ */
.transports-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.transport-date-group {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.transport-date-header {
  background: var(--bg-base);
  padding: 8px 14px;
  font-weight: 700;
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--border-subtle);
}

.transport-items {
  display: flex;
  flex-direction: column;
}

.transport-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
}
.transport-item:last-child { border-bottom: none; }
.transport-item.has-escort { background: #fffbeb; }

.transport-item-main {
  flex: 1;
  min-width: 0;
}
.transport-item-site {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.transport-item-details {
  font-size: var(--text-sm);
  color: var(--text-primary);
}
.transport-item-notes {
  color: var(--text-secondary);
  font-weight: 400;
}
.transport-escort-badge {
  display: inline-block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  background: #fde68a;
  color: #7a4000;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid #d97706;
}

.transport-item-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

/* Cell transports on board */
.cell-transports {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.cell-transport-badge {
  font-size: 11px;
  font-weight: 700;
  /* Pink/red transport color - original design */
  background: #fecaca;
  color: #7f1d1d;
  border: 1px solid #ef4444;
  border-radius: 4px;
  padding: 3px 6px;
  text-align: center;
  line-height: 1.3;
}
/* Escort badge — a rectangular framed box inside the transport, in yellow */
.cell-transport-escort-pill {
  display: inline-block;
  background: #fde047;
  color: #713f12;
  border: 1px solid #ca8a04;
  border-radius: 3px;
  padding: 1px 6px;
  font-size: 9px;
  font-weight: 800;
  margin-right: 4px;
  vertical-align: middle;
  white-space: nowrap;
}
.ctb-line {
  font-weight: 700;
  text-align: center;
}
.ctb-details {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.85;
  margin-top: 1px;
  white-space: pre-line;
  word-break: break-word;
  text-align: center;
}

.board-cell.has-transport {
  background: #fff5f5;
}

/* ============================================================
   v0.7 - Dashboard
   ============================================================ */
.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.dashboard-kpi-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.15s;
  position: relative;
}
.dashboard-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}
.dashboard-kpi-card.primary {
  border-right: 4px solid var(--accent);
}
.dashboard-kpi-card.highlight {
  border-right: 4px solid #f59e0b;
  background: linear-gradient(to right, #fffbeb, var(--bg-surface));
}

.kpi-icon {
  font-size: 32px;
  flex-shrink: 0;
}
.kpi-content { flex: 1; min-width: 0; }
.kpi-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}
.kpi-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: 4px;
}
.kpi-sub {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}
.kpi-sub.warning {
  color: #d97706;
  font-weight: 600;
}

/* Task status bar */
.task-status-bar {
  display: flex;
  height: 24px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: var(--space-2);
  border: 1px solid var(--border-subtle);
}
.task-status-segment.muted { background: #d1d5db; }
.task-status-segment.info { background: #3b82f6; }
.task-status-segment.success { background: #16a34a; }
.task-status-segment.danger { background: #dc2626; }

.task-status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.legend-item .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.legend-item .dot.muted { background: #d1d5db; }
.legend-item .dot.info { background: #3b82f6; }
.legend-item .dot.success { background: #16a34a; }
.legend-item .dot.danger { background: #dc2626; }

/* Alert card for stuck tasks */
.card.alert-card {
  border-right: 4px solid var(--danger);
  background: linear-gradient(to right, #fef2f2, var(--bg-surface));
}

.stuck-tasks-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stuck-task-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-primary);
  font-size: var(--text-sm);
}
.stuck-task-item:hover {
  background: var(--bg-hover);
  border-color: var(--danger);
}
.stuck-task-item small {
  color: var(--text-muted);
}
.stuck-task-reason {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-style: italic;
}

/* Two-column dashboard layout */
.dashboard-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
@media (max-width: 800px) {
  .dashboard-2col { grid-template-columns: 1fr; }
}

/* Today's assignments */
.today-assignments {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.today-asgn-item {
  padding: 8px 12px;
  background: var(--bg-base);
  border-right: 3px solid var(--border-default);
  border-radius: var(--radius-sm);
}
.today-asgn-team {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 700;
  margin-bottom: 4px;
}
.today-asgn-site {
  font-size: var(--text-sm);
  font-weight: 600;
}
.today-asgn-note {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

/* Upcoming transports */
.upcoming-transports {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.upcoming-transport-item {
  display: flex;
  gap: var(--space-3);
  padding: 8px 12px;
  background: var(--bg-base);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}
.upcoming-transport-item.has-escort {
  background: #fffbeb;
  border-color: #f59e0b;
}
.ut-date {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-secondary);
  min-width: 64px;
}
.ut-content { flex: 1; }
.ut-site {
  font-size: var(--text-sm);
  font-weight: 600;
}
.ut-carrier {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Active sites progress list */
.active-sites-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.active-site-item {
  display: block;
  padding: 10px 14px;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.15s;
}
.active-site-item:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}
.active-site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.active-site-pct {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--accent);
}
.progress-bar {
  height: 6px;
  background: var(--bg-surface);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(to left, var(--accent), #60a5fa);
  border-radius: 3px;
  transition: width 0.3s;
}
.active-site-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}
.active-site-stats .danger { color: var(--danger); font-weight: 600; }

/* Task status modal */
.task-status-modal { max-width: 540px; }
.task-modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--space-4);
  padding: 10px;
  background: var(--bg-base);
  border-radius: var(--radius-sm);
}

.status-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.status-option {
  padding: 10px 14px;
  border: 2px solid var(--border-default);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}
.status-option:hover { background: var(--bg-hover); }
.status-option.active {
  border-color: var(--accent);
  background: var(--accent-muted);
  color: var(--accent);
}

.task-status-chip {
  cursor: pointer;
  border: 0;
  font-family: inherit;
}
.task-status-chip:hover {
  filter: brightness(0.95);
}

.task-item-stuck {
  margin-top: 6px;
  padding: 6px 8px;
  background: #fef2f2;
  border-right: 3px solid var(--danger);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  color: #991b1b;
}
.task-item-actual {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============================================================
   v0.7.2 - Inline transports in assign modal
   ============================================================ */
.assign-modal {
  max-width: 600px;
}

.transports-section {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px dashed var(--border-default);
}
.transports-section-title {
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}
.modal-transports-empty {
  padding: 10px;
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-xs);
  background: var(--bg-base);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-2);
}

.transport-entry {
  position: relative;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: var(--space-2);
}

.transport-entry-remove {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 22px;
  height: 22px;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  border-radius: 50%;
  cursor: pointer;
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.transport-entry-remove:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.tr-escort-row {
  margin-top: 4px;
}

/* ============================================================
   v0.8 - Employees
   ============================================================ */
.employees-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.employee-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s;
}
.employee-row:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}
.employee-row.inactive {
  opacity: 0.55;
}

.emp-row-main {
  flex: 1;
  min-width: 0;
}
.emp-row-name {
  font-weight: 700;
  font-size: var(--text-base);
  display: flex;
  align-items: center;
  gap: 6px;
}
.emp-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-top: 4px;
}
.emp-row-id { color: var(--text-muted); }
.emp-row-phone { color: var(--accent); }
.emp-row-team {
  padding: 1px 8px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
}
.emp-row-alerts {
  margin-top: 4px;
}
.emp-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
.emp-badge.warning { background: #fef3c7; color: #92400e; border: 1px solid #f59e0b; }
.emp-badge.danger { background: #fef2f2; color: #991b1b; border: 1px solid var(--danger); }

.emp-row-docs {
  flex-shrink: 0;
}
.emp-docs-score {
  font-size: var(--text-xs);
  font-weight: 700;
}
.chip.warning { background: #fef3c7; color: #92400e; border: 1px solid #fbbf24; }

.emp-row-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.emp-row-action {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.emp-row-action:hover { background: var(--bg-hover); }
.emp-row-action.danger:hover { background: var(--danger-soft); color: var(--danger); }

/* Employee modal form sections */
.employee-modal { max-width: 600px; }
.employee-modal .form-section {
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}
.employee-modal .form-section:last-of-type {
  border-bottom: none;
}
.form-section-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.doc-group {
  background: var(--bg-base);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: var(--space-2);
}

/* Employee alerts on list page */
.emp-alert-section {
  padding: 6px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.emp-alert-section strong {
  font-size: var(--text-sm);
  margin-left: 6px;
}
.emp-alert-chip {
  font-size: var(--text-xs);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
}
.emp-alert-chip.warning { border: 1px solid #f59e0b; background: #fef3c7; color: #7a4000; }
.emp-alert-chip.danger { border: 1px solid var(--danger); background: #fef2f2; color: #991b1b; }

/* ============================================================
   v0.8.2 - Employee file uploads
   ============================================================ */

/* File section in modal (edit mode) */
.doc-file-section {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-subtle);
}

.doc-file-preview {
  display: flex;
  align-items: center;
  gap: 12px;
}

.doc-file-thumbnail {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 8px;
  border: 1.5px solid var(--border-default);
  cursor: pointer;
  background: #fff;
}
.doc-file-thumbnail:hover {
  border-color: var(--accent);
}

.doc-file-pdf {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px;
  border: 1.5px solid var(--border-default);
  border-radius: 8px;
  background: #fff;
  min-width: 70px;
  text-align: center;
}

.doc-file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.doc-file-actions .btn {
  font-size: 12px;
  padding: 4px 10px;
}
.doc-file-actions label.btn {
  margin: 0;
  cursor: pointer;
}

.doc-file-upload {
  margin-top: 6px;
}
.doc-file-upload .upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-muted);
  color: var(--accent);
  border: 1.5px dashed var(--accent);
  cursor: pointer;
  padding: 8px 16px;
  font-weight: 600;
}
.doc-file-upload .upload-btn:hover {
  background: var(--accent);
  color: #fff;
}

.doc-file-uploading {
  padding: 12px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
  background: var(--bg-base);
  border-radius: 6px;
}

/* Detail page docs list */
.docs-detail-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.doc-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-base);
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.doc-detail-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.doc-detail-label {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}

.doc-detail-file {
  flex-shrink: 0;
}
.doc-detail-file.no-file {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

.doc-detail-thumbnail {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  border: 1.5px solid var(--border-default);
  cursor: pointer;
  background: #fff;
}
.doc-detail-thumbnail:hover {
  border-color: var(--accent);
  transform: scale(1.05);
  transition: transform 0.15s;
}

.doc-pdf-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-default);
  border-radius: 6px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
}
.doc-pdf-link:hover {
  border-color: var(--accent);
  background: var(--accent-muted);
  color: var(--accent);
}

/* ============================================================
   v0.9 - Safety Briefings
   ============================================================ */
.briefings-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.briefing-date-group {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.briefing-date-header {
  background: var(--bg-base);
  padding: 8px 14px;
  font-weight: 700;
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--border-subtle);
}

.briefing-items {
  display: flex;
  flex-direction: column;
}

.briefing-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.15s;
}
.briefing-item:last-child { border-bottom: none; }
.briefing-item:hover { background: var(--bg-hover); }
.briefing-item.warning { background: #fffbeb; }
.briefing-item.warning:hover { background: #fef3c7; }

.briefing-item-status { font-size: 24px; flex-shrink: 0; }
.briefing-status-ok { color: var(--success); }
.briefing-status-warn { color: #d97706; }

.briefing-item-main { flex: 1; min-width: 0; }
.briefing-item-site {
  font-weight: 700;
  font-size: var(--text-sm);
  margin-bottom: 2px;
}
.briefing-item-meta {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.briefing-item-notes { font-style: italic; color: var(--text-muted); }

.briefing-item-actions { flex-shrink: 0; }

/* Attended employees in form */
.attended-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 4px;
}
.attended-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--text-sm);
}
.attended-item:hover { background: var(--bg-hover); }
.attended-item input { width: 16px; height: 16px; cursor: pointer; }

/* Checklist form */
.checklist-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s;
}
.checklist-item:has(input:checked) {
  background: #f0fdf4;
  border-color: var(--success);
}
.checklist-item input {
  width: 20px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
}
.checklist-num {
  font-weight: 700;
  color: var(--text-secondary);
  min-width: 24px;
  font-size: var(--text-sm);
}
.checklist-text {
  flex: 1;
  font-size: var(--text-sm);
  line-height: 1.4;
}

.checklist-progress {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--bg-base);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 600;
}

/* Detail page */
.attended-display {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.checklist-display {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.checklist-display-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-base);
  border-radius: var(--radius-sm);
  border-right: 3px solid var(--border-default);
}
.checklist-display-item.ok { border-right-color: var(--success); }
.checklist-display-item.missing { border-right-color: var(--danger); background: #fef2f2; }
.checklist-icon { font-size: 18px; flex-shrink: 0; }

/* Editor */
.checklist-editor {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.checklist-editor-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.checklist-editor-num {
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  min-width: 20px;
}
.checklist-editor-input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  font-size: var(--text-sm);
}
.checklist-editor-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}
.checklist-add-row {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px dashed var(--border-default);
  display: flex;
  gap: var(--space-2);
}
.checklist-add-row .filter-input { flex: 1; }

/* ============================================================
   v0.9.1 - Pending file picker (during employee creation)
   ============================================================ */
.pending-file-name:not(:empty) {
  background: #f0fdf4;
  border: 1px solid var(--success, #16a34a);
  padding: 6px 10px;
  border-radius: 6px;
  display: inline-block;
}

/* ============================================================
   v0.9.2 - Doc titles + date preview
   ============================================================ */
.doc-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.date-preview {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}
.date-preview:empty {
  display: none;
}

/* ============================================================
   v0.9.2 - Safety document display (read-only)
   ============================================================ */
.safety-document-display {
  background: #fefce8;
  border: 1px solid #facc15;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 16px;
  line-height: 1.6;
}

.safety-doc-intro {
  font-weight: 600;
  margin: 0 0 12px;
  color: #713f12;
}

.safety-doc-subhead {
  font-weight: 600;
  margin: 12px 0 8px;
  color: #422006;
}

.safety-doc-list {
  margin: 0 24px 12px 0;
  padding: 0;
  list-style-position: inside;
  list-style-type: decimal;
}
.safety-doc-list li {
  margin: 4px 0;
  font-size: 14px;
  color: #422006;
}

.safety-doc-footnote {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px dashed #d4a017;
  font-size: 12px;
  color: #713f12;
  font-style: italic;
}

.briefing-confirm-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: #f0fdf4;
  border: 2px solid #22c55e;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  color: #14532d;
  transition: all 0.15s;
}
.briefing-confirm-box:hover {
  background: #dcfce7;
}
.briefing-confirm-box:has(input:checked) {
  background: #22c55e;
  color: white;
}
.briefing-confirm-box input {
  width: 20px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
}

/* ============================================================
   v0.10.0 - Board context menu
   ============================================================ */
.board-context-menu {
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border-default, #d4d4d4);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  padding: 6px 0;
  min-width: 160px;
  font-size: 14px;
}
.board-context-menu button {
  display: block;
  width: 100%;
  padding: 8px 16px;
  text-align: right;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-primary);
}
.board-context-menu button:hover:not(:disabled) {
  background: var(--bg-hover, #f5f5f5);
}
.board-context-menu button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.board-cell.copied {
  outline: 2px dashed var(--accent, #2563eb);
  outline-offset: -2px;
}

/* ============================================================
   v0.10.0 - Issues (field problem reports)
   ============================================================ */
.filters-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--bg-surface);
  border-radius: 8px;
  border: 1px solid var(--border-default);
}
.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.filter-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.filter-pills {
  display: flex;
  gap: 4px;
}
.filter-pill {
  padding: 4px 10px;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  border-radius: 14px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.15s;
}
.filter-pill:hover {
  background: var(--bg-hover);
}
.filter-pill.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.filter-select {
  padding: 4px 10px;
  border: 1px solid var(--border-default);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  background: var(--bg-surface);
  color: var(--text-primary);
}

.badge-urgent {
  display: inline-block;
  background: #fee2e2;
  color: #991b1b;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  margin-right: 6px;
}

.issues-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.issue-card {
  display: block;
  padding: 14px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.15s;
}
.issue-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.issue-card.is-urgent.is-open {
  border-right: 4px solid #dc2626;
}
.issue-card.is-closed {
  opacity: 0.7;
}

.issue-card-top {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
}

.issue-status-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}
.issue-status-badge.open {
  background: #fee2e2;
  color: #991b1b;
}
.issue-status-badge.closed {
  background: #d1fae5;
  color: #065f46;
}

.issue-priority-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  background: #f3f4f6;
  color: #4b5563;
}
.issue-priority-badge.urgent {
  background: #fef3c7;
  color: #92400e;
}

.issue-cat-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: #e0e7ff;
  color: #3730a3;
}

.issue-date {
  margin-right: auto;
  font-size: 12px;
  color: var(--text-muted);
}

.issue-site {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}

.issue-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.issue-description {
  padding: 12px 14px;
  background: var(--bg-hover);
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.issue-resolution {
  padding: 12px 14px;
  background: #f0fdf4;
  border-right: 3px solid #16a34a;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.5;
}

.issue-photo {
  max-width: 100%;
  max-height: 400px;
  border-radius: 8px;
  border: 1px solid var(--border-default);
  display: block;
}

.issue-detail-meta {
  margin-bottom: 16px;
}

.issue-detail-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}
.radio-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border-default);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
}
.radio-item:hover {
  background: var(--bg-hover);
}
.radio-item:has(input:checked) {
  border-color: var(--accent);
  background: rgba(37, 99, 235, 0.06);
}
.radio-item.priority-urgent:has(input:checked) {
  border-color: #dc2626;
  background: #fef2f2;
}
.radio-item input {
  flex-shrink: 0;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}
.empty-state h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--text-secondary);
}

/* ============================================================
   v0.11.0 - MOBILE & RESPONSIVE FIXES
   Consolidated mobile/tablet adjustments for modals, forms, tables
   ============================================================ */

/* --- Phones (≤ 600px) --- */
@media (max-width: 600px) {
  /* Modal: full-width on phones with safe padding */
  .modal-backdrop {
    padding: var(--space-2);
    align-items: flex-start;
  }
  .modal,
  .employee-modal,
  .task-status-modal,
  .assign-modal {
    max-width: 100%;
    width: 100%;
    max-height: calc(100vh - 16px);
    margin: 8px 0;
  }
  .modal-content {
    padding: var(--space-4);
  }
  .modal-title {
    font-size: var(--text-base);
    line-height: 1.3;
  }
  .modal-actions {
    flex-direction: column-reverse;
    gap: var(--space-2);
  }
  .modal-actions button,
  .modal-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Form fields stack on mobile */
  .field-row,
  .field-row-2,
  .field-row-3 {
    grid-template-columns: 1fr !important;
  }

  /* Make form inputs larger and easier to tap */
  .modal input[type="text"],
  .modal input[type="tel"],
  .modal input[type="number"],
  .modal input[type="email"],
  .modal input[type="date"],
  .modal input[type="time"],
  .modal input[type="password"],
  .modal select,
  .modal textarea {
    font-size: 16px; /* prevents iOS auto-zoom */
    padding: 10px 12px;
    min-height: 44px; /* iOS touch target */
  }

  /* File-uploads section */
  .file-upload-row {
    flex-direction: column;
    align-items: stretch;
  }
  .file-upload-row .btn,
  .file-upload-row button {
    width: 100%;
  }

  /* Tables inside modals - horizontal scroll wrapper */
  .modal table {
    display: block;
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
  }

  /* Employee section spacing */
  .employee-modal .form-section {
    padding: var(--space-3) 0;
  }

  /* Employee modal - document file preview stacks better */
  .doc-file-preview {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .doc-file-thumbnail {
    width: 100%;
    max-width: 200px;
    height: auto;
    max-height: 200px;
  }
  .doc-file-actions {
    width: 100%;
  }
  .doc-file-actions .btn {
    flex: 1;
    min-height: 38px;
    font-size: 13px;
  }

  /* Document file group - more breathing room */
  .doc-group {
    padding: 12px;
  }

  /* Upload button - full width on mobile */
  .doc-file-upload .upload-btn {
    width: 100%;
    justify-content: center;
    padding: 12px;
  }

  /* Checkbox grids - already handled but make sure tap targets are ok */
  .checkbox-item {
    min-height: 40px;
    padding: 8px 12px;
  }
}

/* --- Small phones (≤ 400px) --- */
@media (max-width: 400px) {
  .modal-content {
    padding: var(--space-3);
  }
  .modal-title {
    font-size: var(--text-base);
  }
  /* tighter spacing */
  .modal .form-section {
    margin-bottom: var(--space-3);
  }
}

/* --- Tablets / small landscape (601-900px) --- */
@media (min-width: 601px) and (max-width: 900px) {
  .modal,
  .employee-modal,
  .assign-modal {
    max-width: 90%;
  }
  .field-row-3 {
    grid-template-columns: 1fr 1fr;
  }
}

/* --- Landscape phones - allow modal to fit reasonably --- */
@media (max-height: 500px) and (orientation: landscape) {
  .modal-backdrop {
    align-items: flex-start;
    padding: 4px;
  }
  .modal {
    max-height: calc(100vh - 8px);
  }
  .modal-content {
    padding: var(--space-3);
  }
}

/* --- Universal touch-friendly improvements --- */
@media (pointer: coarse) {
  /* Make all buttons easier to tap on touch devices */
  .btn,
  button:not(.icon-btn) {
    min-height: 44px;
  }
  /* Larger close 'X' button */
  .modal .close-btn,
  .modal-close {
    min-width: 44px;
    min-height: 44px;
  }
}

/* --- iPhone safe area (notch / home indicator) --- */
@supports (padding: max(0px)) {
  .modal-backdrop {
    padding-left: max(var(--space-2), env(safe-area-inset-left));
    padding-right: max(var(--space-2), env(safe-area-inset-right));
    padding-bottom: max(var(--space-2), env(safe-area-inset-bottom));
    padding-top: max(var(--space-2), env(safe-area-inset-top));
  }
  body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}

/* ============================================================
   v0.11.0 — Site form badges (auto/manual end date) + team chips
   ============================================================ */
.badge-auto, .badge-manual {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 8px;
  margin-right: 6px;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-auto {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}
.badge-manual {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.team-chip {
  display: inline-block;
  white-space: nowrap;
}

/* ============================================================
   v0.11.0 — Sites Gantt Chart (dashboard)
   ============================================================ */
.gantt-wrapper {
  margin-top: 8px;
}

.gantt-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: #fff;
  position: relative;
  /* Force LTR layout so left:0 means visually-leftmost */
  direction: ltr;
}

.gantt-grid {
  position: relative;
  font-size: 12px;
}

.gantt-header-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  background: #f9fafb;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 2;
}

/* Timeline area = the right side (chronological), LTR flow */
.gantt-timeline-area {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  flex-shrink: 0;
}

/* Label cell = right side in RTL Hebrew app, sticky to visual right */
.gantt-label-cell {
  flex-shrink: 0;
  padding: 4px 10px;
  border-right: 1px solid var(--border-default);
  background: #f9fafb;
  /* Inner content is Hebrew RTL */
  direction: rtl;
  text-align: right;
  /* Make label cell come FIRST in LTR flow (visually leftmost), but we want it on the right */
  order: 2;
  position: sticky;
  right: 0;
  z-index: 3;
}

.gantt-month-label {
  flex-shrink: 0;
  text-align: center;
  font-weight: 700;
  color: #4b5563;
  font-size: 12px;
  border-right: 1px solid var(--border-default);
  padding: 4px 0;
  direction: rtl;
}

.gantt-week-cell {
  flex-shrink: 0;
  text-align: center;
  font-size: 10px;
  color: #6b7280;
  border-right: 1px dashed var(--border-subtle);
  padding: 4px 0;
}

.gantt-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  border-bottom: 1px solid #f3f4f6;
  background: #fff;
  min-height: 48px;
}
.gantt-row:hover {
  background: #f9fafb;
}

.gantt-site-name {
  font-size: 12px;
  padding: 4px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  order: 2;
  /* allow content to dictate size */
  min-height: 0;
  gap: 2px;
}

.gantt-site-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.gantt-site-address {
  font-weight: 700;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  line-height: 1.2;
}

.gantt-site-team {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 10px;
  margin-top: 4px;
  white-space: nowrap;
  line-height: 1.3;
  /* don't shrink/clip */
  flex-shrink: 0;
}

.gantt-site-team-empty {
  font-size: 10px;
  color: #9ca3af;
  margin-top: 2px;
  font-style: italic;
}

.gantt-row-body {
  position: relative;
  flex-shrink: 0;
  background-image: repeating-linear-gradient(
    to right,
    transparent,
    transparent 37px,
    #f3f4f6 37px,
    #f3f4f6 38px
  );
  order: 1;
}

.gantt-bar {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  transition: transform 0.1s, box-shadow 0.1s;
  /* Hebrew text inside the bar reads RTL */
  direction: rtl;
}
.gantt-bar:hover {
  transform: translateY(-50%) scale(1.02);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
  z-index: 5;
}

.gantt-bar-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gantt-bar-outside {
  display: inline-block;
  padding: 2px 8px;
  margin: 4px;
  font-size: 10px;
  color: #9ca3af;
  background: #f3f4f6;
  border-radius: 4px;
  direction: rtl;
}

.gantt-today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ef4444;
  pointer-events: none;
  z-index: 1;
}
.gantt-today-line::before {
  content: 'היום';
  position: absolute;
  top: 2px;
  right: -16px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 4px;
  direction: rtl;
}

@media (max-width: 600px) {
  .gantt-wrapper {
    font-size: 11px;
  }
  .gantt-bar-text {
    font-size: 10px;
  }
}

/* ============================================================
   Transport summary below weekly board
   ============================================================ */
.transport-summary {
  margin-top: var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  box-shadow: var(--shadow-sm);
}
.transport-summary-empty {
  margin-top: var(--space-3);
  padding: 12px 16px;
  background: var(--bg-base);
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: var(--text-sm);
}
.transport-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
  gap: var(--space-2);
}
.transport-summary-title {
  font-size: var(--text-base);
  font-weight: 700;
  margin: 0;
}
.transport-summary-stats {
  display: flex;
  gap: 8px;
}
/* Transport summary table — row-based layout (date, day, site, carrier, details) */
.transport-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: white;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.transport-summary-table thead th {
  background: #f3f4f6;
  padding: 8px 10px;
  text-align: right;
  font-weight: 700;
  font-size: 12px;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border-subtle);
}
.transport-summary-table tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
.transport-summary-table tbody tr:hover {
  background: var(--bg-hover);
}
/* Escort rows have NO background highlight - the only distinction is the badge */
.transport-summary-table .tst-date {
  font-weight: 600;
  width: 80px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.transport-summary-table .tst-day {
  width: 60px;
  font-weight: 600;
  color: var(--text-muted);
}
.transport-summary-table .tst-site {
  font-weight: 600;
}
.transport-summary-table .tst-carrier {
  font-weight: 600;
}
.transport-summary-table .tst-carrier-name {
  display: inline-block;
}
.transport-summary-table .tst-details {
  color: var(--text-muted);
  font-size: 12px;
  white-space: pre-line;
}
/* Escort badge inside the carrier cell - same color scheme as in the board */
.tst-escort-badge {
  display: inline-block;
  margin-right: 8px;
  background: #fde047;
  color: #713f12;
  border: 1px solid #ca8a04;
  border-radius: 3px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 800;
  vertical-align: middle;
  white-space: nowrap;
}

@media (max-width: 700px) {
  .transport-summary-table {
    font-size: 12px;
  }
  .transport-summary-table thead th,
  .transport-summary-table tbody td {
    padding: 6px 6px;
  }
}

/* ============================================================
   Transports tab - week envelope
   ============================================================ */
.transports-weeks {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.transport-week-envelope {
  background: var(--bg-surface);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.transport-week-envelope.is-current {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px #2563eb, var(--shadow-sm);
}
.transport-week-envelope.is-upcoming {
  border-color: var(--border-subtle);
}
.transport-week-envelope.is-past {
  opacity: 0.75;
  border-color: #e5e7eb;
}
.twe-header {
  background: linear-gradient(to left, #f8fafc, #f1f5f9);
  padding: 12px 16px;
  border-bottom: 2px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.transport-week-envelope.is-current .twe-header {
  background: linear-gradient(to left, #dbeafe, #eff6ff);
  border-bottom-color: #93c5fd;
}
.twe-week-num {
  display: flex;
  align-items: center;
  gap: 12px;
}
.twe-num-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #2563eb;
  color: white;
  font-weight: 800;
  font-size: 22px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(37,99,235,0.3);
}
.transport-week-envelope.is-past .twe-num-badge {
  background: #94a3b8;
  box-shadow: none;
}
.twe-week-text {
  display: flex;
  flex-direction: column;
}
.twe-week-label {
  font-weight: 700;
  font-size: var(--text-base);
}
.twe-week-year {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}
.twe-range {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: 600;
  margin-right: auto;
}
.twe-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.twe-body {
  padding: 12px 16px;
  background: #fafbfc;
}
.twe-body .transport-date-group {
  margin-bottom: 12px;
}
.twe-body .transport-date-group:last-child {
  margin-bottom: 0;
}

/* ============================================================
   Statistics dashboard
   ============================================================ */
.stats-period-picker {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.stats-period-picker .btn {
  font-size: 12px;
  padding: 6px 10px;
}
.stats-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stats-kpi {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.stats-kpi-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 6px;
}
.stats-kpi-value {
  font-size: 28px;
  font-weight: 800;
  color: #1e40af;
  line-height: 1;
}
.stats-view-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border-subtle);
  margin-bottom: 16px;
}
.stats-tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 10px 16px;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  margin-bottom: -2px;
}
.stats-tab:hover {
  color: var(--text-default);
  background: var(--bg-hover);
}
.stats-tab.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}
.stats-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.stats-section-title {
  font-size: var(--text-base);
  font-weight: 700;
  margin-bottom: 4px;
}
.stats-section-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 16px;
}
.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.stats-table th {
  text-align: right;
  padding: 10px 8px;
  background: #f3f4f6;
  border-bottom: 2px solid var(--border-subtle);
  font-weight: 700;
  color: var(--text-muted);
  font-size: 12px;
}
.stats-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
.stats-table tbody tr:hover {
  background: var(--bg-hover);
}
.stats-row-empty {
  opacity: 0.55;
}
.stats-th-rank { width: 40px; text-align: center !important; }
.stats-cell-rank {
  text-align: center;
  font-weight: 700;
  color: var(--text-muted);
}
.stats-th-num { width: 110px; text-align: center !important; }
.stats-cell-num {
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.stats-cell-name {
  font-weight: 600;
}
.stats-num-with-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.stats-num-with-bar span {
  font-weight: 700;
  font-size: 14px;
}
.stats-bar {
  width: 80px;
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
}
.stats-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
}
.stats-cell-teams {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.stats-team-chip,
.stats-site-chip {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid;
  white-space: nowrap;
}
.stats-site-chip {
  background: #f3f4f6;
  color: #374151;
  border-color: #d1d5db;
}
.stats-team-name-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 12px;
  border: 1px solid;
}

/* Timeline table */
.stats-timeline-wrap {
  overflow-x: auto;
}
.stats-timeline-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 2px;
  font-size: 12px;
}
.stats-timeline-table th {
  padding: 8px 6px;
  font-weight: 700;
  text-align: center;
  border-radius: 4px;
}
.stats-tl-week-col {
  background: #1f2937 !important;
  color: white !important;
  min-width: 100px;
}
.stats-tl-team-col {
  min-width: 80px;
}
.stats-tl-week-cell {
  background: #f3f4f6;
  padding: 8px;
  text-align: center;
  border-radius: 4px;
}
.stats-tl-week-cell strong {
  display: block;
}
.stats-tl-week-cell small {
  font-size: 10px;
}
.stats-tl-cell {
  text-align: center;
  padding: 8px 4px;
  border-radius: 4px;
  vertical-align: middle;
  min-width: 80px;
}
.stats-tl-empty {
  background: #f9fafb !important;
  opacity: 0.5 !important;
  color: #9ca3af;
  font-size: 16px;
}
.stats-tl-days {
  font-weight: 800;
  font-size: 18px;
  line-height: 1;
}
.stats-tl-sites {
  font-size: 10px;
  margin-top: 2px;
  opacity: 0.85;
}
@media (max-width: 700px) {
  .stats-period-picker {
    width: 100%;
    margin-top: 8px;
  }
  .stats-overview {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats-kpi-value {
    font-size: 22px;
  }
  .stats-tab {
    padding: 8px 10px;
    font-size: 12px;
  }
}

/* ============================================================
   Pie chart
   ============================================================ */
.stats-pie-row {
  margin-bottom: 24px;
  padding: 16px;
  background: linear-gradient(to bottom, #f9fafb, #f3f4f6);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}
.stats-pie-title {
  font-size: var(--text-sm);
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-muted);
}
.pie-chart-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.pie-chart-svg {
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.08));
}
.pie-chart-svg path {
  transition: transform 0.15s, filter 0.15s;
  transform-origin: center;
  cursor: pointer;
}
.pie-chart-svg path:hover {
  transform: scale(1.04);
  filter: brightness(1.05) drop-shadow(0 4px 8px rgba(0,0,0,0.15));
}
.pie-chart-legend {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pie-legend-item {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 4px 0;
  font-size: 13px;
  border-bottom: 1px solid #e5e7eb;
}
.pie-legend-item:last-child {
  border-bottom: none;
}
.pie-legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}
.pie-legend-label {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pie-legend-value {
  font-weight: 700;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}
.pie-chart-empty {
  padding: 20px;
  color: var(--text-muted);
  text-align: center;
}

/* ============================================================
   Dashboard insights row
   ============================================================ */
.dashboard-insights-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.dashboard-insight-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  border-right: 4px solid #2563eb;
}
.dashboard-insight-card.warning {
  border-right-color: #f59e0b;
  background: linear-gradient(to left, #fffbeb, var(--bg-surface));
}
.insight-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.insight-icon {
  font-size: 18px;
}
.insight-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}
.insight-value {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 4px;
  line-height: 1.2;
}
.dashboard-insight-card.warning .insight-value {
  color: #b45309;
  font-size: 28px;
}
.insight-sub {
  font-size: 12px;
  color: var(--text-muted);
}
.insight-sub a {
  color: var(--text-muted);
  text-decoration: underline;
}
.insight-sub a:hover {
  color: var(--text-default);
}

/* Today / tomorrow assignments — transport section divider */
.today-transports-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-subtle);
}
.today-section-divider {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.today-transport-item {
  background: #fff5f5;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  margin-bottom: 6px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.today-transport-item.has-escort {
  background: #fef3c7;
  border-color: #ca8a04;
}

@media (max-width: 700px) {
  .pie-chart-wrap {
    flex-direction: column;
  }
  .dashboard-insight-card.warning .insight-value {
    font-size: 22px;
  }
}

/* ============================================================
   Send to Teams modal (WhatsApp generator)
   ============================================================ */
.stt-modal {
  max-width: 720px;
  width: 95vw;
}
.stt-teams-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 4px;
  margin-bottom: var(--space-3);
}
.stt-team-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}
.stt-team-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
}
.stt-team-header--actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.stt-team-head-info {
  min-width: 0;
  flex: 1 1 auto;
}
.stt-team-head-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 0 0 auto;
}
.stt-team-head-actions .btn {
  font-size: 12px;
  padding: 6px 12px;
  white-space: nowrap;
}
.stt-team-head-actions .btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
.stt-team-name {
  font-weight: 800;
  font-size: 15px;
  line-height: 1.2;
}
.stt-team-sub {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 2px;
}
.stt-team-body {
  padding: 12px;
}
.stt-message {
  background: #f9fafb;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: 'Heebo', sans-serif;
  font-size: 13px;
  white-space: pre-wrap;
  word-wrap: break-word;
  margin: 0 0 10px 0;
  max-height: 220px;
  overflow-y: auto;
  direction: rtl;
}
.stt-team-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.stt-team-actions .btn {
  flex: 0 0 auto;
  font-size: 13px;
  padding: 7px 14px;
}
.stt-team-actions .btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================================
   Carrier picker (in assignment modal transport entries)
   ============================================================ */
.carrier-picker {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.carrier-picker .carrier-select {
  width: 100%;
}
.carrier-picker .carrier-custom-input {
  width: 100%;
}
.carrier-picker .hidden {
  display: none;
}

/* ============================================================
   Carriers management modal
   ============================================================ */
.carriers-mgr-modal {
  max-width: 600px;
  width: 95vw;
}
.carriers-list {
  max-height: 350px;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-base);
}
.carrier-row {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}
.carrier-row:last-child {
  border-bottom: none;
}
.carrier-row.inactive {
  opacity: 0.6;
}
.carrier-info {
  flex: 1;
}
.carrier-name {
  font-weight: 700;
  font-size: 14px;
}
.carrier-phone {
  font-size: 12px;
  margin-top: 2px;
}
.carrier-actions {
  display: flex;
  gap: 4px;
}
.carrier-actions .btn-sm {
  padding: 4px 10px;
  font-size: 13px;
}
.carrier-add-form {
  background: #f9fafb;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  margin-top: 12px;
}
.carrier-add-form input {
  font-size: 13px;
}
