:root {
    --bg: #f6f8fb;
    --panel: #ffffff;
    --ink: #1f2937;
    --muted: #667085;
    --line: #e5e7eb;
    --brand: #0f766e;
    --brand-dark: #0b5f59;
    --blue: #2563eb;
    --orange: #f97316;
    --ok: #039855;
    --warn: #dc6803;
    --bad: #d92d20;
    --soft-teal: #ecfdf5;
    --soft-blue: #eff6ff;
    --soft-orange: #fff7ed;
    --soft-green: #ecfdf3;
    --soft-yellow: #fffaeb;
    --soft-red: #fef3f2;
    --shadow: 0 18px 45px rgba(31, 41, 55, .08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, .10), transparent 30%),
        radial-gradient(circle at top right, rgba(249, 115, 22, .10), transparent 28%),
        var(--bg);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
}

a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }

.shell {
    display: grid;
    grid-template-columns: 270px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: rgba(255,255,255,.86);
    border-right: 1px solid var(--line);
    backdrop-filter: blur(18px);
    padding: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 0;
    margin-bottom: 24px;
    line-height: 1.15;
}

.brand::before {
    content: "LBS";
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand), var(--blue));
    color: white;
    font-size: 13px;
    letter-spacing: 0;
}

.nav a, .nav button {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 44px;
    padding: 11px 13px;
    border-radius: 12px;
    color: #475467;
    background: transparent;
    border: 0;
    text-align: left;
    font-weight: 800;
    cursor: pointer;
    margin-bottom: 7px;
}

.nav a:hover, .nav button:hover {
    background: var(--soft-teal);
    color: var(--brand);
}

.content {
    padding: 28px;
    max-width: 1180px;
    width: 100%;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-bottom: 22px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.pwa-btn {
    min-height: 38px;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 13px;
}

.pwa-btn:disabled {
    background: var(--soft-green);
    border-color: #abefc6;
    color: var(--ok);
}

.eyebrow {
    margin: 0 0 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .08em;
}

h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(28px, 4vw, 42px); letter-spacing: -0.05em; margin-bottom: 0; line-height: 1.05; }
h2 { font-size: clamp(22px, 3vw, 32px); letter-spacing: -0.04em; margin-bottom: 10px; line-height: 1.12; }
h3 { font-size: 20px; letter-spacing: -0.025em; margin-bottom: 8px; }

.user-pill {
    background: rgba(255,255,255,.9);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 10px 14px;
    font-weight: 900;
    color: var(--ink);
    white-space: nowrap;
}

.grid {
    display: grid;
    gap: 18px;
}

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

.panel, .card, .resource-card, .hero-panel, .choice-card {
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(229,231,235,.9);
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.panel { padding: 22px; margin-bottom: 22px; }
.card { padding: 20px; }

.hero-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 22px;
    padding: clamp(24px, 4vw, 36px);
    margin-bottom: 22px;
    background: linear-gradient(135deg, rgba(236,253,245,.95), rgba(239,246,255,.95));
}

.hero-subtitle {
    font-weight: 900;
    color: var(--ink);
}

.care-notice {
    display: grid;
    grid-template-columns: 46px 1fr;
    gap: 14px;
    align-items: start;
    margin-bottom: 22px;
    padding: 18px;
    border: 1px solid #fedf89;
    border-radius: 20px;
    background: linear-gradient(135deg, #fffaeb, #ffffff);
    box-shadow: var(--shadow);
}

.care-notice h3 {
    margin-bottom: 6px;
    font-size: 19px;
    line-height: 1.25;
}

.care-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: var(--warn);
    color: #fff;
    font-size: 22px;
    font-weight: 900;
}

.booking-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 22px;
}

.choice-card {
    min-height: 230px;
    padding: 26px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease;
}

.choice-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 24px 55px rgba(31, 41, 55, .12);
}

.choice-card.car { background: linear-gradient(145deg, #ffffff, var(--soft-teal)); }
.choice-card.room { background: linear-gradient(145deg, #ffffff, var(--soft-orange)); }

.choice-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 18px;
    color: white;
    font-size: 13px;
    font-weight: 900;
    background: var(--brand);
}

.choice-card.room .choice-icon { background: var(--orange); }

.choice-arrow {
    align-self: flex-start;
    border-radius: 999px;
    background: white;
    border: 1px solid var(--line);
    padding: 9px 13px;
    font-weight: 900;
}

.section-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
}

.soft-panel { background: rgba(255,255,255,.72); }

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

.resource-card {
    padding: 22px;
    min-width: 0;
}

.resource-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.meta {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 7px 11px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.badge.available { background: var(--soft-green); color: var(--ok); }
.badge.in_use { background: var(--soft-blue); color: var(--blue); }
.badge.overdue { background: var(--soft-red); color: var(--bad); }
.badge.maintenance { background: #f2f4f7; color: #475467; }
.badge.reserved { background: var(--soft-yellow); color: var(--warn); }
.badge.completed { background: var(--soft-green); color: var(--ok); }
.badge.cancelled { background: #f2f4f7; color: #475467; }

.active-box, .schedule-strip {
    border-radius: 16px;
    padding: 14px;
    margin-top: 14px;
}

.active-box { background: var(--soft-blue); }
.schedule-strip { background: #f9fafb; }

.schedule-line, .mini-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
}

.schedule-line:first-of-type, .mini-item:first-child { border-top: 0; }

.mini-list { display: grid; gap: 4px; }
.mini-item span { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.actions.compact { margin-top: 0; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1px solid var(--line);
    background: white;
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 900;
    cursor: pointer;
}

.btn.primary { background: var(--brand); border-color: var(--brand); color: white; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.success { background: var(--blue); border-color: var(--blue); color: white; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: white; }
.btn.whatsapp { background: #12b76a; border-color: #12b76a; color: white; }
.btn.disabled, .btn:disabled {
    opacity: .58;
    cursor: not-allowed;
    pointer-events: none;
}

.notice {
    border-radius: 14px;
    padding: 13px 15px;
    margin-bottom: 16px;
    font-weight: 800;
}

.notice.success { background: var(--soft-green); color: var(--ok); }
.notice.error { background: var(--soft-red); color: var(--bad); }

.form-card { max-width: 820px; }
.booking-form-card {
    max-width: none;
}

.booking-form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 390px);
    gap: 22px;
    align-items: start;
}

.booking-input-panel {
    min-width: 0;
}

.booking-form-layout .grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.field { margin-bottom: 16px; }
.field label {
    display: block;
    font-size: 13px;
    color: var(--muted);
    font-weight: 900;
    margin-bottom: 7px;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    background: #f9fafb;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    color: var(--ink);
    font-weight: 900;
}

.check-row input {
    width: 18px;
    height: 18px;
}

.email-toggle {
    margin-bottom: 16px;
}

.email-help {
    border: 1px solid #bfdbfe;
    border-radius: 16px;
    padding: 14px;
    background: var(--soft-blue);
    color: var(--ink);
}

.email-help strong {
    display: block;
    margin-bottom: 5px;
}

.email-help p {
    margin-bottom: 0;
    color: var(--muted);
}

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

.check-grid.single {
    grid-template-columns: minmax(0, 1fr);
}

.check-card {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 11px 12px;
    background: #fff;
    color: var(--ink);
    font-weight: 900;
    cursor: pointer;
}

.check-card input {
    width: 17px;
    height: 17px;
}

.input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 13px 14px;
    font-size: 15px;
    background: white;
    outline: none;
}

.input:focus, select:focus, textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(15,118,110,.10);
}

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

.readonly {
    background: #f9fafb;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 13px 14px;
    font-weight: 900;
}

.availability-checker {
    position: sticky;
    top: 24px;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 18px;
    background: linear-gradient(180deg, #ffffff, #fbfcfe);
    box-shadow: 0 14px 34px rgba(31, 41, 55, .07);
}

.availability-title h3 {
    margin-bottom: 16px;
    font-size: 20px;
    line-height: 1.15;
    letter-spacing: 0;
}

.calendar-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    font-weight: 900;
    cursor: pointer;
    line-height: 1;
}

.calendar-weekdays,
.booking-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.calendar-weekdays {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-align: center;
}

.booking-calendar > span {
    min-height: 40px;
}

.calendar-day {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    min-height: 40px;
    aspect-ratio: 1;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    font-weight: 900;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.calendar-day:hover {
    border-color: var(--brand);
}

.calendar-day.selected {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.calendar-day.has-booking {
    background: var(--soft-yellow);
    border-color: #fedf89;
}

.calendar-day.selected.has-booking {
    background: var(--brand);
    border-color: var(--brand);
}

.calendar-day:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.calendar-day i {
    position: absolute;
    bottom: 6px;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--warn);
}

.calendar-day.selected i {
    background: #fff;
}

.slot-panel {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

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

.slot-list span {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    border-radius: 999px;
    padding: 8px 11px;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.slot-list .empty-slot {
    background: var(--soft-green);
    color: var(--ok);
    border-color: #abefc6;
}

.slot-warning {
    display: none;
    margin: 12px 0 0;
    border-radius: 12px;
    padding: 11px 12px;
    background: var(--soft-red);
    color: var(--bad);
    font-weight: 900;
}

.slot-warning.show {
    display: block;
}

.checkout-form {
    display: grid;
    gap: 10px;
    min-width: 240px;
}

.upload-box {
    display: grid;
    gap: 7px;
    border: 1px dashed #98a2b3;
    border-radius: 14px;
    padding: 12px;
    background: #f9fafb;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.upload-box small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.upload-box input {
    width: 100%;
    font-size: 12px;
}

.photo-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.photo-strip a {
    display: block;
    width: 54px;
    height: 54px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: #fff;
}

.photo-strip img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

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

.filter-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 180px 180px auto auto;
    gap: 10px;
    align-items: center;
}

.booking-filter {
    grid-template-columns: minmax(220px, 1fr) 150px 170px 150px 150px auto auto;
    margin-top: 18px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
    margin: 18px 0 4px;
}

.summary-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px;
}

.summary-card span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.summary-card strong {
    display: block;
    margin-top: 6px;
    font-size: 24px;
    letter-spacing: -.04em;
}

.log-details {
    margin-top: 8px;
}

.log-details summary {
    cursor: pointer;
    color: var(--brand);
    font-weight: 900;
}

.log-details pre {
    max-width: 520px;
    max-height: 260px;
    overflow: auto;
    background: #111827;
    color: #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    font-size: 12px;
    line-height: 1.45;
    white-space: pre-wrap;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 18px;
    overflow: hidden;
}

th, td {
    padding: 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    background: #f9fafb;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-public-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: 24px;
    align-items: start;
    max-width: 1280px;
    margin: 0 auto;
    padding: clamp(18px, 4vw, 36px);
}

.login-preview {
    display: grid;
    gap: 22px;
}

.public-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    padding: clamp(24px, 4vw, 42px);
    border-radius: 28px;
    background:
        linear-gradient(135deg, rgba(236,253,245,.96), rgba(239,246,255,.96)),
        white;
    border: 1px solid rgba(229,231,235,.9);
    box-shadow: var(--shadow);
}

.public-hero h1 {
    max-width: 760px;
    margin-bottom: 14px;
}

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

.availability-panel {
    background: rgba(255,255,255,.94);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.public-resource-list {
    display: grid;
    gap: 12px;
}

.public-resource-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
}

.public-resource-item strong,
.public-resource-item span {
    display: block;
}

.public-resource-item span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.login-card {
    width: 100%;
    max-width: 430px;
    background: rgba(255,255,255,.94);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 30px;
    box-shadow: var(--shadow);
}

.public-login-card {
    position: sticky;
    top: 24px;
    max-width: none;
}

@media (max-width: 960px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar {
        position: sticky;
        top: 0;
        z-index: 20;
        padding: 14px 16px;
    }
    .brand { margin-bottom: 12px; font-size: 20px; }
    .brand::before { width: 34px; height: 34px; border-radius: 11px; }
    .nav {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 2px;
    }
    .nav a, .nav button {
        width: auto;
        white-space: nowrap;
        margin-bottom: 0;
        min-height: 40px;
    }
    .content { padding: 18px; }
    .topbar { align-items: flex-start; flex-direction: column; }
    .topbar-actions {
        width: 100%;
        justify-content: flex-start;
    }
    .user-pill { white-space: normal; }
    .hero-panel { align-items: flex-start; flex-direction: column; }
    .care-notice {
        grid-template-columns: 1fr;
    }
    .login-public-page { grid-template-columns: 1fr; }
    .public-login-card { position: static; }
    .public-hero { align-items: flex-start; flex-direction: column; }
    .booking-choice-grid, .resource-grid, .availability-grid, .grid.two, .grid.three { grid-template-columns: 1fr; }
    .booking-form-layout {
        grid-template-columns: 1fr;
    }
    .booking-form-layout .grid.three {
        grid-template-columns: 1fr;
    }
    .check-grid {
        grid-template-columns: 1fr;
    }
    .availability-checker {
        position: static;
    }
    .filter-bar { grid-template-columns: 1fr; }
    .booking-filter { grid-template-columns: 1fr; }
    .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .content { padding: 14px; }
    .panel, .card, .resource-card, .choice-card, .hero-panel { border-radius: 18px; padding: 18px; }
    .login-public-page { padding: 14px; }
    .public-hero, .availability-panel, .login-card { border-radius: 20px; padding: 18px; }
    .public-resource-item {
        align-items: stretch;
        flex-direction: column;
    }
    .choice-card { min-height: 190px; }
    .resource-head, .section-head {
        align-items: flex-start;
        flex-direction: column;
    }
    .actions, .actions form, .btn {
        width: 100%;
    }
    .topbar-actions .btn,
    .topbar-actions .user-pill {
        width: 100%;
    }
    .availability-checker {
        padding: 12px;
    }
    .availability-title h3 {
        font-size: 18px;
    }
    .calendar-weekdays,
    .booking-calendar {
        gap: 5px;
    }
    .booking-calendar > span,
    .calendar-day {
        min-height: 36px;
    }
    .calendar-weekdays {
        font-size: 11px;
    }
    .actions.compact {
        gap: 8px;
    }
    .responsive-table,
    .responsive-table thead,
    .responsive-table tbody,
    .responsive-table tr,
    .responsive-table th,
    .responsive-table td {
        display: block;
        width: 100%;
    }
    .responsive-table thead { display: none; }
    .responsive-table tr {
        border: 1px solid var(--line);
        border-radius: 16px;
        padding: 12px;
        margin-bottom: 12px;
        background: white;
    }
    .responsive-table td {
        border-bottom: 0;
        padding: 8px 0;
    }
    .responsive-table td::before {
        content: attr(data-label);
        display: block;
        color: var(--muted);
        font-size: 11px;
        font-weight: 900;
        text-transform: uppercase;
        letter-spacing: .04em;
        margin-bottom: 4px;
    }
}
