:root {
    --navy: #172554;
    --navy-2: #1e3a8a;
    --blue: #2563eb;
    --cyan: #06b6d4;
    --green: #16a34a;
    --red: #dc2626;
    --amber: #d97706;
    --ink: #172033;
    --muted: #64748b;
    --line: #e2e8f0;
    --surface: #ffffff;
    --canvas: #f6f8fc;
    --shadow: 0 14px 38px rgba(30, 58, 138, .09);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 252px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 16px; display: flex; flex-direction: column; background: linear-gradient(175deg, #0f1e49 0%, #172554 62%, #15356a 100%); color: white; z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 28px; }
.brand-mark { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, var(--cyan), #3b82f6); font-weight: 900; box-shadow: 0 10px 28px rgba(6, 182, 212, .3); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; }
.brand small { color: #9fb7ec; margin-top: 3px; font-size: 11px; }
.sidebar nav { display: grid; gap: 7px; }
.sidebar nav a { padding: 12px 14px; border-radius: 12px; color: #bfd0f5; display: flex; align-items: center; gap: 11px; font-size: 14px; transition: .2s ease; }
.sidebar nav a span { width: 20px; text-align: center; font-size: 18px; }
.sidebar nav a:hover, .sidebar nav a.active { color: white; background: rgba(255,255,255,.11); transform: translateX(2px); }
.sidebar nav a.active { box-shadow: inset 3px 0 0 #22d3ee; }
.sidebar-user { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid rgba(255,255,255,.12); display: grid; grid-template-columns: 38px 1fr 24px; align-items: center; gap: 9px; }
.avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.14); font-weight: 800; }
.sidebar-user strong, .sidebar-user small { display: block; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user strong { font-size: 13px; }
.sidebar-user small { color: #9fb7ec; font-size: 11px; margin-top: 2px; }
.logout { color: #c7d8fa; font-size: 19px; }

.main { min-width: 0; display: flex; min-height: 100vh; flex-direction: column; }
.topbar { min-height: 88px; padding: 18px 30px; display: flex; align-items: center; gap: 16px; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 12; }
.topbar p { margin: 0 0 2px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.topbar h1 { margin: 0; font-size: 21px; letter-spacing: -.02em; }
.topbar-badge { margin-left: auto; padding: 8px 12px; color: var(--navy-2); background: #eff6ff; border-radius: 999px; font-size: 12px; font-weight: 800; }
.menu-button { display: none; border: 0; background: #eef2ff; width: 40px; height: 40px; border-radius: 10px; }
.content { width: 100%; max-width: 1540px; margin: 0 auto; padding: 26px 30px 40px; flex: 1; }
.footer { color: var(--muted); padding: 18px 30px 25px; font-size: 12px; text-align: center; }

.alert { padding: 13px 16px; border: 1px solid; border-radius: 13px; margin: 0 0 18px; font-size: 13px; font-weight: 650; }
.alert.success { color: #166534; border-color: #bbf7d0; background: #f0fdf4; }
.alert.error { color: #991b1b; border-color: #fecaca; background: #fef2f2; }
.alert.warning { color: #92400e; border-color: #fde68a; background: #fffbeb; }

.page-actions { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 20px; }
.page-actions h2 { margin: 0; font-size: 18px; }
.page-actions p { color: var(--muted); margin: 5px 0 0; font-size: 13px; }
.action-row { display: flex; flex-wrap: wrap; gap: 9px; }
.button { border: 0; border-radius: 11px; padding: 10px 15px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; color: white; background: var(--blue); font-weight: 750; font-size: 13px; box-shadow: 0 7px 16px rgba(37,99,235,.18); }
.button:hover { filter: brightness(.96); }
.button.secondary { color: var(--navy-2); background: #eaf1ff; box-shadow: none; }
.button.success { background: var(--green); box-shadow: 0 7px 16px rgba(22,163,74,.16); }
.button.cleaning-button { background: #7c3aed; box-shadow: 0 7px 16px rgba(124,58,237,.18); }
.button.danger { color: #b91c1c; background: #fee2e2; box-shadow: none; }
.button.small { padding: 7px 10px; border-radius: 8px; font-size: 11px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 20px; }
.finance-stats { grid-template-columns: repeat(4, minmax(0,1fr)); }
.dashboard-finance-stats { grid-template-columns: repeat(5, minmax(0,1fr)); }
.stat { border: 1px solid #e8edf6; border-radius: 17px; background: var(--surface); padding: 19px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; right: -25px; top: -25px; width: 80px; height: 80px; border-radius: 50%; background: var(--tint, #eff6ff); }
.stat .label { color: var(--muted); font-size: 12px; font-weight: 700; }
.stat .value { margin-top: 8px; font-size: 24px; font-weight: 850; letter-spacing: -.04em; }
.stat .meta { color: var(--muted); font-size: 11px; margin-top: 6px; }
.stat.green { --tint: #dcfce7; }
.stat.red { --tint: #fee2e2; }
.stat.cyan { --tint: #cffafe; }
.stat.amber { --tint: #fef3c7; }
.method-breakdown { margin: 13px -8px -8px; padding: 9px 8px 4px; border-top: 1px solid var(--line); position: relative; z-index: 1; }
.method-breakdown > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0; }
.method-breakdown span { color: var(--muted); font-size: 10px; font-weight: 750; }
.method-breakdown strong { font-size: 11px; white-space: nowrap; }
.period-overview { margin: 0 0 20px; padding: 18px; border: 1px solid #c7d2fe; border-radius: 18px; background: linear-gradient(135deg, #eef2ff, #f0fdfa); box-shadow: var(--shadow); }
.period-overview-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.period-overview-head span { color: var(--navy-2); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.period-overview-head h3 { margin: 4px 0 0; font-size: 22px; letter-spacing: -.03em; }
.period-selector { display: flex; align-items: end; justify-content: center; gap: 8px; flex-wrap: wrap; }
.period-selector label { display: block; }
.period-selector label span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 9px; }
.period-selector select { min-width: 105px; height: 34px; border: 1px solid var(--line); border-radius: 9px; padding: 0 9px; color: var(--ink); background: #fff; font-weight: 750; outline: 0; }
.period-selector select:focus { border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(96,165,250,.18); }
.collection-rate { min-width: 106px; padding: 10px 13px; border-radius: 13px; color: #166534; background: rgba(255,255,255,.85); text-align: right; }
.collection-rate strong, .collection-rate small { display: block; }
.collection-rate strong { font-size: 19px; }
.collection-rate small { margin-top: 2px; color: var(--muted); font-size: 9px; font-weight: 700; }
.period-stats { grid-template-columns: repeat(5, minmax(0,1fr)); align-items: start; margin-bottom: 0; gap: 10px; }
.period-stats .stat { padding: 15px; box-shadow: none; }
.period-stats .stat .value { font-size: 19px; }
.period-detail { padding: 0 !important; }
.period-detail summary { min-height: 100%; padding: 15px; cursor: pointer; list-style: none; position: relative; z-index: 1; }
.period-detail summary::-webkit-details-marker { display: none; }
.period-detail summary:focus-visible { outline: 3px solid rgba(37,99,235,.25); outline-offset: -3px; border-radius: 16px; }
.detail-hint { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 11px; padding-top: 9px; border-top: 1px solid rgba(148,163,184,.25); color: var(--navy-2); font-size: 10px; font-weight: 800; }
.detail-hint span { font-size: 16px; line-height: 1; transition: transform .2s ease; }
.period-detail[open] .detail-hint span { transform: rotate(180deg); }
.period-detail-list { padding: 0 12px 12px; position: relative; z-index: 1; }
.period-detail-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px; border: 1px solid rgba(148,163,184,.22); border-radius: 11px; background: rgba(255,255,255,.78); }
.period-detail-row + .period-detail-row { margin-top: 7px; }
.period-detail-row strong, .period-detail-row small { display: block; }
.period-detail-row strong { font-size: 11px; }
.period-detail-row small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.period-payment-trigger { width: 100%; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.period-payment-trigger:hover { border-color: #f59e0b; background: #fff; transform: translateY(-1px); }
.period-payment-trigger:focus-visible { outline: 3px solid rgba(245,158,11,.24); outline-offset: 1px; }
.period-detail-value { flex: 0 0 auto; text-align: right; }
.period-detail-empty { padding: 12px 8px; color: var(--muted); font-size: 11px; text-align: center; }
.dashboard-section { margin-top: 18px; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); gap: 18px; }
.card { border: 1px solid #e8edf6; border-radius: 17px; background: var(--surface); box-shadow: var(--shadow); min-width: 0; }
.card-header { padding: 17px 19px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-header h3 { margin: 0; font-size: 15px; }
.card-header p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.card-body { padding: 19px; }
.chart-wrap { height: 285px; }
#annualChart { display: block; width: 100%; height: 100%; }
.legend { display: flex; gap: 14px; color: var(--muted); font-size: 11px; }
.legend i { width: 8px; height: 8px; display: inline-block; border-radius: 50%; margin-right: 5px; }
.announcement { padding: 0 0 15px 17px; margin: 0 0 15px; border-bottom: 1px solid var(--line); position: relative; }
.announcement:last-child { border: 0; margin: 0; padding-bottom: 0; }
.announcement::before { content: ""; position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); left: 0; top: 6px; }
.announcement strong { display: block; font-size: 13px; }
.announcement p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; white-space: pre-line; }
.announcement time { display: block; color: #94a3b8; font-size: 10px; margin-top: 6px; }
.empty { color: var(--muted); text-align: center; padding: 28px 12px; font-size: 13px; }

.table-wrap { overflow-x: auto; border-radius: 0 0 17px 17px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: #526079; background: #f8fafc; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
th, td { border-bottom: 1px solid var(--line); padding: 12px 14px; }
td { font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfdff; }
.amount-in { color: var(--green); font-weight: 800; }
.amount-out { color: var(--red); font-weight: 800; }
.badge { display: inline-flex; padding: 5px 8px; border-radius: 999px; background: #eef2ff; color: #3730a3; font-size: 10px; font-weight: 800; white-space: nowrap; }
.badge.green { color: #166534; background: #dcfce7; }
.badge.red { color: #991b1b; background: #fee2e2; }
.badge.gray { color: #475569; background: #f1f5f9; }
.badge.purple { color: #6d28d9; background: #ede9fe; }

.year-picker { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: white; }
.year-picker a, .year-picker .disabled { width: 34px; height: 36px; display: grid; place-items: center; color: var(--navy-2); font-size: 20px; }
.year-picker .disabled { color: #cbd5e1; cursor: default; }
.year-picker select { height: 36px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); background: white; color: var(--ink); font-weight: 800; padding: 0 9px; outline: 0; }
.matrix-wrap { overflow: auto; max-height: calc(100vh - 220px); }
.payment-matrix { min-width: 1180px; }
.payment-matrix th { text-align: center; position: sticky; top: 0; z-index: 3; }
.payment-matrix th:first-child, .payment-matrix td:first-child { position: sticky; left: 0; z-index: 2; background: white; min-width: 160px; box-shadow: 5px 0 12px rgba(15,23,42,.05); }
.payment-matrix th:first-child { z-index: 4; background: #f8fafc; text-align: left; }
.payment-matrix td { text-align: center; min-width: 83px; padding: 10px 7px; }
.resident-cell strong, .resident-cell small { display: block; text-align: left; }
.resident-cell small { color: var(--muted); margin-top: 3px; }
.payment-cell { min-height: 52px; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed #dbe3ee; color: #94a3b8; font-size: 10px; transition: .2s; }
.payment-cell:hover { border-color: #93c5fd; background: #eff6ff; color: var(--blue); }
.payment-cell.paid { border: 1px solid #bbf7d0; color: #15803d; background: #f0fdf4; }
.payment-detail-trigger { cursor: pointer; font: inherit; }
.payment-detail-trigger:hover { border-color: #4ade80; background: #dcfce7; color: #166534; box-shadow: 0 5px 14px rgba(22,163,74,.12); }
.payment-cell.paid b { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--green); font-size: 12px; }
.payment-cell span { margin-top: 4px; font-weight: 750; }
.payment-cell small { margin-top: 3px; color: inherit; font-size: 9px; font-weight: 700; }
.mobile-calendar { display: none; }
.mobile-calendar [hidden] { display: none !important; }
.mobile-calendar-filter { padding: 15px; border-bottom: 1px solid var(--line); background: #f8fafc; }
.mobile-apartment-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px; color: white; background: linear-gradient(135deg, var(--navy), var(--navy-2)); }
.mobile-apartment-header strong, .mobile-apartment-header small { display: block; }
.mobile-apartment-header strong { font-size: 15px; }
.mobile-apartment-header small { margin-top: 3px; color: #cbdcff; font-size: 10px; }
.mobile-apartment-header > span { padding: 6px 9px; border: 1px solid rgba(255,255,255,.18); border-radius: 9px; font-size: 11px; font-weight: 800; }
.mobile-month-list { padding: 4px 14px 10px; }
.mobile-month-row { min-height: 72px; display: grid; grid-template-columns: minmax(92px,.8fr) minmax(125px,1.2fr) auto; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.mobile-month-row:last-child { border-bottom: 0; }
.mobile-month-row.paid { margin: 0 -14px; padding: 0 14px; background: #f0fdf4; }
.mobile-month-name strong, .mobile-month-name small, .mobile-payment-status small { display: block; }
.mobile-month-name strong { font-size: 13px; }
.mobile-month-name small, .mobile-payment-status small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.mobile-payment-detail { width: 100%; padding: 7px 8px; border: 1px solid transparent; border-radius: 10px; background: transparent; text-align: left; }
.mobile-payment-detail:hover { border-color: #bbf7d0; background: #dcfce7; }
.mobile-payment-detail small { display: block; }
.mobile-payment-status { text-align: right; }
.mobile-pay-button { min-width: 48px; padding-left: 9px; padding-right: 9px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 15px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 11px; font-weight: 800; margin: 0 0 6px; color: #44506a; }
.field input, .field select, .field textarea { width: 100%; min-height: 42px; border: 1px solid #dbe3ee; border-radius: 10px; padding: 10px 12px; color: var(--ink); background: white; outline: 0; }
.field textarea { min-height: 92px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #60a5fa; box-shadow: 0 0 0 3px #dbeafe; }
.field small { display: block; color: var(--muted); margin-top: 5px; font-size: 10px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.fee-stats { grid-template-columns: repeat(4, minmax(190px, 1fr)); }
.fee-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fee-item { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; grid-template-columns: minmax(130px, 1fr) minmax(150px, .75fr); align-items: center; gap: 16px; background: #fbfdff; }
.fee-item strong, .fee-item small { display: block; }
.fee-item small { color: var(--muted); font-size: 10px; margin-top: 4px; }
.fee-item label > span:first-child { display: block; color: var(--muted); font-size: 10px; font-weight: 800; margin-bottom: 5px; }
.money-input { display: flex; align-items: center; border: 1px solid #dbe3ee; border-radius: 10px; background: white; overflow: hidden; }
.money-input:focus-within { border-color: #60a5fa; box-shadow: 0 0 0 3px #dbeafe; }
.money-input input { width: 100%; min-width: 0; border: 0; outline: 0; padding: 10px 8px 10px 11px; background: transparent; }
.money-input b { padding: 0 11px; color: var(--green); }
.fee-note { margin: 18px 0 0; }
.cleaning-rate-field { margin-bottom: 18px; padding: 16px; display: grid; grid-template-columns: minmax(220px,1fr) minmax(220px,.6fr); align-items: center; gap: 18px; border: 1px solid #ddd6fe; border-radius: 14px; background: #faf5ff; }
.cleaning-rate-field strong, .cleaning-rate-field small { display: block; }
.cleaning-rate-field small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.cleaning-rate-field label > span:first-child { display: block; margin-bottom: 5px; color: #6d28d9; font-size: 10px; font-weight: 800; }
.elevator-rate-field { border-color: #bae6fd; background: #f0f9ff; }
.elevator-rate-field label > span:first-child { color: #0369a1; }
.cleaning-overview { margin-bottom: 20px; border-color: #ddd6fe; }
.cleaning-overview-body { display: grid; grid-template-columns: minmax(180px,.8fr) minmax(260px,1.4fr) minmax(180px,.8fr); align-items: center; gap: 18px; }
.cleaning-progress-copy span, .cleaning-rate-copy span, .cleaning-progress-copy small, .cleaning-rate-copy small { display: block; }
.cleaning-progress-copy span, .cleaning-rate-copy span { color: #6d28d9; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.cleaning-progress-copy strong, .cleaning-rate-copy strong { display: block; margin-top: 6px; font-size: 17px; }
.cleaning-progress-copy small, .cleaning-rate-copy small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.cleaning-rate-copy { text-align: right; }
.cleaning-steps { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; }
.cleaning-steps span { min-height: 38px; display: grid; place-items: center; border: 1px solid #ddd6fe; border-radius: 10px; color: #7c3aed; background: #faf5ff; font-size: 11px; font-weight: 850; }
.cleaning-steps span.done { border-color: #86efac; color: #166534; background: #dcfce7; }
.cleaning-steps span.next { border-color: #a78bfa; color: #fff; background: #7c3aed; box-shadow: 0 5px 14px rgba(124,58,237,.2); }
.cleaning-modal-summary { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-bottom: 14px; }
.cleaning-modal-summary > div { padding: 13px; border: 1px solid #ddd6fe; border-radius: 12px; background: #faf5ff; }
.cleaning-modal-summary span, .cleaning-modal-summary strong { display: block; }
.cleaning-modal-summary span { color: #6d28d9; font-size: 10px; font-weight: 800; }
.cleaning-modal-summary strong { margin-top: 5px; font-size: 14px; }
.cleaning-modal-alert { margin: 14px 0; }
.cleaning-payment-method { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.temporary-password { display: inline-flex; align-items: center; gap: 8px; padding: 6px 9px; border-radius: 9px; color: #92400e; background: #fef3c7; }
.temporary-password small { font-size: 9px; text-transform: uppercase; letter-spacing: .04em; }
.temporary-password strong { font-size: 13px; }
.filters { display: flex; flex-wrap: wrap; gap: 9px; align-items: end; }
.filters .field { min-width: 140px; }
.filters .resident-filter { min-width: 240px; flex: 1 1 260px; }
.filters input, .filters select { min-height: 38px; padding: 7px 10px; }
.movement-filters { width: 100%; display: grid; grid-template-columns: minmax(100px,.45fr) minmax(230px,1fr) minmax(240px,1.2fr) auto; align-items: end; }
.movement-filters .field, .movement-filters .resident-filter { min-width: 0; }
.movement-filters .filter-submit { min-height: 38px; align-self: end; }
.movement-filter-stats { grid-template-columns: repeat(3,minmax(0,1fr)); margin: 16px 19px; }
.movement-filter-stats.has-carryover { grid-template-columns: repeat(4,minmax(0,1fr)); }
.movement-actions { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.movement-actions form { margin: 0; }
.ledger-check-form { margin: 0; min-width: 126px; }
.ledger-check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.ledger-check input { position: absolute; opacity: 0; pointer-events: none; }
.ledger-check-box { width: 22px; height: 22px; flex: 0 0 22px; display: grid; place-items: center; border: 2px solid #cbd5e1; border-radius: 7px; color: transparent; background: #fff; transition: .16s ease; }
.ledger-check input:focus-visible + .ledger-check-box { outline: 3px solid #bfdbfe; outline-offset: 2px; }
.ledger-check input:checked + .ledger-check-box { border-color: #16a34a; color: #fff; background: #16a34a; }
.ledger-check-text { color: var(--muted); font-size: 10px; font-weight: 800; line-height: 1.25; }
.ledger-check input:checked ~ .ledger-check-text { color: #15803d; }
.ledger-checked-row { background: #f7fef9; }

.modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 18px; background: rgba(15,23,42,.55); backdrop-filter: blur(5px); }
.modal.open { display: flex; }
.modal-panel { width: min(580px, 100%); max-height: 90vh; overflow: auto; border-radius: 18px; background: white; box-shadow: 0 25px 80px rgba(15,23,42,.25); animation: modalIn .18s ease; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-header h3 { margin: 0; font-size: 16px; }
.modal-close { width: 34px; height: 34px; border: 0; border-radius: 9px; background: #f1f5f9; }
.modal-body { padding: 20px; }
.payment-detail-modal { width: min(520px, 100%); }
.payment-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; margin: 0; }
.payment-detail-grid > div { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; }
.payment-detail-grid > div.full { grid-column: 1 / -1; }
.payment-detail-grid dt { margin-bottom: 6px; color: var(--muted); font-size: 11px; font-weight: 750; }
.payment-detail-grid dd { margin: 0; color: var(--ink); font-size: 14px; font-weight: 800; overflow-wrap: anywhere; }
@keyframes modalIn { from { transform: translateY(8px); opacity: 0; } }

.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, .9fr) minmax(420px, 1.1fr); background: white; }
.login-panel { padding: 48px clamp(28px, 6vw, 86px); display: flex; justify-content: center; flex-direction: column; }
.login-panel .brand { color: var(--navy); padding: 0; margin-bottom: 50px; }
.login-panel .brand small { color: var(--muted); }
.login-panel h1 { font-size: clamp(28px, 4vw, 42px); margin: 0; letter-spacing: -.05em; }
.login-panel > p { color: var(--muted); margin: 11px 0 30px; line-height: 1.55; }
.login-form { width: min(430px, 100%); }
.login-form .field { margin-bottom: 15px; }
.login-form .button { width: 100%; min-height: 46px; margin-top: 5px; }
.remember-option { display: flex; align-items: center; gap: 11px; margin: 2px 0 16px; color: var(--ink); cursor: pointer; user-select: none; }
.remember-option input { position: absolute; opacity: 0; pointer-events: none; }
.remember-box { width: 23px; height: 23px; flex: 0 0 23px; display: grid; place-items: center; border: 2px solid #cbd5e1; border-radius: 7px; color: transparent; background: #fff; font-size: 13px; font-weight: 900; transition: .16s ease; }
.remember-option input:focus-visible + .remember-box { outline: 3px solid #bfdbfe; outline-offset: 2px; }
.remember-option input:checked + .remember-box { border-color: var(--blue); color: #fff; background: var(--blue); }
.remember-option strong, .remember-option small { display: block; }
.remember-option strong { font-size: 12px; }
.remember-option small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.login-note { color: var(--muted); font-size: 11px; margin-top: 22px; }
.login-visual { margin: 18px; border-radius: 28px; overflow: hidden; padding: 60px; display: flex; flex-direction: column; justify-content: flex-end; color: white; background: radial-gradient(circle at 75% 15%, rgba(34,211,238,.32), transparent 27%), radial-gradient(circle at 15% 76%, rgba(59,130,246,.45), transparent 35%), linear-gradient(145deg, #0f1d46, #172554 60%, #075985); position: relative; }
.login-visual::before, .login-visual::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.15); border-radius: 50%; }
.login-visual::before { width: 360px; height: 360px; top: -80px; right: -100px; }
.login-visual::after { width: 220px; height: 220px; top: -10px; right: -30px; }
.login-visual h2 { font-size: clamp(30px, 4vw, 54px); line-height: 1.05; margin: 0 0 18px; max-width: 650px; letter-spacing: -.05em; }
.login-visual p { color: #c8d8f8; max-width: 540px; line-height: 1.7; }
.visual-pills { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; }
.visual-pills span { border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.08); padding: 9px 12px; border-radius: 999px; font-size: 11px; }

.install-page { min-height: 100vh; padding: 35px 18px; background: linear-gradient(135deg, #eff6ff, #f8fafc 55%, #ecfeff); }
.install-card { width: min(760px,100%); margin: 0 auto; background: white; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; }
.install-head { padding: 30px; color: white; background: linear-gradient(135deg, var(--navy), #1d4ed8); }
.install-head h1 { margin: 0 0 8px; }
.install-head p { margin: 0; color: #cadbff; }
.install-body { padding: 28px; }
.steps { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-bottom: 24px; }
.steps span { color: var(--muted); background: #f8fafc; padding: 10px; border-radius: 10px; text-align: center; font-size: 11px; }
.steps span.active { color: var(--navy-2); background: #dbeafe; font-weight: 800; }

@media (max-width: 1100px) {
    .stats { grid-template-columns: repeat(2,1fr); }
    .finance-stats { grid-template-columns: repeat(2,1fr); }
    .dashboard-finance-stats { grid-template-columns: repeat(2,1fr); }
    .period-stats { grid-template-columns: repeat(3,1fr); }
    .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
    .app-shell { display: block; }
    .sidebar { position: fixed; width: 265px; transform: translateX(-105%); transition: .23s ease; box-shadow: 20px 0 50px rgba(15,23,42,.25); }
    .sidebar.open { transform: translateX(0); }
    .menu-button { display: block; }
    .topbar { padding: 14px 17px; min-height: 76px; }
    .topbar-badge { display: none; }
    .content { padding: 20px 15px 32px; }
    .page-actions { align-items: flex-start; flex-direction: column; }
    .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat { padding: 15px; }
    .stat .value { font-size: 19px; }
    .form-grid { grid-template-columns: 1fr; }
    .fee-grid { grid-template-columns: 1fr; }
    .fee-stats { grid-template-columns: 1fr 1fr; }
    .cleaning-rate-field, .cleaning-overview-body { grid-template-columns: 1fr; }
    .cleaning-rate-copy { text-align: left; }
    .form-grid .full { grid-column: auto; }
    .desktop-matrix { display: none; }
    .mobile-calendar { display: block; }
    .period-overview { padding: 14px; }
    .period-overview-head { align-items: flex-start; flex-wrap: wrap; }
    .period-selector { width: 100%; justify-content: flex-start; }
    .period-selector label { flex: 1 1 110px; }
    .period-selector select { width: 100%; }
    .period-stats { grid-template-columns: 1fr 1fr; }
    .movement-filters { grid-template-columns: 1fr 1fr; }
    .movement-filter-stats, .movement-filter-stats.has-carryover { grid-template-columns: 1fr 1fr; margin: 14px; }
    .login-page { display: block; min-height: 100vh; }
    .login-panel { min-height: 100vh; padding: 35px 24px; }
    .login-visual { display: none; }
}
@media (max-width: 480px) {
    .stats { grid-template-columns: 1fr; }
    .finance-stats { grid-template-columns: 1fr; }
    .dashboard-finance-stats { grid-template-columns: 1fr; }
    .steps { grid-template-columns: 1fr; }
    .install-body, .install-head { padding: 22px 18px; }
    .fee-stats { grid-template-columns: 1fr; }
    .fee-item { grid-template-columns: 1fr; }
    .period-stats { grid-template-columns: 1fr; }
    .movement-filters, .movement-filter-stats, .movement-filter-stats.has-carryover { grid-template-columns: 1fr; }
    .mobile-month-row { grid-template-columns: minmax(86px,.8fr) minmax(115px,1.2fr) auto; }
}
