:root {
    color-scheme: light;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    background: #f1f5f9;
    color: #1c2430;
    --bg: #f1f5f9;
    --surface: #ffffff;
    --border: #e2e8f0;
    --shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    --text: #0f172a;
    --muted: #64748b;
    --brand: #2563eb;
    --green-bg: #ecfdf3;
    --green-text: #067647;
    --blue-bg: #eff6ff;
    --blue-text: #1d4ed8;
    --orange-bg: #fff7ed;
    --orange-text: #c2410c;
    --red-bg: #fef2f2;
    --red-text: #b42318;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    min-height: 100svh;
}

a {
    color: var(--brand);
    text-decoration: none;
}

button,
.button-link {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    border: 0;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    display: inline-block;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.75rem 1rem;
}

.button-secondary {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
}

.button-whatsapp {
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

.install-app-button {
    white-space: nowrap;
}

.link-button {
    background: transparent;
    color: var(--brand);
    padding: 0;
}

.site-header {
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(14px);
    display: flex;
    justify-content: space-between;
    padding: calc(0.9rem + env(safe-area-inset-top)) 1.1rem 0.9rem;
}

.brand {
    color: var(--text);
    font-size: 1.2rem;
    font-weight: 700;
}

.top-nav,
.inline-links {
    align-items: center;
    display: flex;
    gap: 1rem;
}

.top-nav {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.top-nav-form {
    margin: 0;
}

.top-nav-button {
    border-radius: 999px;
    font-size: 0.85rem;
    padding: 0.45rem 0.75rem;
    white-space: nowrap;
}

.container {
    margin: 0 auto;
    max-width: 1280px;
    padding: 1.25rem 1rem calc(5.5rem + env(safe-area-inset-bottom));
}

.hero,
.grid-two,
.stats-grid,
.grid-cards,
.operations-grid {
    display: grid;
    gap: 1rem;
}

.hero,
.grid-two {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 1rem;
}

.operations-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    margin-bottom: 1rem;
}

.logistics-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.card,
.mini-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 1rem;
}

.mini-card {
    padding: 1rem;
}

.narrow {
    margin: 0 auto;
    max-width: 460px;
}

.section-head {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.9rem;
}

.operations-hero {
    align-items: flex-start;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.eyebrow,
.section-kicker {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin: 0 0 0.35rem;
    text-transform: uppercase;
}

.section-card {
    padding: 1rem;
}

.logistics-today-card {
    margin-bottom: 1rem;
}

.section-card-head {
    align-items: flex-start;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
}

h1 {
    font-size: clamp(1.65rem, 2.8vw, 2.3rem);
    line-height: 1.1;
    margin: 0 0 0.35rem;
}

h2 {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    line-height: 1.2;
}

h3 {
    font-size: 1rem;
}

.count-pill {
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.35rem 0.7rem;
}

.count-delivery {
    background: var(--blue-bg);
    color: var(--blue-text);
}

.count-return,
.status-reserved {
    background: var(--orange-bg);
    color: var(--orange-text);
}

.count-active,
.status-available {
    background: var(--green-bg);
    color: var(--green-text);
}

.status-rented {
    background: var(--red-bg);
    color: var(--red-text);
}

.logistics-panel {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
}

.logistics-delivery {
    background: linear-gradient(180deg, #f8fbff, #ffffff);
}

.logistics-return {
    background: linear-gradient(180deg, #fff8f1, #ffffff);
}

.logistics-checklist {
    background: linear-gradient(180deg, #f4fff7, #ffffff);
}

.logistics-panel-head {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.logistics-panel-head h3,
.route-block h4 {
    margin: 0;
}

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

.grid-form label,
.fieldset-full {
    display: flex;
    flex-direction: column;
    font-size: 0.95rem;
    gap: 0.35rem;
}

.field-full,
.fieldset-full {
    grid-column: 1 / -1;
}

input,
select,
textarea {
    border: 1px solid #ccd5e3;
    border-radius: 8px;
    font: inherit;
    padding: 0.75rem;
}

textarea {
    resize: vertical;
}

table {
    border-collapse: collapse;
    width: 100%;
}

thead th {
    background: #f8fafc;
    color: #334155;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

th,
td {
    border-bottom: 1px solid #e9edf4;
    padding: 0.7rem 0.5rem;
    text-align: left;
    vertical-align: top;
}

tbody tr:nth-child(even) {
    background: rgba(148, 163, 184, 0.07);
}

tbody tr:hover {
    background: rgba(37, 99, 235, 0.08);
}

.table-compact th,
.table-compact td {
    font-size: 0.93rem;
    padding: 0.6rem 0.45rem;
}

.muted {
    color: var(--muted);
}

.success {
    color: #067647;
}

.error {
    color: #b42318;
}

.stack-list,
.summary-list {
    margin: 0;
    padding-left: 1.1rem;
}

.booking-list {
    display: grid;
    gap: 1rem;
}

.booking-card {
    border: 1px solid #e3e7ef;
    border-radius: 12px;
    padding: 1rem;
}

.booking-head {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.booking-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.booking-actions form {
    margin: 0;
}

.simple-section {
    margin-bottom: 1.5rem;
}

.planning-grid {
    align-items: start;
}

.assistant-grid {
    align-items: start;
}

.assistant-shell {
    margin: 0 auto;
    max-width: 920px;
}

.assistant-form {
    display: grid;
    gap: 1rem;
}

.assistant-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.assistant-context {
    border-top: 1px solid var(--border);
    margin-top: 1.25rem;
    padding-top: 1.25rem;
}

.assistant-context pre {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.88rem;
    margin: 0;
    overflow-x: auto;
    padding: 1rem;
    white-space: pre-wrap;
}

.status-pill {
    background: #eef4ff;
    border-radius: 999px;
    color: var(--brand);
    padding: 0.3rem 0.75rem;
}

.inline-form {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.compact-form {
    margin-top: 0.75rem;
}

.actions-row {
    align-items: end;
    display: flex;
}

.top-gap {
    margin-top: 1rem;
}

.section-head.compact {
    margin-bottom: 0.75rem;
}

.status-chip {
    border: 1px solid transparent;
    border-radius: 999px;
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.3rem 0.8rem;
    text-transform: uppercase;
}

.status-maintenance,
.status-out_of_service {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
}

.checkbox {
    align-items: center;
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
}

.event-list {
    display: grid;
    gap: 0.85rem;
}

.event-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.9rem 1rem;
}

.event-delivery {
    background: linear-gradient(180deg, #f8fbff, #ffffff);
}

.event-return {
    background: linear-gradient(180deg, #fffaf5, #ffffff);
}

.event-main {
    display: flex;
    gap: 0.9rem;
    margin-bottom: 0.4rem;
}

.event-date {
    background: #f1f5f9;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    min-width: 72px;
    padding: 0.55rem 0.7rem;
    text-align: center;
}

.event-meta {
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.empty-state {
    color: var(--muted);
    margin: 0;
}

.stat-card h2,
.section-card h2 {
    margin: 0 0 0.35rem;
}

.stat-card p {
    margin: 0;
}

.table-wrap {
    overflow-x: auto;
}

.compact-list {
    display: grid;
    gap: 0.75rem;
}

.compact-item {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 12px;
    padding: 0.85rem;
}

.compact-item-head {
    align-items: center;
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
    margin-bottom: 0.45rem;
}

.compact-item-date {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.compact-item-line {
    font-size: 0.92rem;
    margin-top: 0.22rem;
}

.badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.item-badge {
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 0.28rem 0.58rem;
}

.item-badge-delivery {
    background: var(--blue-bg);
    color: var(--blue-text);
}

.item-badge-return {
    background: var(--orange-bg);
    color: var(--orange-text);
}

.item-badge-checklist {
    background: var(--green-bg);
    color: var(--green-text);
}

.mobile-bottom-nav {
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--border);
    bottom: 0;
    display: none;
    gap: 0.4rem;
    inset-inline: 0;
    padding: 0.5rem 0.75rem calc(0.5rem + env(safe-area-inset-bottom));
    position: fixed;
    z-index: 40;
}

.mobile-bottom-nav a {
    align-items: center;
    border-radius: 12px;
    color: var(--muted);
    display: flex;
    flex: 1;
    flex-direction: column;
    font-size: 0.72rem;
    font-weight: 700;
    gap: 0.2rem;
    padding: 0.5rem 0.25rem;
}

.mobile-bottom-nav a.active {
    background: #eff6ff;
    color: var(--brand);
}

.route-block {
    border-top: 1px solid var(--border);
    margin-top: 1rem;
    padding-top: 1rem;
}

.route-list {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.route-item {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
}

.route-city {
    align-items: center;
    display: flex;
    gap: 0.6rem;
}

.route-badge {
    align-items: center;
    background: var(--red-bg);
    border-radius: 999px;
    color: var(--red-text);
    display: inline-flex;
    font-size: 0.8rem;
    font-weight: 700;
    justify-content: center;
    min-width: 1.8rem;
    padding: 0.2rem 0.55rem;
}

.extra-badge {
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    color: #3730a3;
    display: inline-flex;
    font-size: 0.8rem;
    font-weight: 600;
    margin: 0.1rem 0.35rem 0.1rem 0;
    padding: 0.22rem 0.55rem;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
    }

    .container {
        padding-bottom: 6.5rem;
    }

    .site-header,
    .section-head,
    .operations-hero,
    .section-card-head,
    .event-main,
    .logistics-panel-head,
    .route-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .top-nav {
        gap: 0.5rem;
        justify-content: flex-start;
    }

    .top-nav a,
    .top-nav form {
        font-size: 0.88rem;
    }

    .inline-links {
        flex-wrap: wrap;
        gap: 0.6rem;
    }

    .logistics-grid {
        grid-template-columns: 1fr;
    }

    .table-wrap {
        overflow: visible;
    }

    .responsive-table,
    .responsive-table tbody,
    .responsive-table tr,
    .responsive-table td {
        display: block;
        width: 100%;
    }

    .responsive-table thead {
        display: none;
    }

    .responsive-table tbody {
        display: grid;
        gap: 1rem;
    }

    .responsive-table tbody tr {
        background: #ffffff;
        border: 1px solid var(--border);
        border-radius: 14px;
        box-shadow: var(--shadow);
        padding: 1rem;
    }

    .responsive-table tbody tr:nth-child(even),
    .responsive-table tbody tr:hover {
        background: #ffffff;
    }

    .responsive-table td {
        align-items: flex-start;
        border-bottom: 1px solid #eef2f7;
        display: flex;
        flex-direction: column;
        gap: 0.3rem;
        padding: 0.6rem 0;
    }

    .responsive-table td::before {
        color: var(--muted);
        content: attr(data-label);
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .responsive-table td:last-child {
        border-bottom: 0;
        padding-bottom: 0;
    }

    .assistant-actions button,
    .assistant-actions .button-link,
    .booking-actions button,
    .booking-actions .button-link {
        width: 100%;
    }

    .event-date {
        min-width: auto;
    }
}
