:root {
    --bg: #f5f7f8;
    --panel: #ffffff;
    --ink: #182227;
    --muted: #66757f;
    --line: #d8e1e6;
    --brand: #0f766e;
    --brand-dark: #0b4f4a;
    --warn: #b7791f;
    --danger: #b42318;
    --shadow: 0 12px 32px rgba(20, 34, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    letter-spacing: 0;
}

button,
input,
select {
    font: inherit;
}

button {
    border: 1px solid var(--brand);
    background: var(--brand);
    color: #ffffff;
    border-radius: 6px;
    min-height: 36px;
    padding: 0 14px;
    cursor: pointer;
}

button:hover {
    background: var(--brand-dark);
}

button:disabled {
    border-color: var(--line);
    background: #edf2f4;
    color: #8a9aa3;
    cursor: not-allowed;
}

button:disabled:hover {
    background: #edf2f4;
}

button.secondary,
button[data-action="edit"],
button[data-action="invoice"],
button[data-action="payment"],
button[data-action="contract"] {
    background: #ffffff;
    color: var(--brand-dark);
}

button.danger,
button[data-action="delete"],
button[data-action="unlink"] {
    border-color: var(--danger);
    background: #ffffff;
    color: var(--danger);
}

input,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    min-height: 36px;
    padding: 7px 9px;
    background: #ffffff;
    color: var(--ink);
}

.checkbox-line {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--ink);
}

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

.select-search {
    min-height: 34px;
    border-color: #c8d7df;
    background: #f8fbfb;
}

.select-search::placeholder {
    color: #8c9aa3;
}

.field-hint {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

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

.inspection-photos input[type="file"] {
    padding: 8px;
}

.inspection-photo-preview {
    display: grid;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbfb;
}

.inspection-upload-progress {
    display: grid;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #b9d7ff;
    border-radius: 8px;
    background: #f4f8ff;
    color: #10366c;
}

.inspection-upload-progress.hidden {
    display: none;
}

.progress-text {
    font-size: 13px;
    font-weight: 700;
}

.progress-bar {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #dbeafe;
}

.progress-bar span {
    display: block;
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: #2563eb;
    transition: width 0.2s ease;
}

.inspection-photo-group {
    display: grid;
    gap: 8px;
}

.inspection-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 8px;
}

.inspection-photo-item {
    position: relative;
    margin: 0;
}

.media-preview-button {
    display: block;
    position: relative;
    width: 100%;
    min-height: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    padding: 0;
    aspect-ratio: 4 / 3;
    cursor: zoom-in;
}

.media-preview-button:hover {
    border-color: var(--brand);
    background: #ffffff;
}

.inspection-photo-grid img,
.inspection-photo-grid video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.media-play-badge {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: rgba(16, 32, 35, 0.78);
    color: #ffffff;
    font-size: 16px;
    box-shadow: 0 6px 18px rgba(20, 34, 42, 0.22);
}

.inspection-photo-item figcaption {
    position: absolute;
    left: 6px;
    top: 6px;
    max-width: calc(100% - 12px);
    overflow: hidden;
    border-radius: 999px;
    background: rgba(16, 32, 35, 0.82);
    color: #ffffff;
    padding: 3px 7px;
    font-size: 11px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.photo-delete {
    position: absolute;
    right: 6px;
    bottom: 6px;
    min-height: 28px;
    border-color: rgba(180, 35, 24, 0.75);
    background: rgba(255, 255, 255, 0.92);
    color: var(--danger);
    padding: 0 8px;
    font-size: 12px;
    box-shadow: 0 4px 12px rgba(20, 34, 42, 0.12);
}

.photo-delete:hover {
    background: #fff1f0;
}

.row-actions select.contract-layout {
    width: auto;
    min-width: 132px;
    min-height: 36px;
    color: var(--ink);
}

label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 13px;
}

h1,
h2,
h3,
p {
    margin: 0;
}

h1 {
    font-size: 24px;
}

h2 {
    font-size: 22px;
}

h3 {
    font-size: 16px;
    margin-bottom: 12px;
}

.app-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    background: #102023;
    color: #ffffff;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar .eyebrow {
    color: #8fd2ca;
}

.brand-block {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 72px;
    height: auto;
    max-height: 52px;
    border-radius: 10px;
    background: #ffffff;
    object-fit: contain;
    padding: 5px;
    box-shadow: inset 0 -3px 0 rgba(44, 65, 154, 0.12);
}

.tabs {
    display: grid;
    gap: 8px;
}

.tab {
    justify-content: flex-start;
    text-align: left;
    border-color: transparent;
    background: transparent;
    color: #d8e7e5;
}

.tab.active,
.tab:hover {
    background: #1f3a3d;
    color: #ffffff;
}

.settings-form {
    display: grid;
    gap: 10px;
}

.settings-panel {
    margin-top: auto;
    display: grid;
    gap: 10px;
}

.settings-panel summary {
    cursor: pointer;
    color: #d8e7e5;
    font-weight: 700;
}

.settings-panel[open] summary {
    margin-bottom: 10px;
}

.main {
    padding: 26px;
    min-width: 0;
}

.panel {
    display: none;
}

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

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

.eyebrow {
    color: var(--brand);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
    margin-bottom: 5px;
}

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

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

.surface {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    box-shadow: var(--shadow);
}

.reservation-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr)) auto;
    align-items: end;
    gap: 12px;
    box-shadow: none;
}

.calendar-toolbar {
    display: grid;
    grid-template-columns: auto minmax(160px, 220px) minmax(220px, 1fr) auto minmax(240px, auto);
    align-items: center;
    gap: 14px;
    box-shadow: none;
}

.calendar-nav {
    display: flex;
    gap: 8px;
    align-items: end;
}

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
    color: var(--muted);
    font-size: 13px;
    padding-bottom: 9px;
}

.calendar-title {
    font-size: 20px;
    font-weight: 800;
    text-transform: capitalize;
}

.calendar-view-toggle {
    display: inline-flex;
    justify-self: end;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
}

.calendar-view-toggle button {
    border: 0;
    border-radius: 0;
    min-height: 34px;
}

.calendar-view-toggle button.active {
    background: var(--brand);
    color: #ffffff;
}

.calendar-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
    border: 1px solid transparent;
}

.legend-dot.available {
    background: #e8f8ee;
    border-color: #91d6a9;
}

.legend-dot.reserved {
    background: #0f766e;
}

.legend-dot.today {
    background: #ffffff;
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.16);
}

.calendar-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.calendar-empty {
    box-shadow: none;
    color: var(--muted);
    text-align: center;
}

.scheduler-calendar {
    min-width: 980px;
}

.scheduler-header,
.scheduler-grid {
    display: grid;
}

.scheduler-calendar.month .scheduler-header,
.scheduler-calendar.month .scheduler-grid {
    grid-template-columns: repeat(7, minmax(128px, 1fr));
}

.scheduler-calendar.week .scheduler-header,
.scheduler-calendar.week .scheduler-grid {
    grid-template-columns: repeat(7, minmax(150px, 1fr));
}

.scheduler-calendar.day .scheduler-header,
.scheduler-calendar.day .scheduler-grid {
    grid-template-columns: minmax(280px, 1fr);
}

.scheduler-header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fbfb;
    border-bottom: 1px solid var(--line);
}

.scheduler-heading {
    display: grid;
    gap: 3px;
    min-height: 54px;
    padding: 10px 12px;
    border-right: 1px solid var(--line);
    color: var(--muted);
    text-align: center;
}

.scheduler-heading strong {
    color: var(--ink);
    font-size: 13px;
}

.scheduler-heading.today {
    background: #e9f7f5;
}

.scheduler-day {
    min-height: 148px;
    padding: 8px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: #ffffff;
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 7px;
}

.scheduler-calendar.week .scheduler-day,
.scheduler-calendar.day .scheduler-day {
    min-height: 520px;
}

.scheduler-day.outside-month {
    background: #f8fafb;
    color: #9aa8af;
}

.scheduler-day.today {
    box-shadow: inset 0 0 0 2px rgba(15, 118, 110, 0.24);
}

.scheduler-day.has-reservations {
    background: #fcfefe;
}

.scheduler-day.oversold {
    background: #fff7f7;
    box-shadow: inset 0 0 0 2px rgba(180, 35, 24, 0.18);
}

.scheduler-day-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.scheduler-day-number {
    width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    font-weight: 800;
    font-size: 13px;
}

.capacity-pill {
    overflow: hidden;
    border: 1px solid #b9e4cb;
    border-radius: 999px;
    background: #e9f8ef;
    color: #166534;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.capacity-pill.danger {
    border-color: #f0a49d;
    background: #ffe8e6;
    color: #a1281f;
}

.scheduler-day.today .scheduler-day-number {
    background: #101820;
    color: #ffffff;
}

.scheduler-events {
    display: grid;
    align-content: start;
    gap: 6px;
    min-width: 0;
}

.scheduler-free {
    align-self: center;
    justify-self: center;
    color: #c0c9ce;
    font-size: 12px;
}

.scheduler-event {
    width: 100%;
    min-height: 38px;
    display: grid;
    gap: 1px;
    overflow: hidden;
    border: 1px solid #b6d2ef;
    border-left: 4px solid #2f80ed;
    border-radius: 6px;
    background: #eaf4ff;
    color: #0852a3;
    padding: 5px 7px;
    text-align: left;
    box-shadow: none;
}

.scheduler-event:hover {
    filter: brightness(0.98);
}

.scheduler-event.completed {
    border-color: #b9e4cb;
    border-left-color: #2fb36d;
    background: #e9f8ef;
    color: #166534;
}

.scheduler-event.pending {
    border-color: #ffd8b3;
    border-left-color: #f97316;
    background: #fff1e3;
    color: #9a3412;
}

.scheduler-event.color-0 {
    border-color: #9cc7ff;
    border-left-color: #1d6fe8;
    background: #eaf3ff;
    color: #084c9e;
}

.scheduler-event.color-1 {
    border-color: #a7e2c2;
    border-left-color: #159957;
    background: #ecfdf3;
    color: #11613b;
}

.scheduler-event.color-2 {
    border-color: #fecb8b;
    border-left-color: #ea7600;
    background: #fff4e5;
    color: #92400e;
}

.scheduler-event.color-3 {
    border-color: #c7b8ff;
    border-left-color: #6d4aff;
    background: #f2efff;
    color: #4c1d95;
}

.scheduler-event.color-4 {
    border-color: #f9a8d4;
    border-left-color: #db2777;
    background: #fff0f7;
    color: #9d174d;
}

.scheduler-event.color-5 {
    border-color: #99e6e1;
    border-left-color: #0f9f95;
    background: #e9fffd;
    color: #115e59;
}

.scheduler-event.color-6 {
    border-color: #e7c78f;
    border-left-color: #b7791f;
    background: #fff8e8;
    color: #7c4a03;
}

.scheduler-event.color-7 {
    border-color: #b7c8d8;
    border-left-color: #47657a;
    background: #eef5f8;
    color: #294658;
}

.scheduler-event.start {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42);
}

.scheduler-event.return {
    background-image: linear-gradient(90deg, rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0.16));
}

.scheduler-event.unassigned {
    border-color: #b9e4cb;
    border-left-color: #2fb36d;
    background: #e9f8ef;
    color: #166534;
}

.scheduler-event.oversold {
    border-color: #f0a49d;
    border-left-color: #b42318;
    background: #ffe8e6;
    color: #8f1f17;
}

.scheduler-event .event-car,
.scheduler-event .event-client,
.scheduler-event .event-time {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.scheduler-event .event-car {
    font-size: 12px;
    font-weight: 800;
}

.scheduler-event .event-client {
    font-size: 11px;
    color: inherit;
    opacity: 0.82;
}

.scheduler-event .event-time {
    font-size: 11px;
    color: inherit;
    opacity: 0.74;
}

.event-sign {
    display: inline-flex;
    align-items: center;
    margin-right: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    padding: 1px 5px;
    font-size: 10px;
    font-weight: 900;
}

.inline-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.compact-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
    gap: 10px;
}

.vehicle-form {
    grid-template-columns: minmax(180px, 1fr) minmax(140px, 0.7fr) minmax(260px, 1.4fr) auto;
}

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

.row-actions {
    align-items: center;
}

.actions-cell {
    min-width: 260px;
}

.action-strip {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
}

.secondary-actions {
    padding-top: 8px;
}

.more-actions {
    position: relative;
}

.more-actions summary {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    color: var(--brand-dark);
    padding: 0 11px;
    cursor: pointer;
    font-weight: 700;
    list-style: none;
}

.more-actions summary::-webkit-details-marker {
    display: none;
}

.more-actions summary::after {
    content: "⌄";
    margin-left: 7px;
    font-size: 12px;
}

.more-actions[open] summary {
    border-color: var(--brand);
    background: #eef7f6;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 38px;
    min-width: 38px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    border-color: var(--line);
    background: #ffffff;
    color: var(--brand-dark);
}

.icon-button.primary {
    border-color: var(--brand);
    background: var(--brand);
    color: #ffffff;
}

.icon-button.danger {
    border-color: var(--danger);
    color: var(--danger);
}

.icon-button svg {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-button .action-text {
    font-size: 13px;
    font-weight: 700;
}

.icon-button.has-text {
    width: auto;
    min-width: 72px;
    padding: 0 11px;
}

.icon-button:hover {
    border-color: var(--brand);
    background: #eef7f6;
}

.icon-button.primary:hover {
    background: var(--brand-dark);
}

.icon-button.danger:hover {
    border-color: var(--danger);
    background: #fff1f0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.table-wrap {
    overflow: auto;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    min-width: 920px;
    border-collapse: collapse;
}

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

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.empty-row {
    color: var(--muted);
    text-align: center;
    padding: 24px;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.card {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    display: grid;
    gap: 10px;
}

.meta,
.remote-list {
    color: var(--muted);
    font-size: 13px;
}

.link-product-label {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 999px;
    background: #eef4ff;
    color: #17458f;
    padding: 4px 9px;
    font-size: 13px;
    font-weight: 800;
}

.vehicle-product-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.remote-list {
    display: grid;
    gap: 8px;
    max-height: 520px;
    overflow: auto;
}

.remote-item {
    border-bottom: 1px solid var(--line);
    padding-bottom: 8px;
}

.result {
    min-height: 46px;
    max-height: 180px;
    overflow: auto;
    border: 1px solid var(--line);
    background: #f8fbfb;
    border-radius: 6px;
    padding: 10px;
    color: var(--ink);
    white-space: pre-wrap;
}

.form-note,
.muted {
    color: var(--muted);
    font-size: 13px;
}

.payment-history {
    overflow: auto;
    margin-top: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.return-calculation {
    margin: 12px 0;
}

.return-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    border: 1px solid #b9e4cb;
    border-radius: 8px;
    background: #e9f8ef;
    color: #166534;
    padding: 12px;
    font-size: 13px;
}

.return-summary strong {
    grid-column: 1 / -1;
    font-size: 15px;
}

.return-summary.needs-payment {
    border-color: #ffd8b3;
    background: #fff8ed;
    color: #8a5300;
}

.payment-history .muted {
    padding: 14px;
}

.payment-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
}

.payment-table th,
.payment-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.payment-table th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.payment-table tr:last-child td {
    border-bottom: 0;
}

.media-viewer-open {
    overflow: hidden;
}

.media-viewer {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(7, 18, 21, 0.78);
}

.media-viewer.hidden {
    display: none;
}

.media-viewer-panel {
    width: min(980px, 100%);
    max-height: calc(100vh - 36px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
}

.media-viewer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
}

.media-viewer-body {
    display: grid;
    place-items: center;
    min-height: 220px;
    overflow: auto;
    background: #101820;
}

.media-viewer-body img,
.media-viewer-body video {
    max-width: 100%;
    max-height: calc(100vh - 120px);
    display: block;
    object-fit: contain;
}

.media-viewer-body video {
    width: 100%;
    background: #000000;
}

.toast {
    position: sticky;
    top: 0;
    z-index: 10;
    min-height: 0;
}

.toast.show {
    background: #fff8e8;
    border: 1px solid #eed08d;
    color: #593c0b;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 14px;
}

.capacity-warning {
    margin-bottom: 14px;
    border: 1px solid #f0a49d;
    border-radius: 8px;
    background: #fff1f0;
    color: #8f1f17;
    padding: 12px 14px;
    font-weight: 700;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 999px;
    padding: 2px 9px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.badge.valid {
    background: #e8f8ee;
    color: #146c37;
    border: 1px solid #91d6a9;
}

.badge.ended {
    background: #fff1f0;
    color: #a1281f;
    border: 1px solid #f0a49d;
}

.badge.pending {
    background: #eef4ff;
    color: #17458f;
    border: 1px solid #adc4ed;
}

.badge.unassigned {
    background: #fff8e8;
    color: #8a5300;
    border: 1px solid #e7bd67;
}

.hidden {
    display: none;
}

.edit-form {
    max-width: 900px;
}

@media (max-width: 920px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: sticky;
        top: 0;
        z-index: 20;
        gap: 12px;
        padding: 12px;
        box-shadow: 0 8px 24px rgba(16, 32, 35, 0.18);
    }

    .brand-block {
        grid-template-columns: 58px minmax(0, 1fr);
        gap: 10px;
    }

    .brand-logo {
        width: 56px;
        max-height: 42px;
    }

    .brand-block h1 {
        font-size: 20px;
        line-height: 1.1;
    }

    .tabs {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 3px;
        scrollbar-width: thin;
    }

    .tab {
        flex: 0 0 auto;
        min-height: 34px;
        border-color: rgba(255, 255, 255, 0.12);
        background: rgba(255, 255, 255, 0.04);
        padding: 0 12px;
        white-space: nowrap;
    }

    .settings-form {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
        align-items: end;
        margin-top: 0;
    }

    .main {
        padding: 14px;
    }

    .section-head {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .section-head > button {
        margin-left: auto;
    }

    .grid.two,
    .inline-fields,
    .compact-form,
    .reservation-filters,
    .inspection-photos,
    .calendar-toolbar {
        grid-template-columns: 1fr;
    }

    .calendar-legend {
        justify-content: flex-start;
        padding-bottom: 0;
    }

    .calendar-nav {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }

    .table-wrap {
        margin-inline: -14px;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
    }
}

@media (max-width: 760px) {
    .table-wrap {
        overflow: visible;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .reservation-table,
    .reservation-table thead,
    .reservation-table tbody,
    .reservation-table tr,
    .reservation-table th,
    .reservation-table td {
        display: block;
    }

    .reservation-table {
        min-width: 0;
    }

    .reservation-table thead {
        display: none;
    }

    .reservation-table tbody {
        display: grid;
        gap: 12px;
    }

    .reservation-table tr {
        overflow: hidden;
        border: 1px solid var(--line);
        border-radius: 10px;
        background: #ffffff;
        box-shadow: var(--shadow);
    }

    .reservation-table td {
        display: grid;
        grid-template-columns: minmax(92px, 34%) minmax(0, 1fr);
        gap: 10px;
        padding: 10px 12px;
        border-bottom: 1px solid #edf2f4;
    }

    .reservation-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 11px;
        font-weight: 800;
        text-transform: uppercase;
    }

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

    .actions-cell {
        min-width: 0;
    }

    .actions-cell::before {
        align-self: start;
        padding-top: 8px;
    }

    .row-actions,
    .action-strip {
        width: 100%;
    }

    .action-strip {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .icon-button,
    .icon-button.has-text {
        width: 100%;
        min-width: 0;
        padding: 0 8px;
    }

    .more-actions {
        width: 100%;
    }

    .more-actions summary {
        width: 100%;
        justify-content: center;
    }

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

@media (max-width: 620px) {
    body {
        font-size: 14px;
    }

    h2 {
        font-size: 19px;
    }

    .settings-form {
        grid-template-columns: 1fr;
    }

    .surface {
        padding: 12px;
    }

    .calendar-nav {
        grid-template-columns: 1fr;
    }

    .row-actions {
        gap: 6px;
    }

    .icon-button {
        width: 36px;
        height: 36px;
    }

    .action-strip,
    .secondary-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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