@font-face {
    font-family: "Instrument Sans";
    src: url("/recursos/instrument-sans-400.woff2") format("woff2");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Instrument Sans";
    src: url("/recursos/instrument-sans-500.woff2") format("woff2");
    font-style: normal;
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: "Instrument Sans";
    src: url("/recursos/instrument-sans-600.woff2") format("woff2");
    font-style: normal;
    font-weight: 600;
    font-display: swap;
}

:root {
    --ink: #382b26;
    --green: #b74f11;
    --muted: #74655d;
    --line: #e3d2c7;
    --bg: #f8f3ef;
    --white: #fffdfa;
    --accent: #f2d4c0;
    --highlight: #f5a800;
    --highlight-soft: #fff2c2;
    --highlight-ink: #553900;
}

body {
    background-image:
        radial-gradient(circle at 8% 90%, rgba(245, 168, 0, 0.08), transparent 20rem),
        radial-gradient(circle at 88% 8%, rgba(183, 79, 17, 0.055), transparent 24rem);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline-color: #d9793c;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #b74f11;
    box-shadow: 0 0 0 3px rgba(183, 79, 17, 0.12);
}

.brand-icon {
    background: #b74f11;
    color: #fff7f2;
}

.sidebar {
    width: 252px;
    background: #fffdfa;
    box-shadow: 8px 0 30px rgba(88, 48, 26, 0.035);
}

.brand {
    display: block;
    width: 100%;
    padding: 9px 10px 8px;
    border: 1px solid #ead9cf;
    border-radius: 14px;
    background: #fffaf7;
}

.brand-logo {
    display: block;
    width: 100%;
    max-width: 178px;
    height: auto;
    margin: 0 auto;
}

.brand .brand-sub {
    margin: 2px 0 0;
    text-align: center;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.brand-sub,
.nav-label {
    color: #8c786d;
}

.sidebar nav a.selected {
    background: #fbe9dd;
    color: #8f3b0b;
}

.sidebar nav a:hover {
    background: #fff7f2;
}

.sidebar nav a span {
    color: #9c7662;
}

.avatar {
    background: #f6dfd1;
    color: #9a3f0d;
}

.topbar {
    background: #fffdfa;
    color: #806e64;
    box-shadow: 0 5px 20px rgba(88, 48, 26, 0.025);
}

.date-label {
    color: #63483a;
}

.button {
    background: #b74f11;
    border-color: #b74f11;
}

.button:hover {
    background: #8f3b0b;
    border-color: #8f3b0b;
}

.button.secondary {
    background: #fff;
    border-color: #dfc8ba;
    color: #7c3510;
}

.button.secondary:hover {
    background: #fff7f2;
}

.eyebrow,
.text-link,
.text-button,
.required {
    color: #b74f11;
}

.stat.featured {
    background: #fff0e6;
    border-color: #f0cdb7;
}

.stat.featured strong {
    color: #8f3b0b;
}

.pill {
    background: #fbe9dd;
    color: #963e0d;
}

.section-number {
    color: #c87949;
}

.camera-stage {
    background: #fcf7f3;
    border-color: #ddbda9;
}

.camera-placeholder {
    color: #8a6856;
}

.camera-column {
    display: grid;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 22px;
    min-width: 0;
}

.compact-camera-card {
    padding: 20px;
}

.compact-camera-card .section-number {
    margin-bottom: 14px;
}

.compact-camera-card .camera-stage {
    aspect-ratio: auto;
    height: 210px;
}

.compact-camera-card .camera-placeholder {
    padding: 10px;
}

.compact-camera-card .camera-placeholder > span {
    font-size: 26px;
    margin-bottom: 6px;
}

.compact-camera-card .camera-placeholder p,
.compact-camera-card .help {
    margin: 5px 0;
}

.compact-camera-card .camera-actions {
    align-items: flex-end;
    margin: 9px 0;
}

.compact-camera-card .inline-upload {
    flex: 1;
    min-width: 230px;
    margin: 0;
    padding: 0;
    border-top: 0;
}

.compact-camera-card .inline-upload > span {
    font-size: 11px;
}

.compact-camera-card .inline-upload input {
    min-height: 44px;
    height: 44px;
    padding: 8px;
}

.compact-camera-card .inline-upload small {
    display: none;
}

.compact-camera-card .privacy-note {
    margin-top: 10px;
    padding: 10px 12px;
}

.ocr-status {
    margin: 8px 0;
    padding: 10px 12px;
    border: 1px solid #e6c7b4;
    border-radius: 8px;
    background: #fff4ec;
    color: #75401f;
    font-size: 12px;
    font-weight: 600;
}

.ocr-status[data-state="success"] {
    border-color: #c9dfd1;
    background: #e8f3eb;
    color: #2d6848;
}

.ocr-status[data-state="warning"] {
    border-color: #efd39d;
    background: #fff4dd;
    color: #7a5110;
}

@media (max-width: 1100px) {
    .compact-camera-card .camera-stage {
        height: 230px;
    }
}

.upload-label input {
    background: #fcf7f3;
}

.privacy-note {
    background: #fbf0e9;
    color: #73503d;
}

table th {
    background: #fdf9f6;
}

.person-link:hover {
    color: #b74f11;
}

.count {
    background: #f8f0eb;
    color: #80695d;
}

.back-link {
    color: #8b4a27;
}

.login-wrap {
    border-color: #ead8cc;
    box-shadow: 0 26px 90px rgba(91, 43, 18, 0.13);
}

.login-story {
    background:
        radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.62), transparent 17rem),
        linear-gradient(145deg, #f8e5d8 0%, #efd1bd 100%);
}

.login-story .eyebrow {
    color: #a34a17;
}

.login-story h1 {
    color: #71320f;
}

.login-story p,
.login-story li {
    color: #6f5141;
}

.story-lines span {
    border-color: #e8bea4;
}

.login-logo {
    display: block;
    width: min(250px, 100%);
    height: auto;
    margin: -10px 0 22px;
}

.login-panel .login-logo + .eyebrow {
    margin-bottom: 10px;
}

/* Los estados operativos conservan verde para distinguirlos de la marca. */
.badge.inside {
    background: #e8f3eb;
    color: #2d6848;
}

.dot {
    background: #3d8a5b;
}

.notice.success {
    background: #e8f3eb;
    border-color: #c9dfd1;
    color: #2d6848;
}

.notice.warning {
    background: #fff4dd;
    border: 1px solid #efd39d;
    color: #7a5110;
}

.text-button.danger {
    color: #a43d2f;
}

.residences-table {
    min-width: 1450px;
}

.residences-table .notes-cell {
    max-width: 260px;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.residences-table .row-actions {
    align-items: flex-start;
    flex-direction: column;
    min-width: 90px;
}

.residence-codes-fieldset {
    margin: 0;
    padding: 0;
    border: 0;
}

.residence-codes-fieldset legend {
    margin-bottom: 9px;
    font-size: 13px;
    font-weight: 600;
}

.residence-codes-fieldset legend small {
    margin-left: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
}

.residence-code-inputs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.residence-code-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-width: 125px;
}

.residence-code-pills span {
    padding: 5px 8px;
    border-radius: 7px;
    background: #fbe9dd;
    color: #8f3b0b;
    font-weight: 700;
    letter-spacing: 1px;
}

[data-theme="dark"] .residence-code-pills span {
    background: #4a2818;
    color: #ffb985;
}

@media (max-width: 760px) {
    .residence-code-inputs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .residence-codes-fieldset legend small {
        display: block;
        margin: 4px 0 0;
    }
}

/* Escala tipográfica general para mejorar la lectura en administración y garita. */
body {
    font-size: 15px;
    line-height: 1.5;
}

label,
.entry-type-fieldset legend,
.residence-codes-fieldset legend {
    font-size: 14px;
}

label small,
.residence-field > small,
.residence-codes-fieldset legend small {
    font-size: 12px;
}

input,
select,
textarea {
    font-size: 15px;
}

.help,
.privacy-note,
.camera-placeholder p,
.empty p {
    font-size: 13px;
}

.eyebrow,
.nav-label {
    font-size: 11px;
}

.sidebar nav a {
    font-size: 13px;
}

.brand-sub {
    font-size: 11px;
}

.profile,
.profile small,
.logout {
    font-size: 11px;
}

.topbar {
    font-size: 12px;
}

.page-heading p {
    font-size: 14px;
}

.button {
    font-size: 13px;
}

.button.small {
    font-size: 12px;
}

.text-link,
.text-button,
.back-link {
    font-size: 13px;
}

.card-heading h2 {
    font-size: 17px;
}

.count,
.pill,
.section-number {
    font-size: 12px;
}

.section-number span {
    font-size: 17px;
}

.filters label {
    font-size: 13px;
}

.filters label input,
.filters label select {
    font-size: 13px;
}

th {
    font-size: 12px;
}

td,
td strong,
.person-link {
    font-size: 13px;
}

td small,
.badge,
.pagination,
.export-row small {
    font-size: 12px;
}

.stat > span {
    font-size: 13px;
}

.stat small {
    font-size: 12px;
}

.camera-placeholder strong,
.residence-option {
    font-size: 14px;
}

.residence-picker-trigger {
    font-size: 15px;
}

.residence-search-label,
.residence-search-status {
    font-size: 13px;
}

.ocr-status,
.notice {
    font-size: 14px;
}

.details dt {
    font-size: 12px;
}

.details dd {
    font-size: 15px;
}

.timeline strong,
.timeline small,
.bulk-import p,
.bulk-import li {
    font-size: 13px;
}

.login-panel .muted {
    font-size: 14px;
}

.login-panel .help {
    font-size: 12px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.theme-toggle {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    min-width: 38px;
    padding: 0;
    border: 1px solid #dfc8ba;
    border-radius: 10px;
    background: #fff;
    color: #6f3a20;
    font-size: 18px;
}

.theme-toggle:hover {
    background: #fff2e9;
}

.guest-theme-toggle {
    position: fixed;
    z-index: 10;
    top: 20px;
    right: 20px;
}

[data-theme="dark"] {
    color-scheme: dark;
    --ink: #f4e8e1;
    --green: #d76522;
    --muted: #bdaaa0;
    --line: #49372f;
    --bg: #171210;
    --white: #241b17;
    --accent: #8b3d13;
    --highlight: #ffc13a;
    --highlight-soft: #49360f;
    --highlight-ink: #ffe4a0;
}

[data-theme="dark"] body,
[data-theme="dark"] .workspace {
    background: #171210;
    background-image:
        radial-gradient(circle at 8% 90%, rgba(255, 193, 58, 0.07), transparent 22rem),
        radial-gradient(circle at 88% 8%, rgba(215, 101, 34, 0.08), transparent 26rem);
    color: #f4e8e1;
}

[data-theme="dark"] .sidebar,
[data-theme="dark"] .card,
[data-theme="dark"] .stat,
[data-theme="dark"] .login-wrap,
[data-theme="dark"] .login-panel,
[data-theme="dark"] dialog {
    background: #241b17;
    border-color: #49372f;
    color: #f4e8e1;
}

[data-theme="dark"] .brand {
    background: #f8f0ea;
    border-color: #6a4938;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
}

[data-theme="dark"] .brand .brand-sub {
    color: #6d5a50;
}

[data-theme="dark"] .login-logo {
    padding: 8px 12px;
    border: 1px solid #6a4938;
    border-radius: 14px;
    background: #f8f0ea;
}

[data-theme="dark"] .topbar {
    background: #1d1714;
    border-color: #49372f;
    color: #c5b2a8;
}

[data-theme="dark"] .date-label,
[data-theme="dark"] .back-link,
[data-theme="dark"] .brand-sub,
[data-theme="dark"] .nav-label,
[data-theme="dark"] .muted,
[data-theme="dark"] .help,
[data-theme="dark"] .empty-note,
[data-theme="dark"] .profile small,
[data-theme="dark"] .logout,
[data-theme="dark"] td small,
[data-theme="dark"] .details dt,
[data-theme="dark"] .timeline small {
    color: #bdaaa0;
}

[data-theme="dark"] .sidebar nav a {
    color: #d6c6bd;
}

[data-theme="dark"] .sidebar nav a:hover {
    background: #30231d;
}

[data-theme="dark"] .sidebar nav a.selected {
    background: #4a2818;
    color: #ffb985;
}

[data-theme="dark"] .sidebar nav a span {
    color: #d58b5f;
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: #1c1512;
    border-color: #5a4439;
    color: #f5e9e2;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: #8f7c72;
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
    border-color: #e47735;
    box-shadow: 0 0 0 3px rgba(228, 119, 53, 0.2);
}

[data-theme="dark"] .button.secondary,
[data-theme="dark"] .theme-toggle {
    background: #30231d;
    border-color: #64483a;
    color: #ffc49e;
}

[data-theme="dark"] .button.secondary:hover,
[data-theme="dark"] .theme-toggle:hover {
    background: #442b1f;
}

[data-theme="dark"] .camera-stage,
[data-theme="dark"] .upload-label input,
[data-theme="dark"] .document-placeholder {
    background: #1c1512;
    border-color: #6b4937;
}

[data-theme="dark"] .camera-placeholder,
[data-theme="dark"] .document-placeholder p {
    color: #c8a894;
}

[data-theme="dark"] .privacy-note,
[data-theme="dark"] .pill,
[data-theme="dark"] .count {
    background: #3b271d;
    color: #efb38e;
}

[data-theme="dark"] table th {
    background: #1d1714;
    color: #bca99f;
}

[data-theme="dark"] th,
[data-theme="dark"] td,
[data-theme="dark"] .timeline,
[data-theme="dark"] .upload-label {
    border-color: #49372f;
}

[data-theme="dark"] .stat.featured {
    background: #39261c;
    border-color: #704127;
}

[data-theme="dark"] .stat.featured strong,
[data-theme="dark"] .eyebrow,
[data-theme="dark"] .text-link,
[data-theme="dark"] .text-button,
[data-theme="dark"] .required,
[data-theme="dark"] .section-number {
    color: #ef8a4d;
}

[data-theme="dark"] .entry-type-option {
    background: #211915;
    border-color: #5a4439;
}

[data-theme="dark"] .entry-type-option:has(input:checked) {
    background: #45291c;
    border-color: #db6c2b;
}

[data-theme="dark"] .entry-type-first {
    background: #2d201a;
    border-color: #6b4937;
}

[data-theme="dark"] .entry-type-first legend {
    color: #ffb985;
}

[data-theme="dark"] .badge.closed {
    background: #3a312d;
    color: #c7b8b0;
}

[data-theme="dark"] .badge.inside,
[data-theme="dark"] .notice.success {
    background: #173b2a;
    border-color: #2b6548;
    color: #a7e0bc;
}

[data-theme="dark"] .notice.warning {
    background: #463516;
    border-color: #725a25;
    color: #f0d28d;
}

[data-theme="dark"] .ocr-status {
    border-color: #704127;
    background: #3b271d;
    color: #efb38e;
}

[data-theme="dark"] .ocr-status[data-state="success"] {
    border-color: #2b6548;
    background: #173b2a;
    color: #a7e0bc;
}

[data-theme="dark"] .ocr-status[data-state="warning"] {
    border-color: #725a25;
    background: #463516;
    color: #f0d28d;
}

[data-theme="dark"] .notice.error {
    background: #48251f;
    border-color: #784038;
    color: #f2b0a4;
}

[data-theme="dark"] .login-story {
    background: #3a251b;
}

[data-theme="dark"] .login-story h1 {
    color: #ffd2b4;
}

[data-theme="dark"] .login-story p,
[data-theme="dark"] .login-story li {
    color: #d5b8a7;
}

[data-theme="dark"] .story-lines span {
    border-color: #674332;
}

[data-theme="dark"] dialog::backdrop {
    background: rgba(0, 0, 0, 0.72);
}

@media (max-width: 760px) {
    .app-shell .sidebar .brand {
        width: min(210px, calc(100% - 58px));
        padding: 6px 8px;
    }

    .app-shell .sidebar .brand-logo {
        max-width: 150px;
    }

    .app-shell .sidebar .brand-sub {
        font-size: 10px;
    }

    .topbar-actions {
        gap: 8px;
    }

    .theme-toggle {
        width: 34px;
        height: 34px;
        min-width: 34px;
    }
}

.residence-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.residence-field > small {
    color: var(--muted);
    font-size: 12px;
}

.residence-picker {
    position: relative;
}

.residence-picker-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    min-height: 48px;
    padding: 11px 13px;
    border: 1px solid #cfd8cf;
    border-radius: 8px;
    background: #fff;
    color: #8b968e;
    text-align: left;
}

.residence-picker-trigger.has-value {
    color: var(--ink);
    font-weight: 600;
}

.residence-picker-trigger:focus,
.residence-picker.is-open .residence-picker-trigger {
    border-color: #b74f11;
    box-shadow: 0 0 0 3px rgba(183, 79, 17, 0.12);
}

.residence-picker-trigger.is-invalid {
    border-color: #b74232;
    box-shadow: 0 0 0 3px rgba(183, 66, 50, 0.14);
}

.residence-picker-arrow {
    flex: 0 0 auto;
    font-size: 22px;
    transition: transform 0.18s ease;
}

.residence-picker.is-open .residence-picker-arrow {
    transform: rotate(180deg);
}

.residence-picker-panel {
    position: absolute;
    z-index: 40;
    top: calc(100% + 7px);
    left: 0;
    width: 100%;
    padding: 12px;
    border: 1px solid #dfc8ba;
    border-radius: 12px;
    background: #fffdfa;
    box-shadow: 0 18px 45px rgba(78, 36, 13, 0.2);
}

.residence-search-label {
    gap: 5px;
    color: #755442;
    font-size: 11px;
}

.residence-search-label input {
    min-height: 40px;
    height: 40px;
    padding: 8px 11px;
    background: #fcf7f3;
}

.residence-options {
    display: grid;
    gap: 4px;
    max-height: min(320px, 45vh);
    margin-top: 10px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.residence-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    padding: 10px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
    text-align: left;
}

.residence-option:hover,
.residence-option:focus-visible,
.residence-option[aria-selected="true"] {
    background: #fbe9dd;
    color: #8f3b0b;
}

.residence-option-copy {
    display: grid;
    gap: 3px;
}

.residence-option-copy strong {
    font-weight: 600;
}

.residence-option-copy small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
}

.residence-phones {
    display: grid;
    gap: 13px;
    margin-top: 5px;
    padding: 15px;
    border: 1px solid #efca65;
    border-radius: 11px;
    background: #fffaf0;
}

.residence-phones > div:first-child {
    display: flex;
    align-items: center;
    gap: 11px;
}

.residence-phones > div:first-child > span:last-child {
    display: grid;
}

.residence-phones small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
}

.residence-phones-icon {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border-radius: 10px;
    background: var(--highlight);
    color: #3d2900;
    font-size: 21px;
}

.residence-phone-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.residence-phone-button {
    justify-content: space-between;
    min-width: 210px;
}

.residence-phone-index {
    font-weight: 600;
}

.residence-phone-button strong {
    margin-left: 12px;
    font-size: 18px;
    letter-spacing: 0.025em;
}

.residence-phone-actions p {
    margin: 0;
    color: var(--muted);
}

[data-theme="dark"] .residence-phones {
    border-color: #755a17;
    background: #33270f;
}

.role-guard .residence-phone-button {
    min-height: 56px;
    font-size: 16px;
}

.role-guard .residence-phone-button strong {
    font-size: 20px;
}

@media (max-width: 600px) {
    .residence-phone-actions,
    .residence-phone-button {
        width: 100%;
    }
}

.residence-native-select {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 1px;
    height: 1px;
    min-height: 1px;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.residence-search-status {
    min-height: 0;
    margin: 0;
    color: var(--muted);
    font-size: 11px;
}

.residence-search-status:empty {
    display: none;
}

[data-theme="dark"] .residence-picker {
    background: transparent;
}

[data-theme="dark"] .residence-picker-trigger,
[data-theme="dark"] .residence-picker-panel {
    background: #211915;
    border-color: #5a4439;
    color: #d7c7be;
}

[data-theme="dark"] .residence-search-label {
    color: #d7bbaa;
}

[data-theme="dark"] .residence-search-label input {
    background: #1c1512;
}

[data-theme="dark"] .residence-option {
    color: #f4e8e1;
}

[data-theme="dark"] .residence-option:hover,
[data-theme="dark"] .residence-option:focus-visible,
[data-theme="dark"] .residence-option[aria-selected="true"] {
    background: #4a2818;
    color: #ffb985;
}

.role-guard .residence-search-label {
    font-size: 14px;
}

.role-guard .residence-search-label input {
    height: 52px;
    min-height: 52px;
}

.role-guard .residence-picker-trigger,
.role-guard .residence-option {
    min-height: 54px;
    font-size: 16px;
}

.residences-table .row-actions form {
    margin: 0;
}

.bulk-import {
    align-items: center;
    display: grid;
    gap: 32px;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
}

.bulk-disclosure {
    max-width: none;
}

.residences-heading {
    align-items: flex-start;
    flex-wrap: wrap;
}

.residences-heading .bulk-disclosure {
    margin: 0 0 0 auto;
}

.residences-heading .bulk-disclosure[open] {
    flex-basis: 100%;
    margin: 0;
    order: 3;
    width: 100%;
}

.bulk-disclosure > summary {
    list-style: none;
    margin-left: auto;
    width: max-content;
}

.bulk-disclosure > summary::-webkit-details-marker {
    display: none;
}

.bulk-disclosure[open] > summary {
    margin-bottom: 12px;
}

.disclosure-arrow {
    display: inline-block;
    font-size: 17px;
    transition: transform 0.2s ease;
}

.bulk-disclosure[open] .disclosure-arrow {
    transform: rotate(180deg);
}

.bulk-import h2 {
    margin: 8px 0 10px;
}

.bulk-import p,
.bulk-import li {
    color: var(--muted);
    font-size: 13px;
}

.bulk-import ul {
    margin: 0;
    padding-left: 20px;
}

.bulk-icon {
    font-size: 32px;
}

.bulk-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bulk-actions .button {
    width: 100%;
}

@media (max-width: 900px) {
    .bulk-import {
        grid-template-columns: 1fr;
    }

    .residences-heading .bulk-disclosure {
        margin-left: 0;
        width: 100%;
    }

    .bulk-disclosure > summary {
        margin-left: 0;
    }
}

.field-label {
    align-items: baseline;
    display: inline-flex;
    gap: 4px;
    white-space: nowrap;
}

.field-label .required {
    flex: 0 0 auto;
}

.entry-type-fieldset {
    border: 0;
    margin: 0;
    padding: 0;
}

.entry-type-fieldset legend {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 9px;
}

.entry-type-first {
    margin-bottom: 4px;
    padding: 18px;
    border: 1px solid #edcfbc;
    border-radius: 14px;
    background: #fff7f2;
}

.entry-type-first legend {
    padding: 0 7px;
    color: #8f3b0b;
    font-weight: 750;
}

.entry-type-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.entry-type-option {
    align-items: center;
    background: #fffdfa;
    border: 2px solid #dfc8ba;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    gap: 14px;
    min-height: 88px;
    padding: 14px 18px;
}

.entry-type-option:has(input:checked) {
    background: #fbe9dd;
    border-color: #b74f11;
    box-shadow: 0 0 0 3px rgba(183, 79, 17, 0.12);
}

.entry-type-option input {
    height: 24px;
    min-height: 24px;
    width: 24px;
}

.entry-type-option strong,
.entry-type-option small {
    display: block;
}

.entry-type-option strong {
    font-size: 17px;
}

.entry-type-option small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
    margin-top: 3px;
}

.entry-type-icon {
    font-size: 34px;
    line-height: 1;
}

.entry-type-inline,
.entry-type-detail {
    font-weight: 650;
}

.entry-type-detail span {
    font-size: 24px;
    margin-right: 5px;
}

/* Vista simplificada y de alta legibilidad para el personal de garita. */
.role-guard {
    font-size: 16px;
}

.role-guard .sidebar {
    width: 280px;
}

.role-guard .sidebar nav a {
    font-size: 16px;
    min-height: 56px;
    padding: 13px 15px;
}

.role-guard .sidebar nav a span {
    font-size: 26px;
    width: 32px;
}

.role-guard h1 {
    font-size: 36px;
}

.role-guard .page-heading p,
.role-guard label,
.role-guard .section-number span {
    font-size: 16px;
}

.role-guard input,
.role-guard select,
.role-guard textarea {
    font-size: 16px;
    min-height: 52px;
    padding: 12px 14px;
}

.role-guard label small,
.role-guard .help,
.role-guard .privacy-note {
    font-size: 13px;
}

.role-guard .button {
    font-size: 16px;
    min-height: 52px;
    padding: 12px 22px;
}

.role-guard .primary-action {
    font-size: 18px;
    min-height: 58px;
    min-width: 245px;
}

.role-guard .card {
    padding: 28px;
}

.role-guard .entry-type-fieldset legend {
    font-size: 16px;
}

.role-guard .entry-type-option {
    min-height: 100px;
}

.role-guard .entry-type-option strong {
    font-size: 19px;
}

.role-guard .entry-type-option small {
    font-size: 13px;
}

.role-guard .entry-type-icon {
    font-size: 40px;
}

.role-guard .notice {
    font-size: 16px;
    padding: 17px 20px;
}

@media (max-width: 760px) {
    .entry-type-options {
        grid-template-columns: 1fr;
    }

    .role-guard .sidebar {
        width: 100%;
    }

    .role-guard h1 {
        font-size: 31px;
    }

    .role-guard .card {
        padding: 23px;
    }
}

/* Ajustes de componentes que tenían tamaños compactos propios. */
.entry-type-fieldset legend {
    font-size: 15px;
}

.entry-type-option small,
.compact-camera-card .inline-upload > span,
.upload-label,
.residence-search-label,
.residence-search-status {
    font-size: 13px;
}

.residence-option {
    font-size: 15px;
}

.upload-label input,
.compact input {
    font-size: 14px;
}

.compact label,
.bulk-import p,
.bulk-import li {
    font-size: 14px;
}

details {
    font-size: 13px;
}

.camera-test-layout { display:grid;grid-template-columns:minmax(280px,.7fr) minmax(420px,1.3fr);gap:22px;align-items:start }
.camera-test-result { grid-column:1/-1 }
.camera-connector-card ol { margin:18px 0 24px;padding-left:24px }
.camera-connector-card li { margin:8px 0 }
.connector-state { display:flex;align-items:center;gap:10px;margin-bottom:16px;padding:13px 15px;border:1px solid var(--line);border-radius:10px;background:#f8f4f1 }
.connector-state>span { width:11px;height:11px;flex:0 0 11px;border-radius:50%;background:#d2a375 }
.connector-state[data-state="ready"] { border-color:#b7d8c3;background:#e8f3eb;color:#2d6848 }
.connector-state[data-state="ready"]>span { background:#3d8a5b }
.connector-state[data-state="offline"] { border-color:#e5b8ae;background:#fff0eb;color:#934934 }
.connector-state[data-state="offline"]>span { background:#bd4b3d }
.camera-advanced { max-width:none;padding:14px;border:1px solid var(--line);border-radius:10px }
.camera-advanced summary { font-weight:700 }
.camera-advanced label { margin-top:14px }
.camera-test-placeholder { padding:45px 20px;text-align:center;color:var(--muted) }
.camera-test-placeholder>span { display:block;margin-bottom:12px;font-size:42px }
.camera-test-placeholder strong { display:block;color:var(--ink) }
.camera-test-placeholder p { margin:8px 0 0 }
.camera-test-message { margin-bottom:18px;padding:14px 16px;border:1px solid var(--line);border-radius:9px;background:#f8f4f1;font-weight:700 }
.camera-test-message[data-state="success"] { border-color:#b7d8c3;background:#e8f3eb;color:#2d6848 }
.camera-test-message[data-state="error"] { border-color:#e5b8ae;background:#fff0eb;color:#934934 }
.camera-test-image { display:block;width:100%;max-height:620px;border:1px solid var(--line);border-radius:12px;background:#171210;object-fit:contain }
.camera-test-details { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:18px 0 0 }
.camera-test-details>div { padding:12px;border:1px solid var(--line);border-radius:9px }
.camera-test-details dt { color:var(--muted);font-size:12px }
.camera-test-details dd { margin:4px 0 0;overflow-wrap:anywhere;font-weight:700 }
[data-theme="dark"] .connector-state,[data-theme="dark"] .camera-test-message,[data-theme="dark"] .camera-advanced,[data-theme="dark"] .camera-test-details>div { background:#211915;border-color:#5a4439 }
[data-theme="dark"] .connector-state[data-state="ready"],[data-theme="dark"] .camera-test-message[data-state="success"] { background:#173b2a;border-color:#2b6548;color:#a7e0bc }
[data-theme="dark"] .connector-state[data-state="offline"],[data-theme="dark"] .camera-test-message[data-state="error"] { background:#48251f;border-color:#784038;color:#f2b0a4 }
@media(max-width:1000px){.camera-test-layout{grid-template-columns:1fr}.camera-test-result{grid-column:auto}.camera-test-details{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){.camera-test-details{grid-template-columns:1fr}}

.cameras-table {
    min-width: 940px;
}

.camera-channel {
    display: inline-grid;
    min-width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 9px;
    background: var(--highlight-soft);
    color: var(--highlight-ink);
    font-weight: 600;
}

.credential-mask {
    color: var(--muted);
    font-size: 18px;
    letter-spacing: 2px;
}

.camera-password-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 150px;
}

.camera-password-cell .text-button {
    white-space: nowrap;
}

.credential-dialog {
    max-width: 480px;
}

.camera-password-error {
    margin: 0;
    padding: 11px 13px;
    border: 1px solid #e5b8ae;
    border-radius: 9px;
    background: #fff0eb;
    color: #934934;
}

[data-theme="dark"] .camera-password-error {
    border-color: #784038;
    background: #48251f;
    color: #f2b0a4;
}

.camera-limit {
    padding-block: 24px;
}

/* Acento ámbar: contraste luminoso sin competir con el terracota principal. */
.sidebar nav a.selected {
    background: var(--highlight-soft);
    color: var(--highlight-ink);
    box-shadow: inset 4px 0 var(--highlight);
}

.sidebar nav a.selected span {
    color: #704b00;
}

.button.secondary:hover {
    background: #fff7db;
    border-color: var(--highlight);
    color: var(--highlight-ink);
}

/* Lenguaje visual inspirado en Johnmatel, conservando la identidad cromática de CLV. */
html,
body,
button,
input,
select,
textarea {
    font-family: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    letter-spacing: -0.005em;
}

h1,
h2,
h3,
.page-heading h1,
.login-story h1 {
    font-family: inherit;
    font-weight: 600;
    letter-spacing: -0.035em;
}

label,
th,
.button,
.sidebar nav a,
.card-heading h2,
.entry-type-fieldset legend,
.residence-codes-fieldset legend {
    font-weight: 600;
}

.eyebrow,
.nav-label,
.brand-sub {
    font-weight: 600;
    letter-spacing: 0.11em;
}

.sidebar {
    background: #fff7f2;
    border-color: #ead8cc;
    box-shadow: none;
}

.sidebar nav a {
    border: 1px solid transparent;
    border-radius: 9px;
}

.sidebar nav a.selected {
    border-color: #edc9b2;
}

.topbar {
    border-color: #ead8cc;
    box-shadow: none;
}

.card,
.stat,
.login-wrap {
    border-width: 1px;
    box-shadow: 0 1px 2px rgba(78, 43, 24, 0.055);
}

.card,
.stat {
    border-radius: 12px;
}

input,
select,
textarea,
.residence-picker-trigger {
    border-radius: 10px;
}

.button {
    border-radius: 9px;
}

[data-theme="dark"] .sidebar {
    background: #2d211b;
    border-color: #5a4439;
}

[data-theme="dark"] .topbar {
    border-color: #5a4439;
}

[data-theme="dark"] .card,
[data-theme="dark"] .stat,
[data-theme="dark"] .login-wrap {
    box-shadow: none;
}

.stat.featured {
    background: #fff7db;
    border-color: #efca65;
}

.stat.featured strong {
    color: #765000;
}

.pill,
.count {
    background: var(--highlight-soft);
    color: var(--highlight-ink);
}

.section-number {
    color: #8a5d00;
}

.section-number::before {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    border-radius: 50%;
    background: var(--highlight);
    box-shadow: 0 0 0 4px rgba(245, 168, 0, 0.16);
    content: '';
}

.separator {
    color: #b97d00;
}

.theme-toggle {
    background: #fff8df;
    border-color: #e9bd45;
    color: var(--highlight-ink);
}

.entry-type-first {
    background: #fffaf0;
    border-color: #e7bb3f;
}

.entry-type-first legend {
    color: #765000;
}

.entry-type-option:has(input:checked) {
    background: var(--highlight-soft);
    border-color: var(--highlight);
    box-shadow: 0 0 0 3px rgba(245, 168, 0, 0.2);
}

.entry-type-option input {
    accent-color: var(--highlight);
}

.residence-option:hover,
.residence-option:focus-visible,
.residence-option[aria-selected="true"] {
    background: var(--highlight-soft);
    color: var(--highlight-ink);
}

.login-story .eyebrow {
    padding-bottom: 8px;
    border-bottom: 3px solid var(--highlight);
}

[data-theme="dark"] .sidebar nav a.selected {
    background: var(--highlight-soft);
    color: var(--highlight-ink);
}

[data-theme="dark"] .sidebar nav a.selected span {
    color: #ffd66d;
}

[data-theme="dark"] .button.secondary:hover,
[data-theme="dark"] .theme-toggle:hover {
    background: #49360f;
    border-color: var(--highlight);
    color: var(--highlight-ink);
}

[data-theme="dark"] .stat.featured,
[data-theme="dark"] .entry-type-first {
    background: #33270f;
    border-color: #755a17;
}

[data-theme="dark"] .stat.featured strong,
[data-theme="dark"] .entry-type-first legend,
[data-theme="dark"] .section-number {
    color: #ffd66d;
}

[data-theme="dark"] .pill,
[data-theme="dark"] .count,
[data-theme="dark"] .entry-type-option:has(input:checked),
[data-theme="dark"] .residence-option:hover,
[data-theme="dark"] .residence-option:focus-visible,
[data-theme="dark"] .residence-option[aria-selected="true"] {
    background: var(--highlight-soft);
    border-color: var(--highlight);
    color: var(--highlight-ink);
}
