* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: #172026;
    background: #f5f7f8;
}

a {
    color: inherit;
    text-decoration: none;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 16px 7vw;
    background: #ffffff;
    border-bottom: 1px solid #dde4e8;
}

.brand {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    font-weight: 800;
    color: #111827;
}

.brand img {
    width: clamp(260px, 34vw, 460px);
    height: 86px;
    border-radius: 0;
    object-fit: contain;
    object-position: center;
    display: block;
}

nav {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

nav a {
    padding: 9px 10px;
    border-radius: 6px;
    color: #44525c;
    font-weight: 700;
}

nav a.active,
.nav-button,
nav a:hover {
    background: #e7f4f1;
    color: #0b6b5c;
}

.page {
    width: min(1180px, 92vw);
    margin: 0 auto;
    padding: 32px 0 60px;
}

.hero {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 24px;
    align-items: center;
    margin-bottom: 26px;
}

.hero-copy h1 {
    margin: 0 0 12px;
    font-size: clamp(32px, 5vw, 58px);
    line-height: 1;
}

.hero-copy p {
    margin: 0;
    color: #60707c;
    font-size: 18px;
    line-height: 1.6;
}

.hero-panel,
.card,
.form-panel,
.metric,
.table-wrap {
    background: #ffffff;
    border: 1px solid #dde4e8;
    border-radius: 8px;
    box-shadow: 0 14px 40px rgba(23, 32, 38, 0.06);
}

.hero-panel {
    padding: 22px;
}

.search-grid,
.form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

label {
    display: block;
    color: #4e5e69;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 7px;
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid #cbd6dc;
    border-radius: 6px;
    padding: 10px 11px;
    background: #ffffff;
    color: #172026;
    font: inherit;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 0;
    border-radius: 6px;
    padding: 10px 16px;
    background: #0b6b5c;
    color: #ffffff;
    font-weight: 800;
    cursor: pointer;
}

.button.secondary,
button.secondary {
    background: #e8edf0;
    color: #25323a;
}

.button.danger,
button.danger {
    background: #b42318;
}

.section-title {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin: 20px 0 14px;
}

.section-title h2,
.section-title h1 {
    margin: 0;
}

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

.card {
    overflow: hidden;
}

.car-image {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
    background: #dce5e8;
}

.card-body {
    padding: 16px;
}

.car-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 12px 0;
}

.tag,
.status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #eef3f5;
    color: #43535e;
    font-size: 12px;
    font-weight: 800;
}

.status.available,
.status.confirmed,
.status.paid,
.status.completed {
    background: #dff4e8;
    color: #166534;
}

.status.pending,
.status.unpaid {
    background: #fff3cf;
    color: #854d0e;
}

.status.cancelled,
.status.maintenance {
    background: #fee2e2;
    color: #991b1b;
}

.price {
    font-size: 22px;
    font-weight: 900;
    color: #0b6b5c;
}

.price-tiers {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 10px 0 12px;
}

.price-tiers span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 9px;
    border-radius: 999px;
    background: #eef3f5;
    color: #43535e;
    font-size: 12px;
    font-weight: 900;
}

.price-tiers-panel {
    margin-top: -4px;
}

.muted {
    color: #667783;
}

.form-panel {
    padding: 22px;
    max-width: 760px;
}

.auth-panel {
    max-width: 440px;
    margin: 40px auto;
}

.stack {
    display: grid;
    gap: 14px;
}

.flash {
    width: min(1180px, 92vw);
    margin: 18px auto 0;
    border-radius: 6px;
    padding: 12px 14px;
    font-weight: 800;
}

.flash.success {
    background: #dff4e8;
    color: #166534;
}

.flash.error {
    background: #fee2e2;
    color: #991b1b;
}

.detail-layout,
.admin-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 22px;
}

.admin-layout {
    grid-template-columns: 220px 1fr;
    align-items: start;
}

.admin-nav {
    position: sticky;
    top: 84px;
    display: grid;
    gap: 8px;
    padding: 12px;
    background: #ffffff;
    border: 1px solid #dde4e8;
    border-radius: 8px;
}

.admin-nav a {
    padding: 11px 12px;
    border-radius: 6px;
    color: #43535e;
    font-weight: 800;
}

.admin-nav a.active,
.admin-nav a:hover {
    background: #e7f4f1;
    color: #0b6b5c;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.metric {
    padding: 18px;
}

.metric strong {
    display: block;
    margin-top: 8px;
    font-size: 28px;
}

.table-wrap {
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

th,
td {
    padding: 13px 14px;
    border-bottom: 1px solid #e5ebef;
    text-align: left;
    vertical-align: middle;
}

th {
    color: #53636f;
    font-size: 13px;
}

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.whatsapp-button {
    background: #1f9d55;
}

.whatsapp-outline {
    background: #e5f7ec;
    color: #166534;
}

.small-button {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 13px;
}

.inline-form {
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.booking-list,
.backoffice-list {
    display: grid;
    gap: 16px;
}

.booking-card,
.backoffice-booking,
.empty-state {
    background: #ffffff;
    border: 1px solid #dde4e8;
    border-radius: 8px;
    box-shadow: 0 14px 40px rgba(23, 32, 38, 0.06);
}

.booking-card {
    display: grid;
    grid-template-columns: 180px 1fr 220px;
    gap: 18px;
    padding: 14px;
}

.booking-thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 8px;
    background: #dce5e8;
}

.booking-main,
.booking-side {
    min-width: 0;
}

.booking-heading {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.booking-heading h2,
.backoffice-car h2,
.empty-state h2 {
    margin: 4px 0 6px;
    font-size: 20px;
}

.eyebrow {
    display: block;
    color: #667783;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.status-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.booking-facts,
.admin-info-grid {
    display: grid;
    gap: 10px;
}

.booking-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.booking-facts div,
.info-block,
.amount-pair > div {
    padding: 12px;
    background: #f7fafb;
    border: 1px solid #e2e9ed;
    border-radius: 8px;
}

.booking-facts span,
.info-block span,
.amount-pair span {
    display: block;
    margin-bottom: 6px;
    color: #667783;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.booking-location {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5ebef;
}

.booking-location p,
.info-block p {
    margin: 5px 0 0;
    color: #51616d;
    line-height: 1.45;
}

.booking-side {
    display: grid;
    align-content: space-between;
    gap: 16px;
    padding-left: 18px;
    border-left: 1px solid #e5ebef;
}

.booking-side strong:not(.price) {
    display: inline-block;
    margin: 4px 0 7px;
    font-size: 18px;
}

.booking-side .actions,
.backoffice-actions .actions {
    align-items: stretch;
}

.empty-state {
    padding: 28px;
    text-align: center;
}

.backoffice-booking {
    display: grid;
    gap: 16px;
    padding: 16px;
}

.backoffice-car {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 14px;
    align-items: start;
}

.admin-info-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.backoffice-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    align-items: end;
    padding-top: 14px;
    border-top: 1px solid #e5ebef;
}

.amount-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 180px));
    gap: 10px;
}

.amount-pair strong {
    display: block;
    margin-bottom: 5px;
    color: #0b6b5c;
    font-size: 18px;
}

.amount-pair a {
    color: #0b6b5c;
    font-weight: 900;
}

.amount-pair em {
    color: #854d0e;
    font-style: normal;
    font-weight: 900;
}

.status-form {
    display: grid;
    grid-template-columns: 150px 150px auto;
    gap: 8px;
    align-items: end;
}

.year-filter {
    display: grid;
    grid-template-columns: auto 150px;
    gap: 8px;
    align-items: center;
}

.year-filter label {
    margin: 0;
}

.month-filter {
    display: grid;
    grid-template-columns: 160px auto;
    gap: 8px;
    align-items: center;
}

.schedule-board {
    overflow: hidden;
    background: #101214;
    border: 1px solid #252a2e;
    border-radius: 8px;
    box-shadow: 0 14px 40px rgba(23, 32, 38, 0.12);
}

.schedule-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    color: #ffffff;
    border-bottom: 1px solid #252a2e;
}

.schedule-title strong {
    font-size: 24px;
}

.schedule-weekdays,
.schedule-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.schedule-weekdays span {
    padding: 12px 10px;
    color: #8b9299;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0;
    text-align: center;
    text-transform: uppercase;
    border-bottom: 1px solid #252a2e;
}

.schedule-day {
    min-height: 142px;
    padding: 10px 6px;
    background: #0d0f10;
    border-right: 1px solid #202529;
    border-bottom: 1px solid #202529;
}

.schedule-day:nth-child(7n) {
    border-right: 0;
}

.schedule-day.today {
    background: #1b1e20;
}

.schedule-day.muted-month {
    background: #0a0b0c;
}

.schedule-day-number {
    margin-bottom: 8px;
    color: #f3f4f6;
    font-size: 20px;
    font-weight: 900;
    text-align: center;
}

.muted-month .schedule-day-number {
    color: #565d63;
}

.schedule-day:nth-child(7n + 1) .schedule-day-number {
    color: #e05b6a;
}

.schedule-events {
    display: grid;
    gap: 5px;
}

.schedule-event {
    display: block;
    min-height: 34px;
    padding: 5px 7px;
    overflow: hidden;
    border-radius: 5px;
    color: #ffffff;
    font-weight: 900;
    line-height: 1.15;
}

.schedule-event strong,
.schedule-event span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.schedule-event span {
    margin-top: 2px;
    font-size: 12px;
    opacity: 0.95;
}

.schedule-event.blue {
    background: #2f80b9;
}

.schedule-event.pink {
    background: #b5456f;
}

.schedule-event.teal {
    background: #2b9397;
}

.schedule-event.green {
    background: #259766;
}

.schedule-event.brown {
    background: #73645d;
}

.schedule-event.gold {
    background: #b5822d;
}

.financial-upload-form {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.finance-metrics .metric strong {
    font-size: 24px;
}

.finance-grid {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 16px;
}

.finance-panel {
    padding: 18px;
    background: #ffffff;
    border: 1px solid #dde4e8;
    border-radius: 8px;
    box-shadow: 0 14px 40px rgba(23, 32, 38, 0.06);
}

.selected-row td {
    background: #eef9f6;
}

.month-drill-link {
    color: #0b6b5c;
    font-weight: 900;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.detail-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.detail-metrics > div {
    padding: 13px;
    border: 1px solid #e2e9ed;
    border-radius: 8px;
    background: #f7fafb;
}

.detail-metrics span {
    display: block;
    margin-bottom: 6px;
    color: #667783;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.detail-metrics strong {
    color: #172026;
    font-size: 18px;
}

.compact-empty {
    box-shadow: none;
}

.panel-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.panel-heading h2 {
    margin: 0;
    font-size: 20px;
}

.cashflow-bars {
    display: grid;
    grid-template-columns: repeat(12, minmax(28px, 1fr));
    gap: 9px;
    min-height: 260px;
    align-items: end;
    padding: 10px 4px 0;
}

.cashflow-month {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.bar-pair {
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 4px;
    height: 210px;
    padding: 8px 4px;
    background: #f7fafb;
    border: 1px solid #e2e9ed;
    border-radius: 8px;
}

.bar {
    width: 9px;
    min-height: 3px;
    border-radius: 999px 999px 0 0;
}

.bar.in {
    background: #0b6b5c;
}

.bar.out {
    background: #b42318;
}

.cashflow-month small {
    color: #667783;
    font-size: 10px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.legend {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    color: #53636f;
    font-weight: 800;
}

.legend i {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 6px;
    border-radius: 50%;
}

.legend-in {
    background: #0b6b5c;
}

.legend-out {
    background: #b42318;
}

.category-list {
    display: grid;
    gap: 13px;
}

.category-row > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 7px;
}

.category-row strong {
    color: #172026;
}

.category-row span {
    color: #667783;
    font-weight: 800;
}

.category-track {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #edf3f5;
}

.category-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #0b6b5c;
}

.positive-text {
    color: #166534;
    font-weight: 900;
}

.negative-text {
    color: #991b1b;
    font-weight: 900;
}

.bank-panel {
    display: grid;
    gap: 6px;
    padding: 14px;
    border: 1px solid #b8d8d1;
    border-radius: 8px;
    background: #eef9f6;
    color: #174a40;
}

.bank-panel strong {
    color: #0b6b5c;
}

.booking-estimate {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 14px;
    border: 1px solid #d8e2e7;
    border-radius: 8px;
    background: #f7fafb;
}

.booking-estimate > span {
    grid-column: 1 / -1;
    color: #667783;
}

.booking-estimate div {
    padding: 10px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #e2e9ed;
}

.booking-estimate span {
    display: block;
    margin-bottom: 5px;
    color: #667783;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.booking-estimate strong {
    color: #172026;
}

.estimate-error {
    color: #991b1b !important;
}

.check-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0 0;
    color: #174a40;
}

.check-line input {
    width: auto;
    min-height: 0;
}

.admin-car-preview {
    width: min(260px, 100%);
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #dde4e8;
    background: #dce5e8;
}

.whatsapp-admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 16px;
    align-items: start;
}

.whatsapp-preview {
    display: grid;
    gap: 14px;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #dde4e8;
    border-radius: 8px;
    box-shadow: 0 14px 40px rgba(23, 32, 38, 0.06);
}

.whatsapp-preview h2 {
    margin: 0;
    font-size: 22px;
}

.message-preview {
    display: grid;
    gap: 8px;
    padding: 16px;
    border-radius: 8px;
    background: #effaf4;
    border: 1px solid #cdebd8;
    color: #174a40;
}

.message-preview p {
    margin: 0;
}

.message-preview small {
    margin-top: 4px;
    color: #4f6f64;
    line-height: 1.5;
}

.admin-tip {
    padding: 14px;
    border-radius: 8px;
    background: #f7fafb;
    border: 1px solid #e2e9ed;
}

.admin-tip p {
    margin: 6px 0 0;
    color: #53636f;
    line-height: 1.45;
}

.field-error {
    margin: 7px 0 0;
    color: #991b1b;
    font-weight: 800;
}

@media (max-width: 900px) {
    .hero,
    .detail-layout,
    .admin-layout,
    .search-grid,
    .form-grid,
    .metrics,
    .booking-card,
    .backoffice-actions,
    .status-form,
    .finance-grid,
    .financial-upload-form,
    .whatsapp-admin-grid,
    .detail-metrics {
        grid-template-columns: 1fr;
    }

    .cars-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .booking-side {
        padding-left: 0;
        border-left: 0;
        border-top: 1px solid #e5ebef;
        padding-top: 14px;
    }

    .admin-info-grid,
    .amount-pair {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .schedule-board {
        overflow-x: auto;
    }

    .schedule-weekdays,
    .schedule-grid {
        min-width: 760px;
    }
}

@media (max-width: 640px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
        padding: 14px 5vw;
    }

    .brand img {
        width: min(340px, 90vw);
        height: auto;
    }

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

    .booking-facts,
    .admin-info-grid,
    .amount-pair,
    .backoffice-car,
    .booking-estimate {
        grid-template-columns: 1fr;
    }

    .month-filter {
        grid-template-columns: 1fr;
    }

    .schedule-title {
        align-items: flex-start;
        flex-direction: column;
    }
}
