:root {
  color-scheme: dark;
  --green: #2dbe64;
  --green-bright: #48d77e;
  --green-soft: rgba(45, 190, 100, .13);
  --page: #0c0f0d;
  --surface: #141815;
  --surface-2: #1a201c;
  --line: #29322b;
  --text: #f5f8f5;
  --muted: #929b94;
  --danger: #ff7373;
  --warning: #f1c75b;
}

* { box-sizing: border-box; }
html { background: var(--page); }
body { min-width: 320px; min-height: 100vh; margin: 0; background: var(--page); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
.eyebrow { margin: 0 0 6px; color: var(--green-bright); font-size: 11px; font-weight: 850; letter-spacing: .14em; }

.login-screen { min-height: 100dvh; display: grid; place-items: center; padding: max(24px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom)); }
.login-card { width: min(100%, 410px); padding: 25px 21px; border: 1px solid var(--line); border-radius: 26px; background: linear-gradient(155deg, #171c18, #101411); box-shadow: 0 24px 80px #0008; }
.login-card h1 { margin: 0; font-size: 42px; line-height: 1; letter-spacing: -.055em; }
.lead { margin: 9px 0 25px; color: var(--muted); font-size: 15px; }
form { display: grid; gap: 15px; }
form label { display: grid; gap: 7px; }
form label > span { color: #b9c0ba; font-size: 12px; font-weight: 750; }
input, select, textarea { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 13px; outline: 0; background: #0d110e; color: var(--text); }
input, select { height: 49px; padding: 0 14px; }
textarea { min-height: 88px; padding: 13px 14px; resize: vertical; }
input:focus, select:focus, textarea:focus, .search-box:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(45,190,100,.1); }
.primary-button, .secondary-button { min-height: 48px; padding: 0 17px; border-radius: 13px; font-weight: 850; }
.primary-button { border: 0; background: var(--green); color: #07120a; }
.secondary-button { border: 1px solid var(--line); background: transparent; color: #c6cdc7; }
.primary-button:disabled, .secondary-button:disabled { opacity: .55; cursor: wait; }
.message { min-height: 18px; margin: 0; color: var(--danger); font-size: 13px; line-height: 1.4; }

.topbar { min-height: calc(68px + env(safe-area-inset-top)); display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: env(safe-area-inset-top) max(18px, calc((100vw - 1100px) / 2)) 10px; border-bottom: 1px solid rgba(255,255,255,.07); background: rgba(12,15,13,.9); backdrop-filter: blur(18px); }
.brand { height: 48px; display: flex; align-items: center; gap: 11px; }
.brand div { display: grid; gap: 1px; }
.brand strong { font-size: 18px; letter-spacing: -.03em; }
.brand span, .account > span { color: var(--muted); font-size: 11px; }
.account { display: flex; align-items: center; gap: 12px; }
.account button { min-height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 750; }
.section-tabs { position: sticky; z-index: 10; top: 0; display: flex; gap: 6px; padding: 10px max(18px, calc((100vw - 1100px) / 2)); border-bottom: 1px solid rgba(255,255,255,.06); background: rgba(12,15,13,.93); backdrop-filter: blur(18px); overflow-x: auto; }
.section-tabs button { min-height: 42px; flex: 0 0 auto; padding: 0 15px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 800; }
.section-tabs button.is-active { border-color: rgba(45,190,100,.28); background: var(--green-soft); color: var(--text); }
.section-tabs button span { min-width: 20px; height: 20px; display: inline-grid; place-items: center; margin-left: 5px; padding: 0 6px; border-radius: 10px; background: var(--green); color: #07120a; font-size: 11px; }
.workspace { width: min(100%, 1100px); margin: 0 auto; padding: 34px 18px max(42px, env(safe-area-inset-bottom)); }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.section-heading h1 { margin: 0; font-size: clamp(32px, 7vw, 48px); line-height: 1; letter-spacing: -.05em; }
.section-heading p:last-child { margin: 9px 0 0; color: var(--muted); font-size: 14px; }
.add-button { min-width: 122px; }
.filter-tabs { display: flex; gap: 7px; margin-top: 27px; overflow-x: auto; scrollbar-width: none; }
.filter-tabs button { min-height: 39px; flex: 0 0 auto; padding: 0 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 800; }
.filter-tabs button.is-active { border-color: var(--green); color: var(--green-bright); }
.content-message { min-height: 19px; margin: 17px 1px 8px; color: var(--muted); font-size: 13px; }
.card-list { display: grid; gap: 10px; }
.user-card, .domophone-card { display: grid; gap: 15px; padding: 17px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); }
.card-main h2 { margin: 0 0 5px; font-size: 17px; }
.card-main p { margin: 0; color: var(--muted); font-size: 13px; }
.card-main small { display: block; margin-top: 7px; color: #697169; font-size: 11px; }
.card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.card-actions select { width: auto; min-width: 130px; height: 40px; padding: 0 30px 0 11px; border-radius: 10px; font-size: 12px; }
.action-button { min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font-size: 12px; font-weight: 800; }
.action-button.approve { border-color: rgba(45,190,100,.4); background: var(--green-soft); color: var(--green-bright); }
.action-button.danger { color: var(--danger); }
.status-chip { display: inline-flex; width: fit-content; margin-top: 9px; padding: 5px 8px; border-radius: 8px; background: #222920; color: var(--muted); font-size: 11px; font-weight: 800; }
.status-chip.needs_check { background: rgba(241,199,91,.1); color: var(--warning); }
.status-chip.active { background: var(--green-soft); color: var(--green-bright); }
.status-chip.inactive { color: #777f78; }
.report-count { display: block; width: fit-content; margin-top: 8px; padding: 6px 9px; border: 1px solid rgba(241,199,91,.28); border-radius: 9px; background: rgba(241,199,91,.08); color: var(--warning); font-size: 11px; font-weight: 800; }
.domophone-code { margin-top: 12px; color: var(--green-bright); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 19px; font-weight: 850; overflow-wrap: anywhere; }
.domophone-note { margin-top: 9px !important; color: #bdc4be !important; line-height: 1.45; }
.search-box { height: 49px; display: flex; align-items: center; gap: 10px; max-width: 520px; margin-top: 27px; padding: 0 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.search-box > span { color: var(--green-bright); font-size: 22px; }
.search-box input { height: 45px; padding: 0; border: 0; background: transparent; box-shadow: none !important; }

.modal-backdrop { position: fixed; z-index: 50; inset: 0; display: grid; place-items: end center; padding-top: 20px; background: rgba(0,0,0,.72); backdrop-filter: blur(4px); }
.modal { width: min(100%, 560px); max-height: calc(100dvh - 20px); overflow-y: auto; padding: 22px 18px max(24px, env(safe-area-inset-bottom)); border: 1px solid var(--line); border-bottom: 0; border-radius: 24px 24px 0 0; background: #111512; box-shadow: 0 -20px 70px #0008; }
.modal-head { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.modal-head h2 { margin: 0; font-size: 25px; letter-spacing: -.04em; }
.close-button { width: 39px; height: 39px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--muted); font-size: 24px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; }

@media (min-width: 720px) {
  .workspace { padding-top: 48px; }
  .user-card, .domophone-card { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .modal-backdrop { place-items: center; padding: 24px; }
  .modal { max-height: calc(100dvh - 48px); padding: 26px; border-bottom: 1px solid var(--line); border-radius: 24px; }
}
@media (max-width: 430px) { .account > span { display: none; } .section-heading { align-items: flex-start; } .add-button { min-width: auto; min-height: 42px; padding-inline: 13px; font-size: 12px; } }
@media (max-width: 360px) { .workspace { padding-inline: 14px; } .field-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
