:root { color-scheme: light; --ink: #263039; --muted: #75808a; --paper: #eef0f2; --line: #d8dde1; --green: #347e4d; --green-dark: #245f38; --green-soft: #e5f1e8; --red: #d93632; font-family: 'DM Sans', sans-serif; }
* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; color: var(--ink); background: var(--paper); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.timetable-topbar { position: sticky; z-index: 10; top: 0; display: flex; min-height: 62px; align-items: center; gap: 22px; padding: 8px 22px; color: #fff; background: var(--green); box-shadow: 0 2px 6px rgba(30,48,35,.2); }
.timetable-brand { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; color: #fff; font-family: 'Manrope', sans-serif; font-size: 12px; font-weight: 800; text-decoration: none; }
.timetable-brand-mark { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid rgba(255,255,255,.65); border-radius: 3px; background: rgba(255,255,255,.12); }
.timetable-page-title h1, .timetable-section h2 { margin: 2px 0 0; font-family: 'Manrope', sans-serif; line-height: 1.1; }
.timetable-page-title h1 { font-size: 19px; }
.timetable-kicker { color: var(--green-dark); font-size: 10px; font-weight: 800; letter-spacing: 1.2px; }
.timetable-topbar .timetable-kicker { color: rgba(255,255,255,.72); }
.timetable-clock { display: grid; gap: 1px; margin-left: auto; }
.timetable-clock span { color: rgba(255,255,255,.72); font-size: 8px; font-weight: 800; letter-spacing: 1px; }
.timetable-clock strong { color: #fff; font-family: 'Manrope', sans-serif; font-size: 17px; }
.timetable-links { display: flex; gap: 7px; }
.timetable-links a { padding: 8px 10px; border: 1px solid rgba(255,255,255,.5); border-radius: 2px; color: #fff; font-size: 12px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.timetable-links a:hover { background: rgba(0,0,0,.12); }
.timetable-main { width: min(1000px, 100%); margin: 0 auto; padding: 22px; }
.timetable-overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); background: var(--line); }
.timetable-overview > div { min-height: 78px; padding: 12px 16px; background: #fff; }
.timetable-overview strong { display: block; margin-top: 6px; font-family: 'Manrope', sans-serif; font-size: 21px; }
.timetable-section { margin-top: 18px; padding: 15px 16px; border: 1px solid var(--line); background: #fff; }
.timetable-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.timetable-section h2 { font-size: 16px; }
.schedule-form { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(140px, 220px) auto; align-items: end; gap: 10px; }
.schedule-form label { display: grid; gap: 5px; color: #56636b; font-size: 11px; font-weight: 700; }
.schedule-form select, .schedule-form input { width: 100%; height: 36px; padding: 0 9px; border: 1px solid #d5dce0; border-radius: 2px; outline: 0; color: var(--ink); background: #fff; font-size: 12px; }
.schedule-form select:focus, .schedule-form input:focus { border-color: var(--green); box-shadow: 0 0 0 2px var(--green-soft); }
.schedule-form button, .schedule-actions button { min-height: 34px; padding: 0 12px; border: 0; border-radius: 2px; color: #fff; background: var(--green); font-size: 11px; font-weight: 700; white-space: nowrap; }
.schedule-form button:hover, .schedule-actions button:hover:not(:disabled) { background: var(--green-dark); }
.schedule-form button:disabled, .schedule-actions button:disabled { cursor: not-allowed; opacity: .5; }
.schedule-message { min-height: 17px; margin: 9px 0 0; color: var(--green-dark); font-size: 11px; }
.schedule-message.is-error { color: var(--red); }
.departure-count { color: var(--muted); font-size: 11px; }
.schedule-list { display: grid; gap: 7px; }
.schedule-row { display: grid; grid-template-columns: 74px minmax(130px, 1fr) minmax(190px, .9fr) auto; align-items: center; gap: 12px; padding: 10px; border: 1px solid #e1e6e8; border-left: 3px solid #bdc7cb; background: #fff; }
.schedule-row--assigned { border-left-color: #d79e34; }
.schedule-row--running { border-left-color: var(--green); }
.schedule-row--returning { border-left-color: #d79e34; }
.schedule-row--completed { border-left-color: #9aa5ab; opacity: .82; }
.schedule-row--returning { border-left-color: #d79e34; }
.schedule-row--completed { border-left-color: #9aa5ab; opacity: .8; }
.schedule-time { font-family: 'Manrope', sans-serif; font-size: 18px; font-weight: 800; }
.schedule-route { display: flex; min-width: 0; align-items: flex-start; gap: 8px; }
.schedule-route-swatch { width: 10px; height: 10px; flex: 0 0 auto; margin-top: 3px; border-radius: 50%; }
.schedule-route strong, .schedule-route small { display: block; }
.schedule-route strong { font-size: 12px; }
.schedule-route small { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.schedule-bus-control { display: flex; min-width: 0; align-items: center; gap: 6px; }
.schedule-bus-control select { min-width: 0; height: 32px; flex: 1 1 auto; padding: 0 7px; border: 1px solid #d5dce0; border-radius: 2px; color: var(--ink); background: #fff; font-size: 10px; }
.schedule-bus-name { min-width: 0; color: #44515a; font-size: 11px; font-weight: 700; }
.schedule-status { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; }
.schedule-status--running { color: var(--green-dark); }
.schedule-status--assigned { color: #9b6a12; }
.schedule-status--returning { color: #9b6a12; }
.schedule-status--completed { color: #69767d; }
.schedule-status--returning { color: #9b6a12; }
.schedule-status--completed { color: #69767d; }
.schedule-actions { display: flex; gap: 5px; }
.schedule-actions button { min-height: 31px; padding: 0 9px; font-size: 10px; }
.schedule-actions .schedule-remove { border: 1px solid #d5dce0; color: #657078; background: #fff; }
.schedule-actions .schedule-remove:hover:not(:disabled) { border-color: var(--red); color: var(--red); background: #fff; }
.schedule-empty { padding: 24px 12px; border: 1px dashed #c8d0d4; color: var(--muted); background: #fafbfb; text-align: center; font-size: 12px; }
@media (max-width: 780px) {
  .timetable-topbar { gap: 12px; padding: 8px 12px; }
  .timetable-brand > span:last-child { display: none; }
  .timetable-main { padding: 14px 12px; }
  .schedule-form { grid-template-columns: minmax(0, 1fr) minmax(130px, .7fr); }
  .schedule-form button { grid-column: 1 / -1; }
  .schedule-row { grid-template-columns: 62px minmax(0, 1fr); gap: 8px 10px; }
  .schedule-bus-control { grid-column: 1 / -1; }
  .schedule-actions { grid-column: 1 / -1; justify-content: flex-end; }
}
@media (max-width: 430px) {
  .timetable-topbar { gap: 8px; }
  .timetable-links { gap: 4px; }
  .timetable-links a { padding: 7px; font-size: 10px; }
  .timetable-clock { margin-left: auto; }
  .schedule-form { grid-template-columns: 1fr; }
  .schedule-form button { grid-column: auto; }
}
.schedule-form { grid-template-columns: 1fr; align-items: stretch; }
.schedule-form > label { max-width: 440px; }
.schedule-days { display: flex; flex-wrap: wrap; gap: 8px 12px; margin: 2px 0; padding: 8px 10px 9px; border: 1px solid #e1e6e8; }
.schedule-days legend { padding: 0 4px; color: #56636b; font-size: 10px; font-weight: 800; }
.schedule-days label { display: flex; align-items: center; gap: 4px; color: var(--ink); font-size: 11px; font-weight: 600; }
.schedule-days input { width: 14px; height: 14px; accent-color: var(--green); }
.period-list { display: grid; gap: 6px; }
.period-row { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(100px, 1fr) minmax(110px, 1fr) 32px; align-items: end; gap: 8px; padding: 8px; border: 1px solid #e1e6e8; background: #fafbfb; }
.period-row label, .driver-form label { display: grid; gap: 4px; color: #56636b; font-size: 10px; font-weight: 700; }
.period-row input, .driver-form input { width: 100%; height: 32px; padding: 0 7px; border: 1px solid #d5dce0; border-radius: 2px; color: var(--ink); background: #fff; font-size: 11px; }
.period-row button { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 2px; color: var(--muted); background: #fff; font-size: 18px; }
.period-row button:hover:not(:disabled) { border-color: var(--red); color: var(--red); }
.period-row button:disabled { cursor: default; opacity: .4; }
.schedule-form-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.schedule-form-actions .schedule-secondary, .schedule-secondary { border: 1px solid #cbd4d8; color: #4f5c63; background: #fff; }
.schedule-form-actions .schedule-secondary:hover, .schedule-secondary:hover { border-color: var(--green); color: var(--green-dark); background: #fff; }
.driver-form { display: grid; grid-template-columns: minmax(140px, 1.4fr) repeat(4, minmax(105px, 1fr)) auto; align-items: end; gap: 8px; }
.driver-form button { min-height: 34px; padding: 0 10px; border: 0; border-radius: 2px; color: #fff; background: var(--green); font-size: 10px; font-weight: 700; white-space: nowrap; }
.driver-form button:hover { background: var(--green-dark); }
.driver-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.driver-chip { display: grid; gap: 2px; padding: 6px 9px; border: 1px solid #e1e6e8; background: #fafbfb; }
.driver-chip strong { font-size: 10px; }
.driver-chip small, .driver-empty { color: var(--muted); font-size: 9px; }
.departure-tools { display: flex; align-items: center; gap: 8px; }
.departure-tools button { min-height: 30px; padding: 0 9px; font-size: 10px; }
.plan-report { margin-bottom: 10px; padding: 10px 12px; border: 1px solid #d8dde1; background: #fafbfb; }
.plan-report.is-hidden { display: none; }
.plan-summary { display: flex; flex-wrap: wrap; gap: 8px 14px; color: #5c6870; font-size: 10px; }
.plan-summary strong { color: var(--ink); }
.plan-error, .plan-error li { color: #b72f2a; }
.plan-warning, .plan-warning li { color: #9b6a12; }
.plan-report ul { display: grid; gap: 4px; margin: 8px 0 0; padding-left: 17px; font-size: 10px; }
.plan-report p { margin: 8px 0 0; color: var(--green-dark); font-size: 11px; }
.schedule-row { grid-template-columns: 1fr; align-items: stretch; gap: 9px; }
.schedule-trip-main { display: grid; grid-template-columns: 26px 72px minmax(0, 1fr); align-items: start; gap: 8px; }
.trip-drag-handle { width: 26px; height: 28px; padding: 0; border: 1px solid transparent; border-radius: 2px; color: #7a858b; background: transparent; font-size: 13px; cursor: grab; }
.trip-drag-handle:hover:not(:disabled) { border-color: var(--line); color: var(--green-dark); background: #f4f8f5; }
.trip-drag-handle:disabled { cursor: default; opacity: .35; }
.schedule-row.is-dragging { opacity: .45; }
.schedule-row.is-drop-target { border-color: var(--green); background: #f4faf5; }
.schedule-resources { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.resource-assignment { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 5px; }
.resource-assignment label { display: grid; min-width: 0; gap: 4px; color: #56636b; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.resource-assignment select, .resource-assignment input { width: 100%; min-width: 0; height: 31px; padding: 0 6px; border: 1px solid #d5dce0; border-radius: 2px; color: var(--ink); background: #fff; font-size: 10px; text-transform: none; }
.resource-assignment select:disabled, .resource-assignment input:disabled { opacity: .75; }
.resource-actions { display: flex; gap: 3px; }
.resource-actions button, .resource-assignment > button { min-height: 31px; padding: 0 7px; border: 0; border-radius: 2px; color: #fff; background: var(--green); font-size: 9px; font-weight: 700; white-space: nowrap; }
.resource-actions button:hover, .resource-assignment > button:hover { background: var(--green-dark); }
.resource-actions .schedule-remove { border: 1px solid var(--line); color: #657078; background: #fff; }
.resource-current { grid-column: 1 / -1; color: var(--ink); font-size: 11px; font-weight: 700; }
.resource-block { grid-column: 1 / -1; grid-template-columns: minmax(0, 260px) auto; justify-content: start; }
.schedule-actions { justify-content: flex-end; padding-top: 2px; }
.stop-times { border-top: 1px solid #e9edef; border-bottom: 1px solid #e9edef; }
.stop-times summary { padding: 7px 0; color: var(--green-dark); cursor: pointer; font-size: 10px; font-weight: 700; }
.stop-times-scroll { max-height: 220px; overflow: auto; }
.stop-times table { width: 100%; border-collapse: collapse; font-size: 10px; }
.stop-times th, .stop-times td { padding: 5px 7px; border-top: 1px solid #edf0f1; text-align: left; }
.stop-times thead th { position: sticky; top: 0; color: var(--muted); background: #fafbfb; font-size: 9px; }
.stop-times tbody th { font-weight: 600; }
.leg-time-editor { display: grid; gap: 6px; padding: 9px 0 10px; }
.leg-time-editor > strong { color: #4f5c63; font-size: 10px; }
.leg-time-editor input { width: 78px; height: 27px; padding: 0 5px; border: 1px solid #d5dce0; border-radius: 2px; color: var(--ink); font: inherit; font-size: 10px; }
.leg-time-editor input:disabled { border-color: transparent; color: var(--muted); background: transparent; }
.leg-time-editor button { justify-self: start; min-height: 29px; padding: 0 9px; border: 0; border-radius: 2px; color: #fff; background: var(--green); font-size: 10px; font-weight: 700; }
.leg-time-editor button:hover { background: var(--green-dark); }
@media (max-width: 820px) {
  .driver-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .driver-form label:first-child { grid-column: 1 / -1; }
  .driver-form button { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .timetable-main { padding: 10px; }
  .timetable-section { padding: 12px 10px; }
  .period-row { grid-template-columns: repeat(3, minmax(0, 1fr)) 30px; gap: 5px; padding: 6px; }
  .period-row label { font-size: 9px; }
  .period-row button { width: 30px; }
  .schedule-resources { grid-template-columns: 1fr; }
  .resource-block { grid-column: auto; grid-template-columns: minmax(0, 1fr) auto; }
  .schedule-trip-main { grid-template-columns: 24px 55px minmax(0, 1fr); gap: 5px; }
  .schedule-time { font-size: 16px; }
  .departure-tools { align-items: flex-end; flex-direction: column; }
}