html {
  font-size: calc(14px * var(--font-scale, 1));
}


.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin: 0px;
  background: #ffffff;
  color: #1f2937;
  font-family: "Trebuchet MS", "Verdana", sans-serif;
}

.footer {
  border-top: 1px solid rgba(31, 41, 55, 0.12);
  padding: 12px 0;
  margin-top: 24px;
  color: #6b7280;
  font-size: 0.9rem;
}

.alert {
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.alert-danger {
  background: #fee2e2;
  color: #7f1d1d;
  border: 1px solid rgba(185, 28, 28, 0.2);
}

:root {
  --font-scale: 1;
  --card-bg: #ffffff;
  --card-border: rgba(31, 41, 55, 0.1);
  --accent: #c9783b;
  --muted: #6b7280;
}

h1, h2, h3 {
  font-family: "Georgia", "Times New Roman", serif;
  letter-spacing: 0.01em;
}

.container {
  margin: 0px 16px 10px 16px;
  padding: 0;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 30;
    background: #ffffff;
    padding: 16px 0;
    margin-bottom: 24px;
    /*border-bottom: 1px solid rgba(31, 41, 55, 0.08);*/
    /*box-shadow: 0 6px 6px rgba(31, 41, 55, 0.06);*/
    /*box-shadow: 0 2px 1px -2px gray;*/
}

.muted {
    color: var(--muted);
    font-size: 1.2rem;
}

.page-header .muted {
  margin: 0;
}

.options-quick-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.1rem;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #7a3d13;
  text-decoration: none;
  box-shadow: none;
  transition: color 120ms ease, opacity 120ms ease;
}

.options-quick-toggle:hover {
  color: #a34f1d;
  opacity: 0.92;
}

.options-quick-toggle:focus-visible {
  outline: 2px solid rgba(201, 120, 59, 0.75);
  outline-offset: 2px;
}

.options-quick-toggle svg {
  width: 1.15rem;
  height: 1.15rem;
  stroke: currentColor;
  fill: none;
}

.grid-list {
  margin-bottom: 28px;
}

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

.grid-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 8px 20px rgba(31, 41, 55, 0.08);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.grid-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(31, 41, 55, 0.12);
}

.grid-title {
  font-weight: 700;
  margin-bottom: 8px;
}

.grid-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.92rem;
}

.non-timeslot {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
}

.nav-group {
  margin-bottom: 12px;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.link-row a {
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff2e4;
  color: #7a3d13;
  text-decoration: none;
  border: 1px solid rgba(201, 120, 59, 0.3);
}

.alerts {
  background: #fff6f0;
  border: 1px solid rgba(201, 120, 59, 0.35);
  border-radius: 12px;
  padding: 16px;
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(31, 41, 55, 0.08);
}

.schedule-table th,
.schedule-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(31, 41, 55, 0.08);
  vertical-align: top;
}

.schedule-table th {
  text-align: left;
  background: rgba(239, 241, 247, 0.7);
}

.time-cell {
  font-weight: 700;
  color: #1f2937;
  width: 100px;
}
.entry-grid {
  font-weight: 700;
}

.legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(31, 41, 55, 0.12);
  background: rgba(255, 255, 255, 0.85);
  margin-bottom: 14px;
}

.legend-title {
  font-weight: 700;
  color: #1f2937;
}

.legend-items {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  color: #4b5563;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  /*align-items: flex-end;*/
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(31, 41, 55, 0.12);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-group label {
  font-weight: 600;
  color: #374151;
}

.filter-group select {
  min-width: 180px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(31, 41, 55, 0.18);
  background: #ffffff;
}

.filter-group input[type="text"],
.filter-group input[type="number"] {
  min-width: 90px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(31, 41, 55, 0.18);
  background: #ffffff;
  color: #1f2937;
}

.filter-actions {
  display: flex;
  gap: 10px;
}

.table-section {
  margin-bottom: 28px;
}

.split-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 30px;
  align-items: start;
  margin-bottom: 24px;
}

.split-panel h2 {
  margin-bottom: 14px;
  color: #f05a00;
  font-size: 1.05rem;
}

.split-empty {
  padding: 12px;
  background: #f8fafc;
  border-radius: 8px;
  color: #6b7280;
  font-size: 0.9rem;
}

.split-list {
  display: flex;
  flex-direction: column;
  gap: 0.714rem;
}

.split-row {
  display: grid;
  grid-template-columns: 3.429rem minmax(0, 1fr) 1.586rem;
  gap: 0.714rem;
  align-items: center;
}

.slot-time {
  font-weight: 600;
  font-size: 1.1rem;
  color: #1f2937;
}

.slot-card {
  border-radius: 8px;
  padding: 0.429rem 0.714rem;
  background: #f1f1f1;
  color: #1f2937;
  min-height: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.143rem;
}

.slot-title {
  font-weight: 600;
  font-size: 0.88rem;
}

.slot-sub {
  font-size: 0.78rem;
  opacity: 0.9;
}

.slot-grid {
  font-size: 0.8rem;
  color: inherit;
  opacity: 0.82;
}

.slot-dot {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 999px;
  background: #6b7280;
  position: relative;
}

.slot-booking {
  font-size: 0.9rem;
  color: #374151;
}

.slot-booking a {
  color: inherit;
  text-decoration: none;
}

.slot-card.status-processed {
  background: #f06292;
  color: #ffffff;
}

.slot-card.status-booked {
  background: #e5e7eb;
  color: #374151;
}

.slot-card.status-not_arrived {
  background: #fb76b8;
  color: #ffffff;
}

.slot-card.grid-dow.status-not_arrived {
  background: #f06292;
  color: #ffffff;
}

.slot-card.grid-dow.status-booked {
  background: #f06292;
  color: #ffffff;
}

.slot-card.grid-rpc.status-buffer {
  background: #c4e6ff;
  color: #1f2937;
}

@keyframes statusPulse {
  0% { opacity: 1; }
  50% { opacity: 0.45; }
  100% { opacity: 1; }
}

@keyframes statusRipple {
  0% { transform: scale(0.6); opacity: 0.5; }
  100% { transform: scale(2.6); opacity: 0; }
}

.slot-dot.status-not_arrived,
.slot-dot.status-arrived {
  animation: statusPulse 1.6s ease-in-out infinite;
}

.slot-dot.status-not_arrived::after,
.slot-dot.status-arrived::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  border: 2px solid currentColor;
  opacity: 0;
  animation: statusRipple 1.6s ease-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .slot-dot.status-not_arrived,
  .slot-dot.status-arrived {
    animation: none;
  }

  .slot-dot.status-not_arrived::after,
  .slot-dot.status-arrived::after {
    animation: none;
  }
}

.slot-card.status-arrived {
  background: #0ea5e9;
  color: #ffffff;
}

.slot-card.status-buffer {
  background: #f4dddd;
  color: #7c2d12;
}

.slot-card.status-unknown {
  background: #f3e8ff;
  color: #4c1d95;
}

.slot-card.status-empty {
  background: #f1f1f1;
  color: #9ca3af;
}

.slot-card.grid-rpc {
  background: #03a9f4;
  color: #ffffff;
}

.slot-card.grid-bulk {
  background: #008080;
  color: #ffffff;
}

.slot-dot.status-processed { background: #f6d700; color: #f6d700; }
.slot-dot.status-not_arrived { background: #fb76b8; color: #fb76b8; }
.slot-dot.status-booked { background: #b5b3b6; color: #b5b3b6; }
.slot-dot.status-arrived { background: #22c55e; color: #22c55e; }
.slot-dot.status-buffer { background: #555555; color: #555555; }
.slot-dot.status-unknown { background: #7c4a0d; color: #7c4a0d; }
.slot-dot.status-empty { background: #e5e7eb; color: #e5e7eb; }

.btn-apply,
.btn-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(31, 41, 55, 0.18);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  background: #ffffff;
  color: #1f2937;
}

.btn-apply {
  background: #ffe6cf;
  border-color: rgba(201, 120, 59, 0.5);
  color: #7a3d13;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.85rem;
  background: #f3f4f6;
  color: #374151;
}

.status-badge.booked { background: #e5e7eb; color: #374151; }
.status-badge.processed { background: #e0f2fe; color: #0f4c75; }
.status-badge.not_arrived { background: #fef3c7; color: #92400e; }
.status-badge.buffer { background: #fff1f2; color: #9f1239; }
.status-badge.empty { background: #f0fdf4; color: #166534; }
.status-badge.arrived { background: #dcfce7; color: #166534; }
.status-badge.unknown { background: #f8fafc; color: #475569; }

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.font-scale-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.font-scale-label {
  font-weight: 600;
  color: #1f2937;
}

.filter-group-font-scale {
  min-width: 238px;
}

.font-scale-input {
  width: 5.2rem;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid rgba(31, 41, 55, 0.22);
  color: #1f2937;
  background: #ffffff;
}

.font-scale-input:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.8);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.font-scale-btn {
  border: 1px solid rgba(31, 41, 55, 0.2);
  border-radius: 999px;
  background: #f9fafb;
  color: #1f2937;
  font-weight: 600;
  line-height: 1.1;
  padding: 4px 10px;
  cursor: pointer;
}

.font-scale-btn:hover {
  background: #f3f4f6;
}

.font-scale-value {
  min-width: 3.2rem;
  text-align: left;
  font-weight: 700;
  color: #1f2937;
}

.filter-group-autoscroll {
  min-width: 300px;
}

.auto-scroll-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.auto-scroll-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.auto-scroll-input {
  width: 84px;
}

.auto-scroll-unit {
  color: #6b7280;
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .filter-group-font-scale {
    min-width: 100%;
  }

  .filter-group-autoscroll {
    min-width: 100%;
  }

  .font-scale-controls {
    width: 100%;
  }

  .auto-scroll-controls {
    width: 100%;
  }
}
