html, body { min-height: 100%; }
body { overflow-x: hidden; }
.ariadne-app { --ariadne-thread: #c39a4a; --ariadne-thread-soft: rgba(195,154,74,.18); }
.ariadne-app-header { border-bottom: 1px solid rgba(33,37,41,.08); }
.app-header .navbar-brand { font-size: 1rem; }
.ariadne-brand { display: inline-flex; align-items: center; gap: .55rem; color: inherit; }
.ariadne-brand-name { font-family: Georgia, 'Times New Roman', serif; font-size: 1.13rem; letter-spacing: .015em; }
.ariadne-thread-mark { width: 44px; height: 14px; color: var(--ariadne-thread); opacity: .72; flex: 0 0 auto; }
.ariadne-sidebar-brand .brand-link { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; padding-left: 1rem; line-height: 1.05; }
.ariadne-sidebar-brand .brand-text { font-family: Georgia, 'Times New Roman', serif; font-weight: 600; letter-spacing: .02em; }
.ariadne-sidebar-brand small { margin-top: .18rem; color: rgba(255,255,255,.48); font-size: .65rem; letter-spacing: .08em; text-transform: uppercase; }
.ariadne-app .sidebar-menu .nav-link.active { box-shadow: inset 3px 0 0 var(--ariadne-thread); }
.ariadne-content-header { padding-bottom: .7rem; }
.ariadne-page-thread { position: relative; width: 74px; height: 6px; margin-top: .42rem; }
.ariadne-page-thread::before { content: ''; position: absolute; top: 2px; left: 0; width: 68px; height: 1px; background: linear-gradient(90deg, var(--ariadne-thread), rgba(195,154,74,.22)); }
.ariadne-page-thread::after { content: ''; position: absolute; top: 0; left: 66px; width: 5px; height: 5px; border: 1px solid var(--ariadne-thread); border-radius: 50%; background: var(--bs-body-bg); }
.user-avatar-initials { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; background: var(--bs-primary); color: #fff; font-weight: 700; font-size: .9rem; }
.user-header .user-avatar-initials-lg { width: 72px; height: 72px; margin: 0 auto .65rem; font-size: 1.75rem; }
.user-menu .dropdown-menu { padding: 0; overflow: hidden; }
.user-menu .user-footer { padding: .75rem; background: var(--bs-tertiary-bg); }
.app-main { min-height: calc(100vh - 112px); }
.guest-main { margin-left: 0 !important; }
.login-page-shell { min-height: calc(100vh - 145px); display: grid; place-items: center; padding: 1rem; }
.login-card { width: min(100%, 430px); }
.login-separator { display: flex; align-items: center; gap: .75rem; color: #777; margin: 1.25rem 0; }
.login-separator::before, .login-separator::after { content: ''; flex: 1; border-top: 1px solid #ddd; }
.card { border-radius: .6rem; }
.resident-table th { white-space: nowrap; }
.resident-row { transition: background-color .15s ease, box-shadow .15s ease; }
.resident-row.resident-selected > * { background: rgba(13,110,253,.10) !important; }
.resident-row.resident-selected { box-shadow: inset 4px 0 0 #0d6efd; }
.rfid-pills { display: flex; flex-wrap: wrap; gap: .35rem; }
.rfid-pill { font-size: .75rem; display: inline-flex; align-items: center; gap: .25rem; }
.rfid-delete { border: 0; background: transparent; color: inherit; padding: 0 .1rem; line-height: 1; font-weight: 700; }
.rfid-console { position: sticky; top: 72px; }
kbd { font-size: .75em; }
.error-summary { color: #842029; background: #f8d7da; border-left: 3px solid #dc3545; padding: .75rem 1rem; margin-bottom: 1rem; }
.hint-block { display: block; margin-top: .25rem; color: #6c757d; }
.stat-card { background: #fff; border: 1px solid #dee2e6; border-radius: .6rem; padding: .75rem 1rem; min-height: 76px; display: flex; flex-direction: column; justify-content: center; box-shadow: 0 .125rem .25rem rgba(0,0,0,.05); }
.stat-card strong { font-size: 1.5rem; line-height: 1; }
.stat-card span { color: #6c757d; font-size: .85rem; margin-top: .3rem; }
.stat-filter-card { color: inherit; text-decoration: none; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.stat-filter-card:hover { color: inherit; border-color: #86b7fe; box-shadow: 0 .25rem .6rem rgba(13,110,253,.12); transform: translateY(-1px); }
.stat-filter-card.active { border-color: #0d6efd; box-shadow: 0 0 0 .16rem rgba(13,110,253,.16); background: rgba(13,110,253,.04); }
.active-filter-banner { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .55rem .65rem; border: 1px solid #86b7fe; border-radius: .45rem; background: rgba(13,110,253,.06); }
.programming-list { position: sticky; top: 72px; max-height: calc(100vh - 95px); overflow: auto; }
.programming-list .list-group-item.active .badge { border: 1px solid rgba(255,255,255,.45); }
.programming-focus .card-header { gap: 1rem; }
.programming-command { background: #111827; color: #f8fafc; padding: .8rem 1rem; border-radius: .5rem; overflow-wrap: anywhere; }
.programming-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.programming-actions form { margin: 0; }
.programming-actions .btn { min-height: 58px; font-weight: 700; letter-spacing: .02em; }
.intercom-system-card { max-width: 760px; }
.house-workspace .apartment-work-list { position: sticky; top: 72px; max-height: calc(100vh - 92px); overflow: auto; }
.house-workspace .apartment-work-list .list-group-item.active .badge { border: 1px solid rgba(255,255,255,.45); }
.house-workspace .apartment-work-card { min-width: 0; }
.house-workspace .prep-panel { position: static; }
.house-workspace .rfid-console { position: static; }
.house-mode-tabs .nav-link { font-weight: 700; }
.required-callout { border: 1px solid rgba(13,110,253,.35); border-left: 4px solid #0d6efd; border-radius: .55rem; padding: .9rem 1rem; background: rgba(13,110,253,.045); }
.required-callout .form-control.is-invalid { border-color: #dc3545; box-shadow: 0 0 0 .18rem rgba(220,53,69,.12); }
.house-preparation-pane .resident-mini-list { max-height: 520px; }
.work-checks { display: grid; gap: .25rem; }
.work-check { display: flex; gap: .8rem; align-items: flex-start; padding: .8rem .9rem; border: 1px solid #dee2e6; border-radius: .55rem; cursor: pointer; background: #fff; }
.work-check .form-check-input { flex: 0 0 auto; margin-top: .22rem; width: 1.2rem; height: 1.2rem; }
.work-check span { display: flex; flex-direction: column; min-width: 0; }
.work-check small { color: #6c757d; font-weight: 400; margin-top: .1rem; }
.work-check-disabled { opacity: .55; cursor: not-allowed; background: #f8f9fa; }
.delivery-method-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.delivery-method-option { display: flex; align-items: center; gap: .5rem; border: 1px solid #dee2e6; border-radius: .55rem; padding: .7rem .75rem; background: #fff; cursor: pointer; min-height: 48px; }
.delivery-method-option:has(.form-check-input:checked) { border-color: #0d6efd; box-shadow: 0 0 0 .15rem rgba(13,110,253,.12); }
.visit-time-box { margin-top: .75rem; padding: .85rem; border: 1px dashed #adb5bd; border-radius: .55rem; background: #f8f9fa; }
.resident-mini-list { display: grid; gap: .4rem; max-height: 300px; overflow: auto; }
.resident-mini-list .resident-row { text-align: left; display: flex; align-items: center; gap: .35rem; }
.resident-mini-list .resident-row .badge { margin-left: auto; }
.eeprom-table { max-height: 520px; overflow: auto; }
.eeprom-table table { min-width: 760px; }
.eeprom-page code { font-size: .82em; }
.eeprom-stage-tabs { flex-wrap: nowrap; }
.eeprom-stage-tabs .nav-item { flex: 1 1 0; min-width: 0; }
.eeprom-stage-tabs .nav-link { width: 100%; min-height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .05rem; padding: .65rem .45rem; font-weight: 700; }
.eeprom-stage-tabs .nav-link small { font-size: .72rem; font-weight: 400; opacity: .78; line-height: 1.15; }
.eeprom-stage-tabs .nav-link.disabled { opacity: .45; }
.eeprom-summary { position: sticky; top: 72px; }
.eeprom-source-option { border: 1px solid #dee2e6; border-radius: .6rem; padding: 1rem; background: #f8f9fa; }
.eeprom-summary .info-box-number { font-size: 1.45rem; }
.eeprom-summary-list dt { color: #6c757d; font-weight: 600; }
.eeprom-summary-list dd { margin-bottom: .45rem; }
.eeprom-data-tabs { gap: .15rem; background: #f8f9fa; border-bottom: 1px solid #dee2e6; }
.eeprom-data-tabs .nav-link { font-weight: 600; color: #495057; padding: .7rem .9rem; }
.eeprom-data-tabs .nav-link.active { color: #0d6efd; background: #fff; }
.eeprom-tab-content { padding: 1rem; background: #fff; min-height: 260px; }
.eeprom-tab-content > .tab-pane > .card { margin-bottom: 0 !important; box-shadow: none !important; border: 0; }
.code-grid { min-width: 1040px; table-layout: fixed; }
.code-grid th, .code-grid td { text-align: center; vertical-align: middle; padding: .25rem; }
.code-grid th:first-child { width: 56px; background: #f8f9fa; }
.code-grid .form-control { text-align: center; min-width: 72px; padding: .25rem .3rem; }
.code-grid .saving { opacity: .55; }
.code-grid .saved { box-shadow: 0 0 0 .18rem rgba(25,135,84,.22); border-color: #198754; }
.code-grid-na { background: #f1f3f5 !important; color: #adb5bd; }
.rfid-apartment-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .75rem; }
.rfid-apartment-card { border: 1px solid #dee2e6; border-radius: .55rem; padding: .65rem; min-height: 92px; background: #fff; }
.rfid-entry { display: flex; justify-content: space-between; align-items: center; gap: .4rem; border-top: 1px solid #eee; padding-top: .4rem; margin-top: .4rem; }
.js-eeprom-param.saved { box-shadow: 0 0 0 .18rem rgba(25,135,84,.18); border-color: #198754; }
@media (max-width: 991.98px) {
    .rfid-console, .programming-list, .house-workspace .apartment-work-list, .eeprom-summary { position: static; max-height: none; }
    .app-content-header { padding-top: .75rem; }
}
@media (max-width: 575.98px) {
    .app-content { padding-left: .35rem; padding-right: .35rem; }
    .card-body { padding: .9rem; }
    .resident-table { font-size: .9rem; }
    .resident-table .btn { white-space: nowrap; }
    .app-header .navbar-brand { max-width: 58vw; overflow: hidden; white-space: nowrap; }
    .ariadne-brand { gap: .35rem; }
    .ariadne-thread-mark { width: 32px; }
    .programming-page .stat-card, .house-workspace .stat-card { min-height: 66px; padding: .65rem .75rem; }
    .programming-focus .card-header, .apartment-work-card .card-header { align-items: flex-start !important; }
    .programming-actions { grid-template-columns: 1fr; }
    .programming-actions .btn { min-height: 62px; font-size: 1.05rem; }
    .programming-command { font-size: .92rem; }
    .work-check { padding: .8rem; }
    .delivery-method-grid { grid-template-columns: 1fr; }
    .delivery-method-option { min-height: 52px; }
    .visit-time-box .form-select { padding-left: .45rem; padding-right: 1.6rem; font-size: .9rem; }
    .resident-mini-list { max-height: none; }
    .eeprom-table { max-height: 360px; }
    .eeprom-stage-tabs .nav-link { min-height: 50px; padding: .55rem .25rem; font-size: .88rem; }
    .eeprom-data-tabs { flex-wrap: nowrap; overflow-x: auto; }
    .eeprom-data-tabs .nav-link { white-space: nowrap; }
}
