:root {
  font-family: Inter, "Segoe UI", sans-serif;
  color: #24312f;
  background: #f6f8f7;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #24312f;
  --muted: #8a9693;
  --line: #e9eeeb;
  --green: #1c9a77;
  --green-dark: #147d60;
  --green-pale: #e6f5ef;
  --card: #fff;
  --shadow: 0 8px 30px rgba(42, 65, 57, .045);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 5; display: flex; flex-direction: column;
  width: 246px; padding: 27px 17px 18px; background: #fff; border-right: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 800 23px Inter, "Segoe UI", sans-serif; letter-spacing: -1.2px; }
.brand-mark { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 11px; color: #fff; background: var(--green); font: 800 23px Inter, "Segoe UI", sans-serif; letter-spacing: -2px; }
.brand-dot { color: var(--green); }
.sidebar-label { margin: 47px 11px 12px; color: #a2ada9; font-size: 10px; font-weight: 700; letter-spacing: 1.25px; }
.main-nav { display: grid; gap: 5px; }
.nav-link { display: flex; align-items: center; gap: 13px; height: 43px; padding: 0 12px; border: 0; border-radius: 9px; color: #74817d; background: transparent; text-align: left; font-size: 13px; font-weight: 600; transition: .18s ease; }
.nav-link:hover { color: var(--green-dark); background: #f5faf8; }
.nav-link.active { color: var(--green-dark); background: var(--green-pale); }
.nav-icon { width: 18px; color: #8d9a95; text-align: center; font-size: 19px; }
.nav-link.active .nav-icon { color: var(--green); }
.nav-badge { display: grid; width: 19px; height: 19px; place-items: center; margin-left: auto; border-radius: 50%; color: #fff; background: var(--green); font-size: 10px; }
.sidebar-bottom { margin-top: auto; }
.demo-card { padding: 16px 14px 13px; border: 1px solid #eaf0ed; border-radius: 12px; background: #fafcfb; }
.demo-icon { display: inline-grid; width: 27px; height: 27px; place-items: center; margin-bottom: 10px; border-radius: 8px; color: var(--green); background: var(--green-pale); }
.demo-card strong { display: block; font-size: 12px; }
.demo-card p { margin: 6px 0 9px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.text-button { padding: 0; border: 0; color: var(--green-dark); background: none; font-size: 10px; font-weight: 700; }
.profile { display: flex; align-items: center; gap: 10px; padding: 18px 4px 0; }
.avatar { display: grid; flex: 0 0 auto; width: 34px; height: 34px; place-items: center; border-radius: 50%; color: #8e6342; background: #f3e5d8; font-size: 10px; font-weight: 700; }
.profile strong, .profile span:not(.profile-more) { display: block; }
.profile strong { font-size: 11px; }
.profile span:not(.profile-more) { margin-top: 3px; color: var(--muted); font-size: 10px; }
.profile-more { margin-left: auto; color: #85918d; font-size: 19px; }

.main-area { min-height: 100vh; margin-left: 246px; }
.topbar { display: flex; height: 68px; align-items: center; justify-content: space-between; padding: 0 38px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.8); }
.breadcrumb { display: flex; align-items: center; gap: 10px; color: #a1aaa7; font-size: 11px; }
.breadcrumb strong { color: #4d5a56; font-weight: 600; }
.crumb-separator { color: #c6ceca; }
.topbar-actions { display: flex; align-items: center; gap: 19px; }
.today-label { color: #84908b; font-size: 11px; }
.icon-button { position: relative; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 9px; color: #7a8782; background: #fff; font-size: 16px; }
.notification-button i { position: absolute; top: 6px; right: 6px; width: 6px; height: 6px; border: 1px solid white; border-radius: 50%; background: #ee9b67; }
.top-avatar { width: 29px; height: 29px; }
.mobile-brand { display: none; }
.content { max-width: 1440px; margin: 0 auto; padding: 33px 38px 50px; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 25px; }
.eyebrow { margin: 0 0 7px; color: var(--green); font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 5px; font: 700 25px Inter, "Segoe UI", sans-serif; letter-spacing: -.8px; }
.page-heading > div > p:last-child { margin: 0; color: var(--muted); font-size: 12px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 14px; border: 1px solid transparent; border-radius: 8px; color: #fff; background: var(--green); font-size: 11px; font-weight: 700; transition: .18s ease; }
.button:hover { background: var(--green-dark); transform: translateY(-1px); }
.button.secondary { border-color: var(--line); color: #586560; background: white; }
.button.secondary:hover { color: var(--green-dark); border-color: #bcded1; background: #f8fcfa; }
.button.small { min-height: 32px; padding: 0 11px; font-size: 10px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-bottom: 20px; }
.stat-card, .panel, .trip-card { border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: var(--shadow); }
.stat-card { display: flex; align-items: center; gap: 13px; min-height: 91px; padding: 16px; }
.stat-icon { display: grid; flex: 0 0 auto; width: 38px; height: 38px; place-items: center; border-radius: 11px; color: var(--green); background: var(--green-pale); font-size: 17px; }
.stat-icon.orange { color: #d8905f; background: #fcf1e8; }
.stat-icon.blue { color: #7194d6; background: #eef3fd; }
.stat-icon.violet { color: #9278c5; background: #f3effa; }
.stat-label { margin-bottom: 5px; color: #899590; font-size: 10px; }
.stat-value { font: 700 20px Inter, "Segoe UI", sans-serif; letter-spacing: -.5px; }
.stat-note { margin-left: 6px; color: #a2aca8; font-size: 9px; font-weight: 500; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(265px, .85fr); gap: 16px; align-items: start; }
.panel { padding: 19px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.panel-heading h2 { margin: 0; font: 700 14px Inter, "Segoe UI", sans-serif; }
.panel-heading p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.link-button { padding: 0; border: 0; color: var(--green-dark); background: none; font-size: 10px; font-weight: 700; }
.trip-feature { overflow: hidden; padding: 0; }
.trip-banner { display: flex; min-height: 99px; align-items: center; justify-content: space-between; padding: 19px 22px; color: white; background: linear-gradient(108deg, #178463, #28a17c 62%, #72b999); }
.trip-banner .eyebrow { margin-bottom: 5px; color: rgba(255,255,255,.7); }
.trip-banner h2 { margin: 0; font: 700 17px Inter, "Segoe UI", sans-serif; }
.trip-date-badge { padding: 9px 11px; border: 1px solid rgba(255,255,255,.25); border-radius: 8px; background: rgba(255,255,255,.12); text-align: center; }
.trip-date-badge strong, .trip-date-badge span { display: block; }
.trip-date-badge strong { font: 700 15px Inter, "Segoe UI", sans-serif; }
.trip-date-badge span { margin-top: 2px; color: rgba(255,255,255,.8); font-size: 9px; }
.trip-route { display: grid; grid-template-columns: 1fr 36px 1fr; align-items: center; padding: 19px 22px 13px; }
.route-point span, .route-point strong, .route-point small { display: block; }
.route-point span { margin-bottom: 5px; color: #9aa5a0; font-size: 9px; }
.route-point strong { font-size: 12px; }
.route-point small { margin-top: 3px; color: #7d8984; font-size: 10px; }
.route-line { position: relative; height: 1px; background: #dce5e0; }
.route-line:before, .route-line:after { position: absolute; top: -2px; width: 5px; height: 5px; border-radius: 50%; background: var(--green); content: ""; }
.route-line:before { left: 0; }.route-line:after { right: 0; }
.trip-meta { display: flex; align-items: center; justify-content: space-between; margin: 0 22px; padding: 13px 0 16px; border-top: 1px solid var(--line); }
.trip-meta span { color: #87938e; font-size: 10px; }
.trip-meta strong { color: #53605b; }
.trip-actions { display: flex; gap: 8px; }
.mini-list { display: grid; gap: 11px; }
.mini-trip { display: flex; align-items: center; gap: 11px; padding: 10px; border: 1px solid #edf1ef; border-radius: 9px; cursor: pointer; transition: .16s; }
.mini-trip:hover { border-color: #cde6dc; background: #fbfefd; }
.mini-date { display: grid; width: 38px; height: 40px; place-content: center; border-radius: 8px; color: var(--green-dark); background: #eff8f4; text-align: center; }
.mini-date strong { font: 700 13px Inter, "Segoe UI", sans-serif; }
.mini-date span { font-size: 8px; text-transform: uppercase; }
.mini-trip-info { min-width: 0; flex: 1; }
.mini-trip-info strong, .mini-trip-info span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-trip-info strong { font-size: 10px; }
.mini-trip-info span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.mini-arrow { color: #a6b1ac; }
.occupancy { margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--line); }
.occupancy-top { display: flex; justify-content: space-between; margin-bottom: 8px; color: #7d8984; font-size: 9px; }
.occupancy-top strong { color: var(--ink); }
.progress-track { height: 5px; overflow: hidden; border-radius: 8px; background: #edf1ef; }
.progress-fill { height: 100%; border-radius: inherit; background: var(--green); }
.calendar-widget { margin-top: 16px; }
.calendar-week, .calendar-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.calendar-week { margin-bottom: 7px; color: #a1aaa7; font-size: 8px; }
.calendar-day { display: grid; position: relative; min-height: 26px; place-items: center; border-radius: 6px; color: #66736e; font-size: 9px; }
.calendar-day.has-event:after { position: absolute; bottom: 3px; width: 3px; height: 3px; border-radius: 50%; background: var(--green); content: ""; }
.calendar-day.is-today { color: white; background: var(--green); font-weight: 700; }
.calendar-day.is-today:after { background: white; }
.calendar-day.muted { color: #c4cbc8; }
.section-spacer { margin-top: 20px; }

.calendar-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(270px, .7fr); gap: 17px; }
.calendar-panel { padding: 20px; }
.calendar-title-controls { display: flex; align-items: center; gap: 9px; }
.calendar-title-controls h2 { min-width: 130px; margin: 0; text-align: center; font: 700 15px Inter, "Segoe UI", sans-serif; }
.arrow-button { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 7px; color: #65716c; background: white; }
.full-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.full-weekday { padding: 11px 7px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: #96a19c; font-size: 9px; font-weight: 700; text-align: center; }
.full-day { position: relative; min-height: 91px; padding: 9px 7px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: #65716c; font-size: 10px; }
.full-day.outside { color: #c2cac6; background: #fbfcfc; }
.full-day-number { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 50%; }
.full-day.today .full-day-number { color: white; background: var(--green); font-weight: 700; }
.calendar-event { overflow: hidden; margin-top: 5px; padding: 4px 5px; border-left: 2px solid var(--green); border-radius: 3px; color: #247d61; background: #eaf6f0; font-size: 8px; line-height: 1.35; cursor: pointer; text-overflow: ellipsis; white-space: nowrap; }
.calendar-aside { display: grid; align-content: start; gap: 15px; }
.date-list { display: grid; gap: 9px; }
.date-list-item { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f0f3f1; cursor: pointer; }
.date-list-item:last-child { border-bottom: 0; }
.date-list-item .mini-date { flex: 0 0 38px; }
.date-list-item > div:last-child { padding-top: 2px; }
.date-list-item strong, .date-list-item span { display: block; }
.date-list-item strong { font-size: 10px; }
.date-list-item span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.filter-select, .field input, .field select, .field textarea { min-height: 38px; width: 100%; padding: 9px 11px; border: 1px solid #e5ebe8; border-radius: 8px; outline: 0; color: #52605a; background: white; font-size: 11px; }
.filter-select:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: #8bc8b0; box-shadow: 0 0 0 3px rgba(28,154,119,.09); }
.field textarea { min-height: 145px; resize: vertical; line-height: 1.6; }
.field { display: grid; gap: 6px; }
.field label { color: #68756f; font-size: 10px; font-weight: 700; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-grid .wide { grid-column: 1 / -1; }
.trip-list { display: grid; gap: 12px; }
.trip-list-card { display: grid; grid-template-columns: 74px minmax(0,1fr) auto; align-items: center; gap: 17px; padding: 17px; border: 1px solid var(--line); border-radius: 11px; background: white; box-shadow: var(--shadow); }
.trip-list-date { padding: 11px 7px; border-radius: 9px; color: var(--green-dark); background: #eff8f4; text-align: center; }
.trip-list-date strong { display: block; font: 700 20px Inter, "Segoe UI", sans-serif; }
.trip-list-date span { display: block; margin-top: 2px; font-size: 9px; text-transform: uppercase; }
.trip-list-detail h3 { margin: 0 0 7px; font: 700 13px Inter, "Segoe UI", sans-serif; }
.trip-list-detail p { margin: 0; color: #84908b; font-size: 10px; }
.trip-list-detail .list-route { color: #55625c; font-size: 11px; font-weight: 600; }
.trip-list-actions { display: flex; align-items: center; gap: 8px; }
.status-pill { padding: 5px 8px; border-radius: 20px; color: #258565; background: #edf8f3; font-size: 9px; font-weight: 700; }
.select-row { display: flex; align-items: center; gap: 9px; }
.select-row .filter-select { width: auto; min-width: 175px; }

.seat-layout { display: grid; grid-template-columns: minmax(290px, .95fr) minmax(0,1fr); gap: 17px; align-items: start; }
.bus-panel { padding: 20px; }
.bus-frame { max-width: 365px; margin: 8px auto 0; padding: 20px 22px 22px; border: 2px solid #dce6e1; border-radius: 48px 48px 25px 25px; background: #fbfdfc; }
.bus-front { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 16px; border-bottom: 1px dashed #d8e1dc; color: #8c9993; font-size: 9px; }
.driver-seat { display: grid; width: 31px; height: 28px; place-items: center; border: 1px solid #dce6e1; border-radius: 7px; color: #85928d; background: white; }
.bus-seats { display: grid; grid-template-columns: 1fr 1fr 26px 1fr 1fr; gap: 8px 6px; padding-top: 16px; }
.seat { position: relative; min-height: 39px; border: 1px solid #dce7e1; border-radius: 8px 8px 6px 6px; color: #718078; background: #fff; font-size: 9px; font-weight: 700; transition: .15s; }
.seat:hover { border-color: var(--green); transform: translateY(-1px); }
.seat.reserved { border-color: #85c7ac; color: #167b5d; background: #e7f6ef; }
.seat.empty-aisle { visibility: hidden; }
.seat-legend { display: flex; justify-content: center; gap: 17px; margin: 16px 0 2px; color: #82908a; font-size: 9px; }
.legend-dot { display: inline-block; width: 9px; height: 9px; margin-right: 5px; border: 1px solid #dce7e1; border-radius: 3px; vertical-align: -1px; background: white; }
.legend-dot.reserved { border-color: #85c7ac; background: #e7f6ef; }
.guest-table-wrap { overflow-x: auto; }
.guest-table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.guest-table th { padding: 9px 7px; border-bottom: 1px solid var(--line); color: #99a39f; font-size: 9px; font-weight: 600; text-align: left; }
.guest-table td { padding: 11px 7px; border-bottom: 1px solid #f0f3f1; color: #53615b; font-size: 10px; }
.guest-table tr:last-child td { border-bottom: 0; }
.guest-name-cell { display: flex; align-items: center; gap: 8px; }
.guest-initials { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 50%; color: #557869; background: #e9f3ee; font-size: 9px; font-weight: 700; }
.toggle-check { width: 18px; height: 18px; accent-color: var(--green); vertical-align: middle; cursor: pointer; }
.paid-pill { border: 0; border-radius: 20px; padding: 5px 8px; color: #278362; background: #eaf6f0; font-size: 9px; font-weight: 700; }
.paid-pill.unpaid { color: #b4774c; background: #fcf2e9; }
.table-empty { padding: 24px 8px; color: var(--muted); font-size: 11px; text-align: center; }
.empty-state { padding: 42px 20px; border: 1px dashed #dce6e1; border-radius: 10px; color: #8d9994; text-align: center; font-size: 11px; }
.empty-state strong { display: block; margin-bottom: 6px; color: #5e6c65; font-size: 13px; }
.notice { padding: 13px 15px; border: 1px solid #f0e4c6; border-radius: 9px; color: #876c36; background: #fffaf0; font-size: 10px; line-height: 1.55; }
.notice strong { display: block; margin-bottom: 4px; font-size: 11px; }
.email-layout { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(270px,.8fr); gap: 17px; align-items: start; }
.parse-result { min-height: 58px; margin-top: 12px; padding: 11px 12px; border: 1px solid #e8efeb; border-radius: 8px; color: #76837d; background: #fbfdfc; font-size: 10px; line-height: 1.55; }
.parse-result.success { border-color: #cde9dc; color: #267c5f; background: #f0faf5; }
.modal-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 18px; background: rgba(29,43,38,.38); }
.modal { width: min(100%, 520px); max-height: min(90vh, 760px); overflow-y: auto; padding: 23px; border-radius: 14px; background: white; box-shadow: 0 18px 65px rgba(20,40,32,.2); }
.modal-heading { display: flex; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.modal-heading h2 { margin: 0; font: 700 17px Inter, "Segoe UI", sans-serif; }
.modal-heading p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.close-button { width: 29px; height: 29px; border: 0; border-radius: 7px; color: #75827c; background: #f3f6f4; font-size: 17px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 17px; }
.detail-block { padding: 14px 0; border-bottom: 1px solid var(--line); }
.detail-block:last-of-type { border-bottom: 0; }
.detail-label { margin-bottom: 5px; color: #98a39e; font-size: 9px; text-transform: uppercase; letter-spacing: .5px; }
.detail-value { color: #3c4b45; font-size: 12px; font-weight: 600; }
.detail-route { display: grid; grid-template-columns: 1fr 25px 1fr; align-items: center; }
.detail-route .route-point strong { font-size: 13px; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 30; max-width: min(360px, calc(100vw - 40px)); padding: 12px 16px; border-radius: 9px; color: white; background: #263a32; box-shadow: 0 8px 25px #17302530; font-size: 11px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1040px) {
  .sidebar { width: 210px; padding-inline: 13px; }
  .main-area { margin-left: 210px; }
  .topbar { padding-inline: 24px; }
  .content { padding-inline: 24px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr) minmax(250px, .82fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .seat-layout { grid-template-columns: minmax(270px,.9fr) minmax(0,1.1fr); }
}
@media (max-width: 760px) {
  .sidebar { position: fixed; inset: auto 0 0; width: 100%; height: 63px; padding: 5px 5px calc(5px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); border-right: 0; }
  .sidebar > .brand, .sidebar-label, .sidebar-bottom { display: none; }
  .main-nav { display: flex; height: 100%; justify-content: space-around; gap: 0; }
  .nav-link { flex: 1; height: 52px; flex-direction: column; justify-content: center; gap: 2px; padding: 3px 1px; border-radius: 7px; font-size: 8px; }
  .nav-icon { height: 20px; font-size: 17px; }
  .nav-badge { position: absolute; top: 2px; right: calc(50% - 23px); width: 15px; height: 15px; font-size: 8px; }
  .main-area { margin-left: 0; padding-bottom: 68px; }
  .topbar { height: 58px; padding: 0 17px; }
  .mobile-brand { display: inline-flex; gap: 7px; font-size: 17px; }
  .mobile-brand .brand-mark { width: 28px; height: 28px; border-radius: 8px; font-size: 20px; }
  .breadcrumb, .today-label, .top-avatar { display: none; }
  .topbar-actions { gap: 0; }
  .content { padding: 25px 16px 30px; }
  .page-heading { align-items: flex-start; gap: 12px; }
  h1 { font-size: 22px; }
  .page-heading > .button { flex: 0 0 auto; min-height: 35px; padding-inline: 10px; font-size: 10px; }
  .stats-grid { gap: 9px; }
  .stat-card { min-height: 78px; gap: 9px; padding: 11px; }
  .stat-icon { width: 32px; height: 32px; border-radius: 9px; }
  .stat-value { font-size: 17px; }
  .stat-note { display: none; }
  .dashboard-grid, .calendar-layout, .seat-layout, .email-layout { grid-template-columns: 1fr; }
  .panel { padding: 15px; }
  .calendar-aside { grid-row: auto; }
  .full-day { min-height: 69px; padding: 6px 4px; font-size: 9px; }
  .calendar-event { margin-top: 4px; padding: 3px 3px; font-size: 7px; }
  .full-weekday { padding: 9px 3px; font-size: 8px; }
  .trip-list-card { grid-template-columns: 56px minmax(0,1fr); gap: 12px; padding: 13px; }
  .trip-list-date { padding: 9px 4px; }
  .trip-list-date strong { font-size: 17px; }
  .trip-list-actions { grid-column: 2; justify-content: flex-start; }
  .trip-list-actions .status-pill { margin-right: auto; }
  .trip-actions { gap: 6px; }
  .select-row { width: 100%; justify-content: space-between; }
  .select-row .filter-select { min-width: 0; max-width: 60%; }
}
@media (max-width: 390px) {
  .nav-link { font-size: 7px; }
  .nav-icon { font-size: 15px; }
  .trip-meta { align-items: flex-start; gap: 10px; flex-direction: column; }
  .trip-meta .button { align-self: flex-end; }
  .trip-route { padding-inline: 16px; }
}
