:root {
  --bg: #f6f9fb;
  --surface: #ffffff;
  --ink: #12202a;
  --muted: #6c7a84;
  --line: #dfe7ec;
  --accent: #147b91;
  --accent-dark: #0d6072;
  --soft: #eaf5f7;
  --success: #1f7557;
  --warn: #9a6417;
  --danger: #9b3b3b;
  --shadow: 0 18px 50px rgba(31, 61, 77, .08);
  --radius: 24px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.5; }
a { color: inherit; }
button, input { font: inherit; }
.page-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.topbar { min-height: 86px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }
.brand-mark svg { width: 26px; height: 26px; }
.brand span:last-child { display: flex; flex-direction: column; line-height: 1.05; }
.brand strong { font-size: 18px; }
.brand small { color: var(--muted); margin-top: 4px; }
.text-link { color: var(--muted); font-weight: 700; text-decoration: none; }
.button-reset { background: transparent; border: 0; cursor: pointer; padding: 8px 0; }
.hero { padding: 78px 0 54px; max-width: 780px; }
.hero.small { padding: 48px 0 30px; }
.hero h1 { font-size: clamp(44px, 7vw, 78px); line-height: .98; letter-spacing: -.055em; margin: 12px 0 20px; }
.hero.small h1 { font-size: clamp(40px, 6vw, 62px); }
.hero p { max-width: 650px; color: var(--muted); font-size: 19px; margin: 0; }
.eyebrow { color: var(--accent); font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.hero-actions { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.button { min-height: 50px; padding: 0 20px; border-radius: 14px; border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; font-weight: 800; cursor: pointer; transition: .18s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--accent); color: #fff; }
.button.primary:hover { background: var(--accent-dark); }
.button.secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.button.full { width: 100%; }
.price-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; border: 1px solid var(--line); background: var(--line); border-radius: 20px; overflow: hidden; margin-bottom: 34px; }
.price-strip > div { padding: 20px 24px; background: rgba(255,255,255,.82); display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.price-strip span { color: var(--muted); font-size: 14px; margin-right: auto; }
.price-strip strong { font-size: 14px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, .75fr); gap: 22px; align-items: start; }
.card { background: var(--surface); border: 1px solid rgba(214,225,231,.9); border-radius: var(--radius); box-shadow: var(--shadow); }
.form-card, .compact-card { padding: 28px; }
.compact-card { position: sticky; top: 22px; }
.section-heading { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 24px; }
.section-heading h2, .overview-head h2 { margin: 0; letter-spacing: -.025em; }
.section-heading p, .overview-head p { margin: 4px 0 0; color: var(--muted); }
.step { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: var(--soft); color: var(--accent); font-weight: 900; font-size: 12px; }
.form-stack { display: grid; gap: 18px; }
.field-grid.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label { font-weight: 750; font-size: 14px; }
.hint { color: var(--muted); font-weight: 500; margin-left: 6px; }
input[type="text"], input[type="password"], input:not([type]) { width: 100%; min-height: 50px; border: 1px solid var(--line); border-radius: 13px; background: #fbfdfe; color: var(--ink); padding: 0 14px; margin-top: 8px; outline: 0; }
input:focus { border-color: rgba(20,123,145,.55); box-shadow: 0 0 0 4px rgba(20,123,145,.09); }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 800; margin-bottom: 10px; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice-card, .radio-card { position: relative; border: 1px solid var(--line); border-radius: 16px; padding: 15px; display: flex; align-items: center; gap: 12px; cursor: pointer; background: #fff; min-height: 76px; }
.choice-card input, .radio-card input { accent-color: var(--accent); width: 19px; height: 19px; flex: 0 0 auto; }
.choice-card span:nth-child(2), .radio-card span { display: flex; flex-direction: column; }
.choice-card small, .radio-card small { color: var(--muted); font-weight: 500; margin-top: 2px; }
.checkmark { color: var(--accent); margin-left: auto; opacity: 0; font-size: 20px; }
.choice-card:has(input:checked), .radio-card:has(input:checked) { border-color: rgba(20,123,145,.46); background: var(--soft); }
.choice-card:has(input:checked) .checkmark { opacity: 1; }
.radio-stack { display: grid; gap: 10px; }
.form-note { color: var(--muted); font-size: 12px; margin: -2px 0 0; }
.info-box { margin-top: 22px; padding: 16px; background: #f8fbfc; border: 1px solid var(--line); border-radius: 16px; }
.info-box p { color: var(--muted); margin: 6px 0 0; font-size: 13px; }
.overview-section { padding: 86px 0 24px; }
.overview-head { display: flex; gap: 20px; justify-content: space-between; align-items: flex-end; margin-bottom: 20px; }
.total-pill { background: var(--ink); color: #fff; border-radius: 18px; padding: 12px 16px; display: inline-flex; flex-direction: column; min-width: 180px; }
.total-pill span { opacity: .66; font-size: 12px; }
.total-pill strong { font-size: 21px; }
.total-pill.large { margin-top: 24px; }
.desktop-table { overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 17px 18px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .07em; }
tbody tr:last-child td { border-bottom: 0; }
.right { text-align: right; }
.status { display: inline-flex; padding: 6px 9px; border-radius: 999px; background: #edf7f2; color: var(--success); font-size: 12px; font-weight: 800; }
.status.skip { background: #fff5e5; color: var(--warn); }
.status.muted { background: #f0f3f5; color: var(--muted); }
.inline-note { color: var(--muted); margin-left: 7px; }
.mobile-list { display: none; }
.empty { padding: 28px; color: var(--muted); text-align: center; }
.flash-stack { position: fixed; right: 22px; top: 20px; z-index: 30; display: grid; gap: 8px; width: min(380px, calc(100% - 44px)); }
.flash { padding: 14px 16px; background: var(--ink); color: #fff; border-radius: 14px; box-shadow: var(--shadow); }
.flash.error { background: var(--danger); }
.flash.success { background: var(--success); }
.narrow-main { max-width: 820px; margin: 0 auto; }
.summary-card { padding: 18px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.summary-card > div { padding: 10px 12px; }
.summary-card span { display: block; color: var(--muted); font-size: 12px; }
.summary-card strong { display: block; margin-top: 3px; }
.skip-box { background: #f8fbfc; border: 1px solid var(--line); border-radius: 18px; padding: 16px; transition: opacity .2s ease; }
.skip-box.disabled { opacity: .45; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.switch-row > span:first-child { display: flex; flex-direction: column; }
.switch-row small { color: var(--muted); font-weight: 500; }
.switch { width: 48px; height: 28px; position: relative; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: #cfd8dd; transition: .2s; }
.switch i:after { content: ""; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; border-radius: 50%; background: white; transition: .2s; box-shadow: 0 2px 7px rgba(0,0,0,.18); }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i:after { transform: translateX(20px); }
.skip-box p { color: var(--muted); font-size: 13px; margin: 12px 0 0; }
.login-main { min-height: calc(100vh - 180px); display: grid; place-items: center; }
.login-card { width: min(440px, 100%); padding: 30px; }
.login-card h1 { margin: 8px 0 10px; letter-spacing: -.04em; }
.login-card > p { color: var(--muted); margin: 0 0 24px; }
.admin-hero { max-width: none; display: grid; grid-template-columns: 1fr auto; align-items: end; }
.admin-hero > .eyebrow, .admin-hero > h1, .admin-hero > p { grid-column: 1; }
.admin-hero .total-pill { grid-column: 2; grid-row: 1 / 4; align-self: end; }
.admin-list { display: grid; gap: 14px; padding-bottom: 30px; }
.work-card { padding: 20px; }
.work-card.not-due { box-shadow: none; background: rgba(255,255,255,.62); }
.work-title { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.work-title > div { display: flex; align-items: center; gap: 12px; }
.work-title h2 { margin: 0; font-size: 20px; }
.apartment-badge { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: var(--soft); color: var(--accent); font-weight: 900; }
.work-price { font-size: 24px; }
.work-tags, .service-tags { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 14px; }
.work-tags span, .service-tags span { padding: 6px 9px; border-radius: 999px; background: #f1f5f7; color: #53636d; font-size: 12px; font-weight: 700; }
.work-tags .accent-tag { background: var(--soft); color: var(--accent); }
.work-meta { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; }
.work-meta span { display: block; color: var(--muted); font-size: 12px; }
.work-meta strong { font-size: 14px; }
.footer { min-height: 110px; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 12px; }

@media (max-width: 820px) {
  .page-shell { width: min(100% - 28px, 720px); }
  .topbar { min-height: 74px; }
  .hero { padding: 44px 0 34px; }
  .hero h1 { font-size: clamp(42px, 13vw, 62px); }
  .hero p { font-size: 17px; }
  .hero-actions { display: grid; grid-template-columns: 1fr; }
  .price-strip { grid-template-columns: 1fr; }
  .price-strip > div { align-items: flex-start; }
  .content-grid { grid-template-columns: 1fr; }
  .compact-card { position: static; }
  .overview-head { align-items: stretch; flex-direction: column; }
  .total-pill { width: 100%; }
  .desktop-table { display: none; }
  .mobile-list { display: grid; gap: 10px; }
  .resident-card { border: 1px solid var(--line); background: var(--surface); border-radius: 18px; padding: 16px; }
  .resident-top { display: flex; justify-content: space-between; gap: 12px; }
  .resident-status { color: var(--muted); margin-top: 10px; font-size: 13px; }
  .summary-card { grid-template-columns: 1fr 1fr; }
  .admin-hero { display: block; }
  .admin-hero .total-pill { margin-top: 22px; }
  .work-meta { grid-template-columns: 1fr; gap: 10px; }
  .overview-section { padding-top: 58px; }
}

@media (max-width: 560px) {
  body { padding-bottom: env(safe-area-inset-bottom); }
  .page-shell { width: calc(100% - 20px); }
  .brand small { display: none; }
  .hero { padding-top: 32px; }
  .hero h1 { letter-spacing: -.05em; }
  .form-card, .compact-card { padding: 20px; border-radius: 20px; }
  .field-grid.two, .choice-grid { grid-template-columns: 1fr; }
  .choice-card, .radio-card { min-height: 72px; }
  .summary-card { grid-template-columns: 1fr 1fr; padding: 10px; }
  .summary-card > div { padding: 9px; }
  .sticky-save { position: sticky; bottom: max(10px, env(safe-area-inset-bottom)); z-index: 10; box-shadow: 0 10px 30px rgba(13,96,114,.24); }
  .flash-stack { top: 10px; right: 10px; width: calc(100% - 20px); }
  .work-title { align-items: flex-start; }
  .work-title > div { align-items: flex-start; }
  .work-title h2 { font-size: 18px; }
  .work-price { font-size: 20px; }
}
