/* CondoBox — interface de portaria, independente de fontes e serviços externos. */
:root {
  color-scheme: light;
  --canvas: #f6f7fb;
  --surface: #ffffff;
  --ink: #202839;
  --muted: #7b8394;
  --line: #e9ebf2;
  --brand: #5b54e6;
  --brand-hover: #4942cc;
  --sidebar: #172033;
  --radius: 15px;
  --shadow: 0 3px 14px rgb(31 39 64 / 3%);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--canvas); line-height: 1.5; }
button, input, textarea, select { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, select { cursor: pointer; }
button { color: inherit; }
button:disabled { cursor: not-allowed; opacity: .52; }
button, input, select, textarea, a { outline-offset: 4px; }
:focus-visible { outline: 3px solid #aaa5fc; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { width: 20px; height: 20px; flex-shrink: 0; vertical-align: middle; }
img, video { max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: -.035em; }
button, .btn, .nav-link { transition: background-color .15s, color .15s, border-color .15s, box-shadow .15s; }
[hidden], .hidden { display: none !important; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 25; inset: 0 auto 0 0; width: 236px; display: flex; flex-direction: column; padding: 32px 20px 24px; background: var(--sidebar); color: #fff; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 9px; margin-bottom: 45px; }
.brand-mark { display: grid; place-items: center; flex-shrink: 0; width: 39px; height: 42px; border-radius: 11px; background: #7770f5; color: white; }
.brand-mark svg { width: 24px; height: 24px; }
.brand-name { font-size: 22px; font-weight: 800; letter-spacing: -.045em; line-height: 1.1; }
.brand-subtitle { display: block; margin-top: 5px; font-size: 10px; font-weight: 500; letter-spacing: .13em; text-transform: uppercase; color: #8993a8; }
.sidebar nav { display: flex; flex-direction: column; gap: 8px; }
.sidebar nav > p, .nav-label { margin: 0 12px 12px; color: #6d7992; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.nav-link { display: flex; align-items: center; gap: 13px; width: 100%; min-height: 47px; padding: 12px 15px; border: 0; border-radius: 9px; background: transparent; color: #aab4c7; text-align: left; font-weight: 500; font-size: 13px; }
.nav-link:hover { background: #222d43; color: #fff; text-decoration: none; }
.nav-link[aria-current="page"] { color: white; background: #5b54e6; box-shadow: 0 4px 10px rgb(0 0 0 / 10%); }
.nav-link svg { width: 19px; height: 19px; }
.sidebar-bottom { margin-top: auto; padding: 22px 8px 0; color: #78869d; font-size: 11px; }
.sidebar-bottom p { margin-bottom: 8px; }
.local-badge { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; color: #bac4d7; font-size: 11px; }
.local-badge::before { content: ""; display: block; width: 6px; height: 6px; border-radius: 100%; background: #6ec3a0; box-shadow: 0 0 0 4px rgb(110 195 160 / 9%); }
.workspace { margin-left: 236px; min-height: 100vh; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 40px; border-bottom: 1px solid var(--line); background: var(--surface); }
.breadcrumbs { display: flex; align-items: center; gap: 10px; color: #9299a8; font-size: 12px; }
.breadcrumbs strong, .breadcrumbs [aria-current] { color: #3e4759; font-weight: 500; }
.breadcrumbs svg { width: 15px; height: 15px; }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.connection-status { display: inline-flex; align-items: center; gap: 7px; color: #6f7b88; font-size: 11px; }
.connection-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #53a886; }
.avatar { width: 33px; height: 33px; display: grid; place-items: center; border-radius: 50%; background: #eeeefa; color: #6b62c8; font-size: 11px; font-weight: 700; }
main, .page-content { padding: 34px 40px 24px; max-width: 1700px; margin-inline: auto; }
.page-content main { padding: 0; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 27px; }
.eyebrow { margin-bottom: 6px; color: #9299a8; font-size: 10px; line-height: 1.4; font-weight: 700; text-transform: uppercase; letter-spacing: .13em; }
.page-header h1 { margin: 0 0 6px; color: #202839; font-size: clamp(24px, 2.4vw, 31px); line-height: 1.25; font-weight: 700; }
.page-subtitle { margin-bottom: 0; color: var(--muted); font-size: 12px; }
.header-actions { display: flex; align-items: center; flex-shrink: 0; gap: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 9px 15px; border: 1px solid transparent; border-radius: 8px; font-size: 12px; line-height: 1.5; font-weight: 600; white-space: nowrap; }
.btn:hover { text-decoration: none; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { color: #fff; background: var(--brand); border-color: var(--brand); box-shadow: 0 3px 6px rgb(91 84 230 / 10%); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-secondary { color: #596176; background: white; border-color: #dfe3ec; }
.btn-secondary:hover { background: #f9f9fd; border-color: #b6b7db; }
.btn-ghost { color: #6c6799; background: transparent; }
.btn-ghost:hover { color: var(--brand); background: #efedfc; }
.btn-danger { color: #be4758; background: #fff0f2; border-color: #f9dbe1; }
.btn-danger:hover { background: #ffe3e8; }
.btn-sm { min-height: 30px; padding: 5px 9px; border-radius: 6px; font-size: 11px; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; min-width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: white; color: #7a8294; }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { color: var(--brand); border-color: #c9c5f5; background: #f4f3ff; }
.notice { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 24px; padding: 13px 17px; border: 1px solid #e5e2fa; border-radius: 9px; background: #efedfc; color: #746c9f; font-size: 11px; }
.notice-icon { color: #8276cd; margin-top: 1px; }
.notice-icon svg { width: 17px; height: 17px; }
.notice-text { flex: 1; }
.notice-text strong { color: #5e567d; font-weight: 600; }
.notice-text p { margin: 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 27px; }
.stat-card { position: relative; min-height: 132px; padding: 20px 21px 17px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); }
.stat-icon { position: absolute; right: 20px; top: 20px; display: grid; place-items: center; width: 35px; height: 35px; border-radius: 10px; }
.stat-icon svg { width: 18px; height: 18px; }
.violet { background: #efedff; color: #8272d9; }
.amber { background: #fff5e5; color: #d4a24a; }
.green { background: #eaf8f1; color: #66ad90; }
.blue { background: #edf4ff; color: #739ad0; }
.stat-label { color: #7c8495; font-size: 11px; padding-right: 30px; }
.stat-value { display: block; margin: 6px 0 2px; color: #313a4e; font-size: 31px; line-height: 1.2; font-weight: 700; letter-spacing: -.04em; }
.stat-caption { color: #a0a6b3; font-size: 10px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 2.45fr) minmax(250px, 1fr); align-items: start; gap: 23px; }
.content-grid > * { min-width: 0; }
.card { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); }
.card + .card { margin-top: 22px; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 21px 23px 18px; }
.card-title { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 14px; line-height: 1.4; font-weight: 650; letter-spacing: -.02em; }
.card-title svg { color: #8e85d4; width: 17px; height: 17px; }
.card-subtitle { margin: 4px 0 0; color: #959cab; font-size: 11px; }
.card-body { padding: 0 23px 23px; }
.toolbar { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 0 23px 18px; flex-wrap: wrap; }
.search-field { position: relative; display: flex; align-items: center; flex: 1; min-width: 175px; }
.search-field svg { position: absolute; left: 12px; width: 16px; height: 16px; color: #a0a7b6; pointer-events: none; }
.search-field input { width: 100%; min-height: 37px; padding: 8px 12px 8px 36px; border: 1px solid #e7eaf1; border-radius: 7px; color: #444d62; background: #fafbfe; font-size: 11px; }
input::placeholder, textarea::placeholder { color: #a0a7b6; }
.search-field input:focus { border-color: #aea7f0; outline: none; box-shadow: 0 0 0 3px #f1efff; }
.filter-tabs { display: inline-flex; align-items: center; flex-shrink: 0; padding: 3px; gap: 2px; border-radius: 7px; background: #f4f5f9; }
.filter-tabs button { min-height: 30px; padding: 5px 10px; border: 0; border-radius: 5px; color: #969cab; background: transparent; font-size: 10px; font-weight: 500; }
.filter-tabs button[aria-pressed="true"] { color: #7368d3; background: white; box-shadow: 0 1px 4px rgb(33 40 62 / 7%); }
.filter-tabs button:hover { color: var(--brand); }
.select { min-height: 37px; max-width: 100%; padding: 7px 28px 7px 11px; border: 1px solid #e7eaf1; border-radius: 7px; background-color: #fafbfe; color: #7f8797; font-size: 11px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 11px; white-space: nowrap; }
thead { color: #929aaa; background: #fafbfe; }
th { padding: 12px 16px; border-top: 1px solid #f0f1f6; border-bottom: 1px solid #edf0f6; font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: .055em; }
td { padding: 17px 16px; border-bottom: 1px solid #f0f2f7; color: #70798c; }
th:first-child, td:first-child { padding-left: 23px; }
th:last-child, td:last-child { padding-right: 23px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fcfcff; }
.person { display: flex; align-items: center; gap: 10px; }
.person-avatar { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; border-radius: 9px; background: #efedfa; color: #8c80b3; font-size: 10px; font-weight: 600; }
.person-info { display: flex; flex-direction: column; gap: 2px; }
.person-info strong { color: #4a5265; font-size: 11px; font-weight: 600; }
.person-info span { color: #a0a6b4; font-size: 10px; }
.muted { color: #9ba2b0; }
.mono { font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace; font-size: 10px; }
.status { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 5px; font-size: 9px; font-weight: 500; }
.status::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.status-pending { color: #bf984b; background: #fff7e7; }
.status-delivered { color: #65a48a; background: #eaf7ef; }
.actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.actions .icon-btn { width: 27px; height: 27px; min-width: 27px; border-color: transparent; }
.actions .icon-btn svg { width: 14px; height: 14px; }
.empty-state { padding: 43px 24px 49px; text-align: center; }
.empty-art { display: inline-grid; place-items: center; width: 63px; height: 63px; margin-bottom: 17px; border: 1px solid #ece9fc; border-radius: 19px; background: #f5f3ff; color: #9a8fe5; }
.empty-art svg { width: 29px; height: 29px; }
.empty-title { margin-bottom: 6px; font-size: 14px; font-weight: 600; color: #4d576c; }
.empty-description { max-width: 310px; margin: 0 auto 20px; color: #969dad; font-size: 11px; line-height: 1.75; }
.activity-list { margin: 0; padding: 0; list-style: none; }
.activity-item { position: relative; display: flex; gap: 12px; padding: 0 0 21px; font-size: 11px; }
.activity-item:last-child { padding-bottom: 0; }
.activity-item:not(:last-child)::before { content: ""; position: absolute; top: 21px; bottom: 5px; left: 14px; border-left: 1px solid #ebeef5; }
.activity-dot { display: grid; place-items: center; width: 29px; height: 29px; flex-shrink: 0; border-radius: 50%; color: #8d80cf; background: #f1effc; }
.activity-dot svg { width: 13px; height: 13px; }
.activity-item strong { display: block; margin-bottom: 3px; font-weight: 500; color: #626b7f; }
.activity-item p { margin: 2px 0; color: #8e97a7; font-size: 10px; }
.activity-item time, .activity-item small { display: block; color: #b1b7c2; font-size: 9px; }
.quick-actions { display: grid; gap: 9px; }
.quick-action { display: flex; align-items: center; gap: 11px; width: 100%; padding: 11px 12px; border: 1px solid #edeef6; border-radius: 8px; background: #fff; color: #788092; text-align: left; font-size: 11px; }
.quick-action:hover { border-color: #cfcaf7; background: #faf9ff; color: var(--brand); text-decoration: none; }
.quick-action > svg { width: 16px; height: 16px; color: #988cce; }
.quick-action strong { display: block; color: #667085; font-size: 11px; font-weight: 500; }
.quick-action small { color: #a4aab6; font-size: 9px; }
.quick-action svg:last-child:not(:first-child) { margin-left: auto; width: 12px; height: 12px; color: #b4b7c4; }
.steps { display: grid; gap: 17px; }
.step { display: flex; gap: 11px; align-items: flex-start; }
.step-number { display: grid; place-items: center; width: 23px; height: 23px; flex-shrink: 0; border-radius: 6px; background: #f0eefc; color: #8d80ca; font-size: 10px; }
.step strong { display: block; font-size: 11px; font-weight: 500; color: #657085; }
.step p { margin: 3px 0 0; color: #a2a8b5; font-size: 10px; }
.resident-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.resident-card { padding: 21px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.resident-top { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.resident-top .person-avatar { width: 43px; height: 43px; font-size: 13px; }
.resident-top h3 { margin: 0 0 4px; font-size: 14px; }
.resident-top p { margin: 0; font-size: 11px; color: #939bab; }
.resident-details { display: grid; gap: 9px; color: #8790a2; font-size: 11px; }
.resident-details p { display: flex; align-items: center; gap: 9px; margin: 0; }
.resident-details svg { width: 14px; height: 14px; color: #a5a0be; }
.resident-actions { display: flex; gap: 8px; margin-top: 20px; padding-top: 14px; border-top: 1px solid #eff1f6; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 22px; }
.settings-card { padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.settings-card h2 { margin-bottom: 7px; font-size: 16px; }
.settings-card > p { margin-bottom: 23px; color: #939bab; font-size: 12px; }
.settings-card .btn + .btn { margin-left: 6px; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.field label, label.field { color: #646d80; font-size: 11px; font-weight: 600; }
.field input, .field select, .field textarea { width: 100%; min-height: 41px; padding: 10px 12px; border: 1px solid #e1e5ef; border-radius: 7px; color: #505a70; background: #fff; font-size: 12px; font-weight: 400; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: #aaa2ed; box-shadow: 0 0 0 3px #f2f0ff; }
.field textarea { min-height: 83px; resize: vertical; }
.field input[readonly] { background: #f6f7fa; }
.field input[type="checkbox"] { width: 17px; min-height: 17px; accent-color: var(--brand); }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field-hint { margin: 0; color: #a0a8b6; font-size: 10px; font-weight: 400; line-height: 1.6; }
.required { color: #ae99d4; }
.form-error { margin: 0 0 16px; padding: 10px 12px; color: #b3445a; background: #fff0f3; border-radius: 7px; font-size: 11px; }
.form-error:empty { display: none; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 9px; padding-top: 9px; }
dialog { width: min(480px, calc(100% - 40px)); max-height: 90vh; padding: 0; overflow-y: auto; border: 1px solid #e8e7f1; border-radius: 15px; color: var(--ink); background: #fff; box-shadow: 0 20px 80px rgb(10 19 40 / 20%); }
dialog::backdrop { background: rgb(19 26 44 / 45%); backdrop-filter: blur(3px); }
.modal-wide { width: min(620px, calc(100% - 40px)); }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 23px 25px 20px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0; font-size: 19px; }
.modal-header p { margin: 5px 0 0; font-size: 11px; color: #8c95a6; }
.modal-header .icon-btn { border: 0; }
.modal-body { padding: 24px 25px; }
.modal-body > p { color: #8c95a6; font-size: 12px; }
.modal-body .field:last-child { margin-bottom: 0; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 17px 25px; border-top: 1px solid var(--line); background: #fcfcfe; }
.toast-container { position: fixed; z-index: 100; right: 25px; bottom: 24px; display: grid; gap: 9px; width: min(370px, calc(100% - 40px)); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border: 1px solid #d9ece3; border-radius: 10px; background: #fff; box-shadow: 0 8px 28px rgb(22 43 37 / 13%); color: #4a7c65; font-size: 12px; animation: toast-in .2s ease-out; pointer-events: auto; }
.toast-error { color: #b85263; border-color: #f1d9df; }
.toast svg { width: 18px; height: 18px; }
.scanner-preview { position: relative; min-height: 230px; overflow: hidden; display: grid; place-items: center; margin-bottom: 18px; border-radius: 10px; background: #172033; color: #bfc7d5; }
.scanner-preview video { display: block; width: 100%; max-height: 340px; object-fit: cover; }
.scanner-frame { position: absolute; inset: 25% 12%; border: 2px solid #a19af5; border-radius: 10px; pointer-events: none; }
.scanner-message { position: absolute; inset: auto 16px 17px; text-align: center; font-size: 11px; color: #d1d5e0; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.detail-item { min-width: 0; }
.detail-item dt, .detail-item label, .detail-item span:first-child { display: block; margin-bottom: 5px; color: #9ba3b2; font-size: 10px; }
.detail-item dd { margin: 0; }
.detail-item strong, .detail-item dd { color: #566176; font-size: 12px; font-weight: 500; overflow-wrap: anywhere; }
.detail-note { padding: 13px 15px; margin-top: 20px; border-radius: 8px; color: #818b9f; background: #f7f8fc; font-size: 11px; white-space: pre-wrap; overflow-wrap: anywhere; }
.footer-note { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 30px 0 0; color: #aeb4c1; font-size: 10px; text-align: center; }
.footer-note svg { width: 12px; height: 12px; }
.pill { display: inline-flex; align-items: center; padding: 3px 7px; border-radius: 5px; color: #a0a7b8; background: #f3f4f8; font-size: 9px; font-weight: 500; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (min-width: 1600px) { main, .page-content { padding-top: 44px; } .stat-card { min-height: 145px; } }
@media (max-width: 1200px) {
  .topbar { padding-inline: 27px; }
  main, .page-content { padding-inline: 27px; }
  .content-grid { grid-template-columns: minmax(0, 1fr); }
  .side-card { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .side-card > .card { margin-top: 0; }
  .stats-grid { gap: 12px; }
  .stat-card { padding-inline: 16px; }
  .stat-icon { right: 14px; width: 30px; height: 30px; }
  .resident-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .sidebar { inset: 0 0 auto; width: auto; height: 64px; padding: 0 22px; justify-content: center; }
  .brand { margin: 0; padding: 0; gap: 9px; }
  .brand-mark { width: 31px; height: 34px; border-radius: 8px; }
  .brand-mark svg { width: 20px; height: 20px; }
  .brand-name { font-size: 20px; }
  .brand-subtitle { font-size: 7px; margin-top: 3px; }
  .sidebar nav { position: fixed; inset: auto 0 0; z-index: 26; display: flex; flex-direction: row; align-items: stretch; justify-content: space-evenly; gap: 3px; height: 67px; padding: 6px 8px max(6px, env(safe-area-inset-bottom)); background: white; border-top: 1px solid #e5e7f0; box-shadow: 0 -3px 20px rgb(28 37 60 / 4%); }
  .sidebar nav > p, .nav-label { display: none; }
  .nav-link { flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 48px; padding: 6px 3px; border-radius: 8px; color: #8d95a6; font-size: 9px; text-align: center; }
  .nav-link svg { width: 18px; height: 18px; }
  .nav-link:hover { background: #f5f4fe; color: var(--brand); }
  .nav-link[aria-current="page"] { color: var(--brand); background: #f0eefe; box-shadow: none; }
  .sidebar-bottom { position: absolute; right: 22px; top: 21px; margin: 0; padding: 0; }
  .sidebar-bottom > p { display: none; }
  .local-badge { margin: 0; font-size: 9px; }
  .workspace { margin: 64px 0 0; padding-bottom: 70px; }
  .topbar { height: 54px; padding-inline: 22px; }
  .topbar-actions { gap: 12px; }
  .breadcrumbs { font-size: 10px; }
  .connection-status { font-size: 9px; }
  .avatar { width: 28px; height: 28px; font-size: 9px; }
  main, .page-content { padding: 27px 22px 20px; }
  .page-header { gap: 18px; align-items: flex-start; margin-bottom: 23px; }
  .page-header h1 { font-size: 26px; }
  .page-subtitle { font-size: 11px; }
  .header-actions { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
  .header-actions .btn { padding-inline: 11px; font-size: 11px; }
  .stat-card { min-height: 126px; padding: 17px 14px; }
  .stat-icon { top: 16px; right: 12px; width: 27px; height: 27px; border-radius: 7px; }
  .stat-icon svg { width: 15px; height: 15px; }
  .stat-label { font-size: 10px; }
  .stat-value { margin-top: 11px; font-size: 28px; }
  .stat-caption { font-size: 9px; }
  .notice { padding: 12px 14px; margin-bottom: 20px; }
  .toast-container { bottom: 83px; right: 20px; }
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  main, .page-content { padding-inline: 16px; }
  .topbar { padding-inline: 16px; }
  .sidebar { padding-inline: 17px; }
  .sidebar-bottom { right: 18px; }
  .connection-status { display: none; }
  .page-header { flex-direction: column; gap: 17px; }
  .page-header h1 { font-size: 26px; }
  .header-actions { width: 100%; justify-content: flex-start; }
  .header-actions .btn { min-height: 39px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; margin-bottom: 20px; }
  .stat-card { min-height: 124px; padding: 17px; }
  .stat-label { font-size: 11px; }
  .stat-caption { font-size: 10px; }
  .stat-icon { right: 15px; }
  .stat-value { font-size: 29px; }
  .notice { font-size: 10px; gap: 10px; }
  .content-grid { gap: 20px; }
  .side-card { display: block; }
  .side-card > .card + .card { margin-top: 20px; }
  .card-header { padding: 19px 17px 16px; }
  .card-body { padding: 0 17px 20px; }
  .toolbar { gap: 11px; padding: 0 17px 16px; }
  .search-field { flex-basis: 100%; }
  .filter-tabs { flex: 1; }
  .filter-tabs button { flex: 1; padding-inline: 8px; }
  .toolbar .select { max-width: 40%; }
  th:first-child, td:first-child { padding-left: 17px; }
  th:last-child, td:last-child { padding-right: 17px; }
  .resident-grid { grid-template-columns: 1fr; }
  .settings-card { padding: 21px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  dialog, .modal-wide { width: calc(100% - 24px); max-height: 90vh; border-radius: 13px; }
  .modal-header { padding: 20px 19px 17px; }
  .modal-header h2 { font-size: 18px; }
  .modal-body { padding: 21px 19px; }
  .modal-footer { padding: 15px 19px; }
  .modal-footer .btn { flex: 1; }
  .detail-grid { gap: 17px 12px; }
  .toast-container { right: 14px; width: calc(100% - 28px); }
  .footer-note { font-size: 9px; margin-top: 25px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Application integration and readable, accessible type scale. */
:root { --muted: #64748b; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 200; left: 12px; top: -60px; padding: 10px 17px; border-radius: 8px; color: white; background: var(--brand); font-weight: 600; }
.skip-link:focus { top: 12px; }
.brand { color: white; }
.brand:hover { text-decoration: none; }
.brand-dot { color: #a49bf7; }
.brand-subtitle { color: #a0abc0; }
.nav-caption { margin: 0 13px 17px; color: #9aa6bc; font-size: 10px; font-weight: 600; letter-spacing: .11em; }
.nav-count { display: inline-grid; place-items: center; min-width: 21px; height: 21px; margin-left: auto; padding: 0 5px; border-radius: 5px; background: #30394e; color: #c8cfdd; font-size: 10px; }
.nav-link[aria-current="page"] .nav-count { color: white; background: rgb(255 255 255 / 18%); }
.sidebar-tip { margin-bottom: 24px; padding: 17px 13px; border: 1px solid #30394d; border-radius: 10px; background: #1d283e; }
.sidebar-tip > span { display: block; margin-bottom: 11px; color: #a59bed; }
.sidebar-tip strong { display: block; margin-bottom: 6px; color: #d1d7e3; font-size: 11px; font-weight: 500; }
.sidebar-tip p { color: #9faac0; font-size: 11px; line-height: 1.7; }
.sidebar .local-badge .status-dot, .connection-status .status-dot { display: none; }
.local-badge { font-size: 10px; }
.breadcrumbs { color: #66738a; font-size: 12px; }
.breadcrumb-divider { margin-inline: 3px; color: #b5bbc6; }
.breadcrumbs > span:last-child { color: #3c485e; }
.connection-status { color: #68778c; font-size: 12px; }
.page-header { flex-wrap: wrap; }
.page-header > div:first-child { min-width: 0; }
.eyebrow { color: #6f7c92; font-size: 10px; }
.page-subtitle { color: #64748b; font-size: 13px; line-height: 1.7; }
.today-label { display: block; margin-top: 3px; color: #68768b; font-size: 12px; }
.btn { min-height: 42px; font-size: 13px; }
.btn-secondary { color: #556276; }
.btn-ghost { color: #6154a7; }
.btn-sm { min-height: 32px; font-size: 12px; }
.notice { align-items: center; color: #665c89; font-size: 12px; line-height: 1.65; }
.notice-text strong { display: block; margin-bottom: 2px; color: #514572; }
.notice-text > span { display: block; }
.notice-icon { align-self: flex-start; margin-top: 2px; }
.notice.compact { margin: 22px 0 18px; padding: 13px; align-items: flex-start; }
.notice.compact p { margin: 0; }
.notice.compact > span { color: #8472b8; }
.notice-error { border-color: #efcbd4; color: #985166; background: #fff0f3; }
.notice-error .notice-text strong { color: #984255; }
.stat-card { min-height: 149px; }
.stat-top { display: flex; align-items: center; justify-content: space-between; min-height: 36px; gap: 8px; }
.stat-label { color: #657187; font-size: 12px; padding-right: 0; }
.stat-icon { position: static; width: 35px; height: 35px; flex-shrink: 0; }
.stat-value { margin-top: 8px; font-size: 32px; }
.stat-caption { margin-top: 4px; color: #717e92; font-size: 11px; }
.card-title { font-size: 15px; }
.card-subtitle { color: #717e92; font-size: 12px; line-height: 1.65; }
.search-field input { min-height: 41px; font-size: 13px; }
.search-field input::placeholder, input::placeholder, textarea::placeholder { color: #758197; }
.filter-tabs button { min-height: 34px; color: #68768a; font-size: 12px; }
.filter-tabs button[aria-pressed="true"] { color: #6551b0; }
.select { font-size: 12px; }
.card > .toolbar:first-child { padding-top: 21px; }
.residents-toolbar { padding: 0 0 22px; }
.residents-toolbar .search-field { max-width: 460px; }
.residents-toolbar > .muted { font-size: 12px; }
table { font-size: 12px; }
th { color: #68768c; font-size: 10px; }
td { color: #647187; }
td > strong { color: #4a5870; font-weight: 500; font-size: 12px; }
.table-sub { display: block; margin-top: 4px; color: #727f93; font-size: 11px; }
.person-info strong { color: #46536a; font-size: 12px; }
.person-info span { color: #6a788c; font-size: 11px; }
.person-avatar { color: #76649e; font-size: 11px; }
.muted { color: #6b788d; }
.mono { font-size: 11px; }
.status { font-size: 11px; }
.status > span:empty { display: none; }
.status-pending { color: #8d651e; }
.status-delivered { color: #34795c; }
.list-footer { padding: 14px 23px; border-top: 1px solid var(--line); color: #6c7b91; font-size: 12px; }
.empty-state { padding-block: 42px 45px; }
.empty-title { color: #46566f; font-size: 16px; }
.empty-description { max-width: 335px; color: #6f7b91; font-size: 13px; }
.welcome-strip { display: flex; align-items: center; gap: 17px; margin-top: 22px; padding: 23px; border: 1px solid #e6e3f5; border-radius: 12px; background: #efedf9; }
.welcome-icon { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; color: #9381c5; background: #e4dff3; }
.welcome-icon svg { width: 24px; height: 24px; }
.welcome-strip h3 { margin: 0 0 6px; color: #5a4c7a; font-size: 14px; font-weight: 600; letter-spacing: -.02em; }
.welcome-strip p { margin: 0; color: #716584; font-size: 12px; line-height: 1.75; }
.welcome-strip .btn { margin-left: auto; background: #fdfcff; }
.quick-actions { padding: 0 22px 22px; }
.quick-action { padding: 11px; gap: 11px; }
.quick-icon { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 8px; flex-shrink: 0; }
.quick-icon svg { width: 16px; height: 16px; }
.quick-action strong { color: #536179; font-size: 12px; }
.quick-action small { display: block; margin-top: 3px; color: #6e7b90; font-size: 11px; }
.activity-list { padding: 0 23px 23px; }
.activity-item { font-size: 12px; }
.activity-item strong { color: #526079; font-size: 12px; }
.activity-item p { color: #68788f; font-size: 11px; line-height: 1.6; }
.activity-item time, .activity-item small { color: #718096; font-size: 10px; }
.activity-empty { padding: 0 23px 24px; color: #718096; font-size: 12px; line-height: 1.75; }
.step strong { color: #526179; font-size: 13px; }
.step p { color: #6f7e93; font-size: 12px; line-height: 1.7; }
.step-number { width: 27px; height: 27px; color: #7663aa; font-size: 12px; }
.resident-top { justify-content: space-between; }
.resident-card h2 { margin: 0 0 5px; color: #39485f; font-size: 17px; font-weight: 600; }
.resident-unit { margin-bottom: 18px; color: #687991; font-size: 12px; }
.resident-details { display: flex; align-items: center; gap: 8px; color: #66788e; font-size: 12px; }
.resident-details > svg { color: #8c81aa; }
.resident-actions { justify-content: space-between; }
.resident-card .pill { color: #706185; background: #f1eef7; font-size: 10px; }
.settings-card { padding: 0; }
.settings-card .card-title { margin-bottom: 0; }
.settings-grid > .card { margin-top: 0; }
.settings-card .card-body > p { color: #67788f; font-size: 13px; line-height: 1.8; }
.settings-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 18px 0; }
.settings-card .settings-actions .btn { margin: 0; }
.about-list { margin: 0 0 17px; padding-left: 18px; color: #67788f; font-size: 12px; line-height: 1.85; }
.about-list li + li { margin-top: 10px; }
.pill { color: #68758b; font-size: 10px; }
.file-label { position: relative; overflow: hidden; cursor: pointer; }
.file-label input { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; opacity: 0; }
.file-label:focus-within { outline: 3px solid #aaa5fc; outline-offset: 4px; }
label.field { display: block; }
.field label, label.field { color: #536279; font-size: 13px; }
label.field > input, label.field > select, label.field > textarea, label.field > .input-with-action { display: block; margin-top: 8px; }
.field input, .field select, .field textarea { color: #465873; font-size: 13px; }
.field-hint { display: block; margin-top: 7px; color: #6c7d93; font-size: 11px; }
.required { display: inline; color: #8a5e9a; }
.input-with-action { display: flex !important; align-items: stretch; gap: 7px; }
.input-with-action input { min-width: 0; flex: 1; }
.input-with-action .icon-btn { width: 42px; min-width: 42px; height: 42px; color: #7e6ab2; }
.modal-header p, .modal-body > p, .modal-intro { color: #67798f; font-size: 13px; line-height: 1.8; }
.form-error { font-size: 12px; }
.form-actions { flex-wrap: wrap; }
.form-actions > .muted { flex: 1; font-size: 12px; }
.detail-person { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.detail-person .person-avatar { width: 46px; height: 46px; font-size: 14px; }
.detail-person h3 { margin: 0 0 4px; font-size: 16px; }
.detail-person p { margin: 0; color: #6f7f93; font-size: 12px; }
.detail-person > .status { margin-left: auto; }
.detail-item dt, .detail-item label, .detail-item span:first-child { color: #6c7b91; font-size: 12px; }
.detail-item strong, .detail-item dd { color: #4b5c75; font-size: 13px; }
.detail-note { color: #67788f; font-size: 12px; line-height: 1.8; }
.detail-note strong { color: #53647f; }
.detail-note p { margin: 6px 0 0; }
.scanner-preview { min-height: 220px; }
.scanner-preview video { min-height: 220px; }
.scanner-frame { display: grid; place-items: center; color: #b0a5eb; }
.scanner-frame svg { width: 34px; height: 34px; opacity: .7; }
.scanner-message { position: static; margin: -3px 0 18px; color: #68788f; font-size: 12px; text-align: left; line-height: 1.8; }
.scanner-manual { display: flex; gap: 10px; align-items: flex-end; margin: 22px 0 16px; padding-top: 19px; border-top: 1px solid var(--line); }
.scanner-manual .field { flex: 1; min-width: 0; margin: 0; }
.scanner-manual .btn { min-height: 42px; }
.footer-note { margin: 20px 0 0; padding: 0 16px 24px; color: #6f7e94; font-size: 11px; }
@media (min-width: 801px) and (max-width: 1100px) {
  .header-actions { flex-wrap: wrap; }
  .welcome-strip { flex-wrap: wrap; }
  .welcome-strip .btn { margin-left: 61px; }
}
@media (max-width: 800px) {
  .nav-caption, .sidebar-tip { display: none; }
  .nav-link { font-size: 11px; position: relative; }
  .nav-count { position: absolute; left: calc(50% + 10px); top: 1px; min-width: 16px; height: 16px; font-size: 8px; color: #77708d; background: #eeebf7; }
  .nav-link[aria-current="page"] .nav-count { color: #fff; background: #7665c3; }
  .local-badge { font-size: 9px; }
  .page-subtitle { font-size: 13px; }
  .header-actions .btn { font-size: 13px; }
  .stat-card { min-height: 147px; }
  .stat-label { font-size: 12px; }
  .stat-caption { font-size: 11px; }
  .stat-icon { width: 30px; height: 30px; }
  .notice { font-size: 12px; }
  .welcome-strip { padding: 21px; gap: 13px; }
  .welcome-strip h3 { font-size: 13px; }
  .footer-note { font-size: 11px; }
}
@media (max-width: 520px) {
  .header-actions .btn { font-size: 12px; min-height: 42px; }
  .notice { flex-wrap: wrap; }
  .notice-text { flex-basis: calc(100% - 35px); }
  .notice > .btn { margin-left: 25px; padding-left: 0; }
  .stat-card { min-height: 148px; }
  .stat-label { font-size: 12px; }
  .stat-value { font-size: 30px; }
  .stat-caption { font-size: 11px; }
  .stat-icon { width: 29px; height: 29px; }
  .card-title { font-size: 15px; }
  .card-subtitle { font-size: 12px; }
  .quick-actions { padding: 0 17px 20px; }
  .activity-list, .activity-empty { padding-inline: 17px; }
  .welcome-strip { flex-wrap: wrap; padding: 20px 17px; }
  .welcome-strip > div:nth-child(2) { flex: 1; }
  .welcome-strip .btn { margin-left: 57px; }
  .filter-tabs button { font-size: 12px; }
  .settings-card { padding: 0; }
  .detail-person { flex-wrap: wrap; }
  .detail-person > .status { margin-left: 58px; }
  .scanner-manual { flex-direction: column; align-items: stretch; }
  .scanner-manual .field { width: 100%; }
  .form-actions .btn { flex: 1; }
  .notice.compact { flex-wrap: nowrap; }
  .footer-note { font-size: 10px; }
}
