/* ── Root / Tokens ─────────────────────────────────────────────────────────── */
:root {
  --q4-color: #5c3d99;
  --q4-light: #ede8f8;
  --q2-color: #0d6e4e;
  --q2-light: #e0f5ed;
  --warn-color: #b45309;
  --border-radius: 10px;
  --card-shadow: 0 1px 6px rgba(0,0,0,.08);
}

body {
  background: #f5f6fa;
  font-family: 'Segoe UI', system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; }

[data-bs-theme="dark"] body { background: #121212; }

/* Force readable text on light-background card headers in dark mode */
[data-bs-theme="dark"] .card-header[style*="background:#f1f5f9"],
[data-bs-theme="dark"] .card-header[style*="background: #f1f5f9"] {
  background: #2a2d31 !important;
  color: #e9ecef !important;
}
[data-bs-theme="dark"] .card-header[style*="background:#f1f5f9"] .text-muted,
[data-bs-theme="dark"] .card-header[style*="background: #f1f5f9"] .text-muted {
  color: #adb5bd !important;
}

/* Dark mode overrides for subtle background utilities (our overrides use light colors) */
[data-bs-theme="dark"] .bg-danger-subtle  { background-color: #2d1419 !important; color: #f87171; }
[data-bs-theme="dark"] .bg-success-subtle { background-color: #0e2118 !important; color: #4ade80; }
[data-bs-theme="dark"] .bg-warning-subtle { background-color: #2c1f00 !important; color: #fbbf24; }
[data-bs-theme="dark"] .bg-info-subtle    { background-color: #082535 !important; color: #38bdf8; }
[data-bs-theme="dark"] .bg-light-subtle   { background-color: #1e2125 !important; }
[data-bs-theme="dark"] .bg-secondary-subtle { background-color: #23272b !important; }

/* Dark mode text colour overrides — ensure legibility on dark backgrounds */
[data-bs-theme="dark"] .text-danger    { color: #f87171 !important; }
[data-bs-theme="dark"] .text-success   { color: #4ade80 !important; }
[data-bs-theme="dark"] .text-warning   { color: #fbbf24 !important; }
[data-bs-theme="dark"] .text-info      { color: #38bdf8 !important; }
[data-bs-theme="dark"] .text-secondary { color: #adb5bd !important; }
[data-bs-theme="dark"] .text-muted     { color: #94a3b8 !important; }

/* Monospace filenames in shot rows — extra brightness in dark mode */
[data-bs-theme="dark"] .font-monospace { color: #cbd5e1 !important; }

/* Warning text inside shot rows must be clearly visible on dark amber bg */
[data-bs-theme="dark"] .shot-row .text-warning,
[data-bs-theme="dark"] .shot-isolated .text-warning { color: #fde68a !important; }

/* Collapse toggle chevron smooth transition */
.collapse-toggle-icon { transition: transform .25s ease; }

/* ── Schedule page — dark mode overrides ────────────────────────────────────── */
[data-bs-theme="dark"] .location-block {
  background: #1e2125;
}
/* Block body in dark mode — noticeably darker than the cards (#1e2125) */
[data-bs-theme="dark"] .location-block .collapse {
  background: #13161a;
}
[data-bs-theme="dark"] .location-setup {
  background: #16191d !important;
  border-bottom-color: #2d3035 !important;
}
[data-bs-theme="dark"] .set-card {
  background: #1e2125;
  border-color: #2d3035 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
[data-bs-theme="dark"] .location-block .set-card + .set-card {
  border-top-color: #3a3f46 !important;
}
[data-bs-theme="dark"] .set-header {
  background: #16191d !important;
  border-bottom-color: #2d3035 !important;
}
[data-bs-theme="dark"] .set-header .text-muted { color: #9ca3af !important; }

[data-bs-theme="dark"] .shot-row { border-bottom-color: #2d3035; }
[data-bs-theme="dark"] .shot-isolated { background: transparent; }
[data-bs-theme="dark"] .shot-num { background: #374151; color: #e5e7eb; }

[data-bs-theme="dark"] .shot-type-hero               { background: #1e3a5f; color: #93c5fd; }
[data-bs-theme="dark"] .shot-type-removal            { background: #3b0d20; color: #f9a8d4; }
[data-bs-theme="dark"] .shot-type-person_only        { background: #0d2b1e; color: #6ee7b7; }
[data-bs-theme="dark"] .shot-type-empty              { background: #2a2d31; color: #d1d5db; }
[data-bs-theme="dark"] .shot-type-isolated           { background: #2e1f00; color: #fcd34d; }
[data-bs-theme="dark"] .shot-type-background_isolated{ background: #0c2536; color: #7dd3fc; }
[data-bs-theme="dark"] .shot-type-person_isolated    { background: #0d2b1e; color: #86efac; }
[data-bs-theme="dark"] .shot-type-animal_isolated    { background: #3b0d20; color: #f9a8d4; }

[data-bs-theme="dark"] .reminder-q4        { background: #1e1535 !important; color: #c4b5e8 !important; }
[data-bs-theme="dark"] .reminder-q2        { background: #0d2019 !important; color: #a7d9c7 !important; }
[data-bs-theme="dark"] .reminder-universal { background: #2a0d12 !important; color: #fca5a5 !important; }

[data-bs-theme="dark"] .wardrobe-alert {
  background: #2a1f00 !important;
  border-color: #92400e !important;
  color: #fcd34d;
}
[data-bs-theme="dark"] .wardrobe-chip {
  background: #2a1f00 !important;
  color: #fcd34d !important;
  border-color: #92400e !important;
}

[data-bs-theme="dark"] .location-transition {
  background: #16191d !important;
  border-color: #2d3035 !important;
}

[data-bs-theme="dark"] .setup-q4   { background: #1e1535 !important; color: #c4b5e8 !important; border-color: #3d2f6e !important; }
[data-bs-theme="dark"] .setup-q2   { background: #0d2019 !important; color: #a7d9c7 !important; border-color: #1a5040 !important; }
[data-bs-theme="dark"] .setup-warn { background: #2a1f00 !important; color: #fcd34d !important; border-color: #92400e !important; }
[data-bs-theme="dark"] .setup-info { background: #0c2536 !important; color: #7dd3fc !important; border-color: #1e4a6e !important; }

/* Wardrobe plan card header (inline style background:#fff3cd) */
[data-bs-theme="dark"] .card-header[style*="background:#fff3cd"],
[data-bs-theme="dark"] .card-header[style*="background: #fff3cd"] {
  background: #2a1f00 !important;
  color: #fde68a !important;
}
/* Icon and badge inside wardrobe card header */
[data-bs-theme="dark"] .card-header[style*="background:#fff3cd"] .text-warning,
[data-bs-theme="dark"] .card-header[style*="background: #fff3cd"] .text-warning { color: #fde68a !important; }
[data-bs-theme="dark"] .card-header[style*="background:#fff3cd"] .badge,
[data-bs-theme="dark"] .card-header[style*="background: #fff3cd"] .badge {
  background-color: #92400e !important;
  color: #fde68a !important;
}

/* ── Navbar tweaks ──────────────────────────────────────────────────────────── */
.navbar-brand { letter-spacing: .5px; }

/* ── Stat card links (dashboard) ───────────────────────────────────────────── */
.stat-card-link {
  transition: transform .15s ease, box-shadow .15s ease;
}
.stat-card-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,.13) !important;
}

/* ── Language toggle ────────────────────────────────────────────────────────── */
.lang-btn {
  color: #adb5bd;
  font-size: .8rem;
  font-weight: 600;
  text-decoration: none;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color .15s, background .15s;
}
.lang-btn:hover { color: #fff; background: rgba(255,255,255,.1); }
.lang-active {
  color: #ffc107 !important;
  background: rgba(255, 193, 7, .15);
  border: 1px solid rgba(255, 193, 7, .3);
}

/* ── Badge overrides ────────────────────────────────────────────────────────── */
.bg-q4 { background-color: var(--q4-color) !important; }
.bg-q2 { background-color: var(--q2-color) !important; }

/* ── Dashboard stat cards ───────────────────────────────────────────────────── */
.stat-card { border-radius: var(--border-radius); transition: box-shadow .2s; }
.stat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.12); }
.stat-ok { border-top: 3px solid #198754; }
.stat-warn { border-top: 3px solid #ffc107; }
.stat-missing { border-top: 3px solid #dc3545; }

/* ── Setup step cards ───────────────────────────────────────────────────────── */
.step-card { border-radius: var(--border-radius); transition: transform .15s; }
.step-card:hover { transform: translateY(-2px); }
.step-card.done { border-top: 3px solid #198754; }
.step-number {
  width: 28px; height: 28px;
  background: #e2e8f0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem;
}
.step-card.done .step-number { background: #198754; color: #fff; }

/* ── Rule list ──────────────────────────────────────────────────────────────── */
.rule-list { list-style: none; padding: 0; margin: 0; }
.rule-list li { display: flex; align-items: flex-start; gap: 6px; margin-bottom: 4px; font-size: .875rem; }
.rule-list li i { margin-top: 2px; flex-shrink: 0; }

/* ── Location rows (photographer portal) ───────────────────────────────────── */
.location-row { transition: background .15s; }
.location-row:hover { background: #f8f9fa; }

/* ── Schedule page ──────────────────────────────────────────────────────────── */

/* Location block */
.location-block {
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

/* Block body — slightly off-white so card gaps are visible */
.location-block .collapse {
  background: #edf0f4;
}

.location-block-header {
  background: linear-gradient(135deg, #1e293b, #334155);
  color: #fff;
}
.location-block-header:active { cursor: grabbing; }
.sortable-ghost { opacity: .35; }

.location-block-number {
  display: inline-block;
  background: rgba(255,255,255,.15);
  border-radius: 4px;
  padding: 1px 8px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.location-setup {
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
}

.setup-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .75rem;
}
.setup-q4 { background: var(--q4-light); color: var(--q4-color); border: 1px solid #c4b5e8; }
.setup-q2 { background: var(--q2-light); color: var(--q2-color); border: 1px solid #a7d9c7; }
.setup-warn { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.setup-info { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }

/* Set cards */
.set-card {
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.set-q4 { border-left: 4px solid var(--q4-color); }
.set-q2 { border-left: 4px solid var(--q2-color); }

/* Extra separator between consecutive set-cards inside a block */
.location-block .set-card + .set-card {
  border-top: 2px solid #e2e8f0;
}

.set-header {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.set-number-badge {
  font-weight: 700;
  font-size: .8rem;
  background: #1e293b;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
}

.wardrobe-alert {
  background: #fff3cd;
  border-top: 1px dashed #ffc107;
  border-bottom: 1px dashed #ffc107;
  font-size: .875rem;
}

[data-bs-theme="dark"] .shot-equip-text { color: #94a3b8; }

/* Shot list preview in schedule */
.shot-list-preview { font-size: .82rem; }

.shot-row { border-bottom: 1px dashed #f1f5f9; }
.shot-row:last-child { border-bottom: none; }
.shot-isolated { border-left: none; }

.shot-num {
  width: 22px; height: 22px;
  background: #e2e8f0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 700;
  flex-shrink: 0; margin-top: 2px; margin-right: 8px;
}

.shot-type-badge {
  display: inline-block;
  width: 8.5rem;
  flex-shrink: 0;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shot-equip-text {
  width: 5.5rem;
  flex-shrink: 0;
  font-size: .68rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .04em;
  text-align: center;
  padding: 0 .75rem;
}
.shot-type-hero       { background: #dbeafe; color: #1d4ed8; }
.shot-type-removal    { background: #fce7f3; color: #9d174d; }
.shot-type-person_only { background: #d1fae5; color: #065f46; }
.shot-type-empty      { background: #f3f4f6; color: #374151; }
.shot-type-isolated   { background: #fef3c7; color: #92400e; }
.shot-type-background_isolated { background: #e0f2fe; color: #0369a1; }
.shot-type-person_isolated { background: #dcfce7; color: #15803d; }
.shot-type-animal_isolated { background: #fce7f3; color: #9d174d; }

/* Reminders in schedule */
.reminder-q4 { background: var(--q4-light); color: var(--q4-color); }
.reminder-q2 { background: var(--q2-light); color: var(--q2-color); }
.reminder-universal { background: #fff1f2; color: #9f1239; }

.location-transition {
  background: #f8fafc;
  border-top: 1px dashed #e2e8f0;
  font-style: italic;
}

/* Wardrobe chip */
.wardrobe-chip {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  border-radius: 6px;
  padding: 3px 10px;
  font-size: .8rem;
  font-weight: 600;
}

/* ── Set detail page ────────────────────────────────────────────────────────── */

.shot-detail-row {
  transition: background .15s;
  border-bottom: 2px solid #e9ecef !important;
}
.shot-detail-row:last-child { border-bottom: none !important; }
.shot-detail-row:hover { background: #f8fafc; }
.shot-detail-isolated { background: #fffceb; }
.shot-detail-isolated:hover { background: #fff9d6; }
.shot-done {
  background: #d1fae5 !important;
  opacity: 1 !important;
  text-decoration: none !important;
}
.shot-done * { color: #065f46 !important; }
.shot-done .shot-type-badge,
.shot-done .shot-num,
.shot-done .badge { background: #a7f3d0 !important; }

/* Check button */
.shot-check-btn { color: #9ca3af; line-height: 1; }
.shot-check-btn:hover { color: #16a34a; }
.shot-done .shot-check-btn i { color: #16a34a !important; }

/* Set detail — dark mode */
[data-bs-theme="dark"] .shot-detail-row             { border-bottom-color: #2d3035 !important; }
[data-bs-theme="dark"] .shot-detail-row:hover       { background: #1e2125; }
[data-bs-theme="dark"] .shot-detail-isolated        { background: #25200a; }
[data-bs-theme="dark"] .shot-detail-isolated:hover  { background: #2e2808; }
[data-bs-theme="dark"] .shot-done                   { background: #052e16 !important; }
[data-bs-theme="dark"] .shot-done *                  { color: #86efac !important; }
[data-bs-theme="dark"] .shot-done .shot-type-badge,
[data-bs-theme="dark"] .shot-done .shot-num,
[data-bs-theme="dark"] .shot-done .badge             { background: #14532d !important; }
[data-bs-theme="dark"] .shot-done .shot-check-btn i  { color: #4ade80 !important; }
[data-bs-theme="dark"] .instructions-box {
  background: #1c2028;
  border-left-color: #475569;
  color: #cbd5e1;
}
[data-bs-theme="dark"] .instructions-box .text-muted { color: #64748b !important; }
[data-bs-theme="dark"] .shot-detail-isolated .text-warning { color: #fde68a !important; }

.shot-detail-num {
  width: 32px; height: 32px;
  background: #1e293b;
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem;
  flex-shrink: 0;
}

.instructions-box {
  background: #f1f5f9;
  border-left: 3px solid #94a3b8;
  color: #475569;
  line-height: 1.5;
}

/* ── Footer ─────────────────────────────────────────────────────────────────── */
.footer { background: #1e293b !important; color: #94a3b8 !important; }

/* ── Print styles ────────────────────────────────────────────────────────────── */
@page { margin: 8mm 10mm; }

@media print {
  /* Hide chrome */
  .navbar, .alert, form, .no-print, footer, .footer { display: none !important; }

  /* Compact base */
  body { background: #fff !important; font-size: 9px !important; color: #000 !important; }
  * { color: #000 !important; background: transparent !important;
      box-shadow: none !important; text-shadow: none !important; }

  /* Cards — force consistent border even when border-0 class is present */
  .card, .card.border-0 { border: 1px solid #ddd !important;
                           box-shadow: none !important; }

  /* Stat cards — compact single row, half size */
  .print-stats { margin-bottom: 6px !important; }
  .print-stats .col-6 { width: 20% !important; }
  .print-stats .card { padding: 2px 5px !important; border: 1px solid #ccc !important;
                       box-shadow: none !important; }
  .print-stats .fs-2 { font-size: .5rem !important; font-weight: 700 !important; }
  .print-stats .small { font-size: .42rem !important; }

  /* Location blocks */
  .location-block { margin-bottom: 6px !important; border: 1px solid #555 !important; }
  .location-block-header { background: #1e293b !important; color: #fff !important;
                            padding: 4px 10px !important; }
  .location-block-header * { color: #fff !important; }
  .collapse { display: block !important; height: auto !important; visibility: visible !important; }

  /* Set cards */
  .set-card { page-break-inside: avoid; margin: 4px 6px !important; }
  .set-header { padding: 3px 8px !important; }
  .location-block .collapse { padding: 4px 0 !important; }

  /* Shot rows */
  .shot-list-preview { font-size: 7.5px !important; }
  .shot-row { padding: 1px 0 !important; border-bottom: 1px solid #ddd !important;
              display: flex !important; flex-wrap: nowrap !important; align-items: center !important; }
  .shot-check-btn { flex-shrink: 0 !important; }
  .shot-num { width: 14px !important; height: 14px !important; font-size: .55rem !important;
              flex-shrink: 0 !important; margin-right: 4px !important; }
  .shot-type-badge { font-size: .55rem !important; padding: 1px 3px !important;
                     width: 5.8rem !important; flex-shrink: 0 !important;
                     white-space: nowrap !important; overflow: hidden !important;
                     text-overflow: ellipsis !important; }
  .shot-equip-text { font-size: .55rem !important; width: 3.2rem !important;
                     flex-shrink: 0 !important; padding: 0 .3rem !important; }
  .shot-row .flex-grow-1 { flex: 1 1 0 !important; min-width: 0 !important;
                            overflow: hidden !important; text-overflow: ellipsis !important;
                            white-space: nowrap !important; }

  /* Show check buttons in print */
  .btn { display: none !important; }
  .shot-check-btn { display: inline-flex !important; align-items: center;
                    justify-content: center; pointer-events: none; }
  .shot-check-btn i { font-size: .8rem !important; }

  /* Done rows */
  .shot-done { background: #d1fae5 !important; }
  .shot-done * { color: #065f46 !important; }

  /* Wardrobe alert — tiny in print */
  .wardrobe-alert { font-size: 6.5px !important; padding: 1px 6px !important;
                    border-top: 1px dashed #ffc107 !important;
                    border-bottom: none !important; }
  .wardrobe-alert strong { font-weight: 600 !important; }
  .wardrobe-alert .bi { font-size: 7px !important; }
}

/* ── Onboarding slides ───────────────────────────────────────────────────────── */
.onboarding-card {
  min-height: 420px;
  border-radius: 16px;
}
.onboarding-icon { font-size: 4rem; }

.slide-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #dee2e6;
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.slide-dot.active {
  background: #ffc107;
  transform: scale(1.3);
}

/* ── Mobile responsive (≤575px) ─────────────────────────────────────────────── */
@media (max-width: 575px) {

  /* Manager table action cells — keep buttons on one line */
  table .text-end .btn { padding: .2rem .4rem; }
  table .text-end { white-space: nowrap; }

  /* Dashboard schedule stats — tighter label text */
  .sched-stat-label { font-size: .62rem !important; line-height: 1.2; }

  /* Stat card links — no extra padding shift on mobile */
  .stat-card-link { transition: none; }

  /* Global banned input group — stack vertically on mobile */
  .banned-add-form { flex-direction: column !important; align-items: stretch !important; }
  .banned-add-form .input-group { width: 100% !important; }
  .banned-add-form .input-group input { min-width: 0 !important; }



  /* Location block header — prevent "BLOCK 4" wrapping & allow right badges to wrap */
  .location-block-number { white-space: nowrap !important; }
  .location-block-header {
    flex-wrap: wrap !important;
    gap: 4px 8px !important;
    padding: 8px 12px !important;
  }
  .location-block-header > div:first-child .fw-bold.fs-5 {
    font-size: .95rem !important;
  }
  .location-block-header > div:last-child {
    width: 100%;
    flex-wrap: wrap;
    gap: 4px !important;
  }
  /* Hide Q4/Q2 count badges on mobile (not enough space) */
  .location-block-header .badge.bg-q4,
  .location-block-header .badge.bg-q2 { display: none !important; }

  /* Set header — wrap right side to its own row */
  .set-header { flex-wrap: wrap !important; gap: 4px !important; }
  .set-header > div:last-child {
    width: 100% !important;
    justify-content: flex-end !important;
  }

  /* Shot rows — reduce fixed widths so description text is visible */
  .shot-type-badge {
    width: 5.8rem !important;
    font-size: .6rem !important;
    padding: 2px 3px !important;
  }
  .shot-equip-text {
    width: 3.5rem !important;
    padding: 0 .15rem !important;
    font-size: .6rem !important;
  }
  .shot-row .flex-grow-1 {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

}

/* ── Utilities ───────────────────────────────────────────────────────────────── */
.py-6 { padding-top: 4rem !important; padding-bottom: 4rem !important; }
.font-monospace { font-family: 'SFMono-Regular', Consolas, monospace; }
.bg-danger-subtle  { background-color: #fff1f2 !important; }
.bg-success-subtle { background-color: #f0fdf4 !important; }
.bg-warning-subtle { background-color: #fffbeb !important; }
.bg-info-subtle    { background-color: #e0f2fe !important; }
.bg-light-subtle   { background-color: #f8fafc !important; }
.text-danger  { color: #dc2626 !important; }
.text-success { color: #16a34a !important; }
.text-warning { color: #d97706 !important; }
.text-info    { color: #0284c7 !important; }
