:root {
    --bg: #f6f7f8;
    --panel: #ffffff;
    --panel-border: #e1e4e8;
    --text: #3c4448;
    --muted: #5d686e;
    --primary: #d23b38;
    --primary-dark: #b72f2e;
    --accent: #0ab285;
    --danger: #b42318;
    --warning-bg: #fff7df;
    --warning-border: #f0c24f;
    --success-bg: #e9f8f3;
    --success-border: #0ab285;
    --error-bg: #fff0ed;
    --error-border: #f19a8a;
    --shadow: 0 2px 8px rgba(60, 68, 72, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    width: 100%;
    max-width: 100%;
}

body {
    margin: 0;
    max-width: 100%;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: Roboto, Arial, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.45;
}

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

button,
input,
select,
textarea {
    font: inherit;
}

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

.sidebar {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    background: var(--primary);
    color: #ffffff;
    padding: 18px 14px;
}

.sidebar-head {
    display: block;
}

.brand-block {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 8px 8px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.brand-block strong,
.brand-block span {
    display: block;
}

.brand-block span {
    color: rgba(255, 255, 255, 0.78);
    font-size: 12px;
}

.brand-mark {
    display: grid;
    width: 44px;
    height: 38px;
    place-items: center;
    border-radius: 8px;
    background: #ffffff;
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
}

.mobile-nav-toggle {
    display: none;
}

.mobile-nav-panel {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.nav-list {
    display: grid;
    gap: 4px;
    padding-top: 16px;
}

.nav-list a {
    display: block;
    padding: 10px 12px;
    color: rgba(255, 255, 255, 0.88);
    border-radius: 6px;
}

.nav-list a:hover,
.nav-list a.active {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.sidebar-tools {
    display: grid;
    gap: 8px;
    margin-top: auto;
    padding: 14px 6px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.sidebar-tools .language-switcher,
.sidebar-tools .language-trigger,
.sidebar-tools .admin-chip,
.sidebar-tools .sidebar-logout {
    width: 100%;
}

.sidebar-tools .language-trigger {
    justify-content: space-between;
    border-color: rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.sidebar-tools .language-menu {
    right: auto;
    bottom: calc(100% + 6px);
    left: 0;
    top: auto;
}

.sidebar-tools .admin-chip {
    justify-content: center;
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.sidebar-tools .sidebar-logout {
    border-color: rgba(255, 255, 255, 0.24);
    background: #ffffff;
    color: var(--primary);
}

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

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow);
    padding: 14px 16px;
}

.topbar h1 {
    margin: 0;
    font-size: 24px;
    line-height: 1.2;
}

.topbar p {
    margin: 4px 0 0;
    color: var(--muted);
}

.topbar-actions,
.toolbar,
.actions,
.form-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.language-switcher {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.language-trigger {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 0 11px;
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    background: #ffffff;
    color: var(--muted);
    font-weight: 700;
    cursor: pointer;
}

.language-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 30;
    display: none;
    min-width: 168px;
    padding: 6px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.language-switcher.open .language-menu {
    display: grid;
    gap: 2px;
}

.language-menu a {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 34px;
    padding: 7px 9px;
    border-radius: 6px;
    color: var(--text);
    font-weight: 700;
}

.language-menu a:hover,
.language-menu a.active {
    background: #fff1f1;
    color: var(--primary);
}

.language-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    min-width: 22px;
    max-width: 22px;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 999px;
    line-height: 0;
    box-shadow: 0 0 0 1px rgba(12, 19, 33, 0.12);
    background: #ffffff;
}

.language-flag img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    border-radius: inherit;
    clip-path: circle(50%);
    object-fit: cover;
    object-position: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    background: #ffffff;
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
}

.btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-primary {
    border-color: var(--primary);
    background: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    border-color: var(--primary-dark);
    background: var(--primary-dark);
    color: #ffffff;
}

.btn-secondary {
    background: #ffffff;
    color: var(--muted);
}

.btn-danger {
    color: var(--danger);
    border-color: #efc2bb;
    background: #fff7f5;
}

.btn-small {
    min-height: 30px;
    padding: 5px 9px;
    font-size: 12px;
}

.alert {
    margin-bottom: 14px;
    padding: 11px 13px;
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    background: #ffffff;
}

.alert-warning {
    border-color: var(--warning-border);
    background: var(--warning-bg);
}

.alert-success {
    border-color: var(--success-border);
    background: var(--success-bg);
}

.alert-error {
    border-color: var(--error-border);
    background: var(--error-bg);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card,
.panel {
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.stat-card {
    display: block;
    position: relative;
    padding: 16px;
    border-top: 3px solid var(--primary);
}

.stat-card-link {
    color: inherit;
    text-decoration: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.stat-card-link::after {
    content: ">";
    position: absolute;
    top: 12px;
    right: 12px;
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border: 1px solid #f0c5c4;
    border-radius: 50%;
    background: #fff6f6;
    color: var(--primary);
    font-weight: 800;
    line-height: 1;
}

.stat-card-link:hover,
.stat-card-link:focus-visible {
    border-color: #efc2bb;
    box-shadow: 0 6px 18px rgba(60, 68, 72, 0.16);
    outline: none;
    transform: translateY(-1px);
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.stat-card strong {
    display: block;
    margin-top: 6px;
    font-size: 24px;
    color: var(--primary);
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 16px;
}

.panel {
    min-width: 0;
}

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

.panel-head-actions {
    align-items: center;
}

.panel-head-actions > div:first-child {
    min-width: 0;
}

.panel-head-actions .toolbar {
    flex: 0 0 auto;
    margin-left: auto;
}

.panel-head h2 {
    margin: 0;
    font-size: 17px;
}

.panel-head span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.table-wrap {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

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

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

th {
    color: var(--muted);
    background: #faf4f4;
    font-size: 12px;
    font-weight: 700;
}

td {
    max-width: 280px;
    overflow-wrap: anywhere;
}

tbody tr:hover {
    background: #fffafa;
}

tbody tr {
    transition: background 0.15s ease;
}

.clickable-row {
    cursor: pointer;
}

.clickable-row:focus {
    outline: 2px solid rgba(210, 59, 56, 0.2);
    outline-offset: -2px;
}

.actions-col {
    width: 210px;
}

.actions {
    flex-wrap: nowrap;
    white-space: nowrap;
}

.actions .btn,
.actions form {
    flex: 0 0 auto;
}

.actions form {
    margin: 0;
}

.inline-update-form {
    min-width: 122px;
    margin: 0;
}

.inline-select {
    min-height: 34px;
    padding: 6px 9px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.inline-select-status-0,
.inline-select-payment_status-0 {
    border-color: #d8c28b;
    background: #fff8e5;
    color: #7a5815;
}

.inline-select-status-1,
.inline-select-payment_status-1 {
    border-color: #9bc5a5;
    background: #f2fbf5;
    color: #25633b;
}

.inline-select-status-2 {
    border-color: #e2a3a0;
    background: #fff1f0;
    color: #9d2c28;
}

.inline-select-status-3 {
    border-color: #9fb7d8;
    background: #f1f6fd;
    color: #244f86;
}

.empty {
    color: var(--muted);
    text-align: center;
}

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

.search-form input {
    min-width: 220px;
}

.filter-form {
    display: grid;
    gap: 0;
    padding: 12px 16px;
    border-bottom: 1px solid var(--panel-border);
    background: #ffffff;
}

.filter-toggle {
    appearance: none;
    -webkit-appearance: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 38px;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
    color: var(--text);
    text-align: left;
}

.filter-toggle span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.filter-toggle strong {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid #f0c5c4;
    border-radius: 999px;
    background: #fff6f6;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
}

.filter-toggle:hover strong,
.filter-toggle:focus-visible strong {
    border-color: var(--primary);
}

.filter-toggle:focus-visible {
    outline: 2px solid rgba(210, 59, 56, 0.16);
    outline-offset: 2px;
}

.filter-panel {
    display: grid;
    gap: 10px;
    padding-top: 12px;
}

.filter-panel[hidden] {
    display: none;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 10px;
}

.filter-field {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.filter-field span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.filter-search {
    grid-column: span 2;
}

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

.dashboard-booking-row td:first-child {
    color: var(--primary);
    font-weight: 800;
}

.record-form {
    padding: 16px;
}

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

.field {
    display: grid;
    gap: 6px;
}

.field-wide {
    grid-column: 1 / -1;
}

.field span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

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

input,
select,
textarea {
    width: 100%;
    min-height: 38px;
    border: 1px solid #cfd8e3;
    border-radius: 6px;
    padding: 8px 10px;
    background: #ffffff;
    color: var(--text);
}

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

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(210, 59, 56, 0.16);
    border-color: var(--primary);
}

.form-actions {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--panel-border);
}

.form-note {
    margin: 14px 0 0;
    color: var(--muted);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 16px;
    border-top: 1px solid var(--panel-border);
}

.pagination span {
    color: var(--muted);
    margin-right: auto;
}

.preview-layout {
    display: grid;
    gap: 16px;
    padding: 16px;
}

.preview-section {
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: #fff;
}

.preview-section h3 {
    margin: 0;
    padding: 13px 14px;
    border-bottom: 1px solid var(--panel-border);
    color: var(--text);
    font-size: 15px;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    background: var(--panel-border);
}

.preview-item {
    display: grid;
    gap: 4px;
    min-height: 70px;
    padding: 12px;
    background: #ffffff;
}

.preview-item span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.preview-item strong {
    color: var(--text);
    font-weight: 500;
    overflow-wrap: anywhere;
}

.current-photo {
    display: grid;
    gap: 6px;
    margin-bottom: 8px;
    max-width: 260px;
}

.current-photo img {
    width: 160px;
    height: 110px;
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    object-fit: contain;
    background: #f6f7f8;
}

.current-photo small,
.field small {
    color: var(--muted);
}

.login-screen {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 18px;
    background: #f6f7f8;
}

.login-card {
    width: min(420px, 100%);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
    padding: 22px;
    border-top: 4px solid var(--primary);
}

.login-card h1 {
    margin: 0 0 4px;
    color: var(--text);
}

.login-card p {
    margin: 0 0 18px;
    color: var(--muted);
}

.login-card label {
    display: grid;
    gap: 7px;
    margin-bottom: 14px;
    font-weight: 700;
    color: var(--muted);
}

.login-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 38px;
    padding: 0 16px 4px;
    margin-bottom: 18px;
    border-radius: 6px;
    background: var(--primary);
    color: #ffffff;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 0;
}

.login-logo span {
    font-weight: 800;
}

.login-logo strong {
    font-weight: 700;
}

.login-logo::after {
    content: "";
    position: absolute;
    right: 14px;
    bottom: 8px;
    left: 14px;
    height: 2px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
}

.admin-chip {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid #f0c5c4;
    border-radius: 6px;
    background: #fff6f6;
    color: var(--primary);
    font-weight: 700;
}

body.modal-open {
    overflow: hidden;
}

.row-modal[hidden] {
    display: none;
}

.row-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 18px;
    overflow: hidden;
}

.row-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(31, 38, 42, 0.46);
}

.row-modal-card {
    position: relative;
    z-index: 1;
    width: min(1040px, calc(100vw - 28px));
    max-height: min(88vh, 780px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 48px rgba(60, 68, 72, 0.22);
}

.row-modal-head,
.row-modal-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 16px;
    border-bottom: 1px solid var(--panel-border);
}

.row-modal-actions {
    justify-content: flex-end;
    border-top: 1px solid var(--panel-border);
    border-bottom: 0;
}

.row-modal-head span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.row-modal-head h2 {
    margin: 3px 0 0;
    font-size: 20px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.row-modal-close {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    background: #ffffff;
    color: var(--text);
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

.row-modal-actions .btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.row-modal-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1px;
    overflow: auto;
    overscroll-behavior: contain;
    background: var(--panel-border);
}

.row-modal-body-html {
    display: block;
    padding: 0;
    background: #ffffff;
}

.row-modal-body-html .booking-preview-panel {
    min-width: 0;
}

.row-modal-body-html .panel {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.row-modal-body-html .panel-head {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #ffffff;
}

.row-modal-body-html .preview-layout {
    gap: 12px;
    padding: 12px;
}

.row-modal-body-html .preview-section {
    overflow: hidden;
    border-radius: 7px;
}

.row-modal-body-html .preview-grid {
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
}

.row-modal-body-html .preview-item {
    min-height: 62px;
    padding: 10px 11px;
}

.row-modal-body-html .preview-item strong {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.row-modal-body-html .table-wrap {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}

.row-modal-body-html table {
    min-width: 560px;
}

.modal-loading {
    padding: 28px;
    color: var(--muted);
    text-align: center;
}

.modal-error {
    color: var(--danger);
}

.row-modal-item {
    display: grid;
    gap: 5px;
    min-height: 68px;
    padding: 12px;
    background: #ffffff;
}

.row-modal-item span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.row-modal-item strong {
    color: var(--text);
    font-weight: 500;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

@media (max-width: 1100px) {
    .stats-grid,
    .content-grid,
    .form-grid,
    .preview-grid,
    .filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 780px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
    }

    body {
        font-size: 13px;
        overflow-x: hidden;
        background: #f2f4f6;
    }

    .app-shell {
        min-height: auto;
        max-width: 100%;
        grid-template-columns: 1fr;
        overflow-x: hidden;
    }

    .sidebar {
        position: sticky;
        top: 0;
        z-index: 50;
        height: auto;
        overflow: visible;
        padding: 10px 12px 8px;
        box-shadow: 0 2px 12px rgba(60, 68, 72, 0.18);
    }

    .sidebar-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        min-width: 0;
    }

    .brand-block {
        flex: 1 1 auto;
        min-width: 0;
        gap: 9px;
        padding: 0;
        border-bottom: 0;
    }

    .brand-block > div:last-child {
        min-width: 0;
    }

    .brand-mark {
        flex: 0 0 38px;
        width: 38px;
        height: 32px;
        border-radius: 7px;
        font-size: 11px;
    }

    .brand-block strong {
        display: block;
        max-width: 100%;
        overflow: hidden;
        font-size: 14px;
        line-height: 1.15;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .brand-block span {
        display: none;
    }

    .mobile-nav-toggle {
        display: inline-flex;
        align-items: center;
        column-gap: 7px;
        flex: 0 0 auto;
        min-height: 38px;
        padding: 0 11px;
        border: 1px solid rgba(255, 255, 255, 0.32);
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.14);
        color: #ffffff;
        cursor: pointer;
        font-weight: 800;
    }

    .mobile-nav-toggle:hover,
    .mobile-nav-toggle:focus-visible {
        background: rgba(255, 255, 255, 0.2);
        outline: none;
    }

    .mobile-nav-toggle .hamburger-icon {
        display: grid;
        gap: 3px;
        width: 17px;
        line-height: 0;
    }

    .mobile-nav-toggle .hamburger-icon span {
        display: block;
        width: 17px;
        height: 2px;
        border-radius: 999px;
        background: currentColor;
    }

    .mobile-nav-toggle strong {
        font-size: 13px;
        letter-spacing: 0;
    }

    .mobile-nav-panel {
        display: none;
        max-height: min(62vh, 430px);
        margin: 10px 0 0;
        padding: 8px;
        overflow-x: hidden;
        overflow-y: auto;
        border: 1px solid rgba(255, 255, 255, 0.18);
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.11);
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
    }

    .sidebar.nav-open .mobile-nav-panel {
        display: grid;
        gap: 8px;
    }

    .nav-list {
        display: grid;
        gap: 5px;
        padding-top: 0;
    }

    .nav-list a {
        display: flex;
        align-items: center;
        width: 100%;
        min-height: 36px;
        padding: 9px 11px;
        background: rgba(255, 255, 255, 0.12);
        border-radius: 6px;
        white-space: normal;
    }

    .sidebar-tools {
        margin-top: 0;
        padding: 8px 0 0;
    }

    .sidebar-tools .language-menu {
        top: calc(100% + 6px);
        bottom: auto;
    }

    .main {
        width: 100%;
        max-width: 100vw;
        min-width: 0;
        overflow-x: hidden;
        padding: 8px;
    }

    .panel-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .panel-head-actions {
        align-items: flex-start;
        flex-direction: row;
        justify-content: space-between;
    }

    .panel-head-actions > div:first-child {
        flex: 1 1 auto;
        min-width: 0;
    }

    .panel-head-actions .toolbar {
        flex: 0 0 auto;
        margin-left: auto;
    }

    .language-switcher,
    .language-trigger,
    .language-menu {
        width: 100%;
    }

    .language-trigger {
        justify-content: flex-start;
    }

    .language-menu {
        right: auto;
        left: 0;
        max-height: min(52vh, 320px);
        overflow-y: auto;
    }

    .language-flag {
        flex: 0 0 26px;
        width: 26px;
        height: 26px;
        min-width: 26px;
        max-width: 26px;
    }

    .panel {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow: hidden;
        border-radius: 8px;
        box-shadow: none;
    }

    .panel-head {
        gap: 9px;
        padding: 12px;
    }

    .content-grid,
    .form-grid,
    .preview-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid,
    .filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .stat-card {
        min-height: 92px;
        padding: 12px;
    }

    .stat-card strong {
        font-size: 20px;
    }

    .stat-card-link::after {
        top: 10px;
        right: 10px;
        width: 22px;
        height: 22px;
        font-size: 12px;
    }

    .filter-form {
        padding: 9px 10px;
    }

    .filter-toggle {
        min-height: 34px;
    }

    .filter-toggle strong {
        min-height: 28px;
        padding: 0 9px;
        font-size: 11px;
    }

    .filter-panel {
        gap: 8px;
        padding-top: 9px;
    }

    .filter-search {
        grid-column: 1 / -1;
    }

    .search-form,
    .topbar-actions {
        max-width: 100%;
        width: 100%;
    }

    .toolbar {
        width: auto;
        max-width: 100%;
        align-self: flex-start;
    }

    .topbar-actions .btn,
    .topbar-actions .admin-chip {
        width: 100%;
    }

    .search-form input {
        min-width: 0;
    }

    .search-form .btn {
        flex: 1 1 auto;
    }

    .toolbar .btn {
        flex: 0 0 auto;
        width: auto;
    }

    .filter-form,
    .record-form {
        max-width: 100%;
        min-width: 0;
    }

    .record-form {
        padding: 12px;
    }

    .filter-grid,
    .form-grid {
        gap: 8px;
    }

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

    input,
    select,
    textarea,
    .btn,
    .admin-chip,
    .language-trigger {
        min-height: 42px;
    }

    .filter-field span {
        overflow: hidden;
        font-size: 11px;
        line-height: 1.2;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .filter-field input,
    .filter-field select {
        min-height: 36px;
        padding: 7px 8px;
        font-size: 12px;
    }

    .filter-actions .btn {
        width: 100%;
        min-height: 38px;
        padding: 7px 8px;
        line-height: 1.15;
        white-space: normal;
    }

    .table-wrap {
        width: 100%;
        max-width: 100%;
        margin: 0;
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
    }

    table {
        width: max-content;
        min-width: 980px;
    }

    th,
    td {
        padding: 9px 10px;
        white-space: nowrap;
    }

    td {
        max-width: 240px;
        overflow: hidden;
        text-overflow: ellipsis;
        overflow-wrap: normal;
    }

    .actions-col {
        width: 230px;
        min-width: 230px;
    }

    .actions {
        gap: 6px;
        min-width: 220px;
        flex-wrap: nowrap;
    }

    .actions .btn,
    .actions form {
        flex: 0 0 auto;
    }

    .inline-update-form {
        min-width: 116px;
    }

    .btn-small {
        min-height: 32px;
        padding: 5px 8px;
    }

    .pagination {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        justify-content: stretch;
        padding: 12px;
    }

    .pagination span {
        grid-column: 1 / -1;
        width: 100%;
        margin-right: 0;
    }

    .pagination .btn {
        min-width: 0;
    }

    .row-modal {
        align-items: end;
        padding: 0;
    }

    .row-modal-card {
        width: 100%;
        max-height: 94dvh;
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 10px 10px 0 0;
    }

    .row-modal-head,
    .row-modal-actions {
        padding: 13px;
    }

    .row-modal-head {
        align-items: flex-start;
    }

    .row-modal-head h2 {
        font-size: 17px;
    }

    .row-modal-body {
        grid-template-columns: 1fr;
    }

    .row-modal-body-html .panel-head {
        position: static;
        gap: 6px;
        padding: 12px;
    }

    .preview-layout,
    .row-modal-body-html .preview-layout {
        padding: 12px;
    }

    .preview-section h3 {
        padding: 11px 12px;
    }

    .preview-grid,
    .row-modal-body-html .preview-grid {
        grid-template-columns: 1fr;
    }

    .preview-item,
    .row-modal-body-html .preview-item {
        min-height: 58px;
        padding: 10px;
    }

    .row-modal-actions .btn {
        flex: 1 1 96px;
        min-width: 0;
        padding-right: 8px;
        padding-left: 8px;
    }

    .row-modal-actions {
        flex-wrap: wrap;
    }

    .row-modal-body-html table {
        min-width: 520px;
    }

    .login-card {
        padding: 18px;
    }
}

@media (max-width: 380px) {
    .filter-grid,
    .filter-actions {
        grid-template-columns: 1fr;
    }

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

@media print {
    body.modal-open * {
        visibility: hidden;
    }

    body.modal-open .row-modal,
    body.modal-open .row-modal * {
        visibility: visible;
    }

    body.modal-open .row-modal {
        position: static;
        display: block;
        padding: 0;
    }

    body.modal-open .row-modal-backdrop,
    body.modal-open .row-modal-head,
    body.modal-open .row-modal-actions,
    .no-print {
        display: none !important;
    }

    body.modal-open .row-modal-card {
        display: block;
        width: 100%;
        max-height: none;
        border: 0;
        box-shadow: none;
        overflow: visible;
    }

    body.modal-open .row-modal-body {
        display: block;
        overflow: visible;
        background: #ffffff;
    }

    .booking-preview-panel {
        border: 0;
        box-shadow: none;
    }

    .preview-layout,
    .record-form {
        padding: 0;
    }

    .preview-section {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}
