:root {
    --ink: #172a3a;
    --ink-soft: #526371;
    --paper: #f3f5f4;
    --card: #fff;
    --accent: #f6c945;
    --accent-dark: #d7a915;
    --line: #dde3e5;
    --success: #1b7f5b;
    --danger: #b93b3b;
    --radius: 22px;
    --shadow: 0 14px 40px rgba(23, 42, 58, .09);
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--paper);
    color: var(--ink);
    font-family: Inter, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.topbar {
    align-items: center;
    display: flex;
    height: 72px;
    justify-content: space-between;
    margin: 0 auto;
    max-width: 1120px;
    padding: 0 22px;
}

.brand { align-items: center; display: flex; font-size: 17px; font-weight: 800; gap: 10px; letter-spacing: -.03em; }
.brand-mark { align-items: center; background: var(--ink); border-radius: 11px; color: var(--accent); display: inline-flex; height: 36px; justify-content: center; width: 36px; }
.link-button { background: none; border: 0; color: var(--ink-soft); cursor: pointer; font-weight: 600; padding: 10px 0; }
.page-shell { margin: 0 auto; max-width: 760px; padding: 22px 20px 72px; }
.has-nav .page-shell { padding-bottom: 112px; }

h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(31px, 7vw, 48px); letter-spacing: -.055em; line-height: 1.02; margin-bottom: 14px; }
h2 { font-size: 19px; letter-spacing: -.025em; }
.muted { color: var(--ink-soft); line-height: 1.6; }
.eyebrow { color: var(--ink-soft); font-size: 12px; font-weight: 800; letter-spacing: .13em; margin-bottom: 10px; text-transform: uppercase; }

.button {
    align-items: center;
    border: 0;
    border-radius: 15px;
    cursor: pointer;
    display: inline-flex;
    font-weight: 750;
    justify-content: center;
    min-height: 54px;
    padding: 0 22px;
    transition: transform .15s, opacity .15s, background .15s;
}
.button:active { transform: scale(.98); }
.button:disabled { cursor: not-allowed; opacity: .45; }
.button-primary { background: var(--accent); color: var(--ink); }
.button-primary:hover { background: #ffd457; }
.button-danger { background: #f8e2e2; color: var(--danger); }
.button-wide { justify-content: space-between; width: 100%; }

.auth-card {
    background: var(--card);
    border-radius: 28px;
    box-shadow: var(--shadow);
    margin: 5vh auto 0;
    max-width: 480px;
    padding: clamp(28px, 7vw, 48px);
}
.form-stack { display: grid; gap: 18px; margin-top: 30px; }
label { color: var(--ink); display: grid; font-size: 13px; font-weight: 700; gap: 8px; }
input, textarea, select {
    background: #fafbfb;
    border: 1px solid var(--line);
    border-radius: 13px;
    color: var(--ink);
    outline: none;
    padding: 15px 16px;
    width: 100%;
}
input:focus, textarea:focus, select:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(23, 42, 58, .08); }
.auth-footer { color: var(--ink-soft); font-size: 14px; margin: 24px 0 0; text-align: center; }
.auth-footer a, .section-heading a, .detail-card a { color: #9a7000; font-weight: 750; }

.hero { padding: 44px 4px 58px; }
.hero h1 { font-size: clamp(42px, 12vw, 68px); max-width: 600px; }
.hero .button { margin-top: 24px; max-width: 360px; }
.section-block { margin-top: 10px; }
.section-heading { align-items: center; display: flex; justify-content: space-between; }
.section-heading a { font-size: 13px; }

.ride-list { display: grid; gap: 14px; }
.ride-card {
    align-items: flex-start;
    background: var(--card);
    border: 1px solid rgba(23, 42, 58, .06);
    border-radius: var(--radius);
    box-shadow: 0 8px 25px rgba(23, 42, 58, .055);
    display: grid;
    gap: 14px;
    grid-template-columns: 52px minmax(0, 1fr);
    padding: 18px;
    position: relative;
}
.ride-date { align-items: center; background: var(--ink); border-radius: 14px; color: white; display: flex; flex-direction: column; padding: 8px 5px; }
.ride-date strong { font-size: 21px; line-height: 1; }
.ride-date span { color: var(--accent); font-size: 10px; font-weight: 800; margin-top: 4px; }
.ride-main { min-width: 0; padding-right: 2px; }
.ride-main > strong, .ride-main > div strong { font-size: 19px; }
.ride-main p { color: var(--ink-soft); font-size: 12px; margin: 11px 0 0; overflow: hidden; padding-left: 18px; position: relative; text-overflow: ellipsis; white-space: nowrap; }
.route-dot { border: 2px solid var(--ink); border-radius: 50%; display: inline-block; height: 10px; width: 10px; }
.ride-main .route-dot { left: 0; position: absolute; top: 2px; }
.route-dot.destination { background: var(--accent); border-color: var(--accent-dark); border-radius: 2px; }
.ride-price { font-size: 13px; font-weight: 800; grid-column: 2; }
.status { border-radius: 20px; display: inline-block; font-size: 9px; font-weight: 800; margin-left: 4px; padding: 4px 7px; text-transform: uppercase; vertical-align: 2px; }
.status-confirmed, .status-in_progress { background: #dff3eb; color: var(--success); }
.status-pending { background: #fff3c9; color: #7a5900; }
.status-cancelled, .status-no_show { background: #f8e2e2; color: var(--danger); }
.status-completed { background: #e9ecee; color: var(--ink-soft); }

.empty-state { background: rgba(255,255,255,.6); border: 1px dashed #cdd4d7; border-radius: var(--radius); color: var(--ink-soft); padding: 38px 24px; text-align: center; }
.empty-state h3 { color: var(--ink); margin: 12px 0 7px; }
.empty-state p { font-size: 14px; margin: 0; }
.empty-icon { font-size: 30px; }

.bottom-nav {
    align-items: center;
    background: rgba(255,255,255,.94);
    border-top: 1px solid var(--line);
    bottom: 0;
    display: flex;
    gap: 4px;
    justify-content: space-around;
    left: 0;
    padding: 8px max(16px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    position: fixed;
    right: 0;
    z-index: 1000;
}
.bottom-nav a { align-items: center; color: var(--ink-soft); display: flex; flex: 1; flex-direction: column; font-size: 10px; font-weight: 700; gap: 4px; max-width: 130px; padding: 6px; }
.bottom-nav a span { font-size: 21px; line-height: 1; }
.bottom-nav .nav-primary span { align-items: center; background: var(--accent); border-radius: 50%; color: var(--ink); display: flex; height: 42px; justify-content: center; margin-top: -24px; width: 42px; }

.page-title { align-items: center; display: flex; gap: 16px; margin: 8px 0 24px; }
.page-title > a { align-items: center; background: white; border-radius: 50%; display: flex; flex: 0 0 42px; font-size: 22px; height: 42px; justify-content: center; }
.page-title h1 { font-size: clamp(28px, 7vw, 38px); margin: 0; }
.page-title p { margin-bottom: 5px; }
.page-title.compact { margin-bottom: 28px; }
.map { background: #dfe6e0; border-radius: var(--radius); height: 265px; overflow: hidden; z-index: 1; }
	.booking-panel, .quote-card, .detail-card, .detail-grid { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
	.booking-panel { margin: -24px 12px 20px; padding: 24px 20px 20px; position: relative; z-index: 2; }
	.service-toggle { background: #eef2f2; border-radius: 14px; display: grid; gap: 4px; grid-template-columns: 1fr 1fr; margin-bottom: 18px; padding: 4px; }
	.service-toggle button { background: transparent; border: 0; border-radius: 11px; color: var(--ink-soft); cursor: pointer; font-weight: 800; padding: 12px; }
	.service-toggle button.selected { background: white; box-shadow: 0 4px 12px rgba(23, 42, 58, .08); color: var(--ink); }
	.place-field { padding-left: 26px; position: relative; }
.place-field .route-dot { left: 0; position: absolute; top: 7px; }
.place-field label { font-size: 12px; }
.place-field input { background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; font-size: 15px; padding: 8px 0 13px; }
.place-field input:focus { box-shadow: none; border-color: var(--ink); }
.route-line { border-left: 1px dashed #9ba8af; height: 18px; margin-left: 4px; }
.booking-panel .button { margin-top: 22px; }
.suggestions { background: white; border-radius: 12px; box-shadow: 0 12px 30px rgba(23,42,58,.14); left: 18px; overflow: hidden; position: absolute; right: 0; top: 61px; z-index: 20; }
.suggestions button { background: white; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); cursor: pointer; display: block; font-size: 12px; line-height: 1.45; padding: 12px; text-align: left; width: 100%; }
.suggestions button:last-child { border-bottom: 0; }
.alert { background: #fbe5e5; border-radius: 13px; color: #8f2929; font-size: 13px; margin: 14px 0; padding: 14px 16px; }
.quote-card { display: grid; gap: 20px; grid-template-columns: 1fr 1fr; padding: 24px; }
.quote-card[hidden] { display: none; }
.quote-stat span, .quote-total span, .detail-card small, .detail-grid small { color: var(--ink-soft); display: block; font-size: 11px; font-weight: 700; margin-bottom: 7px; text-transform: uppercase; }
.quote-stat strong { font-size: 18px; }
.quote-total { border-top: 1px solid var(--line); grid-column: 1 / -1; padding-top: 18px; }
.quote-total strong { font-size: 31px; }
	.quote-card label, .quote-card #slots-section, .quote-card .button { grid-column: 1 / -1; }
	.delivery-fields { display: grid; gap: 14px; grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.delivery-fields[hidden] { display: none; }
	.quote-card h2 { margin-bottom: 12px; }
.slots { display: grid; gap: 8px; grid-template-columns: repeat(3, 1fr); }
.slot { background: #f5f7f7; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; font-weight: 700; padding: 11px 5px; }
.slot.selected { background: var(--ink); border-color: var(--ink); color: white; }
.slot-message { color: var(--ink-soft); font-size: 13px; grid-column: 1 / -1; }

.detail-hero { align-items: baseline; background: var(--ink); border-radius: var(--radius); color: white; display: flex; justify-content: space-between; margin-bottom: 16px; padding: 24px; }
.detail-hero span { color: #bac4ca; font-size: 14px; }
.detail-hero strong { color: var(--accent); font-size: 38px; }
.detail-card { margin-bottom: 16px; padding: 22px; }
.detail-card p:last-child { margin-bottom: 0; }
.route-detail { display: grid; gap: 24px; }
.route-detail > div { padding-left: 25px; position: relative; }
.route-detail .route-dot { left: 0; position: absolute; top: 2px; }
.route-detail p { line-height: 1.45; margin: 0; }
	.detail-grid { display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); margin-bottom: 16px; padding: 20px; }
	.detail-grid strong { font-size: 14px; }
	.admin-hero { align-items: center; display: flex; justify-content: space-between; margin: 20px 0 30px; }
	.admin-hero h1 { margin: 0; }
	.admin-hero .text-link + .text-link { margin-left: 12px; }
	.text-link { color: #8a6500; display: inline-block; font-size: 13px; font-weight: 750; margin-top: 9px; }
	.count-pill { align-items: center; background: var(--accent); border-radius: 50%; display: flex; font-size: 20px; font-weight: 800; height: 52px; justify-content: center; width: 52px; }
	.filter-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 18px; padding: 20px; }
	.filter-card .button { grid-column: 1 / -1; }
	.metric-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 18px; }
	.metric-grid > div { background: var(--card); border-radius: 16px; box-shadow: 0 8px 25px rgba(23, 42, 58, .055); padding: 18px; }
	.metric-grid small { color: var(--ink-soft); display: block; font-size: 10px; font-weight: 800; margin-bottom: 8px; text-transform: uppercase; }
	.metric-grid strong { font-size: 18px; }
	.customer-card { align-items: center; background: var(--card); border: 1px solid rgba(23, 42, 58, .06); border-radius: var(--radius); box-shadow: 0 8px 25px rgba(23, 42, 58, .055); display: flex; gap: 14px; justify-content: space-between; padding: 20px; }
	.customer-card h2 { margin: 0 0 6px; }
	.customer-card p, .customer-card small { color: var(--ink-soft); font-size: 13px; margin: 0; }
	.customer-stats { display: grid; gap: 7px; text-align: right; white-space: nowrap; }
	.customer-stats span { color: var(--ink-soft); font-size: 11px; font-weight: 800; text-transform: uppercase; }
	.customer-stats strong { font-size: 15px; }
	.settings-page { display: grid; gap: 18px; }
.settings-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); display: grid; gap: 22px; padding: clamp(20px, 5vw, 30px); }
.settings-heading { align-items: flex-start; display: flex; gap: 14px; }
.settings-heading > span { align-items: center; background: var(--ink); border-radius: 10px; color: var(--accent); display: flex; flex: 0 0 38px; font-size: 12px; font-weight: 800; height: 38px; justify-content: center; }
.settings-heading h2 { margin: 0 0 5px; }
.settings-heading p { color: var(--ink-soft); font-size: 12px; margin: 0; }
.field-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.full-field { grid-column: 1 / -1; }
	.inline-checks { display: flex; flex-wrap: wrap; gap: 14px; }
	.check-field { align-items: center; display: flex; gap: 9px; }
.check-field input { accent-color: var(--ink); height: 18px; padding: 0; width: 18px; }
.hours-list { display: grid; gap: 9px; }
.hours-row { align-items: center; border-bottom: 1px solid var(--line); display: grid; gap: 8px; grid-template-columns: minmax(120px, 1fr) 100px auto 100px; padding: 9px 0; }
.hours-row input[type="time"] { padding: 10px; }
.hours-row > span { color: var(--ink-soft); font-size: 11px; }
.block-list { border-top: 1px solid var(--line); display: grid; }
.block-list > div { align-items: center; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; padding: 12px 0; }
.block-list p { font-size: 13px; margin: 0; }
.block-list small { color: var(--ink-soft); }
.danger-text { color: var(--danger); }
.success-message { background: #dff3eb; border-radius: 13px; color: var(--success); font-size: 13px; font-weight: 700; padding: 14px 16px; }
.error-page { margin: 14vh auto; max-width: 500px; text-align: center; }
.error-page > span { color: var(--accent-dark); font-size: 72px; font-weight: 800; }

@media (min-width: 720px) {
    .page-shell { padding-top: 38px; }
    .bottom-nav { border: 1px solid var(--line); border-radius: 22px; bottom: 18px; left: 50%; max-width: 500px; right: auto; transform: translateX(-50%); width: calc(100% - 36px); }
    .ride-card { grid-template-columns: 58px minmax(0, 1fr) auto; padding: 22px; }
    .ride-price { grid-column: 3; grid-row: 1; padding-top: 4px; }
    .map { height: 350px; }
    .booking-panel { margin-left: 26px; margin-right: 26px; }
}

@media (max-width: 420px) {
    .topbar { height: 64px; padding: 0 18px; }
    .page-shell { padding-left: 16px; padding-right: 16px; }
	    .detail-grid { grid-template-columns: 1fr; }
	    .field-grid { grid-template-columns: 1fr; }
	    .filter-card, .delivery-fields, .metric-grid { grid-template-columns: 1fr; }
	    .full-field { grid-column: auto; }
	    .customer-card { align-items: flex-start; flex-direction: column; }
	    .customer-stats { text-align: left; }
	    .hours-row { grid-template-columns: 1fr 1fr; }
    .hours-row .check-field { grid-column: 1 / -1; }
    .hours-row > span { display: none; }
}
