/* CourseWatch Marshal Logbook, Roster Planner & Print Styles */
:root {
  --primary: #1b5e20;
  --primary-hover: #2e7d32;
  --primary-light: #e8f5e9;
  --accent: #4caf50;
  --dark: #0f172a;
  --dark-surface: #1e293b;
  --light-bg: #f8fafc;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --border-color: #e2e8f0;
  --text-main: #1e293b;
  --text: #1e293b;
  --text-muted: #64748b;
  --danger: #dc2626;
  --warning: #ea580c;
  --info: #0284c7;
  --success: #16a34a;
  --radius: 10px;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

/* Marshal Logbook & Document Layout */
.marshal-banner {
  background: linear-gradient(135deg, #e65100 0%, #f97316 100%);
  color: #ffffff;
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  font-size: 1.35rem;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 10px rgba(230, 81, 0, 0.2);
}

.marshal-banner-subtitle {
  font-size: 0.9rem;
  font-weight: 400;
  opacity: 0.9;
}

.marshal-doc-container {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  max-width: 900px;
  margin: 0 auto 2rem auto;
}

.marshal-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  background: #f8fafc;
  padding: 1.25rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  margin-bottom: 1.5rem;
}

.marshal-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.marshal-meta-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.marshal-meta-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.marshal-section-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  background: #ffffff;
  transition: border-color 0.2s;
}

.marshal-section-card:hover {
  border-color: #cbd5e1;
}

.marshal-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.marshal-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.marshal-check-group {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.marshal-check-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}

.marshal-check-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.badge-all-clear {
  background-color: #dcfce7;
  color: #166534;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.badge-has-issues {
  background-color: #fef3c7;
  color: #92400e;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.badge-closed {
  background-color: #fee2e2;
  color: #991b1b;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

/* Print Stylesheet voor Print & PDF */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-family: var(--font-family-base, Verdana, Geneva, Tahoma, sans-serif) !important;
    font-size: 12pt !important;
  }

  header, footer, nav, .no-print, .btn, .table-filter-bar {
    display: none !important;
  }

  main {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
  }

  .marshal-doc-container {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    max-width: 100% !important;
  }

  .marshal-banner {
    background: #ea580c !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color: #ffffff !important;
    border-radius: 4px !important;
    padding: 0.75rem 1rem !important;
    box-shadow: none !important;
  }

  .marshal-meta-grid {
    background: #f1f5f9 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    border: 1px solid #cbd5e1 !important;
  }

  .marshal-section-card {
    border: 1px solid #94a3b8 !important;
    page-break-inside: avoid;
    margin-bottom: 0.75rem !important;
    padding: 0.75rem !important;
  }

  @page {
    size: A4 portrait;
    margin: 1.5cm;
  }
}

/* Shift block selection & Touch pills */
.marshal-meta-span-full {
  grid-column: 1 / -1;
}

.shift-block-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.btn-shift-pill {
  min-height: 48px;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: #ffffff;
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-shift-pill:hover {
  border-color: var(--primary);
  background: #f0fdf4;
}

.btn-shift-pill.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 4px rgba(27, 94, 32, 0.25);
}

.btn-shift-pill-custom {
  border-style: dashed;
}

/* Availability touch buttons (Marshals - Outdoor & Buggy proof >= 48px) */
.btn-avail-pill {
  min-height: 48px;
  min-width: 105px;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  transition: all 0.2s ease;
}

.btn-avail-green:hover,
.btn-avail-green.active {
  background: #2e7d32 !important;
  color: #ffffff !important;
  border-color: #2e7d32 !important;
  box-shadow: 0 2px 6px rgba(46, 125, 50, 0.35);
}

.btn-avail-yellow:hover,
.btn-avail-yellow.active {
  background: #f57f17 !important;
  color: #ffffff !important;
  border-color: #f57f17 !important;
  box-shadow: 0 2px 6px rgba(245, 127, 23, 0.35);
}

.btn-avail-red:hover,
.btn-avail-red.active {
  background: #c62828 !important;
  color: #ffffff !important;
  border-color: #c62828 !important;
  box-shadow: 0 2px 6px rgba(198, 40, 40, 0.35);
}


/* ==============================================================================
   Marshal Roster Week-Row Calendar Grid & Interactive Context Menu
   ============================================================================== */
.roster-view-toggle {
  display: inline-flex;
  background: #e2e8f0;
  padding: 3px;
  border-radius: 8px;
  gap: 3px;
}

.roster-view-btn {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.roster-view-btn.active {
  background: #ffffff;
  color: var(--text-main);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.roster-calendar-wrapper {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.roster-calendar-header {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  background: #f1f5f9;
  border-bottom: 2px solid var(--border);
  text-align: center;
}

.roster-day-header-cell {
  padding: 0.65rem 0.25rem;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.roster-day-header-cell.weekend {
  color: var(--primary);
  background: #e8f5e9;
}

.roster-calendar-body {
  display: flex;
  flex-direction: column;
}

.roster-calendar-week-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-bottom: 1px solid var(--border);
  min-height: 125px;
}

.roster-calendar-week-row:last-child {
  border-bottom: none;
}

.roster-day-cell {
  border-right: 1px solid var(--border);
  padding: 0.5rem;
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
  user-select: none;
  min-height: 125px;
}

.roster-day-cell:last-child {
  border-right: none;
}

.roster-day-cell:hover {
  background-color: #f8fafc;
}

.roster-day-cell.other-month {
  background: #f8fafc;
  opacity: 0.45;
  cursor: default;
}

.roster-day-cell.weekend-day {
  background-color: #fafdfa;
}

.roster-day-cell.today-cell {
  background-color: #f0fdf4;
  outline: 2px solid #22c55e;
  outline-offset: -2px;
}

.roster-day-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.roster-day-number {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main);
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.roster-day-cell.today-cell .roster-day-number {
  background: #22c55e;
  color: #ffffff;
}

.roster-day-quick-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.5;
  transition: all 0.15s ease;
}

.roster-day-cell:hover .roster-day-quick-btn {
  opacity: 1;
  background: #e2e8f0;
  color: var(--text-main);
}

.roster-day-comp-badge {
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  margin-bottom: 0.35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.roster-slots-container {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.roster-slot-card {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-left: 4px solid #3b82f6;
  border-radius: 4px;
  padding: 0.3rem 0.45rem;
  font-size: 0.78rem;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.roster-slot-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.roster-slot-card.assigned {
  border-left-color: #22c55e;
  background: #f0fdf4;
}

.roster-slot-card.unassigned {
  border-left-color: #f59e0b;
  background: #fffbeb;
}

.roster-slot-card.open-takeover {
  border-left-color: #dc2626 !important;
  border-color: #fca5a5 !important;
  background: #fef2f2 !important;
  box-shadow: 0 1px 4px rgba(220, 38, 38, 0.2);
}

.roster-slot-card.open-takeover .roster-slot-marshal {
  color: #b91c1c !important;
  font-weight: 700 !important;
}

.roster-slot-time {
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
}

.roster-slot-name {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.roster-slot-marshal {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.roster-slot-card.assigned .roster-slot-marshal {
  color: #15803d;
  font-weight: 600;
}

.roster-slot-card.unassigned .roster-slot-marshal {
  color: #b45309;
  font-weight: 600;
}

/* Floating Context Menu */
.roster-context-menu {
  position: fixed;
  z-index: 2500;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
  min-width: 220px;
  display: none;
  overflow: hidden;
  animation: contextFadeIn 0.12s ease-out;
}

@keyframes contextFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.roster-context-header {
  padding: 0.5rem 0.85rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.roster-context-item {
  padding: 0.6rem 0.85rem;
  font-size: 0.85rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: background-color 0.12s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.roster-context-item:hover {
  background-color: #f1f5f9;
}

.roster-context-item.danger {
  color: #dc2626;
}

.roster-context-item.danger:hover {
  background-color: #fee2e2;
}

.roster-context-item.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.roster-context-divider {
  height: 1px;
  background-color: var(--border);
  margin: 0.25rem 0;
}

/* Modals */
.roster-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  z-index: 1300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.roster-modal-dialog {
  background: #ffffff;
  border-radius: var(--radius);
  max-width: 520px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  animation: modalScaleUp 0.15s ease-out;
}

@keyframes modalScaleUp {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.roster-modal-header {
  padding: 1rem 1.25rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.roster-modal-body {
  padding: 1.25rem;
  max-height: 75vh;
  overflow-y: auto;
}

.roster-modal-footer {
  padding: 0.85rem 1.25rem;
  background: #f8fafc;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Preset chips in modals and quick selection */
.btn-modal-preset,
.btn-quick-slot-template {
  border-color: var(--border);
  background: #ffffff;
  color: var(--text-main);
  transition: all 0.15s ease-in-out;
  cursor: pointer;
  border-radius: 6px;
}

.btn-modal-preset:hover,
.btn-quick-slot-template:hover {
  background: #f1f5f9;
  border-color: var(--primary);
  color: var(--primary);
}

.btn-modal-preset.active,
.btn-quick-slot-template.active {
  background: #eef2ff;
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 0 0 1px var(--primary);
}

.btn-modal-preset.is-default {
  border-color: #86efac;
}

.btn-modal-preset.is-default.active {
  background: #f0fdf4;
  border-color: #16a34a;
  color: #15803d;
  box-shadow: 0 0 0 1px #16a34a;
}

/* Subtle pulse highlight after adding or modifying a shift */
@keyframes rosterCellPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    border-color: #22c55e;
  }
  50% {
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.35);
    border-color: #16a34a;
    background-color: #f0fdf4;
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

.roster-day-cell.roster-day-highlight {
  animation: rosterCellPulse 1.8s ease-out;
  border-color: #22c55e !important;
}

/* 1-Pagina A4 Marshal Overzicht (Publicatiebord Koffieruimte) */
.roster-a4-sheet {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  max-width: 960px;
  margin: 0 auto;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
  color: #0f172a;
}

.roster-a4-header {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 1rem;
  margin-bottom: 0.65rem;
}

.roster-a4-intro-box {
  flex: 1;
  border: 1px solid #334155;
  background: #f8fafc;
  padding: 0.45rem 0.7rem;
  font-size: 0.8rem;
  line-height: 1.35;
  color: #0f172a;
}

.roster-a4-title-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 220px;
}

.roster-a4-month-banner {
  background: #1b4332;
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 800;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  letter-spacing: 0.02em;
  text-align: right;
  margin-top: 0.15rem;
}

.roster-a4-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  line-height: 1.2;
  border: 1.5px solid #1e293b;
}

.roster-a4-table thead tr {
  background: #1e293b;
  color: #ffffff;
}

.roster-a4-table th {
  padding: 0.3rem 0.45rem;
  text-align: left;
  font-weight: 700;
  border: 1px solid #334155;
  font-size: 0.78rem;
}

.roster-a4-table td {
  padding: 0.22rem 0.45rem;
  border: 1px solid #94a3b8;
  vertical-align: middle;
}

.roster-a4-weekend-row {
  background-color: #f0fdf4;
}

.roster-a4-swap-row {
  background-color: #fffbeb;
}

.roster-a4-footer {
  margin-top: 0.5rem;
  padding-top: 0.35rem;
  border-top: 1.5px solid #1e293b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: #1e293b;
}

.roster-a4-stats {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  flex-wrap: wrap;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 7mm 9mm;
  }

  .roster-a4-sheet {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
  }

  .roster-a4-header {
    margin-bottom: 4px !important;
  }

  .roster-a4-intro-box {
    font-size: 7.8pt !important;
    line-height: 1.22 !important;
    padding: 4px 7px !important;
    background: #f8fafc !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .roster-a4-month-banner {
    background: #1b4332 !important;
    color: #ffffff !important;
    font-size: 11pt !important;
    padding: 2px 8px !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .roster-a4-table {
    font-size: 7.8pt !important;
    line-height: 1.12 !important;
    page-break-inside: avoid;
  }

  .roster-a4-table thead tr {
    background: #1e293b !important;
    color: #ffffff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .roster-a4-table th {
    padding: 2.5px 4px !important;
    font-size: 7.8pt !important;
  }

  .roster-a4-table td {
    padding: 1.8px 4px !important;
  }

  .roster-a4-weekend-row {
    background-color: #ecfdf5 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .roster-a4-footer {
    font-size: 7.2pt !important;
    margin-top: 4px !important;
    padding-top: 3px !important;
    page-break-inside: avoid;
  }

  .roster-edit-input {
    display: none !important;
  }

  .roster-print-val {
    display: inline !important;
  }
}
