:root {
    --brand: #a2ad9c;
    --brand-deep: #88947f;
    --brand-ink: #3d4638;
    --ivory: #f7f4ee;
    --sage-50: #f4f6f1;
    --sage-100: #e5ebe0;
    --sage-400: #9aab94;
    --sage-500: #7d9176;
    --sage-700: #4f5c4a;
    --sage-800: #3a4437;
    --sage-900: #272e25;
    --ink: #2b3329;
    --muted: rgba(43, 51, 41, 0.62);
    --unpaid: #9a4f4a;
    --unpaid-soft: rgba(166, 93, 87, 0.18);
    --deposit: #b08a3e;
    --deposit-soft: rgba(184, 146, 74, 0.2);
    --paid: #4f6b49;
    --paid-soft: rgba(90, 117, 83, 0.18);
    --glass: rgba(255, 255, 255, 0.52);
    --glass-strong: rgba(255, 255, 255, 0.68);
    --glass-edge: rgba(255, 255, 255, 0.62);
    --glass-edge-dim: rgba(247, 244, 238, 0.22);
    --glass-ink-edge: rgba(162, 173, 156, 0.22);
    --blur: blur(32px) saturate(1.55);
    --radius: 20px;
    --radius-sm: 12px;
    --font: "IBM Plex Sans Arabic", "Noto Naskh Arabic", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { min-height: 100%; }
body {
    font-family: var(--font);
    color: var(--ink);
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.6;
    background:
        radial-gradient(900px 460px at 88% -8%, rgba(255, 255, 255, 0.88), transparent 52%),
        radial-gradient(720px 380px at 8% 108%, rgba(162, 173, 156, 0.22), transparent 48%),
        #f3f5f0;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }

.glass {
    background:
        linear-gradient(165deg, rgba(255, 255, 255, 0.62), rgba(162, 173, 156, 0.12) 58%, rgba(255, 255, 255, 0.38));
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--glass-edge);
    box-shadow: none;
}

.app {
    display: grid;
    grid-template-columns: 272px 1fr;
    min-height: 100vh;
    background: transparent;
}

.sidebar {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(61, 70, 56, 0.08)),
        var(--brand);
    color: var(--ivory);
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    border-inline-end: 1px solid rgba(247, 244, 238, 0.18);
}

.brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding-bottom: 28px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(247, 244, 238, 0.18);
    text-align: center;
}

.brand-mark {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    border: 1px solid rgba(247, 244, 238, 0.34);
    overflow: hidden;
    background: rgba(247, 244, 238, 0.12);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand h1 { font-size: 22px; font-weight: 600; color: var(--ivory); }
.brand p { font-size: 12px; color: rgba(247, 244, 238, 0.72); }

.nav { display: flex; flex-direction: column; gap: 6px; }
.nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    color: rgba(247, 244, 238, 0.86);
    border: 1px solid transparent;
    background: transparent;
}

.nav a.is-active,
.nav a:hover {
    background: rgba(247, 244, 238, 0.16);
    color: var(--ivory);
    border-color: rgba(247, 244, 238, 0.28);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.sidebar-foot {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(247, 244, 238, 0.18);
}

.user-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: rgba(247, 244, 238, 0.86);
    font-size: 13px;
}

.shell {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: transparent;
}

.topbar {
    padding: 22px 32px 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.topbar h2 { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.topbar .lead { color: var(--muted); font-size: 14px; margin-top: 4px; }
.content { padding: 24px 32px 40px; }

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

.btn,
.btn-ghost,
.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0)),
        rgba(136, 148, 127, 0.78);
    color: var(--ivory);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.56);
    color: var(--brand-ink);
    border-color: rgba(255, 255, 255, 0.74);
}

.sidebar .btn-ghost {
    background: rgba(247, 244, 238, 0.14);
    color: var(--ivory);
    border-color: rgba(247, 244, 238, 0.28);
}

.btn-danger {
    background: rgba(154, 79, 74, 0.78);
}

.btn-soft {
    background: rgba(162, 173, 156, 0.22);
    color: var(--brand-ink);
}

.card {
    background:
        linear-gradient(165deg, rgba(255, 255, 255, 0.8), rgba(162, 173, 156, 0.1) 64%, rgba(255, 255, 255, 0.56));
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: var(--radius);
    box-shadow: none;
}

.card-pad { padding: 20px; }
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.card-head h3 { font-size: 16px; font-weight: 600; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; letter-spacing: 0.04em; }

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

.stat {
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 132px;
}

.stat-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--muted);
    font-size: 13px;
}

.stat-value { font-size: 32px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; }
.stat-note { font-size: 13px; color: var(--muted); }

.split {
    display: grid;
    grid-template-columns: 1fr minmax(280px, 340px);
    gap: 16px;
    margin-top: 16px;
}

.family-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--glass-ink-edge);
}

.family-item:last-child { border-bottom: 0; }
.family-item strong { display: block; }
.family-item span { font-size: 13px; color: var(--muted); }

.chart-wrap { height: 280px; }

.split-board {
    display: grid;
    grid-template-columns: minmax(340px, 460px) 1fr;
    gap: 16px;
    margin-top: 16px;
    align-items: start;
}

.chart-card {
    display: flex;
    flex-direction: column;
}

.chart-square {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    margin: 4px auto 0;
}

.chart-square canvas {
    width: 100% !important;
    height: 100% !important;
}

.chart-readout {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.38);
    border: 1px solid rgba(255, 255, 255, 0.58);
}

.chart-readout strong { font-size: 22px; letter-spacing: -0.03em; }
.chart-hint { margin-top: 10px; font-size: 12px; color: var(--muted); text-align: center; }

.seg {
    display: inline-flex;
    border: 1px solid rgba(255, 255, 255, 0.58);
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.36);
}

.seg a, .seg button {
    padding: 6px 14px;
    background: transparent;
    border: 0;
    color: var(--muted);
}

.seg a.is-active, .seg button.is-active {
    background: rgba(162, 173, 156, 0.28);
    color: var(--brand-ink);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    border: 1px solid var(--glass-edge);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.badge-unpaid { background: var(--unpaid-soft); color: var(--unpaid); }
.badge-deposit { background: var(--deposit-soft); color: var(--deposit); }
.badge-paid { background: var(--paid-soft); color: var(--paid); }
.badge-neutral { background: rgba(255, 255, 255, 0.28); color: var(--sage-800); }

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

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

label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.field input,
.field select,
.field textarea {
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--glass-edge);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.68);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.field textarea { min-height: 120px; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: 1px solid rgba(162, 173, 156, 0.7);
    outline-offset: 1px;
}

.check-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--glass-edge);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.4);
    color: var(--ink);
}

.table-wrap { overflow: auto; }
table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

table.data th,
table.data td {
    padding: 14px 10px;
    text-align: start;
    border-bottom: 1px solid var(--glass-ink-edge);
    white-space: nowrap;
}

table.data th { color: var(--muted); font-weight: 500; font-size: 12px; }

.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.actions .btn,
.actions .btn-ghost { min-height: 34px; padding: 0 10px; font-size: 13px; }

table.data td.actions-cell { white-space: normal; min-width: 320px; }

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

.status-form select {
    min-height: 34px;
    padding: 0 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.62);
    background: rgba(255, 255, 255, 0.4);
    color: var(--brand-ink);
    font-size: 13px;
}

.cal-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 16px;
}

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

.mini-month {
    padding: 10px;
    border: 1px solid var(--glass-edge);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.38);
}

.mini-month.is-current {
    border-color: rgba(162, 173, 156, 0.55);
    background: rgba(162, 173, 156, 0.2);
}
.mini-month h4 { font-size: 12px; margin-bottom: 8px; color: var(--sage-800); }
.mini-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

.mini-days i {
    display: block;
    aspect-ratio: 1;
    border-radius: 2px;
    background: rgba(229, 235, 224, 0.45);
}

.mini-days i.unpaid { background: var(--unpaid); }
.mini-days i.deposit { background: var(--deposit); }
.mini-days i.paid { background: var(--paid); }
.mini-days i.empty { background: rgba(238, 241, 234, 0.4); }

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

.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-nav strong { min-width: 140px; text-align: center; }

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

.weekdays span {
    padding: 8px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
}

.day {
    min-height: 108px;
    border: 1px solid var(--glass-edge);
    padding: 10px;
    background: rgba(255, 255, 255, 0.4);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.day.out { background: rgba(162, 173, 156, 0.08); color: #8a9384; }
.day.today { border-color: rgba(136, 148, 127, 0.7); background: rgba(162, 173, 156, 0.2); }
.day-num { font-size: 13px; color: var(--muted); }
.day-booking {
    margin-top: auto;
    padding: 8px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.4;
    border: 1px solid var(--glass-edge);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.day-booking.unpaid { background: var(--unpaid-soft); color: var(--unpaid); }
.day-booking.deposit { background: var(--deposit-soft); color: var(--deposit); }
.day-booking.paid { background: var(--paid-soft); color: var(--paid); }
.day-booking b { display: block; font-size: 13px; color: var(--ink); }

.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 14px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.swatch { width: 12px; height: 12px; border-radius: 3px; }
.swatch.unpaid { background: var(--unpaid); }
.swatch.deposit { background: var(--deposit); }
.swatch.paid { background: var(--paid); }

.flash {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 16px;
    border: 1px solid var(--glass-edge);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.flash-ok { background: var(--paid-soft); color: var(--paid); }
.flash-err { background: var(--unpaid-soft); color: var(--unpaid); }

.detail-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 16px;
}

.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px;
    background:
        radial-gradient(820px 380px at 50% 0%, rgba(255, 255, 255, 0.22), transparent 58%),
        var(--brand);
}

.login-card {
    width: min(420px, 100%);
    background:
        linear-gradient(165deg, rgba(255, 255, 255, 0.78), rgba(247, 244, 238, 0.46) 62%, rgba(255, 255, 255, 0.56));
    backdrop-filter: blur(40px) saturate(1.55);
    -webkit-backdrop-filter: blur(40px) saturate(1.55);
    border: 1px solid rgba(255, 255, 255, 0.58);
    border-radius: 28px;
    padding: 36px 32px;
    text-align: center;
    color: var(--ink);
}

.login-card .brand-mark { margin: 0 auto 16px; width: 110px; height: 110px; }
.login-card h1 { font-size: 28px; margin-bottom: 4px; }
.login-card .lead { margin-bottom: 28px; }
.login-card form { text-align: start; display: flex; flex-direction: column; gap: 14px; }
.login-card .btn { width: 100%; margin-top: 8px; }

.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

.pager { display: flex; gap: 6px; justify-content: flex-end; margin-top: 16px; }
.pager a, .pager span {
    min-width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--glass-edge);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.4);
}

.pager .active span { background: rgba(136, 148, 127, 0.82); color: var(--ivory); border-color: transparent; }

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

.mobile-bar,
.sidebar-backdrop,
.sidebar-top,
.mobile-logout { display: none; }

body.nav-locked { overflow: hidden; }

@media (max-width: 1180px) {
    .stats { grid-template-columns: 1fr 1fr; }
    .cal-layout, .split, .split-board, .detail-grid { grid-template-columns: 1fr; }
    .chart-square { max-width: 420px; margin-inline: auto; }
}

@media (max-width: 860px) {
    .app { grid-template-columns: 1fr; min-height: 100vh; min-height: 100dvh; }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 40;
        background: rgba(43, 51, 41, 0.38);
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
    }

    .sidebar-backdrop[hidden] { display: none; }

    .sidebar {
        position: fixed;
        inset-inline-start: 0;
        top: 0;
        bottom: 0;
        width: min(300px, 88vw);
        z-index: 50;
        padding: 16px 18px 24px;
        transform: translateX(100%);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .app.is-nav-open .sidebar { transform: translateX(0); }

    .sidebar-top {
        display: flex;
        justify-content: flex-start;
        margin-bottom: 4px;
    }

    .nav-close {
        min-height: 40px;
        min-width: 40px;
        padding: 0;
    }

    .brand {
        flex-direction: column;
        border-bottom: 1px solid rgba(247, 244, 238, 0.18);
        margin-bottom: 12px;
        padding-bottom: 20px;
    }

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

    .nav { flex-direction: column; gap: 4px; overflow: visible; }

    .nav a { min-height: 46px; }

    .sidebar-foot { display: block; margin-top: auto; padding-top: 16px; }

    .mobile-bar {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 14px;
        padding-top: max(10px, env(safe-area-inset-top));
        position: sticky;
        top: 0;
        z-index: 30;
        background:
            linear-gradient(165deg, rgba(255, 255, 255, 0.82), rgba(162, 173, 156, 0.18));
        backdrop-filter: blur(24px) saturate(1.4);
        -webkit-backdrop-filter: blur(24px) saturate(1.4);
        border-bottom: 1px solid rgba(255, 255, 255, 0.62);
    }

    .nav-toggle {
        min-width: 44px;
        min-height: 44px;
        padding: 0;
        flex: 0 0 auto;
    }

    .mobile-bar-meta {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 2px;
        line-height: 1.35;
    }

    .mobile-bar-meta strong {
        font-size: 15px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-bar-meta .tiny {
        color: var(--muted);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-logout { display: block; flex: 0 0 auto; }
    .mobile-logout .btn-ghost { min-width: 44px; min-height: 44px; padding: 0; }

    .topbar {
        padding: 14px 16px 0;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .topbar h2 { font-size: 24px; }
    .topbar .lead { font-size: 13px; }

    .page-actions {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .page-actions .btn,
    .page-actions .btn-ghost {
        flex: 1 1 auto;
        min-width: min(100%, 140px);
    }

    .content {
        padding: 16px 14px max(28px, env(safe-area-inset-bottom));
    }

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

    .stat {
        min-height: auto;
        padding: 16px 18px;
    }

    .stat-value { font-size: 28px; }

    .card-head {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .seg {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        max-width: 100%;
        -webkit-overflow-scrolling: touch;
    }

    .seg a, .seg button {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .form-grid, .check-list { grid-template-columns: 1fr; }

    .cal-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .cal-nav {
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .cal-nav strong { min-width: 0; flex: 1; }

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

    .month-grid .day { min-height: 76px; padding: 8px 6px; }

    .day-booking { font-size: 11px; padding: 6px; }
    .day-booking b { font-size: 12px; }

    .weekdays span { font-size: 11px; padding: 6px 2px; }

    .detail-grid { gap: 12px; }

    .kv { grid-template-columns: 1fr; gap: 4px; }

    .pager { justify-content: center; flex-wrap: wrap; }

    table.data td.actions-cell { min-width: 0; }

    .actions { width: 100%; }
    .actions .btn,
    .actions .btn-ghost,
    .actions form { flex: 1 1 calc(50% - 6px); }
    .actions .btn,
    .actions .btn-ghost { width: 100%; }
    .actions form { display: flex; }
    .actions form .btn,
    .actions form .btn-ghost { width: 100%; }

    .status-form {
        flex: 1 1 100%;
        flex-wrap: wrap;
    }

    .status-form select { flex: 1; min-width: 0; }
}

@media (max-width: 720px) {
    table.data.data-stack thead { display: none; }

    table.data.data-stack tbody tr {
        display: block;
        margin-bottom: 14px;
        padding: 14px;
        border: 1px solid var(--glass-ink-edge);
        border-radius: var(--radius-sm);
        background: rgba(255, 255, 255, 0.42);
    }

    table.data.data-stack tbody tr:last-child { margin-bottom: 0; }

    table.data.data-stack td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 14px;
        padding: 9px 0;
        border-bottom: 1px solid rgba(162, 173, 156, 0.14);
        white-space: normal;
        text-align: end;
    }

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

    table.data.data-stack td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 12px;
        font-weight: 500;
        text-align: start;
        flex: 0 0 38%;
    }

    table.data.data-stack td.actions-cell {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    table.data.data-stack td.actions-cell::before {
        content: attr(data-label);
        margin-bottom: 2px;
    }

    table.data.data-stack td[colspan] {
        display: block;
        border: 0;
        padding: 0;
    }

    table.data.data-stack td[colspan]::before { display: none; }

    .table-wrap { overflow: visible; }
}

@media (max-width: 480px) {
    .login-body { padding: 20px 16px; padding-bottom: max(20px, env(safe-area-inset-bottom)); }

    .login-card {
        padding: 28px 22px;
        border-radius: 22px;
    }

    .login-card h1 { font-size: 24px; }

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

    .month-grid .day { min-height: 64px; }

    .day-num { font-size: 12px; }

    .topbar h2 { font-size: 22px; }

    .btn, .btn-ghost, .btn-danger { min-height: 44px; }

    .actions .btn,
    .actions .btn-ghost,
    .actions form { flex: 1 1 100%; }
}
