:root {
    color-scheme: light;
    --ink: #1d252c;
    --muted: #68747f;
    --line: #dbe2e8;
    --paper: #ffffff;
    --bg: #f0f4f6;
    --brand: #0f766e;
    --brand-strong: #0b5f59;
    --brand-light: #e8f3f1;
    --warn: #b7791f;
    --danger: #b42318;
    --good: #15803d;
    --shadow-sm: 0 1px 3px rgba(29, 37, 44, .06);
    --shadow-md: 0 4px 16px rgba(29, 37, 44, .08);
    --radius: 10px;
    --icon-text-gap: 12px;
    --sidebar-width: 264px;
    --sidebar-bg: #f7fafa;
    --sidebar-border: #d8e6e3;
    --font-sans: "Sukhumvit Set", "Sukhumvit", "Thonburi", Tahoma, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
}

button,
input,
select,
textarea,
optgroup {
    font-family: var(--font-sans);
}

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

.login-shell {
    width: min(420px, 100%);
}

.login-card {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    box-shadow: 0 14px 40px rgba(29, 37, 44, .08);
}

.login-brand {
    padding: 0 0 18px;
}

.login-form {
    display: grid;
    gap: 12px;
}

.login-hint {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 12px;
}

h1,
h2,
h3,
h4,
strong,
th {
    font-weight: 500;
}

h1 { font-size: 24px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }

.app-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 14px 12px 16px;
    background: linear-gradient(180deg, #f9fcfb 0%, var(--sidebar-bg) 100%);
    border-right: 1px solid var(--sidebar-border);
}

.sidebar-brand {
    padding: 6px 8px 18px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-minimal .sidebar-hint {
    flex: 1;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 12px;
    padding: 20px 12px;
    margin: 8px 4px;
    border: 1px dashed var(--sidebar-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, .55);
    text-align: center;
}

.sidebar-hint-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--brand-light);
    color: var(--brand-strong);
    font-size: 18px;
}

.sidebar-hint p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 2px;
    color: var(--ink);
    text-decoration: none;
    border-radius: 10px;
    transition: background .15s ease;
}

.brand:hover {
    background: rgba(255, 255, 255, .7);
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    overflow: hidden;
    background: #f5c51d;
    box-shadow: 0 4px 12px rgba(15, 118, 110, .14);
    flex-shrink: 0;
}

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

.brand-text {
    min-width: 0;
}

.brand-text strong,
.brand-text small {
    display: block;
}

.brand-text strong {
    font-size: 14px;
    line-height: 1.35;
}

.brand-text small {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.35;
}

.content-area {
    min-width: 0;
}

.page-header {
    padding: 16px clamp(16px, 2.4vw, 30px) 4px;
}

.top-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    margin-bottom: 0;
    padding: 10px 16px;
    border: 1px solid var(--sidebar-border);
    border-radius: 14px;
    background: linear-gradient(135deg, #ffffff 0%, #eef7f5 100%);
    box-shadow: var(--shadow-md);
}

.breadcrumb {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumb-home {
    display: inline-flex;
    align-items: center;
    gap: var(--icon-text-gap);
    min-height: 34px;
    padding: 6px 11px;
    border-radius: 8px;
    background: var(--brand-light);
    color: var(--brand-strong);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s ease, color .15s ease;
}

.breadcrumb-home:hover {
    background: #dff0ed;
    color: var(--brand);
}

.breadcrumb-sep {
    display: inline-flex;
    align-items: center;
    color: #9aaeb8;
    font-size: 10px;
}

.top-nav-context {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    max-width: 100%;
    min-height: 34px;
    margin: 0;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(15, 118, 110, .1);
    color: var(--brand-strong);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.top-nav-context-zone,
.top-nav-context-page {
    display: inline-flex;
    align-items: center;
    gap: var(--icon-text-gap);
}

.top-nav-context-zone {
    flex-shrink: 0;
    color: var(--brand);
}

.top-nav-context-sep {
    flex-shrink: 0;
    color: rgba(11, 95, 89, .45);
    font-weight: 700;
}

.top-nav-context-page {
    color: var(--ink);
    font-weight: 600;
}

.top-nav-date {
    flex: 0 0 auto;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: var(--icon-text-gap);
    min-height: 34px;
    padding: 6px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.top-nav-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.top-nav-meta .top-nav-date {
    height: 38px;
    min-height: 38px;
    margin-left: 0;
}

.top-nav-employee {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid #cfe7e2;
    border-radius: 9px;
    background: var(--brand-light);
    color: var(--brand-strong);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.top-nav-employee:hover {
    border-color: var(--brand);
    background: #dff2ed;
    color: var(--brand-strong);
}

.top-nav-employee .fa-icon {
    margin-inline-end: 0;
}

.top-nav-date .fa-icon {
    color: var(--brand-strong);
}

.main-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    padding: 4px 2px;
    overflow-y: auto;
}

.main-nav .nav-link,
.text-link {
    color: var(--ink);
    text-decoration: none;
    font-weight: 500;
}

.main-nav .nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: var(--icon-text-gap);
    border-radius: 10px;
    padding: 8px 10px;
    background: transparent;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}

.main-nav .nav-link:hover:not(.active) {
    background: rgba(15, 118, 110, .07);
    color: var(--brand-strong);
}

.main-nav .nav-link.active {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 4px 14px rgba(15, 118, 110, .28);
}

.nav-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    border-radius: 0;
    background: rgba(15, 118, 110, .09);
    color: var(--brand-strong);
    font-size: 14px;
    transition: background .15s ease, color .15s ease;
}

.nav-text {
    min-width: 0;
    font-size: 14px;
    line-height: 1.3;
}

.main-nav .nav-link.active .nav-icon {
    background: rgba(255, 255, 255, .2);
    color: #fff;
}

.main-nav .nav-link:hover:not(.active) .nav-icon {
    background: rgba(15, 118, 110, .14);
}

.fa-icon {
    display: inline-block;
    flex-shrink: 0;
    line-height: 1;
    vertical-align: -0.1em;
    margin-inline-end: 0.4em;
}

:where(
    .button,
    .action-tile strong,
    .breadcrumb-home,
    .sidebar-footer .sidebar-action,
    .sidebar-footer .logout-btn,
    .zone-badge,
    .main-nav .nav-link,
    .top-nav-context,
    .top-nav-date,
    .branch-card .button,
    .close,
    .empty-icon,
    .branch-card-icon
) .fa-icon {
    margin-inline-end: 0;
}

.action-tile strong {
    display: flex;
    align-items: center;
    gap: var(--icon-text-gap);
}

.action-tile strong .fa-icon {
    color: var(--brand);
}

.empty-icon {
    color: var(--brand);
    margin-bottom: 4px;
}

.empty-icon .fa-icon {
    font-size: 40px;
}

.branch-card-icon .fa-icon {
    font-size: 20px;
}

.nav-label {
    margin: 0 0 8px;
    padding: 0 10px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.sidebar-footer {
    margin-top: auto;
    padding: 14px 6px 4px;
    display: grid;
    gap: 10px;
}

.user-card {
    padding: 12px;
    border: 1px solid var(--sidebar-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, .82);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand) 0%, #0b5f59 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(15, 118, 110, .25);
}

.user-badge {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.user-badge strong {
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-badge span {
    color: var(--muted);
    font-size: 12px;
}

.sidebar-zone {
    display: grid;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--sidebar-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, .82);
}

.sidebar-action {
    display: inline-flex;
    align-items: center;
    gap: var(--icon-text-gap);
    color: var(--brand-strong);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    padding: 4px 2px;
    border-radius: 6px;
    transition: color .15s ease, background .15s ease;
}

.sidebar-action:hover {
    color: var(--brand);
    background: var(--brand-light);
}

.logout-form {
    margin: 0;
}

.logout-btn {
    width: 100%;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid #f0d4d0;
    border-radius: 0;
    background: #fff8f7;
    color: var(--danger);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: var(--icon-text-gap);
    transition: background .15s ease, border-color .15s ease;
}

.logout-btn:hover {
    background: #fff0ee;
    border-color: #e8b4ad;
}

.logout-confirm-modal {
    width: min(420px, calc(100vw - 28px));
    text-align: center;
}

.logout-confirm-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin: 2px auto 14px;
    border-radius: 50%;
    background: #fff1f1;
    color: var(--danger);
    font-size: 20px;
}

.logout-confirm-icon .fa-icon {
    margin: 0;
}

.logout-confirm-modal .section-title {
    display: block;
    margin-bottom: 20px;
}

.logout-confirm-modal .modal-actions {
    justify-content: center;
}

.logout-confirm-modal .modal-actions form {
    margin: 0;
}

.zone-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--icon-text-gap);
    max-width: 100%;
    padding: 6px 10px;
    border-radius: 8px;
    background: var(--brand-light);
    color: var(--brand-strong);
    font-size: 12px;
    font-weight: 500;
}

.page-header h1,
.section-title h2,
.zone h3 {
    margin: 0;
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--brand);
    font-weight: 500;
    font-size: 13px;
}

.app-shell {
    width: min(1280px, 100%);
    margin: 0 auto;
    padding: 8px clamp(12px, 2.4vw, 24px) 34px;
}

.app-shell:has(> .quick-actions:first-child) {
    padding-top: 4px;
}

.app-shell:has(> .stats-grid:first-child),
.app-shell:has(> .summary-row:first-child) {
    padding-top: 2px;
}

.notice {
    padding: 12px 14px;
    margin-bottom: 16px;
    border: 1px solid #9dd5cf;
    background: #e6f6f4;
    color: #164e49;
    border-radius: 8px;
}

.notice.danger {
    border-color: #f3b4ac;
    background: #fff0ee;
    color: var(--danger);
}

.notice.success {
    border-color: #a7e0b7;
    background: #edfdf2;
    color: var(--good);
}

.stats-grid,
.summary-row,
.executive-strip {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    margin-top: 0;
    margin-bottom: 20px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.stats-grid article,
.panel,
.setup-box {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.stats-grid article,
.summary-row article,
.executive-strip > div {
    flex: 1 1 0;
    min-width: 0;
}

.stats-grid article {
    padding: 22px 18px 18px;
    position: relative;
    overflow: hidden;
}

.stats-grid article::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 18px;
    right: 18px;
    height: 3px;
    border-radius: 99px;
    background: var(--brand);
    opacity: .6;
}

.stats-grid article:nth-child(2)::before { background: var(--warn); }
.stats-grid article:nth-child(3)::before { background: var(--danger); }
.stats-grid article:nth-child(4)::before { background: #436a9d; }

.stats-grid span,
.section-title p,
.muted,
.invoice-card span {
    color: var(--muted);
}

.stats-grid span {
    display: block;
    padding-top: 8px;
}

.stats-grid strong {
    display: block;
    margin-top: 6px;
    font-size: clamp(18px, 2.2vw, 26px);
}

.panel {
    padding: 18px;
    margin-bottom: 16px;
}

.section-title {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.section-title p {
    margin: 0;
}

.market-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

.zone {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #fbfcfd;
}

.stall-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.stall {
    min-height: 62px;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #f7faf9;
    color: var(--ink);
    cursor: pointer;
    text-align: left;
}

.stall strong,
.stall span {
    display: block;
}

.stall strong {
    font-size: 16px;
}

.stall.available {
    border-color: #9fd7bd;
    background: #edf9f2;
}

.stall.reserved {
    border-color: #e6c56f;
    background: #fff8df;
}

.stall.rented {
    border-color: #9fb8e8;
    background: #eef4ff;
}

.stall.expiring {
    border-color: #e6c56f;
    background: #fff8df;
}

.stall.debt {
    border-color: #1d252c;
    background: #27323a;
    color: #fff;
}

.map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: -3px 0 16px;
}

.map-legend span {
    padding: 3px 8px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 500;
}

.map-legend .available { background: #edf9f2; color: var(--good); }
.map-legend .reserved, .map-legend .expiring { background: #fff8df; color: var(--warn); }
.map-legend .rented { background: #eef4ff; color: #295aa6; }
.map-legend .debt { background: #27323a; color: #fff; }

.stall.closed {
    opacity: .55;
}

.map-toolbar select {
    width: auto;
    min-width: 130px;
    margin: 0;
}

.map-designer-panel {
    overflow: hidden;
}

.map-designer-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.map-canvas-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.map-decoration-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin: 10px 0 14px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fafb;
}

.map-decoration-toolbar > strong {
    margin-right: 3px;
    font-size: 12px;
}

.map-decoration-toolbar > span {
    flex: 1 1 180px;
    margin-left: 6px;
    color: var(--muted);
    font-size: 11px;
}

.map-decoration-toolbar-actions {
    display: flex;
    align-items: center;
    margin-left: auto;
    gap: 7px;
}

.map-grid-bg {
    cursor: crosshair;
}

.map-item-selected {
    outline: 3px solid #168c83 !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 5px rgba(22, 140, 131, .14) !important;
}

.map-selection-marquee {
    position: absolute;
    z-index: 999;
    border: 1px solid var(--brand);
    background: rgba(15, 118, 110, .12);
    pointer-events: none;
}

.map-decoration {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 6px;
    border: var(--decoration-stroke-width) solid var(--decoration-stroke);
    background: var(--decoration-fill);
    color: var(--decoration-stroke);
    font-family: var(--decoration-font), sans-serif;
    font-size: var(--decoration-font-size);
    font-weight: var(--decoration-font-weight);
    text-align: var(--decoration-align);
    transform: rotate(var(--decoration-rotation));
    cursor: move;
    touch-action: none;
    user-select: none;
}

.map-decoration > span {
    width: 100%;
    text-align: var(--decoration-align);
    overflow-wrap: anywhere;
}

.map-decoration-circle {
    border-radius: 50%;
}

.map-decoration-line {
    height: max(8px, var(--decoration-stroke-width));
    padding: 0;
    border: 0;
    background: linear-gradient(var(--decoration-stroke), var(--decoration-stroke)) center / 100% var(--decoration-stroke-width) no-repeat;
}

.map-decoration-text {
    background: color-mix(in srgb, var(--decoration-fill) 75%, transparent);
}

.map-decoration:hover,
.map-decoration:focus-visible {
    outline: 2px dashed var(--brand);
    outline-offset: 3px;
}

.map-decoration-readonly {
    pointer-events: none;
    cursor: default;
}

.map-decoration-readonly:hover {
    outline: none;
}

.decoration-resize-handle {
    position: absolute;
    right: -6px;
    bottom: -6px;
    width: 13px;
    height: 13px;
    border: 2px solid #fff;
    border-radius: 3px;
    background: var(--brand);
    cursor: nwse-resize;
}

.decoration-drawer {
    z-index: 90;
}

.decoration-color-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.decoration-color-grid input[type="color"] {
    width: 100%;
    min-height: 42px;
    padding: 4px;
}

.zoom-label {
    min-width: 48px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

.map-board {
    --map-width: 1600px;
    --map-height: 980px;
    --map-zoom: 1;
    position: relative;
    min-height: 620px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafb;
    touch-action: none;
}

.map-size-spacer {
    width: var(--map-width);
    height: var(--map-height);
    pointer-events: none;
}

.map-canvas {
    position: absolute;
    left: 0;
    top: 0;
    width: var(--map-width);
    height: var(--map-height);
    transform: scale(var(--map-zoom));
    transform-origin: top left;
}

.map-grid-bg {
    position: absolute;
    left: 0;
    top: 0;
    width: var(--map-width);
    height: var(--map-height);
    background-image:
        linear-gradient(#e4ebf0 1px, transparent 1px),
        linear-gradient(90deg, #e4ebf0 1px, transparent 1px);
    background-size: 24px 24px;
}

.map-lock {
    position: absolute;
    z-index: 1;
    display: grid;
    align-content: center;
    gap: 2px;
    min-width: 56px;
    min-height: 44px;
    padding: 8px;
    border: 1px solid #9fd7bd;
    border-radius: 6px;
    background: #edf9f2;
    color: var(--ink);
    font-family: var(--font-sans);
    cursor: grab;
    text-align: left;
    touch-action: none;
    user-select: none;
}

.map-lock {
    justify-items: center;
    text-align: center;
}

.map-lock strong,
.map-lock > span {
    width: 100%;
    text-align: center;
}

.map-lock:active {
    cursor: grabbing;
}

.map-lock strong,
.map-lock span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
}

.map-lock strong {
    font-size: 15px;
}

.map-lock span {
    color: rgba(29, 37, 44, .74);
    font-size: 12px;
}

.map-lock.reserved,
.map-lock.expiring {
    border-color: #e6c56f;
    background: #fff8df;
}

.map-lock.rented {
    border-color: #9fb8e8;
    background: #eef4ff;
}

.map-lock.debt {
    border-color: #1d252c;
    background: #27323a;
    color: #fff;
}

.map-lock.debt span {
    color: rgba(255, 255, 255, .78);
}

.map-lock.closed {
    opacity: .55;
}

/* Checkin page attendance colours */
.map-lock.attendance-present {
    border-color: #9fd7bd;
    background: #edf9f2;
}
.map-lock.attendance-absent {
    border-color: #c7352a;
    background: #fdf2f2;
}
.map-lock.attendance-pending {
    border-color: #c8d5de;
    background: #f2f5f7;
    color: var(--muted);
}
.map-lock .attendance-badge {
    position: absolute;
    right: 4px;
    bottom: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    max-width: calc(100% - 8px);
    min-height: 18px;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    pointer-events: none;
}
.map-lock .attendance-badge.present {
    background: var(--good);
    color: #fff;
}
.map-lock .attendance-badge.absent {
    background: var(--danger);
    color: #fff;
}
.map-lock .attendance-badge.pending {
    background: #8a97a3;
    color: #fff;
}
.map-lock[aria-pressed="true"] {
    outline: 3px solid var(--brand);
    outline-offset: 2px;
    z-index: 2;
    cursor: pointer;
}
.map-lock:not([aria-pressed="true"]) {
    cursor: pointer;
}

/* Legend for checkin */
.map-legend .attendance-present { background: #edf9f2; color: var(--good); border: 1px solid #9fd7bd; }
.map-legend .attendance-absent { background: #fdf2f2; color: var(--danger); border: 1px solid #c7352a; }
.map-legend .attendance-pending { background: #f2f5f7; color: var(--muted); border: 1px solid #c8d5de; }

.checkin-date-form,
.checkin-tabs {
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
}
.checkin-date-form label {
    min-width: 180px;
}
.checkin-date-form input {
    min-height: 38px;
}
.checkin-date-form .checkin-date-shortcut {
    box-sizing: border-box;
    min-height: 38px;
    height: 38px;
    align-items: center;
}
.checkin-tabs {
    align-items: center;
    margin: 0 0 16px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f7fafb;
    width: fit-content;
}
.checkin-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    padding: 7px 12px;
    font-family: var(--font-sans);
    font-weight: 700;
    cursor: pointer;
}
.checkin-tab.active {
    background: #fff;
    color: var(--ink);
    box-shadow: 0 1px 4px rgba(29, 37, 44, .08);
}
.checkin-view[hidden] {
    display: none;
}
.checkin-list-panel {
    display: grid;
    gap: 12px;
}
.checkin-list-head,
.checkin-list-item,
.checkin-list-form,
.checkin-list-main {
    display: flex;
    align-items: center;
    gap: 10px;
}
.checkin-list-head {
    justify-content: space-between;
    color: var(--muted);
}
.checkin-list-head strong {
    color: var(--ink);
}
.checkin-list {
    display: grid;
    gap: 8px;
}
.checkin-list-item {
    justify-content: space-between;
    min-height: 72px;
    padding: 12px;
    border: 1px solid var(--line);
    border-left-width: 4px;
    border-radius: 8px;
    background: #fff;
}
.checkin-list-item.attendance-present {
    border-left-color: var(--good);
}
.checkin-list-item.attendance-absent {
    border-left-color: var(--danger);
}
.checkin-list-item.attendance-pending {
    border-left-color: #8a97a3;
}
.checkin-list-main {
    align-items: flex-start;
    flex: 1 1 220px;
    flex-direction: column;
    gap: 2px;
    min-width: 160px;
}
.checkin-list-main strong {
    font-size: 16px;
}
.checkin-list-main span,
.checkin-list-main small {
    color: var(--muted);
}
.checkin-list-form {
    flex: 1 1 380px;
    justify-content: flex-end;
}
.checkin-list-form input[name="checkin_note"] {
    flex: 1 1 180px;
    min-width: 160px;
}
.checkin-list-form .attendance-actions {
    flex: 0 0 auto;
}

/* Checkin detail panel */
.checkin-detail {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(360px, 90vw);
    background: var(--paper);
    border-left: 1px solid var(--line);
    box-shadow: -4px 0 24px rgba(29, 37, 44, .12);
    z-index: 900;
    overflow-y: auto;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    transition: transform .22s ease;
}
.checkin-detail[aria-hidden="true"] {
    transform: translateX(105%);
}
.checkin-detail .close {
    align-self: flex-end;
    margin-bottom: -10px;
}
.checkin-detail-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.checkin-detail-header h2 {
    margin: 0;
}
.checkin-tenant-info {
    padding: 12px;
    background: var(--bg);
    border-radius: var(--radius);
    font-size: 14px;
}
.checkin-tenant-info p {
    margin: 0 0 4px;
}
.attendance-form {
    display: grid;
    gap: 10px;
    margin-top: 8px;
    padding: 18px 12px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}
.attendance-form p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}
.checkin-panel-title {
    font-weight: 700;
}
.attendance-form-head,
.attendance-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.attendance-form-head {
    justify-content: space-between;
}
.attendance-actions .button {
    flex: 1 1 120px;
}
.attendance-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 3px 9px;
    border-radius: 999px;
    background: #eef3f5;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}
.attendance-status.present {
    background: #edf9f2;
    color: var(--good);
}
.attendance-status.absent {
    background: #fdf2f2;
    color: var(--danger);
}

/* Invoice fine badge */
.invoice-amounts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.invoice-amounts span {
    display: inline;
}
.fine-badge {
    color: var(--danger);
    font-weight: 600;
}
.balance-due {
    color: var(--danger);
}

/* Payment breakdown */
.payment-breakdown {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 4px;
}
.payment-breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    font-size: 14px;
    border-bottom: 1px solid var(--line);
}
.payment-breakdown-row:last-child {
    border-bottom: none;
}
.payment-breakdown-row.fine-row {
    background: #fdf2f2;
    color: var(--danger);
}
.payment-breakdown-row.total-row {
    background: var(--bg);
    font-weight: 600;
}
.payment-breakdown-row.balance-row {
    background: color-mix(in srgb, var(--danger) 6%, #fff);
    font-weight: 700;
}
.payment-breakdown-row .danger {
    color: var(--danger);
}

/* Checkin stat cards */
.checkin-stat span {
    display: flex;
    align-items: center;
    gap: 6px;
}
.checkin-stat.overdue { border-left: 3px solid var(--danger); }
.checkin-stat.due_today { border-left: 3px solid var(--warn); }
.checkin-stat.ok { border-left: 3px solid var(--good); }
.checkin-stat.attendance-present { border-left: 3px solid var(--good); }
.checkin-stat.attendance-absent { border-left: 3px solid var(--danger); }
.checkin-stat.attendance-pending { border-left: 3px solid #7390af; }

.resize-handle {
    position: absolute;
    right: 3px;
    bottom: 3px;
    width: 12px;
    height: 12px;
    border-right: 2px solid rgba(29, 37, 44, .45);
    border-bottom: 2px solid rgba(29, 37, 44, .45);
    cursor: nwse-resize;
}

.two-column {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr);
    gap: 12px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, .8fr);
    gap: 12px;
}

.compact-list {
    display: grid;
    gap: 8px;
}

.compact-list > div {
    display: grid;
    gap: 4px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 10px;
}

.compact-list > div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.compact-list span {
    color: var(--muted);
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.action-tile {
    display: grid;
    gap: 4px;
    align-content: start;
    min-height: 72px;
    padding: 12px 16px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    color: var(--ink);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    box-shadow: var(--shadow-sm);
}

.action-bar h2,
.action-bar p {
    margin: 0;
}

.action-bar p {
    color: var(--muted);
    font-size: 13px;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--icon-text-gap);
    justify-content: flex-end;
}

.summary-row {
    margin-bottom: 16px;
}

.summary-row article {
    padding: 22px 18px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    box-shadow: var(--shadow-sm);
}

.summary-row span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.summary-row strong {
    display: block;
    margin-top: 3px;
    font-size: 18px;
}

.action-tile:hover {
    border-color: var(--brand);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.action-tile span {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.zone-welcome {
    margin-bottom: 24px;
    padding: 24px 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(135deg, #e8f3f1 0%, var(--paper) 60%);
    box-shadow: var(--shadow-sm);
}

.zone-welcome h2 {
    margin: 0 0 6px;
    font-size: 20px;
}

.zone-welcome p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.zone-select-body .app-shell {
    width: 100%;
    max-width: none;
    padding-inline: clamp(16px, 2.4vw, 30px);
}

.zone-select-layout {
    display: grid;
    gap: 20px;
    width: 100%;
}

.zone-select-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    padding: 24px 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(135deg, #e8f3f1 0%, var(--paper) 65%);
    box-shadow: var(--shadow-sm);
}

.zone-select-header-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    flex-shrink: 0;
}

.zone-select-intro h2 {
    margin: 0 0 6px;
    font-size: 22px;
}

.zone-select-intro p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.zone-select-count {
    flex-shrink: 0;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--brand-light);
    color: var(--brand-strong);
    font-size: 13px;
    font-weight: 500;
}

.zone-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    width: 100%;
}

.zone-select-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 20px;
    min-height: 180px;
    padding: 28px 32px;
    border: 2px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    color: var(--ink);
    transition: border-color .2s ease, box-shadow .2s ease, transform .15s ease;
    box-shadow: var(--shadow-sm);
}

.zone-select-card-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.zone-select-card-actions form {
    margin: 0;
}

.zone-select-card:hover {
    border-color: var(--brand);
    box-shadow: var(--shadow-md);
}

.zone-select-card .button {
    min-width: 0;
}

.zone-select-card-main {
    display: flex;
    align-items: flex-start;
    gap: 18px;
}

.zone-select-card-icon {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border-radius: 14px;
    background: var(--brand-light);
    color: var(--brand-strong);
}

.zone-select-card-icon .fa-icon {
    font-size: 24px;
}

.zone-select-card-body {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.zone-select-card-body strong {
    font-size: 20px;
}

.zone-select-card-body span {
    color: var(--muted);
    font-size: 14px;
}

.zone-select-empty {
    width: 100%;
}

.branch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.branch-card {
    display: grid;
    gap: 8px;
    align-content: start;
    padding: 24px;
    border: 2px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    color: var(--ink);
    text-decoration: none;
    cursor: pointer;
    transition: border-color .2s ease, box-shadow .2s ease, transform .15s ease;
    box-shadow: var(--shadow-sm);
}

.branch-card:hover {
    border-color: var(--brand);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.branch-card-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--brand-light);
    color: var(--brand-strong);
    font-size: 22px;
    font-weight: 600;
}

.branch-card strong {
    font-size: 18px;
}

.branch-card span {
    color: var(--muted);
    font-size: 13px;
}

.branch-card .button {
    margin-top: 8px;
    width: 100%;
}

.branch-card span,
.branch-card small {
    color: var(--muted);
}

.empty-state {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 48px 24px;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    text-align: center;
}

.empty-state .empty-icon {
    line-height: 1;
}

.empty-state h3 {
    margin: 0;
}

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

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

.full {
    grid-column: 1 / -1;
}

label,
legend {
    color: #34414b;
    font-weight: 500;
    font-size: 13px;
}

input,
select,
textarea {
    width: 100%;
    margin-top: 5px;
    border: 1px solid #cbd5df;
    border-radius: 7px;
    padding: 7px 9px;
    font-family: var(--font-sans);
    font-size: inherit;
    line-height: inherit;
    background: #fff;
}

textarea {
    resize: vertical;
}

.check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
}

.check-grid label,
.switch {
    font-weight: 400;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--icon-text-gap);
    min-height: 34px;
    border: 0;
    border-radius: 7px;
    background: var(--brand);
    color: #fff;
    padding: 7px 12px;
    font-family: var(--font-sans);
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}

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

.button.danger {
    background: var(--danger);
}

.button.danger:hover {
    background: #8f1d14;
}

.button:disabled {
    cursor: wait;
    opacity: .68;
}

.button.ghost {
    background: #e8f3f1;
    color: var(--brand-strong);
}

.button.ghost.danger {
    background: #fff8f7;
    color: var(--danger);
    border: 1px solid #f0d4d0;
}

.button.ghost.danger:hover {
    background: #fff0ee;
}

.icon-button {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
}

.icon-button:hover {
    border-color: var(--brand);
    color: var(--brand-strong);
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.drawer-actions {
    display: grid;
    gap: 10px;
    margin-top: 8px;
}

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

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

th,
td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    white-space: nowrap;
}

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

tbody tr:hover {
    background: #fafcfd;
}

tbody tr:last-child td {
    border-bottom: 0;
}

.invoice-list {
    display: grid;
    gap: 10px;
}

.invoice-card {
    display: grid;
    grid-template-columns: 1.25fr .9fr 1fr auto;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    align-items: center;
    background: var(--paper);
    box-shadow: var(--shadow-sm);
    transition: box-shadow .15s ease;
}

.invoice-card:hover {
    box-shadow: var(--shadow-md);
}

.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.filter-tab {
    min-height: 34px;
    padding: 6px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--paper);
    color: var(--muted);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s ease;
}

.filter-tab:hover {
    border-color: var(--brand);
    color: var(--brand-strong);
}

.filter-tab.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.invoice-card strong,
.invoice-card span {
    display: block;
}

.invoice-actions,
.modal-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.invoice-actions .button {
    white-space: nowrap;
}

.status {
    width: fit-content;
    margin-top: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #eef2f6;
    color: var(--ink);
    font-weight: 500;
}

.status.overdue {
    background: #fff0ee;
    color: var(--danger);
}

.status.partial {
    background: #fff8df;
    color: var(--warn);
}

.status.paid {
    background: #edfdf2;
    color: var(--good);
}

.status.available {
    background: #edf9f2;
    color: var(--good);
}

.status.reserved,
.status.expiring {
    background: #fff8df;
    color: var(--warn);
}

.status.rented {
    background: #eef4ff;
    color: #295aa6;
}

.status.debt {
    background: #27323a;
    color: #fff;
}

.payment-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 110px 120px 120px 1fr auto auto;
    gap: 6px;
}

.receipt-link {
    grid-column: 1 / -1;
    color: var(--brand-strong);
    font-size: 13px;
    font-weight: 500;
}

.executive-strip {
    margin-bottom: 16px;
}

.executive-strip > div {
    padding: 22px 18px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    box-shadow: var(--shadow-sm);
}

.executive-strip span,
.finance-summary span,
.receipt-meta span { color: var(--muted); font-size: 13px; }
.executive-strip strong,
.finance-summary strong { display: block; margin-top: 3px; font-size: 17px; }
.finance-summary { display: grid; align-content: start; gap: 5px; }
.finance-summary h2 { margin: 0 0 8px; }
.inline-form { display: flex; gap: var(--icon-text-gap); align-items: center; }
.inline-form select { margin: 0; min-width: 150px; }
.inline-form .button { min-height: 36px; padding: 7px 10px; }
.chart-panel { overflow: hidden; }
.bar-chart { height: 160px; display: grid; grid-template-columns: repeat(6, minmax(70px, 1fr)); gap: 12px; align-items: end; }
.bar-item { height: 100%; display: grid; grid-template-rows: 1fr auto auto; gap: 4px; text-align: center; font-size: 12px; }
.bar-track { display: flex; align-items: end; height: 100%; background: #edf2f4; }
.bar-track span { width: 100%; min-height: 8px; background: var(--brand); }
.bar-item strong { font-size: 12px; }
.bar-item small { color: var(--muted); }
.visual-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.visual-grid .panel { margin-bottom: 0; }
.occupancy-panel { display: grid; justify-items: center; }
.occupancy-panel .section-title { width: 100%; }
.donut { width: 130px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--brand) calc(var(--value) * 1%), #e9eef1 0); }
.donut > div { width: 96px; aspect-ratio: 1; display: grid; place-content: center; text-align: center; border-radius: 50%; background: var(--paper); }
.donut strong { font-size: 24px; line-height: 1; }
.donut span { margin-top: 4px; color: var(--muted); font-size: 13px; }
.visual-legend { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; font-size: 12px; }
.visual-legend span { display: grid; gap: 2px; }
.dot { display: inline-block; width: 8px; height: 8px; margin-right: 4px; border-radius: 50%; }
.dot.rented { background: #4d79c7; }.dot.available { background: var(--good); }.dot.reserved { background: #d19b24; }
.status-visual-list, .method-visual-list { display: grid; gap: 10px; }
.status-visual, .method-visual-list > div { display: grid; grid-template-columns: 92px minmax(50px, 1fr) auto; align-items: center; gap: 8px; font-size: 13px; }
.status-visual > div, .method-visual-list > div > div { height: 9px; overflow: hidden; border-radius: 99px; background: #edf1f3; }
.status-visual i, .method-visual-list i { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.status-visual.paid i { background: var(--good); }.status-visual.partial i { background: var(--warn); }.status-visual.unpaid i { background: #7390af; }.status-visual.overdue i { background: var(--danger); }
.method-visual-list i { background: #436a9d; }

.print-page { background: #fff; }
.receipt { width: min(780px, calc(100% - 32px)); margin: 32px auto; }
.receipt h1, .receipt h2 { margin: 0; }
.receipt h2 { font-size: 18px; margin-top: 28px; }
.receipt-head { display: flex; justify-content: space-between; align-items: start; padding-bottom: 20px; border-bottom: 2px solid var(--brand); }
.receipt-brand { display: flex; align-items: center; gap: 12px; }
.receipt-brand img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; }
.receipt-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 18px 0; }
.receipt-meta strong, .receipt-meta small { display: block; }
.receipt-note { margin-top: 28px; color: var(--muted); font-size: 12px; }

.drawer {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(420px, 100%);
    background: var(--paper);
    box-shadow: -24px 0 48px rgba(20, 32, 42, .16);
    transform: translateX(110%);
    transition: transform .2s ease;
    z-index: 8;
    padding: 22px;
    overflow-y: auto;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: none;
    place-items: center;
    padding: 18px;
}

.modal.open {
    display: grid;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(16, 25, 32, .36);
}

.modal-card {
    position: relative;
    z-index: 1;
    width: min(860px, 100%);
    max-height: min(760px, calc(100vh - 36px));
    overflow-y: auto;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    box-shadow: 0 24px 64px rgba(20, 32, 42, .18);
}

.modal-card .close {
    position: absolute;
    top: 10px;
    right: 10px;
}

.toast-stack {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 40;
    display: grid;
    gap: 8px;
    width: min(340px, calc(100vw - 36px));
    pointer-events: none;
}

.toast {
    transform: translateY(8px);
    opacity: 0;
    padding: 11px 13px;
    border: 1px solid #9dd5cf;
    border-radius: 8px;
    background: #e6f6f4;
    color: #164e49;
    box-shadow: 0 14px 36px rgba(20, 32, 42, .14);
    transition: opacity .18s ease, transform .18s ease;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.danger {
    border-color: #f3b4ac;
    background: #fff0ee;
    color: var(--danger);
}

.drawer.open {
    transform: translateX(0);
}

.drawer form {
    display: grid;
    gap: 12px;
}

.drawer h2 {
    margin: 0;
}

.drawer-section {
    margin-top: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.drawer-section h3,
.drawer-section p {
    margin: 0;
}

.billing-schedule {
    display: grid;
    gap: 14px;
}

.billing-schedule .drawer-section p.muted {
    margin-top: 6px;
    font-size: 13px;
}

.billing-type-picker {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.billing-type-radio {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.billing-schedule[data-billing-always-show] {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.billing-schedule[data-billing-always-show] > .drawer-section {
    grid-column: 1 / -1;
}

.billing-choice-section {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 10px;
}

.billing-choice-section > .billing-type-option {
    width: 100%;
}

.billing-choice-section > .billing-panel {
    flex: 1;
}

.billing-type-option {
    display: grid;
    gap: 4px;
    padding: 14px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    text-align: left;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.billing-type-option strong {
    font-size: 14px;
    color: var(--ink);
}

.billing-type-option span {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.35;
}

.billing-type-option:hover {
    border-color: var(--brand);
    background: var(--brand-light);
}

.billing-type-option:hover strong {
    color: var(--brand-strong);
}

.billing-type-option.active {
    border-color: var(--brand);
    background: var(--brand-light);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand) 25%, transparent);
}

.billing-type-option.active strong {
    color: var(--brand-strong);
}

.billing-panel {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--bg) 70%, #fff);
}

.billing-panel-title {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
}

.billing-panel-title select {
    display: block;
    width: 100%;
    margin-top: 8px;
}

@media (max-width: 720px) {
    .billing-schedule[data-billing-always-show] {
        grid-template-columns: 1fr;
    }

}

.billing-chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

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

.report-category-nav {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    padding: 8px;
    margin-bottom: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.report-category-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 8px 10px;
    border-radius: 10px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.report-category-link:hover { background: var(--brand-light); color: var(--brand-strong); }
.report-category-link.active { background: var(--brand); color: #fff; box-shadow: 0 5px 14px rgba(31,100,163,.22); }

.report-filter-bar {
    display: flex;
    align-items: end;
    gap: 12px;
    padding: 16px 18px;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.report-filter-title { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.report-filter-title > .fa-icon { font-size: 22px; color: var(--brand); }
.report-filter-title div { display: grid; }
.report-filter-title span { font-size: 12px; color: var(--muted); }
.report-filter-bar label { min-width: 170px; font-size: 12px; }

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

.report-kpi-grid article { position: relative; overflow: hidden; padding: 18px 20px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.report-kpi-grid article::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: #3b82f6; }
.report-kpi-grid article.green::before { background: #22a06b; }
.report-kpi-grid article.orange::before { background: #e59b24; }
.report-kpi-grid article.red::before { background: #d84b40; }
.report-kpi-grid span { display: block; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.report-kpi-grid strong { font-size: 22px; color: var(--ink); }
.report-kpi-grid small { margin-left: 5px; color: var(--muted); }

.report-dashboard-section,
.report-dataset-section {
    padding: 20px;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: #f9fbfd;
}

.report-dashboard-section > header { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.report-dashboard-section > header > div { display: flex; align-items: center; gap: 12px; }
.report-dashboard-section h2 { margin: 0 0 3px; font-size: 18px; }
.report-dashboard-section header p { margin: 0; color: var(--muted); font-size: 12px; }
.report-section-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: #2563a5; background: #dbeafe; }
.report-section-icon.green { color: #16704b; background: #dcfce7; }
.report-section-icon.orange { color: #9a5b0b; background: #fef3c7; }
.report-section-icon.red { color: #a72d25; background: #fee2e2; }
.report-section-count { padding: 6px 10px; border-radius: 999px; background: #fff; color: var(--muted); font-size: 12px; border: 1px solid var(--line); }
.report-dashboard-section .report-visual-grid { margin-bottom: 0; }
.report-visual-grid.single { grid-template-columns: minmax(0, 1fr); }

.report-overview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.report-donut-card { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.report-donut-card h3 { margin: 0 0 16px; font-size: 14px; }
.report-donut-body { display: grid; grid-template-columns: 132px 1fr; align-items: center; gap: 18px; }
.report-donut { position: relative; width: 132px; height: 132px; border-radius: 50%; }
.report-donut::after { content: ''; position: absolute; inset: 24px; border-radius: 50%; background: #fff; }
.report-donut > span { position: absolute; z-index: 1; inset: 0; display: grid; place-content: center; text-align: center; }
.report-donut strong { font-size: 17px; color: var(--ink); }
.report-donut small { font-size: 10px; color: var(--muted); }
.report-donut-legend { display: grid; gap: 10px; }
.report-donut-legend div { display: grid; grid-template-columns: 9px 1fr auto; align-items: center; gap: 8px; font-size: 12px; }
.report-donut-legend i { width: 9px; height: 9px; border-radius: 50%; }
.report-donut-legend span { color: var(--muted); }
.report-overview-footer { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.report-overview-footer span { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--muted); font-size: 12px; }
.report-overview-footer .fa-icon { color: var(--brand); }
.report-overview-footer strong { color: var(--ink); font-size: 15px; }

.report-dataset-section { background: #fff; }
.report-dataset-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.report-dataset-grid article { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; }
.report-dataset-grid article > span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: var(--brand); background: var(--brand-light); }
.report-dataset-grid strong { font-size: 13px; }
.report-dataset-grid p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.report-dataset-grid b { min-width: 34px; padding: 5px 8px; border-radius: 8px; text-align: center; color: var(--brand-strong); background: var(--brand-light); }

.report-detail-panel { margin-bottom: 18px; }
.report-detail-table { min-width: 1180px; }
.report-detail-table td { vertical-align: middle; }
.report-detail-table td small,
.report-detail-panel table td small { display: block; margin-top: 4px; color: var(--muted); }
.report-result { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.report-result.good { color: #166534; background: #dcfce7; }
.report-result.warn { color: #92400e; background: #fef3c7; }
.report-result.danger { color: #991b1b; background: #fee2e2; }

.report-chart-card {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.report-chart-card h3 {
    margin: 0 0 18px;
    color: var(--ink);
}

.report-bars,
.report-bar-row {
    display: grid;
    gap: 8px;
}

.report-bars {
    gap: 16px;
}

.report-bar-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
}

.report-bar-track {
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: #edf1f5;
}

.report-bar-track i {
    display: block;
    height: 100%;
    min-width: 3px;
    border-radius: inherit;
    background: #3b82f6;
}

.report-bar-track i.green { background: #22a06b; }
.report-bar-track i.orange { background: #e59b24; }
.report-bar-track i.red { background: #d84b40; }
.report-bar-track i.gray { background: #8795a5; }

@media (max-width: 800px) {
    .report-visual-grid { grid-template-columns: 1fr; }
    .report-filter-bar { align-items: stretch; flex-direction: column; }
    .report-category-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .report-kpi-grid, .report-dataset-grid { grid-template-columns: 1fr; }
    .report-overview-grid, .report-overview-footer { grid-template-columns: 1fr; }
    .report-donut-body { grid-template-columns: 110px 1fr; }
    .report-donut { width: 110px; height: 110px; }
    .report-filter-bar label { min-width: 0; }
}

.billing-chip-grid-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.billing-chip {
    position: relative;
    display: block;
    margin: 0;
    cursor: pointer;
}

.billing-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.billing-chip span {
    display: grid;
    place-items: center;
    min-height: 38px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.billing-chip-weekday span {
    min-width: 42px;
    font-size: 14px;
}

.billing-chip:hover span {
    border-color: var(--brand);
    background: var(--brand-light);
    color: var(--brand-strong);
}

.billing-chip input:checked + span,
.billing-chip input:checked:hover + span {
    border-color: var(--brand-strong);
    background: var(--brand);
    color: #fff;
}

.billing-chip input:focus-visible + span {
    outline: 2px solid color-mix(in srgb, var(--brand) 45%, transparent);
    outline-offset: 2px;
}

@media (max-width: 720px) {
    .billing-type-picker {
        grid-template-columns: 1fr;
    }

    .billing-chip-grid-days {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

.close {
    width: 36px;
    height: 36px;
    margin-left: auto;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: #fff;
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--muted);
    cursor: pointer;
    display: inline-grid;
    place-items: center;
    gap: 0;
}

.close .fa-icon {
    margin: 0;
}

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

.setup-box {
    width: min(560px, 100%);
    padding: 28px;
}

.setup-logo {
    width: 58px;
    height: 58px;
    border-radius: 12px;
    object-fit: cover;
    display: block;
    margin-bottom: 12px;
}

.text-danger {
    color: var(--danger);
}

@media (max-width: 960px) {
    .two-column,
    .dashboard-grid,
    .quick-actions,
    .form-grid,
    .invoice-card,
    .payment-row {
        grid-template-columns: 1fr;
    }

    .visual-grid { grid-template-columns: 1fr 1fr; }
    .payment-visual-panel { grid-column: 1 / -1; }

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

    .invoice-actions,
    .modal-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 720px) {
    .app-layout {
        display: block;
    }

    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        padding: 12px 14px 0;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .brand {
        padding: 0 4px 12px;
    }

    .main-nav {
        flex-direction: row;
        overflow-x: auto;
        gap: 8px;
        padding: 0 2px 12px;
        flex: none;
    }

    .main-nav p,
    .nav-label {
        display: none;
    }

    .sidebar-minimal .sidebar-footer,
    .zone-select-body .sidebar-footer {
        display: grid;
        padding: 10px 4px 12px;
    }

    .sidebar-footer {
        display: none;
    }

    .main-nav .nav-link {
        flex: 0 0 auto;
        min-height: 40px;
        padding: 6px 12px;
        background: rgba(255, 255, 255, .85);
        border: 1px solid var(--sidebar-border);
        font-size: 13px;
    }

    .main-nav .nav-link.active {
        border-color: var(--brand);
    }

    .nav-icon {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .nav-text {
        white-space: nowrap;
    }

    .page-header {
        padding: 18px 14px 10px;
    }

    .top-nav {
        gap: 8px;
        padding: 10px 12px;
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .top-nav-context {
        font-size: 11px;
        padding: 6px 10px;
    }

    .top-nav-date span {
        display: none;
    }

    .action-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .action-buttons {
        width: 100%;
        justify-content: flex-start;
    }

    .zone-select-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .zone-select-grid {
        grid-template-columns: 1fr;
    }

    .zone-select-card {
        padding: 22px 20px;
    }

    .zone-select-card-actions {
        width: 100%;
    }

    .zone-select-card-actions form,
    .zone-select-card .button {
        width: 100%;
        min-width: 0;
    }

    .stats-grid article,
    .summary-row article,
    .executive-strip > div {
        flex: 0 0 auto;
        min-width: 128px;
    }

    .checkin-date-form,
    .checkin-date-form label,
    .checkin-date-form .button,
    .checkin-tabs {
        width: 100%;
    }

    .checkin-tabs {
        justify-content: stretch;
    }

    .checkin-tab {
        flex: 1 1 0;
        justify-content: center;
    }

    .checkin-list-item,
    .checkin-list-form {
        align-items: stretch;
        flex-direction: column;
    }

    .checkin-list-form {
        width: 100%;
    }

    .checkin-list-form input[name="checkin_note"],
    .checkin-list-form .attendance-actions {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .app-shell {
        padding-inline: 10px;
    }

    .panel {
        padding: 12px;
    }

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

    .receipt-meta { grid-template-columns: 1fr; }
    .visual-grid { grid-template-columns: 1fr; }
    .payment-visual-panel { grid-column: auto; }
    .bar-chart { gap: 6px; grid-template-columns: repeat(6, minmax(46px, 1fr)); }
    .receipt-head { gap: 12px; flex-direction: column; }
    .inline-form { min-width: 250px; }
}

/* 2026 workspace redesign — structured, quiet and task focused */
:root {
    --ink: #172033;
    --muted: #788397;
    --line: #e8ebf0;
    --paper: #ffffff;
    --bg: #f4f6f9;
    --brand: #1687d9;
    --brand-strong: #0b6fb8;
    --brand-light: #edf7fd;
    --warn: #d58a17;
    --danger: #e94d5b;
    --good: #24b47e;
    --shadow-sm: 0 1px 2px rgba(23, 32, 51, .025);
    --shadow-md: 0 10px 28px rgba(23, 32, 51, .07);
    --radius: 14px;
    --sidebar-width: 252px;
    --sidebar-bg: #ffffff;
    --sidebar-border: #e8ebef;
}

body {
    background: var(--bg);
}

.sidebar {
    background: #fff;
    border-right: 1px solid var(--sidebar-border);
    box-shadow: none;
}

.sidebar-brand {
    min-height: 72px;
    padding: 13px 20px;
    border-bottom-color: var(--sidebar-border);
}

.brand {
    gap: 13px;
}

.brand-mark {
    width: 40px;
    height: 40px;
    overflow: hidden;
    border-radius: 11px;
    background: #f5c51d;
    box-shadow: 0 3px 10px rgba(23, 32, 51, .1);
}

.brand-mark img {
    display: block;
}

.brand-text strong {
    color: var(--ink);
    font-size: 15px;
}

.brand-text small {
    color: #9099a8;
}

.main-nav {
    gap: 7px;
    padding: 22px 14px;
}

.main-nav .nav-link {
    position: relative;
    min-height: 46px;
    padding: 8px 13px;
    border-radius: 11px;
    color: #687488;
    font-weight: 500;
}

.main-nav .nav-link:hover:not(.active) {
    background: #f4f7fa;
    color: var(--ink);
}

.main-nav .nav-link.active {
    background: var(--brand-light);
    color: var(--brand-strong);
    box-shadow: none;
}

.main-nav .nav-link.active::before {
    content: "";
    position: absolute;
    left: -14px;
    width: 4px;
    height: 24px;
    border-radius: 0 4px 4px 0;
    background: var(--brand);
}

.nav-icon,
.main-nav .nav-link.active .nav-icon,
.main-nav .nav-link:hover:not(.active) .nav-icon {
    color: currentColor;
}

.sidebar-footer {
    padding: 16px 18px 19px;
    border-top-color: var(--sidebar-border);
}

.user-card {
    color: var(--ink);
}

.user-avatar {
    background: #e9f4fb;
    color: var(--brand-strong);
}

.user-badge span {
    color: #8b95a5;
}

.sidebar-zone {
    border-top-color: var(--sidebar-border);
}

.zone-badge {
    background: var(--brand-light);
    color: var(--brand-strong);
}

.sidebar-action {
    color: #657287;
}

.sidebar-action:hover {
    background: #f3f6f9;
    color: var(--brand-strong);
}

.logout-btn {
    color: #ff9099;
}

.logout-btn:hover {
    background: #fff1f2;
}

.page-header {
    min-height: 72px;
    padding-inline: clamp(24px, 3.2vw, 48px);
    border-bottom: 0;
    border-bottom: 1px solid var(--line);
    background: #fff;
}

.top-nav-context-page {
    font-size: clamp(19px, 1.7vw, 23px);
    letter-spacing: -.025em;
}

.top-nav-context-zone {
    color: #8a94a6;
    font-size: 11px;
}

.top-nav-date {
    min-height: 36px;
    padding: 7px 11px;
    border: 0;
    border-radius: 10px;
    background: #f5f7f9;
    box-shadow: none;
}

.top-nav-date .fa-icon {
    color: var(--brand);
}

.app-shell,
.zone-select-body .app-shell {
    padding: 24px clamp(24px, 3.2vw, 48px) 42px;
}

.app-shell:has(> .quick-actions:first-child),
.app-shell:has(> .stats-grid:first-child),
.app-shell:has(> .summary-row:first-child) {
    padding-top: 24px;
}

.zone-welcome,
.zone-select-header {
    background: linear-gradient(135deg, var(--brand-light) 0%, #fff 62%);
}

.sidebar-hint-icon,
.action-tile strong .fa-icon,
.zone-select-card-icon,
.branch-card-icon,
.empty-icon {
    background: var(--brand-light);
    color: var(--brand);
}

.user-avatar {
    background: var(--brand-light);
    color: var(--brand-strong);
}

.billing-type-option:hover,
.billing-type-option.active {
    border-color: var(--brand);
    background: var(--brand-light);
}

.billing-type-option:hover strong,
.billing-type-option.active strong {
    color: var(--brand-strong);
}

.panel,
.stats-grid article,
.summary-row article,
.executive-strip > div,
.action-tile,
.action-bar,
.zone-select-card,
.zone-select-header,
.branch-card,
.login-card,
.setup-box {
    border: 0;
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(23, 32, 51, .035);
}

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

.quick-actions,
.stats-grid,
.summary-row,
.executive-strip {
    gap: 16px;
    margin-bottom: 24px;
}

.action-tile {
    min-height: 104px;
    padding: 21px 22px;
    border: 1px solid transparent;
}

.action-tile:hover,
.zone-select-card:hover,
.branch-card:hover {
    border-color: #dbe6f7;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.action-tile strong .fa-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: var(--brand-light);
    color: var(--brand);
}

.stats-grid article,
.summary-row article,
.executive-strip > div {
    min-height: 112px;
    padding: 21px 22px;
}

.stats-grid article {
    border-left: 3px solid #9ecfeb;
}

.stats-grid article:nth-child(2) { border-left-color: #f1c36f; }
.stats-grid article:nth-child(3) { border-left-color: #f39aa2; }
.stats-grid article:nth-child(4) { border-left-color: #8ca9db; }

.stats-grid strong {
    font-size: clamp(23px, 2.2vw, 30px);
    letter-spacing: -.02em;
}

.section-title {
    margin-bottom: 18px;
}

.section-title h2 {
    font-size: 17px;
}

.text-link {
    padding: 5px 9px;
    border-radius: 8px;
    color: var(--brand-strong);
}

.text-link:hover {
    background: var(--brand-light);
}

.action-bar {
    min-height: 86px;
    padding: 20px 22px;
    margin-bottom: 22px;
}

.button {
    min-height: 40px;
    padding: 8px 15px;
    border-radius: 9px;
    background: var(--brand);
    box-shadow: none;
}

.button:hover {
    background: var(--brand-strong);
    box-shadow: none;
}

.button.ghost {
    border-color: transparent;
    background: #f2f4f7;
    color: #536075;
    box-shadow: none;
}

.button.ghost:hover {
    border-color: transparent;
    background: #e9edf2;
}

input,
select,
textarea {
    min-height: 42px;
    margin-top: 7px;
    padding: 9px 12px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: #f3f5f7;
}

input:hover,
select:hover,
textarea:hover {
    background: #eef1f5;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #91b9f7;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(22, 135, 217, .1);
}

.table-wrap {
    margin: 0 -22px -22px;
}

th {
    background: #f7f8fa;
    color: #9099a9;
}

th,
td {
    padding-inline: 22px;
    border-bottom-color: #eff1f4;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover {
    background: #f8faff;
}

.filter-tabs,
.checkin-tabs {
    border: 0;
    background: #edf0f4;
}

.filter-tab.active,
.checkin-tab.active {
    color: var(--brand-strong);
    box-shadow: 0 1px 4px rgba(23, 32, 51, .09);
}

.zone-select-header {
    padding: 23px 24px;
}

.zone-select-card {
    position: relative;
    overflow: hidden;
    padding: 25px;
    border: 1px solid transparent;
}

.zone-select-card::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: #84b3fb;
}

.zone-select-card-icon,
.branch-card-icon,
.empty-icon {
    background: var(--brand-light);
    color: var(--brand);
}

.modal-backdrop {
    background: rgba(14, 21, 33, .55);
    backdrop-filter: blur(4px);
}

.modal-card {
    padding: 26px;
    border-radius: 18px;
    box-shadow: 0 28px 80px rgba(13, 21, 34, .24);
}

.modal-card .close {
    border: 0;
    background: #f1f3f6;
}

.map-board {
    border: 0;
    border-radius: 12px;
    box-shadow: inset 0 0 0 1px #e7ebf0;
}

.login-body {
    background:
        radial-gradient(circle at 20% 15%, rgba(22, 135, 217, .08), transparent 28rem),
        #f4f6f9;
}

.login-card {
    padding: 30px;
    box-shadow: 0 22px 60px rgba(23, 32, 51, .11);
}

.login-shell,
.login-card,
.login-brand .brand-text {
    min-width: 0;
}

.login-brand .brand-text small {
    overflow-wrap: anywhere;
}

/* Compact density pass — shared by every management page */
:root {
    --radius: 11px;
    --sidebar-width: 228px;
}

body {
    font-size: 13px;
}

.sidebar-brand {
    min-height: 60px;
    padding: 10px 16px;
}

.brand {
    gap: 10px;
}

.brand-mark {
    width: 34px;
    height: 34px;
}

.brand-text strong {
    font-size: 13px;
}

.brand-text small {
    font-size: 10px;
}

.main-nav {
    gap: 4px;
    padding: 14px 10px;
}

.main-nav .nav-link {
    min-height: 38px;
    padding: 6px 10px;
    border-radius: 8px;
}

.main-nav .nav-link.active::before {
    left: -10px;
    width: 3px;
    height: 20px;
}

.nav-icon,
.main-nav .nav-link.active .nav-icon,
.main-nav .nav-link:hover:not(.active) .nav-icon {
    width: 24px;
    height: 24px;
    font-size: 13px;
}

.nav-text {
    font-size: 13px;
}

.sidebar-footer {
    gap: 6px;
    padding: 11px 14px 13px;
}

.user-avatar {
    width: 31px;
    height: 31px;
}

.user-card {
    gap: 9px;
}

.user-badge strong,
.sidebar-action,
.logout-btn {
    font-size: 12px;
}

.page-header {
    min-height: 48px;
    padding-block: 0;
    padding-inline: clamp(18px, 2.5vw, 34px);
}

.top-nav {
    width: 100%;
    min-height: 48px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.breadcrumb {
    display: none;
}

.top-nav-context {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 7px;
    width: auto;
    min-height: 0;
    max-width: calc(100% - 150px);
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    white-space: nowrap;
}

.top-nav-context-page {
    order: 1;
    color: var(--ink);
    font-size: clamp(15px, 1.2vw, 17px);
    font-weight: 600;
    line-height: 1.15;
}

.top-nav-context-zone {
    order: 2;
    color: var(--muted);
    font-size: 10px;
    font-weight: 400;
}

.top-nav-context-zone .fa-icon,
.top-nav-context-sep {
    display: none;
}

.top-nav-date {
    min-height: 28px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
}

.app-shell,
.zone-select-body .app-shell,
.app-shell:has(> .quick-actions:first-child),
.app-shell:has(> .stats-grid:first-child),
.app-shell:has(> .summary-row:first-child) {
    padding: 18px clamp(18px, 2.5vw, 34px) 32px;
}

.panel {
    padding: 15px;
    margin-bottom: 14px;
}

.quick-actions,
.stats-grid,
.summary-row,
.executive-strip {
    gap: 10px;
    margin-bottom: 14px;
}

.action-tile {
    min-height: 78px;
    padding: 13px 15px;
}

.action-tile strong {
    font-size: 13px;
}

.action-tile strong .fa-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
}

.action-tile span,
.stats-grid span,
.summary-row span,
.executive-strip span {
    font-size: 12px;
}

.stats-grid article,
.summary-row article,
.executive-strip > div {
    min-height: 82px;
    padding: 13px 15px;
}

.stats-grid strong {
    margin-top: 4px;
    font-size: clamp(18px, 1.7vw, 23px);
}

.summary-row strong,
.executive-strip strong {
    margin-top: 4px;
    font-size: 17px;
}

.section-title {
    margin-bottom: 11px;
}

.section-title h2 {
    font-size: 14px;
}

.section-title p {
    font-size: 12px;
}

.text-link {
    padding: 3px 6px;
    border-radius: 6px;
    font-size: 12px;
}

.action-bar {
    min-height: 64px;
    padding: 13px 15px;
    margin-bottom: 14px;
}

.action-bar h2 {
    font-size: 15px;
}

.action-bar p {
    font-size: 12px;
}

.button {
    min-height: 34px;
    padding: 6px 11px;
    border-radius: 7px;
    font-size: 12px;
}

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

input,
select,
textarea {
    min-height: 36px;
    margin-top: 5px;
    padding: 6px 9px;
    border-radius: 7px;
    font-size: 13px;
}

textarea {
    min-height: 70px;
}

label,
legend {
    font-size: 12px;
}

.table-wrap {
    margin: 0 -15px -15px;
}

th,
td {
    height: 44px;
    padding: 8px 15px;
}

th {
    height: 38px;
    font-size: 10px;
}

.filter-tabs,
.checkin-tabs {
    padding: 3px;
}

.filter-tab,
.checkin-tab {
    min-height: 30px;
    padding: 5px 9px;
    font-size: 11px;
}

.zone-select-header {
    padding: 15px 17px;
}

.zone-select-intro h2 {
    font-size: 18px;
}

.zone-select-card {
    padding: 17px;
}

.zone-select-card-icon {
    width: 38px;
    height: 38px;
}

.modal-card {
    padding: 18px;
    border-radius: 13px;
}

.close {
    width: 30px;
    height: 30px;
    font-size: 12px;
}

.form-grid {
    gap: 10px;
}

.invoice-card,
.checkin-list-item {
    padding: 11px 13px;
}

.donut {
    width: 108px;
}

.donut > div {
    width: 78px;
}

.donut strong {
    font-size: 20px;
}

.bar-chart {
    height: 132px;
}

.empty-state {
    padding: 28px 16px;
}

.empty-icon {
    width: 44px;
    height: 44px;
}

.drawer,
.checkin-detail {
    padding: 16px;
}

.login-card {
    padding: 22px;
}

/* Balanced density — readable without returning to the oversized layout */
:root {
    --radius: 12px;
    --sidebar-width: 240px;
}

body {
    font-size: 14px;
}

.sidebar-brand {
    min-height: 64px;
    padding: 11px 17px;
}

.brand-mark {
    width: 46px;
    height: 46px;
    aspect-ratio: 1;
    flex: 0 0 46px;
    overflow: hidden;
    border: 1px solid #e2e6eb;
    border-radius: 0;
    background: #fff;
}

.brand-mark img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 0;
}

.brand-text strong {
    font-size: 14px;
}

.brand-text small {
    font-size: 10px;
}

.main-nav {
    gap: 5px;
    padding: 16px 11px;
}

.main-nav .nav-link {
    min-height: 42px;
    padding: 7px 11px;
    border-radius: 9px;
}

.nav-icon,
.main-nav .nav-link.active .nav-icon,
.main-nav .nav-link:hover:not(.active) .nav-icon {
    width: 27px;
    height: 27px;
    font-size: 14px;
}

.nav-text {
    font-size: 14px;
}

.page-header,
.top-nav {
    min-height: 56px;
}

.page-header {
    position: sticky;
    top: 0;
    z-index: 7;
    overflow: hidden;
    border-bottom: 1px solid #dce7f0;
    background: #fff;
    box-shadow: 0 3px 14px rgba(31, 56, 82, .045);
}

.page-header::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 2px;
    background: linear-gradient(90deg, var(--brand) 0 80px, rgba(22, 135, 217, .16) 80px 32%, transparent 62%);
}

.top-nav {
    position: relative;
    z-index: 1;
}

.top-nav-context-page::before {
    content: "";
    width: 5px;
    height: 20px;
    display: inline-block;
    flex: 0 0 5px;
    margin-right: 3px;
    border-radius: 99px;
    background: linear-gradient(180deg, #4eaff0, var(--brand-strong));
    box-shadow: 0 3px 8px rgba(22, 135, 217, .22);
}

.top-nav-context-page {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: clamp(18px, 1.45vw, 20px);
    font-weight: 650;
}

.top-nav-context-zone {
    min-height: 24px;
    padding: 3px 8px;
    border: 1px solid #d8eaf6;
    border-radius: 999px;
    background: rgba(237, 247, 253, .85);
    color: var(--brand-strong);
    font-size: 11px;
}

.top-nav-date {
    min-height: 32px;
    padding: 5px 10px;
    border: 1px solid #dfe8ef;
    border-radius: 9px;
    background: rgba(255, 255, 255, .88);
    color: #536176;
    font-size: 12px;
    box-shadow: 0 2px 7px rgba(31, 56, 82, .05);
}

.top-nav-date .fa-icon {
    width: 24px;
    height: 24px;
    display: inline-grid;
    place-items: center;
    margin: -2px 2px -2px -4px;
    border-radius: 7px;
    background: var(--brand-light);
    color: var(--brand-strong);
}

.app-shell,
.zone-select-body .app-shell,
.app-shell:has(> .quick-actions:first-child),
.app-shell:has(> .stats-grid:first-child),
.app-shell:has(> .summary-row:first-child) {
    padding: 22px clamp(20px, 2.7vw, 38px) 38px;
}

.panel {
    padding: 18px;
    margin-bottom: 17px;
}

.quick-actions,
.stats-grid,
.summary-row,
.executive-strip {
    gap: 13px;
    margin-bottom: 17px;
}

.action-tile {
    min-height: 88px;
    padding: 16px 18px;
}

.action-tile strong {
    font-size: 14px;
}

.action-tile strong .fa-icon {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 34px;
    margin: 0;
    border-radius: 9px;
    line-height: 1;
    text-align: center;
    vertical-align: middle;
}

.action-tile strong .fa-icon::before {
    display: block;
    line-height: 1;
}

.action-tile span,
.stats-grid span,
.summary-row span,
.executive-strip span {
    font-size: 13px;
}

.stats-grid article,
.summary-row article,
.executive-strip > div {
    min-height: 94px;
    padding: 16px 18px;
}

.stats-grid strong {
    margin-top: 6px;
    font-size: clamp(21px, 1.9vw, 26px);
}

.summary-row strong,
.executive-strip strong {
    font-size: 19px;
}

.section-title {
    margin-bottom: 14px;
}

.section-title h2 {
    font-size: 16px;
}

.section-title p,
.action-bar p {
    font-size: 13px;
}

.action-bar {
    min-height: 72px;
    padding: 16px 18px;
    margin-bottom: 17px;
}

.action-bar h2 {
    font-size: 17px;
}

.button {
    min-height: 38px;
    padding: 7px 13px;
    border-radius: 8px;
    font-size: 13px;
}

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

input,
select,
textarea {
    min-height: 40px;
    padding: 8px 11px;
    border-radius: 8px;
    font-size: 14px;
}

label,
legend {
    font-size: 13px;
}

.table-wrap {
    margin: 0 -18px -18px;
}

th,
td {
    height: 48px;
    padding: 10px 18px;
}

th {
    height: 42px;
    font-size: 11px;
}

.zone-select-header {
    padding: 18px 20px;
}

.zone-select-card {
    padding: 20px;
}

.modal-card {
    padding: 21px;
    border-radius: 14px;
}

.login-card {
    position: relative;
    overflow: hidden;
    padding: 26px;
    border: 1px solid #e2e8ee;
    box-shadow: 0 18px 48px rgba(23, 45, 68, .1);
}

.login-brand {
    justify-content: center;
    padding: 3px 0 17px;
    text-align: left;
}

.login-brand > span:last-child {
    min-width: 0;
}

.login-brand > span:last-child strong,
.login-brand > span:last-child small {
    display: block;
}

.login-card > .section-title {
    justify-content: center;
    margin-bottom: 18px;
    text-align: center;
}

.login-card > .section-title > div {
    width: 100%;
}

.login-card > .section-title h1 {
    margin: 0 0 6px;
    color: var(--ink);
    font-size: 23px;
    line-height: 1.25;
}

.login-card > .section-title p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.login-form {
    gap: 13px;
}

.login-form .button {
    margin-top: 3px;
}

.password-field {
    position: relative;
    display: block;
}

.password-field input {
    width: 100%;
    padding-right: 46px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 7px;
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transform: translateY(-50%);
}

.password-toggle:hover {
    background: var(--brand-light);
    color: var(--brand-strong);
}

.password-toggle .fa-icon {
    margin: 0;
}

.login-hint {
    padding-top: 3px;
    text-align: center;
}

/* Zone picker — clear hierarchy and scannable cards */
.zone-select-layout {
    gap: 18px;
    width: 100%;
    max-width: none;
    margin: 0 auto;
}

.zone-select-header,
.zone-select-table-wrap {
    width: 100%;
}

.zone-select-header {
    position: relative;
    min-height: 116px;
    padding: 20px 22px;
    overflow: hidden;
    border: 1px solid #e1e8ee;
    background: #fff;
    box-shadow: 0 4px 18px rgba(23, 32, 51, .045);
}

.zone-select-header::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--brand);
}

.zone-select-heading {
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 0;
}

.zone-select-heading-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    flex: 0 0 48px;
    border: 1px solid #d4e9f6;
    border-radius: 13px;
    background: var(--brand-light);
    color: var(--brand-strong);
}

.zone-select-heading-icon .fa-icon {
    margin: 0;
    font-size: 19px;
}

.zone-select-intro {
    position: relative;
    z-index: 1;
}

.zone-select-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
    color: var(--brand-strong);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: .02em;
}

.zone-select-kicker .fa-icon {
    margin: 0;
}

.zone-select-intro h2 {
    margin: 0 0 4px;
    color: var(--ink);
    font-size: 20px;
    line-height: 1.3;
}

.zone-select-intro p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.zone-select-header-actions {
    position: relative;
    z-index: 1;
}

.zone-select-count {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    padding: 5px 11px;
    border: 1px solid #dceaf4;
    border-radius: 8px;
    background: #f5fafd;
    color: var(--brand-strong);
    font-size: 12px;
    font-weight: 650;
}

.zone-select-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
}

.zone-select-card {
    min-height: 98px;
    padding: 15px 16px 15px 18px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
    border: 1px solid #e2e7ec;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(23, 32, 51, .035);
}

.zone-select-card::after {
    width: 3px;
    background: var(--brand);
    opacity: .7;
}

.zone-select-card:hover {
    border-color: #bddcf0;
    box-shadow: 0 10px 26px rgba(23, 75, 112, .09);
    transform: translateY(-2px);
}

.zone-select-card-main {
    align-items: center;
    gap: 14px;
}

.zone-select-card-icon {
    width: 46px;
    height: 46px;
    border: 1px solid #d7ebf7;
    border-radius: 12px;
    background: var(--brand-light);
    color: var(--brand-strong);
}

.zone-select-card-icon .fa-icon {
    margin: 0;
    font-size: 18px;
}

.zone-select-card-body {
    width: 100%;
    gap: 2px;
}

.zone-select-card-body > strong {
    color: var(--ink);
    font-size: 18px;
    line-height: 1.35;
}

.zone-select-card-subtitle {
    color: var(--muted);
    font-size: 12px;
}

.zone-select-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 7px;
}

.zone-select-card-meta span {
    min-height: 27px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border: 1px solid #e6eaf0;
    border-radius: 7px;
    background: #f7f8fa;
    color: #5f6c80;
    font-size: 11px;
}

.zone-select-card-meta .fa-icon {
    margin: 0;
    color: var(--brand);
}

.zone-select-card-actions {
    display: grid;
    grid-template-columns: auto auto;
    gap: 8px;
    padding: 0 0 0 18px;
    border-top: 0;
    border-left: 1px solid #edf0f3;
}

.zone-select-card-actions form,
.zone-select-enter {
    width: auto;
}

.zone-select-enter {
    justify-content: center;
    min-width: 154px;
}

.zone-select-card-actions > .button.ghost {
    min-width: 78px;
}

.zone-select-empty {
    min-height: 300px;
    place-content: center;
    justify-items: center;
}

.zone-select-table-wrap {
    overflow-x: auto;
    border: 1px solid #e1e6eb;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 3px 14px rgba(23, 32, 51, .045);
}

.zone-select-table {
    width: 100%;
    min-width: 620px;
    border-collapse: separate;
    border-spacing: 0;
}

.zone-select-table th {
    height: 42px;
    padding: 9px 17px;
    border-bottom: 1px solid #e6eaee;
    background: #f7f9fb;
    color: #727e90;
    font-size: 11px;
    font-weight: 650;
    letter-spacing: .02em;
    text-align: left;
}

.zone-select-table td {
    height: 72px;
    padding: 11px 17px;
    border-bottom: 1px solid #edf0f3;
    vertical-align: middle;
}

.zone-select-table tbody tr:last-child td {
    border-bottom: 0;
}

.zone-select-table tbody tr {
    transition: background .15s ease;
}

.zone-select-table tbody tr:hover {
    background: #f8fbfd;
}

.zone-select-table-name {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 210px;
}

.zone-select-table-name .zone-select-card-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
}

.zone-select-table-name strong,
.zone-select-table-name small {
    display: block;
}

.zone-select-table-name strong {
    color: var(--ink);
    font-size: 14px;
}

.zone-select-table-name small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

.zone-select-table-value {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #566377;
    white-space: nowrap;
}

.zone-select-table-value .fa-icon {
    width: 17px;
    margin: 0;
    color: #8a9bad;
    text-align: center;
}

.zone-select-actions-heading {
    width: 245px;
    text-align: right !important;
}

.zone-select-table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
}

.zone-select-table-actions form {
    margin: 0;
}

.zone-select-table-actions .zone-select-enter {
    min-width: 116px;
}

.zone-select-table-actions .button.ghost {
    min-width: 72px;
}

/* Stalls table — preserve all nine columns and scroll when space is limited */
.stalls-table-wrap {
    position: relative;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
}

.stalls-table {
    width: 100%;
    min-width: 1120px;
    table-layout: auto;
}

.stalls-table th:nth-child(1),
.stalls-table td:nth-child(1) {
    min-width: 90px;
}

.stalls-table th:nth-child(2),
.stalls-table td:nth-child(2) {
    min-width: 120px;
}

.stalls-table th:nth-child(3),
.stalls-table td:nth-child(3) {
    min-width: 100px;
}

.stalls-table th:nth-child(4),
.stalls-table td:nth-child(4) {
    min-width: 110px;
}

.stalls-table th:nth-child(5),
.stalls-table td:nth-child(5) {
    min-width: 110px;
}

.stalls-table th:nth-child(6),
.stalls-table td:nth-child(6) {
    min-width: 90px;
}

.stalls-table th:nth-child(7),
.stalls-table td:nth-child(7) {
    min-width: 170px;
}

.stalls-table th:nth-child(8),
.stalls-table td:nth-child(8) {
    min-width: 125px;
}

.stalls-table th:nth-child(9),
.stalls-table td:nth-child(9) {
    min-width: 180px;
}

.stalls-table .table-actions {
    flex-wrap: nowrap;
    justify-content: flex-start;
}

.stalls-table .table-actions .inline-form {
    min-width: 0;
}

/* Invoice workspace */
.filter-tabs {
    color: var(--ink);
}

.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    width: 100%;
    margin: 0;
    padding: 0 14px;
    border: 1px solid #dfe5eb;
    border-bottom: 0;
    border-radius: 10px 10px 0 0;
    background: #fff;
}

.filter-tabs .filter-tab {
    min-height: 45px;
    padding: 8px 16px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    color: #637084;
    -webkit-text-fill-color: #637084;
    opacity: 1;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
}

.filter-tabs .filter-tab:hover {
    background: #f8fafc;
    color: var(--brand-strong);
    -webkit-text-fill-color: var(--brand-strong);
}

.filter-tabs .filter-tab.active {
    border-bottom-color: var(--brand);
    background: transparent;
    color: var(--brand-strong);
    -webkit-text-fill-color: var(--brand-strong);
    box-shadow: none;
}

.invoice-advanced-filters {
    margin: 0;
    padding: 16px;
    border: 1px solid #dfe5eb;
    border-radius: 0;
    background: #f8fafc;
}

.invoice-filter-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 1px solid #e3e8ed;
}

.invoice-filter-heading > div {
    min-width: 0;
}

.invoice-filter-heading strong,
.invoice-filter-heading span {
    display: block;
}

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

.invoice-filter-heading strong .fa-icon {
    margin-right: 6px;
    color: var(--brand);
}

.invoice-filter-heading span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.invoice-filter-grid {
    display: grid;
    grid-template-columns: minmax(230px, 1.6fr) repeat(3, minmax(145px, 1fr));
    gap: 12px;
}

.invoice-filter-grid label {
    min-width: 0;
    color: #49566a;
    font-size: 12px;
    font-weight: 600;
}

.invoice-filter-search {
    grid-column: auto;
}

.invoice-filter-grid input,
.invoice-filter-grid select {
    width: 100%;
    min-height: 40px;
    margin-top: 5px;
    background: #fff;
    border-color: #dce3ea;
    border-radius: 7px;
    font-size: 13px;
}

.invoice-filter-result {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px;
    min-height: 43px;
    margin: 0 0 14px;
    padding: 9px 16px;
    border: 1px solid #dfe5eb;
    border-top: 0;
    border-radius: 0 0 10px 10px;
    background: #fff;
}

.invoice-filter-result > span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
}

.invoice-filter-result strong {
    color: var(--ink);
    font-size: 13px;
}

.invoice-table-wrap {
    max-width: 100%;
    min-width: 0;
    width: 100%;
    overflow-x: auto;
    border: 1px solid #dfe5eb;
    border-radius: 10px;
    background: #fff;
    scrollbar-width: thin;
}

.invoice-table {
    width: 100%;
    min-width: 1060px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.invoice-table th {
    height: 43px;
    padding: 9px 9px;
    border-bottom: 1px solid #dfe5eb;
    background: #f4f7f9;
    color: #5c687a;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
    text-align: left;
    white-space: nowrap;
}

.invoice-table td {
    height: 64px;
    padding: 10px 9px;
    border-bottom: 1px solid #edf0f3;
    color: #344054;
    font-size: 12px;
    line-height: 1.35;
    vertical-align: middle;
}

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

.invoice-table tbody tr:hover td {
    background: #f9fbfd;
}

.invoice-table td > strong,
.invoice-table td > small {
    display: block;
}

.invoice-table td > strong {
    color: var(--ink);
    font-size: 13px;
    font-weight: 650;
}

.invoice-table td > small {
    margin-top: 3px;
    color: #7b8798;
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.invoice-table th:nth-child(1) { width: 13%; }
.invoice-table th:nth-child(2) { width: 15.5%; }
.invoice-table th:nth-child(3) { width: 13.5%; }
.invoice-table th:nth-child(4) { width: 9.5%; }
.invoice-table th:nth-child(5),
.invoice-table th:nth-child(6),
.invoice-table th:nth-child(7) { width: 8.5%; }
.invoice-table th:nth-child(8) { width: 9%; }
.invoice-table th:nth-child(9) { width: 14%; }

.invoice-table td:nth-child(2) strong,
.invoice-table td:nth-child(3) .invoice-billing-cycle {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.invoice-table td:nth-child(1) strong {
    font-size: 12px;
    white-space: nowrap;
}

.invoice-table td:nth-child(2) {
    padding-right: 14px;
}

.invoice-table td:nth-child(4) {
    text-align: center;
    white-space: nowrap;
}

.invoice-table th:nth-child(4) {
    text-align: center;
}

.invoice-table .amount-column {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.invoice-billing-cycle {
    display: block;
    color: #344054;
    font-weight: 600;
    white-space: nowrap;
}

.invoice-fine-text,
.invoice-table .invoice-balance-due {
    color: #d43d4f;
}

.invoice-table .status {
    margin: 0 auto;
    white-space: nowrap;
}

.invoice-table th:nth-child(8),
.invoice-table td:nth-child(8) {
    padding-inline: 8px;
    text-align: center;
}

.invoice-action-heading {
    text-align: center !important;
}

.invoice-table td:last-child {
    min-width: 0;
}

.invoice-table-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
    white-space: nowrap;
}

.invoice-table-actions .button {
    gap: 5px;
    min-height: 34px;
    padding: 6px 7px;
    border-radius: 7px;
    font-size: 11px;
}

.invoice-table-actions .button .fa-icon {
    margin-right: 0;
}

.invoice-table-actions .invoice-detail-button {
    flex: 0 0 34px;
    width: 34px;
    padding-inline: 0;
}

.invoice-detail-modal {
    width: min(720px, calc(100vw - 28px));
    max-height: calc(100vh - 36px);
    overflow-y: auto;
}

.invoice-detail-heading {
    padding-right: 38px;
}

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

.invoice-detail-grid > div {
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fafbfc;
}

.invoice-detail-grid span,
.invoice-detail-grid strong {
    display: block;
}

.invoice-detail-grid span {
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 11px;
}

.invoice-detail-totals {
    margin-bottom: 16px;
}

.invoice-payment-history h3 {
    margin: 0 0 9px;
    font-size: 14px;
}

.invoice-payment-history article {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 14px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
}

.invoice-payment-history article div span,
.invoice-payment-history article small {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.invoice-payment-history article p {
    grid-column: 1 / -1;
    margin: 2px 0 0;
    font-size: 12px;
}

@media (max-width: 620px) {
    .invoice-detail-grid {
        grid-template-columns: 1fr;
    }

    .invoice-payment-history article {
        grid-template-columns: 1fr;
    }
}

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

.invoice-panel {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.invoice-billing-label {
    display: block;
    margin: 4px 0;
    color: #6d7a8d;
    font-size: 11px;
}

.invoice-billing-label .fa-icon {
    margin-right: 3px;
    color: var(--brand);
}

.invoice-no-results {
    min-height: 180px;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 5px;
    color: var(--muted);
    text-align: center;
}

.invoice-no-results[hidden] {
    display: none;
}

.invoice-no-results > .fa-icon {
    margin: 0 0 6px;
    color: #9aabc0;
    font-size: 24px;
}

.invoice-no-results strong {
    color: var(--ink);
}

.invoice-no-results span {
    font-size: 12px;
}

@media (max-width: 1000px) {
    .invoice-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .filter-tabs .filter-tab {
        flex: 0 0 auto;
    }
}

@media (max-width: 560px) {
    .invoice-filter-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .invoice-filter-heading .button {
        width: 100%;
    }

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

    .invoice-filter-search {
        grid-column: auto;
    }

    .invoice-filter-result {
        display: grid;
        grid-template-columns: 1fr;
    }
}

.stall-edit-modal {
    width: min(760px, 100%);
}

.stall-edit-modal .section-title {
    padding-right: 38px;
}

.stall-utility-options {
    min-width: 0;
    margin: 0;
    padding: 9px 11px;
    border: 1px solid #e3e7ec;
    border-radius: 8px;
    background: #f7f9fa;
}

.stall-utility-options legend {
    padding: 0 4px;
}

.stall-utility-options label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 3px 14px 3px 0;
    color: #526075;
    cursor: pointer;
}

.stall-utility-options input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-height: 0;
    margin: 0;
    padding: 0;
    accent-color: var(--brand);
}

.account-permissions {
    margin: 4px 0 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.account-permissions legend {
    padding: 0 5px;
    font-weight: 700;
}

.account-permissions p {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 12px;
}

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

.account-permission-grid label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 500;
}

.account-permission-grid input {
    width: 16px;
    min-height: 16px;
    margin: 0;
}

.account-access-summary {
    min-width: 210px;
}

.account-access-summary span {
    display: inline-block;
    margin: 2px;
    padding: 3px 7px;
    border-radius: 999px;
    background: var(--brand-light);
    color: var(--brand-strong);
    font-size: 11px;
}

.operator-note {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.35;
}

.profile-panel {
    width: 100%;
    max-width: none;
    margin-inline: 0;
}

.profile-form input[readonly] {
    background: #f4f6f8;
    color: var(--muted);
    cursor: not-allowed;
}

.manual-layout {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    align-items: start;
    gap: 20px;
}

.manual-toc {
    position: sticky;
    top: 20px;
    display: grid;
    gap: 3px;
    padding: 16px;
}

.manual-toc h2 {
    margin: 0 0 8px;
    font-size: 15px;
}

.manual-toc a {
    padding: 7px 9px;
    border-radius: 7px;
    color: var(--muted);
    font-size: 12px;
    text-decoration: none;
}

.manual-toc a:hover {
    background: var(--brand-light);
    color: var(--brand-strong);
}

.manual-content {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.manual-section {
    position: relative;
    scroll-margin-top: 20px;
}

.manual-section h2 {
    margin: 0 0 12px 42px;
    font-size: 18px;
}

.manual-section p,
.manual-section li {
    color: #536075;
    font-size: 13px;
    line-height: 1.75;
}

.manual-section ol,
.manual-section ul {
    margin: 8px 0 0;
    padding-left: 22px;
}

.manual-step {
    position: absolute;
    top: 20px;
    left: 20px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--brand-light);
    color: var(--brand-strong);
    font-size: 11px;
    font-weight: 800;
}

.manual-note {
    margin-top: 14px;
    padding: 11px 13px;
    border-left: 3px solid var(--brand);
    border-radius: 7px;
    background: #f4faf8;
    color: #536075;
    font-size: 12px;
    line-height: 1.6;
}

.manual-flow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
}

.manual-flow span {
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    font-size: 12px;
    font-weight: 600;
}

.manual-flow i {
    color: var(--muted);
    font-style: normal;
}

.billing-cleanup-panel {
    border-color: #f0d4d0;
}

.billing-cleanup-warning {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid #f0d4d0;
    border-radius: 10px;
    background: #fff8f7;
    color: var(--danger);
}

.billing-cleanup-warning > .fa-icon {
    margin-top: 2px;
}

.billing-cleanup-warning strong,
.billing-cleanup-warning span {
    display: block;
}

.billing-cleanup-warning span {
    margin-top: 3px;
    color: #7b5555;
    font-size: 12px;
}

.billing-cleanup-form {
    max-width: 760px;
}

.billing-cleanup-form label > small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 11px;
}

.billing-cleanup-range {
    padding: 0;
}

.billing-cleanup-confirm {
    margin-top: 6px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fafbfc;
}

@media (max-width: 900px) {
    .manual-layout {
        grid-template-columns: 1fr;
    }

    .manual-toc {
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .manual-toc h2 {
        grid-column: 1 / -1;
    }
}

.stall-edit-modal .modal-actions {
    padding-top: 5px;
}

/* Tenant page stall directory */
.tenant-stalls-table-wrap {
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
}

.tenant-stalls-table {
    width: 100%;
    min-width: 1060px;
}

.tenant-stalls-table th:nth-child(1),
.tenant-stalls-table td:nth-child(1) {
    min-width: 85px;
}

.tenant-stalls-table th:nth-child(2),
.tenant-stalls-table td:nth-child(2) {
    min-width: 120px;
}

.tenant-stalls-table th:nth-child(3),
.tenant-stalls-table td:nth-child(3) {
    min-width: 100px;
}

.tenant-stalls-table th:nth-child(4),
.tenant-stalls-table td:nth-child(4) {
    min-width: 110px;
}

.tenant-stalls-table th:nth-child(5),
.tenant-stalls-table td:nth-child(5) {
    min-width: 170px;
}

.tenant-stalls-table th:nth-child(6),
.tenant-stalls-table td:nth-child(6) {
    min-width: 125px;
}

.tenant-stalls-table th:nth-child(7),
.tenant-stalls-table td:nth-child(7) {
    min-width: 112px;
}

.tenant-edit-modal {
    width: min(720px, 100%);
}

.tenant-edit-modal .section-title {
    padding-right: 38px;
}

.tenant-edit-modal .modal-actions {
    padding-top: 5px;
}

/* Keep the tenant directory within the page instead of forcing horizontal scrolling. */
.tenant-stats article {
    position: relative;
}

.tenant-stats article span .fa-icon {
    margin-right: 5px;
    color: var(--brand);
}

.tenant-stats article small {
    margin-left: 6px;
    color: var(--muted);
    font-size: 12px;
}

.tenant-table-filters {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(150px, 220px) auto auto;
    align-items: end;
    gap: 12px;
    margin: 0 0 18px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fafb;
}

.tenant-table-filters label span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 12px;
}

.tenant-table-filters input,
.tenant-table-filters select {
    width: 100%;
    margin-top: 0;
    background: #fff;
}

.tenant-filter-clear {
    min-height: 40px;
}

.tenant-filter-result {
    align-self: center;
    margin: 20px 0 0;
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.tenant-filter-empty td {
    padding: 34px 16px !important;
    color: var(--muted);
    text-align: center;
}

.tenant-stalls-panel .tenant-stalls-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.tenant-stalls-panel {
    min-width: 0;
    overflow: hidden;
}

.tenant-stalls-panel .tenant-stalls-table {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.tenant-stalls-panel .tenant-stalls-table th,
.tenant-stalls-panel .tenant-stalls-table td {
    min-width: 0;
    height: auto;
    padding: 13px 11px;
    font-size: 13px;
    line-height: 1.45;
    white-space: normal;
    overflow-wrap: anywhere;
    vertical-align: middle;
}

.tenant-stalls-panel .tenant-stalls-table th:nth-child(1) { width: 15%; }
.tenant-stalls-panel .tenant-stalls-table th:nth-child(2) { width: 12%; }
.tenant-stalls-panel .tenant-stalls-table th:nth-child(3) { width: 15%; }
.tenant-stalls-panel .tenant-stalls-table th:nth-child(4) { width: 12%; }
.tenant-stalls-panel .tenant-stalls-table th:nth-child(5) { width: 13%; }
.tenant-stalls-panel .tenant-stalls-table th:nth-child(6) { width: 18%; }
.tenant-stalls-panel .tenant-stalls-table th:nth-child(7) { width: 15%; }

.tenant-stalls-panel .tenant-stalls-table .status {
    display: inline-flex;
    max-width: 100%;
    padding: 5px 7px;
    white-space: normal;
    text-align: center;
}

.tenant-stalls-panel .tenant-stalls-table .button {
    width: 100%;
    min-width: 0;
    padding: 9px 7px;
    font-size: 12px;
    white-space: normal;
}

@media (max-width: 980px) {
    .tenant-table-filters {
        grid-template-columns: minmax(0, 1fr) minmax(140px, 190px);
    }

    .tenant-filter-clear,
    .tenant-filter-result {
        margin-top: 0;
    }

    .tenant-stalls-panel .tenant-stalls-table th,
    .tenant-stalls-panel .tenant-stalls-table td {
        padding-inline: 5px;
        font-size: 11px;
    }

    .tenant-stalls-panel .tenant-stalls-table th:nth-child(1) { width: 15%; }
    .tenant-stalls-panel .tenant-stalls-table th:nth-child(2) { width: 12%; }
    .tenant-stalls-panel .tenant-stalls-table th:nth-child(3) { width: 15%; }
    .tenant-stalls-panel .tenant-stalls-table th:nth-child(4) { width: 12%; }
    .tenant-stalls-panel .tenant-stalls-table th:nth-child(5) { width: 13%; }
    .tenant-stalls-panel .tenant-stalls-table th:nth-child(6) { width: 18%; }
    .tenant-stalls-panel .tenant-stalls-table th:nth-child(7) { width: 15%; }
}

@media (max-width: 620px) {
    .tenant-table-filters {
        grid-template-columns: 1fr;
    }

    .tenant-filter-result {
        margin-top: 0;
    }

    .tenant-stalls-panel .tenant-stalls-table .tenant-row-actions .tenant-edit-button {
        flex: 0 0 32px;
        width: 32px;
        padding-inline: 0;
    }

    .tenant-stalls-panel .tenant-stalls-table .tenant-row-actions .tenant-edit-button span {
        display: none;
    }
}

@media (min-width: 1200px) {
    .app-shell,
    .zone-select-body .app-shell,
    .app-shell:has(> .quick-actions:first-child),
    .app-shell:has(> .stats-grid:first-child),
    .app-shell:has(> .summary-row:first-child) {
        width: 100%;
        max-width: none;
        padding-inline: clamp(18px, 1.8vw, 30px);
    }

    .page-header {
        padding-inline: clamp(18px, 1.8vw, 30px);
    }

    .panel {
        width: 100%;
        padding: 24px;
    }

    .page-tenants .tenant-stalls-panel .section-title {
        margin-bottom: 20px;
    }

    .page-tenants .tenant-stalls-table-wrap {
        margin-inline: 0;
        margin-bottom: 0;
        border: 1px solid var(--line);
        border-radius: 12px;
    }

    .page-tenants .tenant-stalls-table th,
    .page-tenants .tenant-stalls-table td {
        padding: 15px 14px;
        font-size: 14px;
        line-height: 1.5;
    }

    .page-tenants .tenant-stalls-table th {
        font-size: 12px;
    }

    .page-tenants .tenant-stalls-table .button {
        padding: 10px 9px;
        font-size: 13px;
    }
}

@media (min-width: 1600px) {
    .app-shell,
    .zone-select-body .app-shell,
    .app-shell:has(> .quick-actions:first-child),
    .app-shell:has(> .stats-grid:first-child),
    .app-shell:has(> .summary-row:first-child),
    .page-header {
        padding-inline: 36px;
    }

    .panel {
        padding: 28px;
    }

    .page-tenants .tenant-stalls-table-wrap {
        margin-inline: 0;
        margin-bottom: 0;
    }

    .page-tenants .tenant-stalls-table th,
    .page-tenants .tenant-stalls-table td {
        padding: 17px 16px;
        font-size: 15px;
    }
}

/* Check-in modal */
.checkin-modal {
    padding: 18px;
}

.checkin-modal-card {
    width: min(560px, 100%);
    max-height: calc(100vh - 36px);
    overflow-y: auto;
    padding: 22px;
    border: 1px solid #e0e7ed;
    border-radius: 15px;
    background: #fff;
}

.checkin-modal-card > .close {
    position: absolute;
    top: 17px;
    right: 17px;
    z-index: 2;
}

.checkin-detail-header {
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-right: 42px;
    margin-bottom: 16px;
}

.checkin-detail-title {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.checkin-detail-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    border: 1px solid #d8eaf6;
    border-radius: 11px;
    background: var(--brand-light);
    color: var(--brand-strong);
}

.checkin-detail-title small {
    display: block;
    margin-bottom: 1px;
    color: var(--muted);
    font-size: 11px;
}

.checkin-detail-title h2 {
    margin: 0;
    color: var(--ink);
    font-size: 20px;
    line-height: 1.25;
}

.checkin-tenant-info {
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid #e5e9ee;
    border-radius: 10px;
    background: #f7f9fb;
}

.checkin-info-label {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 650;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.checkin-tenant-info p {
    margin: 0;
}

.checkin-tenant-info p + p {
    margin-top: 4px;
    color: #5b687b;
    font-size: 12px;
}

.checkin-tenant-info .fa-phone {
    width: 17px;
    color: var(--brand);
}

.checkin-tenant-empty {
    display: flex;
    align-items: center;
    gap: 10px;
    border-color: #e2e6eb;
    background: #f7f8fa;
}

.checkin-empty-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    flex: 0 0 34px;
    border-radius: 9px;
    background: #e9edf1;
    color: #7b8797;
}

.checkin-tenant-empty strong {
    color: #526075;
    font-size: 13px;
}

.checkin-tenant-empty p {
    margin-top: 2px !important;
}

.attendance-status.disabled {
    background: #e8ebef;
    color: #6f7b8b;
}

.checkin-disabled-panel {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px 14px;
    border: 1px dashed #cfd6de;
    border-radius: 10px;
    background: #f7f8fa;
    color: #758193;
}

.checkin-disabled-panel > .fa-solid {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    flex: 0 0 36px;
    border-radius: 9px;
    background: #e7ebef;
}

.checkin-disabled-panel strong,
.checkin-disabled-panel span {
    display: block;
}

.checkin-disabled-panel strong {
    color: #536075;
    font-size: 13px;
}

.checkin-disabled-panel span {
    margin-top: 2px;
    font-size: 11px;
}

.checkin-list-disabled {
    min-width: 260px;
    padding: 9px 11px;
    border-radius: 8px;
    background: #f0f2f5;
    color: #6f7b8b;
    font-size: 12px;
    text-align: center;
}

.checkin-list-disabled .fa-icon {
    color: #8a95a3;
}

.checkin-modal .attendance-form {
    gap: 12px;
    margin: 0;
    padding: 14px;
    border: 1px solid #e2e7ec;
    border-radius: 11px;
    background: #fff;
}

.checkin-modal .attendance-form-head {
    padding-bottom: 10px;
    border-bottom: 1px solid #edf0f3;
}

.checkin-modal .attendance-form-head small {
    color: var(--muted);
    font-size: 11px;
}

.checkin-modal .checkin-panel-title {
    color: var(--ink);
    font-size: 14px;
    font-weight: 650;
}

.checkin-modal .attendance-form > p {
    padding: 7px 9px;
    border-radius: 7px;
    background: #f5f7f9;
    color: #687589;
    font-size: 11px;
}

.checkin-modal .attendance-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.checkin-modal .attendance-actions .button {
    width: 100%;
    min-height: 40px;
    justify-content: center;
}

.checkin-modal .attendance-actions .fa-solid {
    margin-right: 5px;
}

.checkin-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin: 0 0 17px;
    padding: 5px;
    border: 1px solid #dfe6ec;
    border-radius: 11px;
    background: #eef2f5;
}

.checkin-tabs .checkin-tab {
    width: 100%;
    min-height: 48px;
    justify-content: center;
    gap: 9px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #5b687a;
    font-size: 15px;
    font-weight: 650;
}

.checkin-tabs .checkin-tab .fa-icon {
    margin: 0;
    font-size: 16px;
}

.checkin-tabs .checkin-tab:hover {
    background: rgba(255, 255, 255, .7);
    color: var(--brand-strong);
}

.checkin-tabs .checkin-tab.active {
    background: #fff;
    color: var(--brand-strong);
    box-shadow: 0 3px 10px rgba(23, 49, 72, .09);
}

@media (max-width: 520px) {
    .checkin-modal {
        padding: 10px;
    }

    .checkin-modal-card {
        max-height: calc(100vh - 20px);
        padding: 17px;
        border-radius: 12px;
    }

    .checkin-detail-header {
        align-items: flex-start;
        flex-direction: column;
        padding-right: 38px;
    }
}

@media (max-width: 720px) {
    .sidebar {
        background: #fff;
        border-bottom: 1px solid var(--line);
    }

    .sidebar-brand {
        min-height: 60px;
        padding: 10px 14px;
    }

    .brand-mark {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
        border-radius: 0;
    }

    .main-nav {
        padding: 5px 12px 9px;
    }

    .main-nav .nav-link {
        border: 1px solid var(--line);
        background: #fff;
        color: #687488;
    }

    .main-nav .nav-link.active {
        border-color: #cfe8f7;
        background: var(--brand-light);
        color: var(--brand-strong);
    }

    .main-nav .nav-link.active::before {
        display: none;
    }

    .page-header {
        min-height: 54px;
        padding: 0 14px;
    }

    .top-nav {
        min-height: 54px;
    }

    .top-nav-context-page {
        font-size: 18px;
    }

    .top-nav-context-zone {
        display: none;
    }

    .app-shell,
    .zone-select-body .app-shell,
    .app-shell:has(> .quick-actions:first-child),
    .app-shell:has(> .stats-grid:first-child),
    .app-shell:has(> .summary-row:first-child) {
        padding: 17px 14px 30px;
    }

    .login-body {
        padding: 14px;
    }

    .login-card {
        padding: 23px 19px;
    }

    .login-brand .brand {
        align-items: flex-start;
    }

    .zone-select-layout {
        gap: 13px;
    }

    .zone-select-header {
        min-height: 0;
        padding: 17px 17px 17px 19px;
    }

    .zone-select-heading {
        align-items: flex-start;
    }

    .zone-select-heading-icon {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }

    .zone-select-intro h2 {
        font-size: 18px;
    }

    .zone-select-grid {
        grid-template-columns: 1fr;
        gap: 11px;
    }

    .zone-select-table-wrap {
        border-radius: 11px;
    }

    .zone-select-card {
        min-height: 0;
        padding: 17px;
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 14px;
    }

    .zone-select-card-actions {
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 13px 0 0;
        border-top: 1px solid #edf0f3;
        border-left: 0;
    }

    .zone-select-card-actions form,
    .zone-select-enter {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .panel {
        padding: 15px;
    }

    .table-wrap {
        margin: 0 -15px -15px;
    }

    th,
    td {
        padding-inline: 15px;
    }

    .zone-select-card-actions {
        grid-template-columns: 1fr;
    }

    .zone-select-card-actions > .button.ghost {
        width: 100%;
    }
}

@media print {
    .no-print { display: none !important; }
    .receipt { width: 100%; margin: 0; }
}

/* Previous refresh kept as a low-priority fallback for older browsers/components. */
@layer legacy-refresh {
/* 2026 admin refresh — clean, spacious management theme */
:root {
    --ink: #182031;
    --muted: #7b8496;
    --line: #e2e6eb;
    --paper: #ffffff;
    --bg: #f5f6f8;
    --brand: #2fba84;
    --brand-strong: #159766;
    --brand-light: #ebfaf4;
    --warn: #d18a18;
    --danger: #ef3f48;
    --good: #20ad79;
    --shadow-sm: 0 1px 2px rgba(24, 32, 49, .025);
    --shadow-md: 0 8px 24px rgba(24, 32, 49, .07);
    --radius: 14px;
    --sidebar-width: 246px;
    --sidebar-bg: #fff;
    --sidebar-border: #e5e8ec;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-size: 14px;
}

h1,
h2,
h3,
h4,
strong,
th {
    font-weight: 600;
}

.sidebar {
    padding: 0;
    background: #fff;
    border-right: 1px solid var(--sidebar-border);
}

.sidebar-brand {
    min-height: 94px;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 20px 22px;
    border-bottom: 1px solid var(--sidebar-border);
}

.brand {
    width: 100%;
    gap: 12px;
    padding: 0;
}

.brand:hover {
    background: transparent;
}

.brand-mark {
    width: 10px;
    height: 10px;
    overflow: visible;
    border-radius: 50%;
    background: var(--brand);
    box-shadow: none;
}

.brand-mark img {
    display: none;
}

.brand-text strong {
    color: var(--ink);
    font-size: 16px;
    line-height: 1.25;
}

.brand-text small {
    margin-top: 2px;
    color: #9aa2b2;
    font-size: 11px;
}

.main-nav {
    gap: 4px;
    padding: 22px 12px 16px;
}

.nav-label {
    display: none;
}

.main-nav .nav-link {
    min-height: 45px;
    gap: 13px;
    padding: 8px 13px;
    border-radius: 10px;
    color: #697284;
    font-weight: 600;
}

.main-nav .nav-link:hover:not(.active) {
    background: #f6f8f9;
    color: var(--ink);
}

.main-nav .nav-link.active {
    background: var(--brand-light);
    color: var(--brand-strong);
    box-shadow: none;
}

.nav-icon,
.main-nav .nav-link.active .nav-icon,
.main-nav .nav-link:hover:not(.active) .nav-icon {
    width: 28px;
    height: 28px;
    background: transparent;
    color: currentColor;
    font-size: 15px;
}

.nav-text {
    font-size: 14px;
}

.sidebar-footer {
    gap: 8px;
    padding: 16px 20px 20px;
    border-top: 1px solid var(--sidebar-border);
}

.user-card,
.sidebar-zone {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: #e6e9ee;
    color: #616b7c;
    box-shadow: none;
}

.user-badge strong {
    font-size: 13px;
}

.user-badge span {
    color: #929aaa;
    font-size: 11px;
}

.sidebar-zone {
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid #eff1f3;
}

.zone-badge {
    padding: 5px 8px;
    background: var(--brand-light);
    color: var(--brand-strong);
}

.logout-btn {
    min-height: 34px;
    padding: 7px 8px;
    border: 0;
    background: transparent;
    color: var(--danger);
}

.logout-btn:hover {
    border-color: transparent;
    background: #fff3f3;
}

.page-header {
    min-height: 94px;
    display: flex;
    align-items: center;
    padding: 0 clamp(22px, 3vw, 40px);
    border-bottom: 1px solid var(--line);
    background: #fff;
}

.top-nav {
    width: 100%;
    min-height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.breadcrumb {
    display: none;
}

.top-nav-context {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: auto;
    min-height: 0;
    max-width: min(720px, 70vw);
    padding: 0;
    border-radius: 0;
    background: transparent;
    white-space: normal;
}

.top-nav-context-page {
    order: 1;
    color: var(--ink);
    font-size: clamp(20px, 2vw, 25px);
    font-weight: 700;
    line-height: 1.2;
}

.top-nav-context-zone {
    order: 2;
    color: #9aa2b2;
    font-size: 12px;
    font-weight: 400;
}

.top-nav-context-zone .fa-icon,
.top-nav-context-sep {
    display: none;
}

.top-nav-date {
    min-height: 38px;
    padding: 8px 12px;
    border-color: #dfe3e8;
    border-radius: 9px;
    color: #697284;
    box-shadow: 0 1px 2px rgba(24, 32, 49, .03);
}

.top-nav-date .fa-icon {
    color: var(--ink);
}

.app-shell,
.zone-select-body .app-shell {
    width: 100%;
    max-width: none;
    padding: 28px clamp(22px, 3vw, 40px) 42px;
}

.app-shell:has(> .quick-actions:first-child),
.app-shell:has(> .stats-grid:first-child),
.app-shell:has(> .summary-row:first-child) {
    padding-top: 28px;
}

.panel,
.stats-grid article,
.summary-row article,
.executive-strip > div,
.action-tile,
.action-bar,
.zone-select-card,
.zone-select-header,
.branch-card,
.login-card,
.setup-box {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

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

.section-title {
    align-items: center;
    margin-bottom: 16px;
}

.section-title h2 {
    font-size: 16px;
    font-weight: 700;
}

.text-link {
    color: var(--brand-strong);
    font-weight: 600;
}

.stats-grid,
.summary-row,
.executive-strip {
    gap: 14px;
    margin-bottom: 22px;
}

.stats-grid article,
.summary-row article,
.executive-strip > div {
    min-height: 104px;
    padding: 20px;
}

.stats-grid article::before {
    display: none;
}

.stats-grid span {
    padding-top: 0;
    font-size: 13px;
}

.stats-grid strong {
    margin-top: 8px;
    color: var(--ink);
    font-size: clamp(22px, 2.2vw, 28px);
    font-weight: 700;
}

.summary-row span,
.executive-strip span {
    color: #858e9f;
}

.summary-row strong,
.executive-strip strong {
    margin-top: 8px;
    color: var(--ink);
    font-size: 21px;
    font-weight: 700;
}

.quick-actions {
    gap: 14px;
    margin-bottom: 22px;
}

.action-tile {
    min-height: 94px;
    padding: 18px 20px;
}

.action-tile:hover,
.zone-select-card:hover,
.branch-card:hover {
    border-color: #cfd6dc;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.action-tile strong {
    font-size: 15px;
}

.action-tile strong .fa-icon {
    width: 32px;
    height: 32px;
    display: inline-grid;
    place-items: center;
    border-radius: 9px;
    background: var(--brand-light);
    color: var(--brand-strong);
}

.action-bar {
    min-height: 78px;
    padding: 18px 20px;
    margin-bottom: 20px;
}

.button {
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 8px;
    background: var(--ink);
    font-weight: 600;
    transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}

.button:hover {
    background: #2a3446;
    box-shadow: 0 5px 12px rgba(24, 32, 49, .12);
}

.button.ghost {
    border: 1px solid #dfe3e8;
    background: #fff;
    color: #465164;
}

.button.ghost:hover {
    border-color: #cbd1d8;
    background: #f8f9fa;
    box-shadow: none;
}

.button.danger {
    background: var(--danger);
}

.button.ghost.danger {
    border-color: #ffc7ca;
    background: #fff;
    color: var(--danger);
}

.icon-button {
    width: 38px;
    height: 38px;
    border-color: #dfe3e8;
    border-radius: 8px;
}

input,
select,
textarea {
    min-height: 40px;
    margin-top: 6px;
    padding: 8px 11px;
    border-color: #dfe3e8;
    border-radius: 8px;
    color: var(--ink);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

textarea {
    min-height: 86px;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(47, 186, 132, .12);
}

label,
legend {
    color: #5e687a;
    font-weight: 600;
}

.table-wrap {
    margin: 0 -20px -20px;
}

table {
    border-collapse: separate;
    border-spacing: 0;
}

th,
td {
    height: 52px;
    padding: 12px 20px;
    border-bottom-color: #eceef1;
}

th {
    height: 44px;
    background: #fafbfc;
    color: #a0a8b7;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .045em;
}

tbody tr:hover {
    background: #fcfdfd;
}

.status,
.attendance-status,
.filter-tab {
    font-size: 12px;
    font-weight: 700;
}

.status {
    padding: 4px 9px;
}

.status.overdue {
    background: #ffe8e9;
}

.status.partial,
.status.reserved,
.status.expiring {
    background: #fff3d8;
}

.status.paid,
.status.available {
    background: #e6f8f1;
}

.status.rented {
    background: #e8f0ff;
    color: #3672d9;
}

.filter-tabs,
.checkin-tabs {
    gap: 5px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f7f8fa;
    width: fit-content;
}

.filter-tab,
.checkin-tab {
    min-height: 34px;
    border: 0;
    border-radius: 7px;
    background: transparent;
}

.filter-tab.active,
.checkin-tab.active {
    background: #fff;
    color: var(--ink);
    box-shadow: 0 1px 4px rgba(24, 32, 49, .08);
}

.invoice-card,
.checkin-list-item {
    border-color: var(--line);
    border-radius: 11px;
    box-shadow: none;
}

.invoice-card:hover {
    border-color: #d5dae0;
    box-shadow: var(--shadow-sm);
}

.zone-select-header,
.zone-welcome {
    background: #fff;
}

.zone-select-card {
    padding: 24px;
    border-width: 1px;
}

.zone-select-card-icon,
.branch-card-icon,
.empty-icon {
    background: var(--brand-light);
    color: var(--brand-strong);
}

.empty-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 14px;
}

.empty-icon .fa-icon {
    font-size: 22px;
}

.empty-state {
    border-style: dashed;
    background: #fbfcfc;
}

.map-board {
    border-color: var(--line);
    border-radius: 10px;
    background: #fafbfc;
}

.map-grid-bg {
    background-image:
        linear-gradient(#edf0f2 1px, transparent 1px),
        linear-gradient(90deg, #edf0f2 1px, transparent 1px);
}

.map-lock {
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(24, 32, 49, .05);
}

.modal-backdrop {
    background: rgba(16, 23, 36, .42);
    backdrop-filter: blur(2px);
}

.modal-card {
    padding: 22px;
    border-radius: 14px;
    box-shadow: 0 24px 70px rgba(20, 28, 42, .2);
}

.tenant-row-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    white-space: nowrap;
}

.tenant-stalls-panel .tenant-stalls-table .tenant-row-actions .button {
    width: 100%;
    min-height: 34px;
    padding: 7px 6px;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
}

.tenant-stalls-panel .tenant-stalls-table .tenant-row-actions .tenant-edit-button {
    flex: 1 1 0;
    min-width: 0;
}

.tenant-stalls-panel .tenant-stalls-table .tenant-row-actions .tenant-edit-button span {
    display: inline-block;
    white-space: nowrap;
}

.tenant-stalls-panel .tenant-stalls-table .tenant-row-actions .tenant-calendar-button {
    flex: 0 0 32px;
    width: 32px;
    min-width: 32px;
    padding-inline: 0;
}

.tenant-stalls-panel .tenant-stalls-table th:nth-child(1) { width: 14%; }
.tenant-stalls-panel .tenant-stalls-table th:nth-child(2) { width: 12%; }
.tenant-stalls-panel .tenant-stalls-table th:nth-child(3) { width: 14%; }
.tenant-stalls-panel .tenant-stalls-table th:nth-child(4) { width: 11%; }
.tenant-stalls-panel .tenant-stalls-table th:nth-child(5) { width: 13%; }
.tenant-stalls-panel .tenant-stalls-table th:nth-child(6) { width: 20%; }
.tenant-stalls-panel .tenant-stalls-table th:nth-child(7) { width: 16%; }

.tenant-stalls-panel .tenant-stalls-table th:nth-child(7),
.tenant-stalls-panel .tenant-stalls-table td:nth-child(7) {
    min-width: 0;
    overflow-wrap: normal;
    white-space: nowrap;
}

.attendance-calendar-modal {
    width: min(720px, calc(100vw - 28px));
}

.attendance-calendar-heading,
.attendance-calendar-toolbar,
.attendance-calendar-legend {
    display: flex;
    align-items: center;
}

.attendance-calendar-heading {
    justify-content: space-between;
    gap: 18px;
    padding-right: 38px;
}

.attendance-calendar-heading h2,
.attendance-calendar-heading p {
    margin: 0;
}

.attendance-calendar-heading p {
    margin-top: 4px;
    color: var(--muted);
}

.attendance-calendar-toolbar {
    justify-content: center;
    gap: 16px;
    margin: 22px 0 12px;
}

.attendance-calendar-toolbar strong {
    min-width: 190px;
    text-align: center;
    font-size: 18px;
}

.attendance-calendar-legend {
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 13px;
}

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

.attendance-calendar-legend i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e9edf1;
}

.attendance-calendar-legend i.present { background: #2fba84; }
.attendance-calendar-legend i.absent { background: #e35d68; }

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

.attendance-calendar-weekdays span {
    padding: 8px 4px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.attendance-calendar-grid {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--line);
    gap: 1px;
}

.attendance-calendar-day {
    position: relative;
    min-height: 76px;
    padding: 8px;
    background: #fff;
}

.attendance-calendar-day > span {
    display: grid;
    width: 25px;
    height: 25px;
    place-items: center;
    border-radius: 50%;
    font-weight: 700;
}

.attendance-calendar-day strong,
.attendance-calendar-day small {
    display: block;
    margin-top: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
}

.attendance-calendar-day.present { background: #e9f9f2; color: #167653; }
.attendance-calendar-day.absent { background: #fff0f1; color: #b83643; }
.attendance-calendar-day.outside { opacity: .36; background: #f7f8fa; }
.attendance-calendar-day.today > span { background: var(--brand); color: #fff; }
.attendance-calendar-summary { margin: 14px 0 0; text-align: center; color: var(--muted); }

@media (max-width: 600px) {
    .attendance-calendar-modal { padding: 16px; }
    .attendance-calendar-heading { align-items: flex-start; }
    .attendance-calendar-day { min-height: 54px; padding: 5px; }
    .attendance-calendar-day strong { font-size: 9px; }
    .attendance-calendar-day small { display: none; }
}

.drawer,
.checkin-detail {
    box-shadow: -12px 0 36px rgba(20, 28, 42, .12);
}

.login-body {
    background:
        radial-gradient(circle at 15% 15%, rgba(47, 186, 132, .09), transparent 28%),
        var(--bg);
}

.login-card {
    padding: 28px;
}

.login-brand .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    overflow: hidden;
    background: #f5c51d;
}

.login-brand .brand-mark img {
    display: block;
}

@media (max-width: 720px) {
    .sidebar {
        padding: 0;
    }

    .sidebar-brand {
        min-height: 70px;
        padding: 14px 18px;
    }

    .main-nav {
        padding: 10px 12px 12px;
    }

    .main-nav .nav-link {
        border-color: #e6e9ed;
        background: #fff;
    }

    .main-nav .nav-link.active {
        border-color: #c7edde;
        background: var(--brand-light);
        color: var(--brand-strong);
    }

    .page-header {
        min-height: 76px;
        padding: 14px 16px;
    }

    .top-nav {
        overflow: visible;
    }

    .top-nav-context {
        flex: 1 1 auto;
        min-width: 0;
        max-width: none;
        font-size: inherit;
    }

    .top-nav-context-page {
        font-size: 19px;
    }

    .top-nav-date {
        padding: 8px 10px;
    }

    .top-nav-employee {
        min-height: 36px;
        padding: 8px 9px;
    }

    .top-nav-meta .top-nav-date {
        display: none;
    }

    .app-shell,
    .zone-select-body .app-shell,
    .app-shell:has(> .quick-actions:first-child),
    .app-shell:has(> .stats-grid:first-child),
    .app-shell:has(> .summary-row:first-child) {
        padding: 18px 14px 32px;
    }

    .sidebar-footer {
        padding-inline: 16px;
    }
}

@media (max-width: 520px) {
    .panel {
        padding: 15px;
    }

    .table-wrap {
        margin: 0 -15px -15px;
    }

    th,
    td {
        padding-inline: 15px;
    }

    .stats-grid article,
    .summary-row article,
    .executive-strip > div {
        min-width: 148px;
    }
}
}

/* Formal landscape receipt */
.print-page {
    margin: 0;
    background: #edf0f3;
    color: #111;
}

.receipt-formal {
    box-sizing: border-box;
    width: min(200mm, calc(100% - 32px));
    height: 138mm;
    min-height: 138mm;
    margin: 24px auto;
    padding: 5mm 6mm 3mm;
    background: #fff;
    color: #111;
    box-shadow: 0 8px 30px rgba(20, 30, 40, .12);
}

.formal-receipt-header {
    display: grid;
    grid-template-columns: 1fr 1.1fr .9fr;
    align-items: start;
    gap: 4mm;
    padding-bottom: 2.5mm;
    border-bottom: 3px solid #111;
}

.formal-company h1,
.formal-document-title h2 { margin: 0; color: #111; }
.formal-company h1 { font-size: 20px; }
.formal-company p { margin: 2px 0 0; font-size: 10px; }
.formal-document-title { display: grid; justify-items: center; text-align: center; }
.formal-document-title h2 { font-size: 23px; line-height: 1.1; }
.formal-document-side { display: grid; justify-items: end; align-content: start; gap: 2px; padding-top: 22px; text-align: right; }
.formal-document-side span { margin-top: 2px; font-size: 10px; }
.formal-document-side strong { font-size: 11px; font-weight: 800; }
.formal-print-button { position: fixed; z-index: 5; top: 18px; right: 18px; padding: 10px 14px; border: 0; border-radius: 6px; background: #050505; color: #fff; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }

.formal-customer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8mm;
    padding: 3mm 0;
}
.formal-customer-grid p { margin: 3px 0; font-size: 10px; }
.formal-customer-grid p span { display: inline-block; min-width: 70px; }

.formal-items-table { width: 100%; border: 1.5px solid #111; border-collapse: collapse; table-layout: fixed; }
.formal-items-table th,
.formal-items-table td { padding: 1.7mm 2.5mm; border: 1.5px solid #111; color: #111; background: #fff; font-size: 10px; }
.formal-items-table th { text-align: center; font-size: 11px; }
.formal-items-table th:first-child,
.formal-items-table td:first-child { width: 12mm; text-align: center; }
.formal-items-table th:last-child,
.formal-items-table td:last-child { width: 38mm; text-align: right; font-weight: 700; }
.formal-items-table tbody tr:last-child td { border-bottom: 1.5px solid #111 !important; }

.formal-receipt-bottom { display: grid; grid-template-columns: 1fr 66mm; gap: 8mm; align-items: end; margin-top: 3mm; }
.formal-signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 38px; text-align: center; }
.formal-signatures div { display: grid; gap: 8px; }
.formal-signatures span { display: block; height: 25px; border-bottom: 1px solid #111; }
.formal-signatures strong { font-size: 10px; }
.formal-totals { border: 1.5px solid #111; }
.formal-totals > div { display: flex; justify-content: space-between; gap: 14px; padding: 5px 9px; border-bottom: 1px solid #111; font-size: 10px; }
.formal-totals > div:last-child { border-bottom: 0; }
.formal-totals .formal-paid-row { background: #050505; color: #fff; font-size: 12px; }
.formal-totals .formal-balance-row { background: #f1f1f1; color: #111; }

.formal-payment-history { margin-top: 2mm; padding-top: 1.5mm; border-top: 1px solid #aaa; }
.formal-payment-history h3 { margin: 0 0 5px; font-size: 12px; }
.formal-payment-history span { display: block; font-size: 10px; line-height: 1.5; }
.formal-receipt-footer { display: flex; justify-content: space-between; gap: 15px; margin-top: 2mm; padding: 1.5mm 0 1mm; border-bottom: 2px dashed #111; font-size: 8px; }
.formal-receipt-footer p { margin: 0; }

@media (max-width: 640px) {
    .receipt-formal { width: 100%; min-height: 0; margin: 0; padding: 24px 18px; box-shadow: none; }
    .formal-receipt-header { grid-template-columns: 1fr; }
    .formal-document-title { justify-items: start; text-align: left; }
    .formal-print-button { justify-self: start; }
    .formal-customer-grid,
    .formal-receipt-bottom { grid-template-columns: 1fr; gap: 20px; }
    .formal-items-table th:last-child,
    .formal-items-table td:last-child { width: 130px; }
}

@page { size: A4 portrait; margin: 5mm; }
@media print {
    html,
    body.print-page {
        width: 200mm;
        min-width: 200mm;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        background: #fff;
        color: #000;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .receipt-formal {
        box-sizing: border-box;
        width: 200mm !important;
        max-width: 200mm !important;
        height: 138mm;
        min-height: 138mm;
        margin: 0 !important;
        padding: 5mm 6mm 3mm !important;
        overflow: visible !important;
        box-shadow: none;
        page-break-inside: avoid;
    }

    .formal-receipt-header {
        grid-template-columns: 1fr 1.1fr .9fr;
        gap: 4mm;
        padding-bottom: 2.5mm;
    }

    .formal-customer-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 8mm;
        padding: 3mm 0;
    }

    .formal-items-table {
        width: 100% !important;
        max-width: 100% !important;
        table-layout: fixed !important;
        page-break-inside: auto;
    }

    .formal-items-table thead { display: table-header-group; }
    .formal-items-table th:first-child,
    .formal-items-table td:first-child { width: 12mm; }
    .formal-items-table th:last-child,
    .formal-items-table td:last-child { width: 38mm; }
    .formal-items-table th,
    .formal-items-table td { padding: 1.7mm 2.5mm; }

    .formal-receipt-bottom {
        grid-template-columns: 1fr 66mm;
        gap: 8mm;
        margin-top: 3mm;
    }

    .formal-payment-history { margin-top: 2mm; padding-top: 1.5mm; }
    .formal-receipt-footer { margin-top: 2mm; padding-top: 1.5mm; }

    .formal-items-table tr,
    .formal-receipt-bottom,
    .formal-signatures,
    .formal-totals,
    .formal-receipt-header {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}
