body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f3f7fb;
    color: #17324d;
}

.app-footer {
    max-width: 1200px;
    margin: 24px auto 18px;
    padding: 0 20px;
    color: #6f8193;
    font-size: 11px;
    line-height: 1.4;
    text-align: center;
}

.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #eaf4ff, #f8fbff);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    width: 100%;
    max-width: 390px;
    background: white;
    padding: 36px;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.12);
    text-align: center;
}

.login-box h1 {
    margin-top: 0;
    color: #17324d;
    font-size: 34px;
}

input {
    width: 100%;
    padding: 15px;
    border: 1px solid #d9e2ec;
    border-radius: 14px;
    font-size: 16px;
    box-sizing: border-box;
    margin-bottom: 15px;
}

button {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 14px;
    background: #17324d;
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

.error {
    color: #b00020;
    margin-bottom: 15px;
}

.topbar {
    background: linear-gradient(135deg, #17324d, #2b5f8a);
    color: white;
    padding: 34px 28px;
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
    box-shadow: 0 12px 35px rgba(0,0,0,0.16);
}

.topbar-inner {
    max-width: 1200px;
    margin: auto;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
}

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

h1 {
    margin: 0;
    font-size: 38px;
}

.date {
    margin-top: 8px;
    opacity: 0.9;
    font-size: 15px;
}

.logout {
    color: white;
    text-decoration: none;
    background: rgba(255,255,255,0.18);
    padding: 11px 16px;
    border-radius: 14px;
    font-weight: bold;
}

.logout:hover,
.logout:visited,
.logout:active {
    color: white;
    text-decoration: none;
}

.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 26px;
}

.stat {
    background: white;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.06);
}

.stat-number {
    font-size: 34px;
    font-weight: bold;
}

.stat-label {
    color: #65758b;
    margin-top: 5px;
}

.stat-link {
    display: block;
    color: inherit;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-link:hover,
.stat-link:visited,
.stat-link:active,
.stat-link:focus {
    color: inherit;
    text-decoration: none;
}

.stat-link:hover {
    transform: translateY(-2px);
}

.active-stat {
    outline: 2px solid rgba(23, 50, 77, 0.18);
}

.movement-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: -12px;
    margin-bottom: 22px;
}

.movement-stat {
    min-height: 74px;
    padding: 14px 18px;
    border-radius: 16px;
}

.movement-stat .stat-number {
    font-size: 26px;
}

.movement-stat .stat-label {
    font-size: 14px;
}

.stat-link.is-disabled {
    cursor: default;
    opacity: 0.45;
    pointer-events: none;
    box-shadow: none;
}

.stat-link.is-disabled:hover {
    transform: none;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 18px;
}

.room-card {
    background: white;
    border-radius: 22px;
    padding: 22px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.06);
    border: 1px solid #e6edf5;
    overflow: hidden;
}

.room-card-link,
.room-card-link:hover,
.room-card-link:visited,
.room-card-link:active,
.room-card-link:focus {
    color: inherit;
    text-decoration: none;
    display: block;
}

.room-card-link:hover {
    transform: translateY(-2px);
}

.room-card-link {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.room-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.room-name {
    font-size: 20px;
    font-weight: bold;
}

.light {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 3px rgba(255,255,255,0.45), 0 0 0 5px rgba(0,0,0,0.05);
}

.red,
.light.occupied {
    background: #d93025;
}

.green,
.light.available {
    background: #188038;
}

.light.checkin {
    background: #f29900;
}

.light.checkout {
    background: #1a73e8;
}

.status {
    margin-top: 18px;
    display: inline-block;
    padding: 8px 13px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: bold;
}

.status-red,
.status-occupied {
    background: #fdecea;
    color: #a50e0e;
}

.status-green,
.status-available {
    background: #e6f4ea;
    color: #137333;
}

.status-checkin {
    background: #fff4e0;
    color: #b06000;
}

.status,
.maintenance-badge {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
    line-height: 1.25;
}

.status-checkout {
    background: #e8f0fe;
    color: #174ea6;
}

.room-id {
    margin-top: 12px;
    color: #7b8a9b;
    font-size: 12px;
    word-break: break-all;
}

.error-box {
    background: #fff3f3;
    color: #a50e0e;
    border: 1px solid #ffd0d0;
    padding: 18px;
    border-radius: 16px;
    margin-bottom: 20px;
}

.debug-box {
    background: #111;
    color: #00ff7f;
    padding: 20px;
    border-radius: 16px;
    overflow: auto;
    margin-bottom: 25px;
    font-size: 12px;
    line-height: 1.5;
}

.guest-panel {
    background: white;
    border-radius: 22px;
    padding: 24px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.06);
    border: 1px solid #e6edf5;
    margin-bottom: 26px;
}

.guest-panel-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 18px;
}

.guest-panel h2,
.guest-panel h3 {
    margin-top: 0;
}

.guest-detail-card {
    border-top: 1px solid #e6edf5;
    padding-top: 18px;
    margin-top: 18px;
}

.copy-row {
    display: grid;
    grid-template-columns: 120px 1fr auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.copy-row input {
    margin: 0;
    padding: 10px;
    font-size: 13px;
}

.copy-button {
    width: auto;
    padding: 10px 14px;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(243, 247, 251, 0.92);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.show {
    display: flex;
}

.loading-box {
    background: white;
    padding: 34px;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.12);
    text-align: center;
    max-width: 340px;
}

.loading-box h2 {
    margin: 16px 0 8px;
    color: #17324d;
}

.loading-box p {
    margin: 0;
    color: #65758b;
}

.spinner {
    width: 42px;
    height: 42px;
    border: 4px solid #d9e2ec;
    border-top-color: #17324d;
    border-radius: 50%;
    margin: auto;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 650px) {
    .topbar-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    h1 {
        font-size: 32px;
    }

    .stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .movement-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-top: -12px;
    }

    .stat {
        padding: 16px;
    }

    .movement-stat {
        min-height: 62px;
        padding: 11px 14px;
    }

    .stat-number {
        font-size: 28px;
    }

    .movement-stat .stat-number {
        font-size: 24px;
    }

    .stat-label {
        font-size: 14px;
    }

    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .room-card {
        padding: 16px;
        border-radius: 18px;
    }

    .room-name {
        font-size: 16px;
    }

    .light {
        width: 18px;
        height: 18px;
    }

    .status {
        font-size: 12px;
        padding: 7px 10px;
    }

    .copy-row {
        grid-template-columns: 1fr;
    }
}

.apartment-detail-page {
    display: grid;
    gap: 18px;
}

.detail-title-card,
.detail-card {
    background: white;
    margin-bottom: 0;
    border-radius: 22px;
    padding: 24px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.06);
    border: 1px solid #e6edf5;
}

.maintenance-container {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.maintenance-container .detail-card {
    margin-bottom: 0;
}

.detail-title-card h2,
.detail-card h3 {
    margin: 0 0 14px;
}

.detail-title-card p {
    margin: 0;
    color: #65758b;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.detail-row,
.link-row {
    display: grid;
    grid-template-columns: 140px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-top: 1px solid #eef3f8;
}

.detail-row:first-of-type,
.link-row:first-of-type {
    border-top: none;
}

.detail-row span,
.link-row span {
    color: #65758b;
    font-weight: bold;
}

.detail-row a,
.link-row a {
    color: #17324d;
    font-weight: bold;
    text-decoration: none;
    word-break: break-all;
}

.detail-row a:hover,
.link-row a:hover {
    text-decoration: underline;
}

.copy-value {
    width: auto;
    text-align: left;
    background: #f3f7fb;
    color: #17324d;
    border: 1px solid #d9e2ec;
    padding: 10px 12px;
    border-radius: 12px;
}

.mini-copy,
.mini-link {
    width: auto;
    display: inline-block;
    background: #17324d;
    color: white;
    border: none;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

.button-pair {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.status-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 12px;
}

.status-mini-card {
    display: flex;
    gap: 12px;
    align-items: center;
    border-radius: 16px;
    padding: 14px;
    border: 1px solid #e6edf5;
}

.status-mini-card strong {
    display: block;
}

.status-mini-card span {
    display: block;
    margin-top: 4px;
    font-size: 13px;
}

.status-icon {
    font-size: 22px;
}

.status-card-complete {
    background: #e6f4ea;
    color: #137333;
}

.status-card-pending {
    background: #fff4e0;
    color: #b06000;
}

.status-card-muted {
    background: #f1f3f4;
    color: #7b8a9b;
    opacity: 0.75;
}

@media (max-width: 750px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .detail-row,
    .link-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .button-pair {
        justify-content: flex-start;
    }
}

.detail-title-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.detail-title-header .status {
    margin-top: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.detail-title-header .light {
    width: 14px;
    height: 14px;
    box-shadow: none;
}

@media (max-width: 650px) {
    .detail-title-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
.whatsapp-link {
    text-align: center;
    min-width: 96px;
}

.whatsapp-link:hover,
.whatsapp-link:visited,
.whatsapp-link:active {
    color: white;
    text-decoration: none;
}

.internet-status {
    margin-top: 12px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 9px 11px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: bold;
}

.internet-enabled {
    background: #e6f4ea;
    color: #137333;
}

.status-card-internet-disabled {
    background: #ffe5e5;
    border: 1px solid #ffb3b3;
}

.status-card-internet-disabled .status-icon {
    color: #d90429;
}

.internet-toggle {
    grid-column: 1 / -1;
    margin-top: 8px;
    text-align: center;
    background: #17324d;
    color: white;
    text-decoration: none;
    border-radius: 12px;
    padding: 8px 10px;
}

.internet-toggle:hover,
.internet-toggle:visited,
.internet-toggle:active {
    color: white;
    text-decoration: none;
}

.internet-toggle-card {
    text-decoration: none;
}

.status-card-internet-disabled strong,
.status-card-internet-disabled span {
    color: #b00020;
}

.detail-row a.whatsapp-link,
.detail-row a.whatsapp-link:hover,
.detail-row a.whatsapp-link:visited,
.detail-row a.whatsapp-link:active,
.detail-row a.whatsapp-link:focus {
    color: white;
    text-decoration: none;
}

.whatsapp-link {
    text-align: center;
    min-width: 96px;
    color: white;
}

.detail-cta-row {
    margin-top: 20px;
}

.chekin-cta,
.chekin-cta:hover,
.chekin-cta:visited,
.chekin-cta:active,
.chekin-cta:focus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #17324d;
    color: white;
    text-decoration: none;
    border-radius: 14px;
    padding: 13px 18px;
    font-size: 15px;
    font-weight: bold;
    min-width: 180px;
}

.chekin-cta:hover {
    opacity: 0.92;
}
.refresh-mobile-icon {
    display: none;
}

@media (max-width: 650px) {
    .refresh-desktop-text {
        display: none;
    }

    .refresh-mobile-icon {
        display: inline;
        font-size: 18px;
        line-height: 1;
    }
}

@media (max-width: 650px) {
    .topbar-actions {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 8px;
        width: 100%;
        align-items: center;
    }

    .topbar-actions .logout {
        text-align: center;
        padding: 10px 12px;
        font-size: 14px;
        white-space: nowrap;
        flex: 0 0 auto;
    }

    .topbar-actions .logout:first-child {
        flex: 1 1 auto;
    }

    .refresh-link {
        width: 44px;
        min-width: 44px;
        padding-left: 0;
        padding-right: 0;
    }
}

.status-card-router-online {
    background: #e6f4ea;
    color: #137333;
}

.status-card-router-warning {
    background: #fff4e0;
    color: #b06000;
}

.status-card-router-offline {
    background: #ffe5e5;
    color: #b00020;
    border: 1px solid #ffb3b3;
}
.logout {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: white;
}

.logout i {
    color: white;
    font-size: 15px;
}

@media (max-width: 650px) {

    .action-text {
        display: none;
    }

    .logout {
        min-width: 42px;
        justify-content: center;
        padding: 10px;
    }

    .logout i {
        font-size: 18px;
    }
}

.search-box {
    margin-bottom: 20px;
}

.search-box input {
    margin: 0;
    max-width: 350px;
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 650px) {
    .status {
        display: inline-block;
        max-width: 100%;
        padding: 10px 14px;
        font-size: 15px;
        text-align: left;
    }

    .maintenance-badge {
        max-width: 100%;
        white-space: normal;
    }
}

.status {
    font-size: 13px;
}

.fa-spin-custom {
    animation: fa-spin 1s linear infinite;
}

@keyframes fa-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.maintenance-badge {
    margin-top: 8px;
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    background: #fff3cd;
    color: #7a5a00;
    font-size: 12px;
    font-weight: 700;
}

.maintenance-stats {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.maintenance-dashboard-user-filter {
    display: flex;
    gap: 10px;
    align-items: end;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.maintenance-dashboard-user-filter label {
    display: block;
    width: 100%;
    color: #17324d;
    font-size: 13px;
    font-weight: 800;
}

.maintenance-dashboard-user-filter select {
    width: min(320px, 100%);
    height: 48px;
    margin: 0;
    padding: 0 12px;
    border: 1px solid #cfd8e3;
    border-radius: 12px;
    background: #fff;
    color: #17324d;
    font-size: 15px;
}

.maintenance-dashboard-user-filter-button {
    width: auto;
    min-width: 110px;
    height: 48px;
    margin: 0;
    padding: 0 18px;
    border-radius: 12px;
}

.maintenance-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.dashboard-section.hidden {
    display: none;
}

.maintenance-task-card {
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    background: #fafafa;
}

.maintenance-apartment {
    font-weight: 700;
    margin-bottom: 4px;
}

.maintenance-apartment a,
.maintenance-task-title {
    color: #1f6feb;
    text-decoration: none;
}

.maintenance-task-title {
    display: block;
    font-weight: 700;
    color: #111;
    margin-bottom: 5px;
}

.maintenance-apartment a:hover,
.maintenance-task-title:hover {
    text-decoration: underline;
}

.maintenance-availability {
    display: inline-block;
    margin-bottom: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.availability-free {
    background: #e6ffed;
    color: #0b6b2b;
}

.availability-occupied {
    background: #ffe0e0;
    color: #9d0000;
}

.availability-unknown {
    background: #eeeeee;
    color: #555;
}

.maintenance-due-date,
.maintenance-task-meta {
    color: #666;
    font-size: 13px;
}

.maintenance-due-date {
    margin-bottom: 5px;
    font-weight: 700;
}

.maintenance-task-badges {
    min-width: 110px;
    text-align: right;
}

.maintenance-badge {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 5px;
}

.priority-high,
.status-blocked {
    background: #ffe0e0;
    color: #9d0000;
}

.priority-medium,
.status-in_progress {
    background: #fff3cd;
    color: #7a5a00;
}

.priority-low,
.status-open {
    background: #e7f3ff;
    color: #004c8c;
}

.status-scheduled {
    background: #eee5ff;
    color: #4b218a;
}

.status-completed {
    background: #e6ffed;
    color: #0b6b2b;
}

.status-cancelled {
    background: #eeeeee;
    color: #555;
}

@media (max-width: 850px) {
    .maintenance-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .maintenance-layout {
        grid-template-columns: 1fr;
    }

    .maintenance-task-card {
        display: block;
    }

    .maintenance-task-badges {
        text-align: left;
        margin-top: 8px;
    }
}

@media (max-width: 600px) {
    .maintenance-dashboard-user-filter {
        display: grid;
        grid-template-columns: 1fr;
    }

    .maintenance-dashboard-user-filter select,
    .maintenance-dashboard-user-filter-button {
        width: 100%;
        box-sizing: border-box;
    }
}

.stat-filter {
    text-decoration: none;
    color: inherit;
}

.stat-filter:hover {
    text-decoration: none;
}

.stat-filter.is-disabled {
    cursor: default;
    opacity: 0.45;
    box-shadow: none;
}

.stat-filter.is-disabled:hover {
    transform: none;
}

.stat-filter .stat-number,
.stat-filter .stat-label {
    color: inherit;
    text-decoration: none;
}

.success-box {
    background: #e6ffed;
    padding: 10px;
    border: 1px solid #8fd19e;
    margin-bottom: 15px;
    border-radius: 8px;
}

.maintenance-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.maintenance-field {
    background: #fafafa;
    padding: 10px;
    border-radius: 8px;
}

.maintenance-field strong {
    display: block;
    margin-bottom: 4px;
    color: #333;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.quick-actions form {
    margin: 0;
}

.quick-action-btn {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 8px;
    border: none;
    background: #666;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
}

.quick-action-btn.warning {
    background: #b7791f;
}

.quick-action-btn.success {
    background: #198754;
}

.quick-action-btn.edit {
    background: #1f6feb;
}

.maintenance-note {
    border-bottom: 1px solid #ddd;
    padding: 10px 0;
}

.maintenance-note:last-child {
    border-bottom: none;
}

.maintenance-form {
    margin-top: 15px;
}

.maintenance-form textarea,
.maintenance-form input,
.maintenance-form select {
    width: 100%;
    padding: 10px;
    margin-top: 6px;
    box-sizing: border-box;
}

.maintenance-form textarea {
    min-height: 90px;
}

.maintenance-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
}

.maintenance-photo-item img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.delete-photo {
    display: block;
    margin-top: 6px;
    text-align: center;
    color: #c62828;
    font-size: 13px;
    text-decoration: none;
    font-weight: 700;
}

.delete-photo:hover {
    text-decoration: underline;
}

.maintenance-table {
    width: 100%;
    border-collapse: collapse;
}

.maintenance-table th,
.maintenance-table td {
    padding: 9px;
    border-bottom: 1px solid #ddd;
    text-align: left;
    vertical-align: top;
}

.maintenance-table th {
    background: #fafafa;
}

.table-scroll {
    overflow-x: auto;
}

@media (max-width: 700px) {
    .maintenance-detail-grid {
        grid-template-columns: 1fr;
    }

    .quick-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .quick-action-btn {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }
}
.maintenance-title-card h2 {
    margin-bottom: 8px;
}

.maintenance-title-card p {
    margin: 0;
    color: #555;
    font-weight: 600;
}

.maintenance-apartment-link {
    color: #1f6feb;
    text-decoration: none;
    font-weight: 700;
}

.maintenance-apartment-link:hover {
    text-decoration: underline;
}

.quick-action-btn.delete {
    background: #c62828;
}

.maintenance-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: end;
}

.maintenance-filters label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
}

.maintenance-filters select {
    padding: 8px;
    min-width: 150px;
}

.maintenance-filter-actions {
    display: flex;
    gap: 8px;
}

.maintenance-list-table tr:hover {
    background: #f9f9f9;
}

@media (max-width: 800px) {
    .maintenance-table,
    .maintenance-table thead,
    .maintenance-table tbody,
    .maintenance-table th,
    .maintenance-table td,
    .maintenance-table tr {
        display: block;
    }

    .maintenance-table thead {
        display: none;
    }

    .maintenance-table tr {
        margin-bottom: 12px;
        border: 1px solid #ddd;
        border-radius: 10px;
        padding: 10px;
    }

    .maintenance-table td {
        border-bottom: none;
        padding: 6px 0;
    }

    .maintenance-table td::before {
        content: attr(data-label);
        font-weight: 700;
        display: block;
        margin-bottom: 2px;
    }

    .maintenance-filter-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
    }
}
.maintenance-filter-card {
    padding-bottom: 22px;
}

.maintenance-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.maintenance-filter-header h3 {
    margin: 0;
}

.maintenance-reset-link {
    color: #1f6feb;
    font-weight: 700;
    text-decoration: none;
}

.maintenance-reset-link:hover {
    text-decoration: underline;
}

.maintenance-filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}

.maintenance-filter-field label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
}

.maintenance-filter-field select {
    width: 100%;
    height: 48px;
    padding: 0 12px;
    border: 1px solid #d5dde7;
    border-radius: 12px;
    background: #fff;
    font-size: 15px;
}

.maintenance-filter-button {
    width: 100%;
    height: 48px;
    border-radius: 12px;
}

@media (max-width: 900px) {
    .maintenance-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .maintenance-filter-header {
        display: block;
    }

    .maintenance-reset-link {
        display: inline-block;
        margin-top: 8px;
    }

    .maintenance-filters {
        grid-template-columns: 1fr;
    }
}
.maintenance-filter-header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.maintenance-filter-toggle {
    display: none;
    border: none;
    background: #1f6feb;
    color: #fff;
    font-weight: 700;
    border-radius: 10px;
    padding: 9px 12px;
    cursor: pointer;
}

@media (max-width: 600px) {
    .maintenance-filter-toggle {
        display: inline-block;
    }

    .maintenance-filters {
        display: none;
        margin-top: 14px;
    }

    .maintenance-filters.is-open {
        display: grid;
    }
}

@media (max-width: 800px) {
    .maintenance-list-table td[data-label="Categoría"],
    .maintenance-list-table td[data-label="Ubicación"],
    .maintenance-list-table td[data-label="Estimado"],
    .maintenance-list-table td[data-label="Asignado"],
    .maintenance-list-table td[data-label="Creada"] {
        display: none;
    }

    .maintenance-list-table small {
        display: none;
    }

    .maintenance-list-table tr {
        padding: 14px;
    }

    .maintenance-list-table td[data-label="Apartamento"],
    .maintenance-list-table td[data-label="Tarea"] {
        padding-bottom: 10px;
    }
}

.task-row {
    transition: background-color .15s ease;
}

.task-row:hover {
    background: #f7fafc;
}

@media (max-width: 800px) {

    .task-row {
        cursor: pointer;
        transition: transform .15s ease;
    }

    .task-row:active {
        transform: scale(0.98);
    }

    .task-link {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-size: 1rem;
        font-weight: 700;
        color: #18395b;
        text-decoration: none;
    }
    
    .task-link:hover {
        text-decoration: underline;
    }

    .task-link::after {
        content: "›";
        font-size: 1.2rem;
        font-weight: bold;
    }
}

@media (max-width: 800px) {
    .maintenance-list-table .maintenance-task-title {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-size: 1.05rem;
        font-weight: 800;
        color: #18395b;
        text-decoration: none;
    }

    .maintenance-list-table .maintenance-task-title::after {
        content: "›";
        font-size: 1.4rem;
        line-height: 1;
        font-weight: 800;
    }

    .maintenance-list-table td[data-label="Tarea"] {
        background: #f7fafc;
        border-radius: 10px;
        padding: 10px 12px;
        margin-top: 8px;
    }
}

.maintenance-add-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

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

.maintenance-form-field.full {
    grid-column: 1 / -1;
}

.maintenance-form-field label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
}

.maintenance-form-field input,
.maintenance-form-field select,
.maintenance-form-field textarea {
    width: 100%;
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid #d5dde7;
    border-radius: 12px;
    background: #fff;
    font-size: 15px;
    box-sizing: border-box;
}

.maintenance-form-field textarea {
    min-height: 120px;
    resize: vertical;
}

.maintenance-form-actions-card {
    display: flex;
    gap: 10px;
    align-items: center;
}

.maintenance-primary-button {
    min-width: 180px;
}

@media (max-width: 700px) {
    .maintenance-form-grid {
        grid-template-columns: 1fr;
    }

    .maintenance-form-actions-card {
        display: grid;
        grid-template-columns: 1fr;
    }

    .maintenance-primary-button,
    .maintenance-form-actions-card .button {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }
}

.maintenance-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.maintenance-card-header h3 {
    margin: 0;
}

.maintenance-card-add,
.maintenance-card-view-all {
    font-weight: 700;
    color: #1f6feb;
    text-decoration: none;
}

.maintenance-card-add:hover,
.maintenance-card-view-all:hover {
    text-decoration: underline;
}

.apartment-maintenance-list {
    display: grid;
    gap: 10px;
}

.apartment-maintenance-item {
    display: block;
    padding: 12px 12px 12px 14px;
    background: #fafafa;
    border: 1px solid #dde3ea;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
}

.apartment-maintenance-item:hover {
    background: #f5f8fb;
}

.priority-border-high {
    border-left: 5px solid #c62828;
}

.priority-border-medium {
    border-left: 5px solid #b7791f;
}

.priority-border-low {
    border-left: 5px solid #1f6feb;
}

.apartment-maintenance-title {
    font-weight: 800;
    color: #18395b;
    margin-bottom: 4px;
}

.apartment-maintenance-meta,
.apartment-maintenance-due {
    color: #666;
    font-size: 13px;
}

.apartment-maintenance-due {
    margin-top: 4px;
    font-weight: 700;
}

.maintenance-card-view-all {
    display: inline-block;
    margin-top: 14px;
}

@media (max-width: 700px) {
    .maintenance-card-header {
        display: block;
    }

    .maintenance-card-add {
        display: inline-block;
        margin-top: 8px;
    }
}

.maintenance-description-box {
    margin-top: 22px;
    padding: 18px;
    background: #f7fafc;
    border: 1px solid #dde3ea;
    border-radius: 14px;
}

.maintenance-description-box h3 {
    margin-top: 0;
    margin-bottom: 10px;
}

.maintenance-description-box p {
    margin: 0;
    line-height: 1.5;
}

.maintenance-form-actions-card {
    display: flex;
    gap: 12px;
    justify-content: flex-start;
    align-items: center;
}

.maintenance-form-actions-card .button {
    margin: 0;
    min-width: 180px;
    text-align: center;
    box-sizing: border-box;
    text-decoration: none;
}

.maintenance-cancel-button {
    background: #666;
    color: #fff;
    border: none;
}

@media (max-width: 768px) {
    .maintenance-form-actions-card {
        display: grid;
        grid-template-columns: 1fr;
    }

    .maintenance-form-actions-card .button {
        width: 100%;
    }
}


.maintenance-form-actions-card {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 240px));
    gap: 12px;
    justify-content: start;
}

.maintenance-form-actions-card .button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    height: 52px;
    margin: 0 !important;
    padding: 0 18px !important;
    border-radius: 12px !important;
    font-weight: 800;
    text-decoration: none !important;
    box-sizing: border-box;
}

.maintenance-form-actions-card .button-secondary {
    background: #6b7280 !important;
    color: #fff !important;
}

@media (max-width: 700px) {
    .maintenance-form-actions-card {
        grid-template-columns: 1fr;
    }
}

.maintenance-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.maintenance-section-header h3 {
    margin: 0;
}

.maintenance-section-header span {
    font-size: 13px;
    font-weight: 700;
    color: #6b7280;
    background: #f3f6f9;
    border-radius: 999px;
    padding: 5px 10px;
}

.maintenance-timeline {
    display: grid;
    gap: 14px;
}

.maintenance-timeline-item {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 12px;
}

.maintenance-timeline-avatar {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: #18395b;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.maintenance-timeline-content {
    background: #f7fafc;
    border: 1px solid #dde3ea;
    border-radius: 14px;
    padding: 12px 14px;
}

.maintenance-timeline-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    color: #6b7280;
    font-size: 13px;
}

.maintenance-timeline-meta strong {
    color: #18395b;
}

.maintenance-timeline-note {
    line-height: 1.5;
}

.maintenance-note-form {
    margin-top: 18px;
}

@media (max-width: 600px) {
    .maintenance-timeline-item {
        grid-template-columns: 34px 1fr;
        gap: 10px;
    }

    .maintenance-timeline-avatar {
        width: 34px;
        height: 34px;
        font-size: 13px;
    }

    .maintenance-timeline-meta {
        display: block;
    }

    .maintenance-timeline-meta span {
        display: block;
        margin-top: 2px;
    }
}

.improved-photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.maintenance-photo-item {
    background: #f7fafc;
    border: 1px solid #dde3ea;
    border-radius: 14px;
    padding: 10px;
}

.maintenance-photo-item img {
    transition: transform .15s ease, box-shadow .15s ease;
}

.maintenance-photo-item img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.maintenance-collapsible {
    width: 100%;
    border: none;
    background: #f7fafc;
    border: 1px solid #dde3ea;
    border-radius: 12px;
    padding: 14px 18px;
    cursor: pointer;

    display: flex;
    justify-content: space-between;
    align-items: center;

    font-size: 16px;
    font-weight: 700;
    color: #18395b;
}

.maintenance-collapsible:hover {
    background: #eef4f8;
}

.maintenance-overview-card {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.overview-pill {
    background: #f3f6f9;
    border: 1px solid #dde3ea;
    border-radius: 999px;
    padding: 10px 14px;
    font-weight: 600;
    color: #18395b;
}

.overview-pill.priority-high {
    background: #ffe0e0;
    border-color: #f3b1b1;
    color: #9d0000;
}

.overview-pill.priority-medium {
    background: #fff3cd;
    border-color: #f0dd8c;
    color: #7a5a00;
}

.overview-pill.priority-low {
    background: #e7f3ff;
    border-color: #b8d7f3;
    color: #004c8c;
}

.maintenance-last-viewed {
    margin-top: 6px;
    font-size: 13px;
    color: #6b7280;
}

.maintenance-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.88);
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.maintenance-lightbox.is-open {
    display: flex;
}

.maintenance-lightbox img {
    max-width: 95vw;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}

.maintenance-lightbox-close {
    position: fixed;
    top: 18px;
    right: 22px;
    border: none;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 36px;
    line-height: 1;
    width: 48px;
    height: 48px;
    border-radius: 999px;
    cursor: pointer;
}

.maintenance-lightbox-close:hover {
    background: rgba(255,255,255,0.25);
}

@media (max-width: 700px) {
    input,
    select,
    textarea {
        font-size: 16px !important;
    }
}

.maintenance-checkbox {
    display: flex !important;
    align-items: center;
    gap: 8px;
    margin-top: 10px !important;
    font-weight: 600;
}

.maintenance-checkbox input {
    width: auto !important;
    min-height: auto !important;
    margin: 0 !important;
}

.account-action-grid {
    margin-top: 15px;
}

.account-action-card {
    text-decoration: none;
    cursor: pointer;
    transition: all .2s ease;
}

.account-action-card:hover {
    transform: translateY(-2px);
}

.settings-divider {
    border: none;
    border-top: 1px solid #dde3ea;
    margin: 18px 0;
}

.quiet-hours-grid {
    margin-top: 12px;
    max-width: 420px;
}

.notification-list {
    display: grid;
    gap: 10px;
}

.notification-item {
    display: grid;
    grid-template-columns: 14px 1fr;
    gap: 10px;
    padding: 14px;
    border: 1px solid #dde3ea;
    border-radius: 14px;
    background: #fff;
    color: inherit;
    text-decoration: none;
}

.notification-item:hover {
    background: #f7fafc;
}

.notification-unread {
    background: #eef5ff;
    border-color: #b8d7f3;
}

.notification-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    margin-top: 5px;
    background: transparent;
}

.notification-unread .notification-dot {
    background: #1f6feb;
}

.notification-title {
    font-weight: 800;
    color: #18395b;
    margin-bottom: 4px;
}

.notification-message {
    color: #475569;
    font-size: 14px;
    line-height: 1.4;
}

.notification-time {
    margin-top: 6px;
    color: #6b7280;
    font-size: 12px;
    font-weight: 600;
}

.notification-bell {
    position: relative;
}

.notification-counter {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: #e53935;
    color: white;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 10000;

    max-width: 360px;
    width: calc(100% - 36px);

    display: flex;
    gap: 12px;
    align-items: flex-start;

    padding: 14px 16px;

    background: #18395b;
    color: #fff;

    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.25);

    cursor: pointer;

    opacity: 0;
    transform: translateY(12px);
    transition: opacity .25s ease, transform .25s ease;
}

.notification-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.notification-toast-icon {
    font-size: 22px;
    line-height: 1;
}

.notification-toast-content strong {
    display: block;
    margin-bottom: 4px;
}

.notification-toast-content span {
    display: block;
    font-size: 14px;
    line-height: 1.35;
    opacity: .9;
}

@media (max-width: 700px) {
    .notification-toast {
        left: 12px;
        right: 12px;
        bottom: 12px;
        width: auto;
        max-width: none;
    }
}

.notification-wrapper {
    position: relative;
    display: inline-block;
}

.notification-bell {
    position: relative;
}

.notification-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: 340px;
    max-width: calc(100vw - 24px);
    background: #fff;
    border: 1px solid #dde3ea;
    border-radius: 14px;
    box-shadow: 0 18px 45px rgba(0,0,0,0.18);
    z-index: 9999;
    overflow: hidden;
}

.notification-dropdown.show {
    display: block;
}

.notification-dropdown-header {
    padding: 12px 14px;
    border-bottom: 1px solid #dde3ea;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.notification-dropdown-header a {
    font-size: 13px;
    font-weight: 700;
    color: #1f6feb;
    text-decoration: none;
}

.notification-dropdown-item {
    display: block;
    padding: 12px 14px;
    border-bottom: 1px solid #eef2f6;
    text-decoration: none;
    color: inherit;
}

.notification-dropdown-item:hover {
    background: #f7fafc;
}

.notification-dropdown-title {
    font-weight: 800;
    color: #18395b;
    margin-bottom: 4px;
}

.notification-dropdown-message {
    font-size: 13px;
    color: #475569;
}

.notification-dropdown-empty {
    padding: 14px;
    color: #6b7280;
}

.chat-thread {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 16px;
}

.chat-message {
    display: flex;
    gap: 10px;
    max-width: 78%;
}

.chat-message.mine {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-message.theirs {
    align-self: flex-start;
}

.chat-avatar {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: #18395b;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    flex: 0 0 auto;
}

.chat-bubble {
    background: #f3f6f9;
    border: 1px solid #dde3ea;
    border-radius: 18px;
    padding: 12px 14px;
}

.chat-message.mine .chat-bubble {
    background: #18395b;
    color: #fff;
    border-color: #18395b;
}

.chat-meta {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 6px;
    opacity: .8;
}

.chat-text {
    font-size: 16px;
    line-height: 1.45;
}

.chat-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    margin-top: 18px;
}

.chat-form textarea {
    min-height: 52px;
    resize: vertical;
    font-size: 16px;
}

@media (max-width: 700px) {
    .chat-message {
        max-width: 92%;
    }

    .chat-form {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 700px) {
    .notification-wrapper {
        position: static;
    }

    .notification-dropdown {
        position: fixed;
        top: 230px;
        left: 12px;
        right: 12px;
        width: auto;
        max-width: none;
        max-height: 55vh;
        overflow-y: auto;
        border-radius: 18px;
        z-index: 99999;
    }

    .notification-dropdown-item {
        padding: 14px 16px;
    }

    .notification-dropdown-title,
    .notification-dropdown-message {
        white-space: normal;
        overflow-wrap: anywhere;
    }
}

.status-pair {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.status-pair .status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.status-pair .status strong {
    font-size: 0.9em;
    opacity: 0.85;
}

.detail-title-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.status-pair {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.status strong {
    font-size: 0.9em;
    opacity: 0.85;
}

/* ==========================================
   SYSTEM SETTINGS
========================================== */

.settings-page {
    max-width: 1180px;
}

.settings-intro {
    margin-bottom: 18px;
    color: #64748b;
    font-size: 14px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

.settings-card .settings-field {
    width: 100%;
}

.settings-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.settings-card-wide {
    grid-column: 1 / -1;
}

.settings-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e5e7eb;
}

.settings-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    color: #1d4ed8;
    flex: 0 0 auto;
}

.settings-card h3 {
    margin: 0;
    font-size: 18px;
}

.settings-card p {
    margin: 3px 0 0;
    color: #64748b;
    font-size: 13px;
}

.settings-field {
    margin-bottom: 16px;
}

.settings-field:last-child {
    margin-bottom: 0;
}

.settings-field label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
    color: #334155;
    font-size: 14px;
}

.settings-field input[type="text"],
.settings-field input[type="password"],
.settings-field input[type="number"],
.settings-field input[type="url"],
.settings-field input[type="date"],
.settings-field input[type="time"] {
    width: 100%;
    box-sizing: border-box;
}

.settings-help {
    margin-top: 6px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;
}

.settings-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.settings-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
    margin-bottom: 14px;
}

.settings-toggle strong {
    display: block;
    color: #334155;
    font-size: 14px;
}

.settings-toggle span {
    display: block;
    color: #64748b;
    font-size: 12px;
    margin-top: 2px;
}

.settings-toggle input {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
}

.settings-save-bar {
    position: sticky;
    bottom: 0;
    z-index: 20;
    margin-top: 20px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(10px);
    border: 1px solid #e2e8f0;
    box-shadow: 0 -8px 25px rgba(15,23,42,0.08);
    border-radius: 18px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.settings-save-bar span {
    color: #64748b;
    font-size: 14px;
}

.settings-save-bar button {
    flex-shrink: 0;
}

@media (max-width: 900px) {

    .settings-grid,
    .settings-row {
        grid-template-columns: 1fr;
    }

    .settings-save-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .settings-save-bar button {
        width: 100%;
    }
}

.room-settings-add-form {
    margin: 0;
}

.room-settings-add-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) minmax(200px, 1fr) auto;
    gap: 14px;
    align-items: start;
}

.room-settings-add-grid .settings-field {
    margin-bottom: 0;
}

.room-settings-add-grid .settings-field input,
.room-settings-add-grid .settings-field select,
.room-settings-add-action button {
    min-height: 50px;
}

.room-settings-add-action {
    min-width: 140px;
    padding-top: 23px;
    align-self: start;
}

.room-settings-add-action button {
    width: 100%;
    justify-content: center;
}

.room-settings-list {
    display: grid;
    gap: 10px;
}

.room-settings-row {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.room-settings-row.is-manual {
    border-color: #bbf7d0;
}

.room-settings-row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    list-style: none;
    background: #f8fafc;
}

.room-settings-row-header::-webkit-details-marker {
    display: none;
}

.room-settings-row[open] .room-settings-row-header {
    border-bottom: 1px solid #e2e8f0;
}

.room-settings-row-header::after {
    content: "\f078";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: #64748b;
    transition: transform 0.18s ease;
}

.room-settings-row[open] .room-settings-row-header::after {
    transform: rotate(180deg);
}

.room-settings-row.is-manual .room-settings-row-header {
    background: #f0fdf4;
}

.room-settings-summary-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.room-settings-summary-title {
    min-width: 0;
}

.room-settings-row-header strong {
    display: block;
    color: #1e293b;
    font-size: 16px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.room-settings-summary-kind {
    display: block;
    margin-top: 3px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.room-settings-pill {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #075985;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.room-settings-row.is-manual .room-settings-pill {
    background: #dcfce7;
    color: #166534;
}

.room-settings-disable,
.room-settings-enable {
    border: 1px solid #fecaca;
    background: #fff;
    color: #b91c1c;
    border-radius: 8px;
    padding: 8px 12px;
    font-weight: 700;
    cursor: pointer;
}

.room-settings-disable:hover {
    background: #fef2f2;
}

.room-settings-enable {
    border-color: #bbf7d0;
    color: #166534;
}

.room-settings-enable:hover {
    background: #f0fdf4;
}

.room-settings-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
    padding: 16px;
}

.room-settings-views {
    grid-column: span 2;
}

.room-settings-checks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
    border: 1px solid #d7dde8;
    border-radius: 8px;
    background: #fff;
}

.room-settings-checks label {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.room-settings-checks input {
    width: 16px;
    height: 16px;
}

.room-settings-row-actions {
    display: flex;
    justify-content: flex-end;
    padding: 0 16px 16px;
}

.room-settings-disabled-card {
    margin-top: 18px;
}

.room-settings-disabled-row {
    border-color: #cbd5e1;
}

.room-settings-disabled-row .room-settings-row-header {
    background: #f1f5f9;
}

.room-settings-disabled-pill {
    background: #e2e8f0;
    color: #475569;
}

.room-settings-disabled-panel {
    display: flex;
    justify-content: flex-end;
    padding: 16px;
}

.room-settings-empty {
    padding: 16px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    color: #64748b;
    background: #f8fafc;
    font-size: 14px;
}

@media (max-width: 900px) {
    .room-settings-add-grid,
    .room-settings-grid {
        grid-template-columns: 1fr;
    }

    .room-settings-add-action {
        min-width: 0;
        padding-top: 0;
    }

    .room-settings-views {
        grid-column: auto;
    }

    .room-settings-row-header {
        align-items: flex-start;
    }

    .room-settings-summary-main {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }
}

.settings-page {
    padding-bottom: 120px;
}

.secret-toggle {
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
    border-radius: 12px;
    padding: 0 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.secret-toggle:hover {
    background: #e2e8f0;
}

/* System settings fixes */

.secret-field {
    display: flex;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 96px !important;
    gap: 8px !important;
    align-items: center !important;
}

.secret-field .secret-input {
    flex: 1;
    width: 100% !important;
    min-width: 0 !important;
    height: 48px !important;
}

.secret-field .secret-toggle {
    flex: 0 0 96px;
    width: 96px !important;
    height: 48px !important;
    min-width: 96px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 1px solid #cbd5e1 !important;
    background: #f8fafc !important;
    color: #334155 !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.settings-save-bar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 18px !important;
}

.settings-save-bar span {
    width: auto !important;
    max-width: 720px !important;
    line-height: 1.4 !important;
}

.settings-save-bar button {
    width: auto !important;
    min-width: 220px !important;
    max-width: 280px !important;
    margin: 0 !important;
    white-space: nowrap !important;
}

@media (max-width: 700px) {
    .secret-field {
        grid-template-columns: 1fr !important;
    }

    .secret-field .secret-toggle {
        width: 100% !important;
    }

    .settings-save-bar {
        grid-template-columns: 1fr !important;
    }

    .settings-save-bar button {
        width: 100% !important;
        max-width: none !important;
    }
}

.muted-row {
    opacity: 0.6;
}

.text-danger {
    color: #dc2626 !important;
}

.user-actions {
    white-space: nowrap;
}

.action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 38px;
    height: 38px;

    border-radius: 10px;

    text-decoration: none;

    margin-right: 6px;

    transition: all 0.2s ease;
}

.action-icon i {
    font-size: 14px;
}

.action-icon.edit {
    background: #e0f2fe;
    color: #0369a1;
}

.action-icon.edit:hover {
    background: #bae6fd;
}

.action-icon.delete {
    background: #fee2e2;
    color: #dc2626;
}

.action-icon.delete:hover {
    background: #fecaca;
}

/* Apartment dashboard status badge wrapping fix */
.room-card .status {
    display: inline-block;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
    line-height: 1.25;
    box-sizing: border-box;
}

@media (max-width: 650px) {
    .room-card .status {
        font-size: 12px;
        padding: 7px 10px;
    }
}


/* Deposit module */
.deposit-mode-banner {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 14px;
    font-weight: 700;
}

.deposit-mode-banner.sandbox {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
}

.deposit-alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 14px;
    font-weight: 700;
}

.deposit-alert.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.deposit-alert.success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.deposit-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.deposit-panel {
    margin-bottom: 16px;
}

.deposit-form-grid,
.deposit-view-grid,
.deposit-metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.deposit-form-grid label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 700;
}

.deposit-form-grid input,
.deposit-form-grid select,
.deposit-action-row input,
.deposit-link-box input {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
}

.deposit-primary-button,
.deposit-secondary-button,
.deposit-danger-button {
    display: inline-block;
    margin-top: 14px;
    padding: 10px 14px;
    border: 0;
    border-radius: 9px;
    text-decoration: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
}

.deposit-primary-button {
    background: #111827;
    color: #fff;
}

.deposit-secondary-button {
    background: #e5e7eb;
    color: #111827;
}

.deposit-danger-button {
    background: #991b1b;
    color: #fff;
}

.deposit-table-wrap {
    overflow-x: auto;
}

.deposit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.deposit-table th,
.deposit-table td {
    padding: 10px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
}

.deposit-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    background: #e5e7eb;
    font-size: 12px;
    font-weight: 700;
}

.deposit-status-authorised {
    background: #dcfce7;
    color: #166534;
}

.deposit-status-failed {
    background: #fee2e2;
    color: #991b1b;
}

.deposit-status-captured,
.deposit-status-partially_captured {
    background: #dbeafe;
    color: #1e40af;
}

.deposit-link-box {
    display: flex;
    gap: 8px;
    align-items: center;
}

.deposit-link-box .deposit-secondary-button {
    margin-top: 0;
}

.deposit-action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.deposit-action-row .deposit-danger-button,
.deposit-action-row .deposit-secondary-button {
    margin-top: 0;
}

.deposit-metric {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 14px;
}

.deposit-metric span {
    display: block;
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 6px;
}

.deposit-metric strong {
    font-size: 24px;
}

.deposit-mini-list {
    display: grid;
    gap: 8px;
}

.deposit-mini-item {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    background: #fff;
}

.deposit-mini-item span {
    color: #6b7280;
    font-size: 13px;
}

.deposit-checkbox {
    display: block;
    margin: 10px 0 18px;
}

@media (max-width: 700px) {
    .deposit-link-box,
    .deposit-action-row,
    .deposit-mini-item {
        display: block;
    }

    .deposit-link-box .deposit-secondary-button,
    .deposit-action-row .deposit-danger-button,
    .deposit-action-row .deposit-secondary-button {
        margin-top: 8px;
    }
}

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

.maintenance-options-card {
    border: 1px solid #e6edf5;
    border-radius: 18px;
    padding: 16px;
    background: #f8fbff;
}

.maintenance-options-card h4 {
    margin: 0 0 12px;
}

.maintenance-option-row {
    display: grid;
    grid-template-columns: 1fr 90px auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.maintenance-option-row input[type="text"],
.maintenance-option-row input[type="number"] {
    margin: 0;
    padding: 10px;
    font-size: 14px;
}

.maintenance-option-new {
    border-top: 1px solid #e6edf5;
    padding-top: 12px;
    margin-top: 12px;
}

.mini-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: bold;
    color: #65758b;
    white-space: nowrap;
}

.mini-check input {
    width: auto;
    margin: 0;
}

@media (max-width: 750px) {
    .maintenance-options-grid {
        grid-template-columns: 1fr;
    }

    .maintenance-option-row {
        grid-template-columns: 1fr;
    }
}

.settings-field select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d7dde8;
    border-radius: 10px;
    font-size: 14px;
    background: #fff;
    color: #243b5a;
    box-sizing: border-box;
}

.settings-field select:focus {
    outline: none;
    border-color: #2f6fed;
    box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.15);
}

.photo-meta {
    margin-top: 8px;
    display: grid;
    gap: 4px;
    font-size: 12px;
    color: #65758b;
}

.photo-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.photo-meta i {
    color: #17324d;
    font-size: 12px;
}

.notification-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid #e5e7eb;
}

.notification-dropdown-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.notification-action-btn,
.notification-action-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    color: #666;
    cursor: pointer;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.notification-action-btn:hover,
.notification-action-link:hover {
    background: #f3f4f6;
    color: #111827;
}

.notification-dropdown-item {
    padding: 12px 14px;
    border-bottom: 1px solid #f0f0f0;
}

.notification-dropdown-item:last-child {
    border-bottom: none;
}

.notification-dropdown-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 3px;
}

.notification-dropdown-message {
    font-size: 13px;
    color: #555;
}

.notification-dropdown-time {
    margin-top: 5px;
    font-size: 11px;
    color: #888;
}

.notification-dropdown-time {
    margin-top: 5px;
    font-size: 11px;
    color: #888;
}

.notification-dropdown-header {
    display: grid;
    grid-template-columns: 36px 1fr 36px;
    align-items: center;
    gap: 8px;
}

.notification-dropdown-header strong {
    text-align: center;
}

.notification-dropdown-header {
    display: grid;
    grid-template-columns: 42px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid #e5e7eb;
}

.notification-dropdown-header strong {
    text-align: center;
    font-size: 14px;
}

.notification-dropdown-actions {
    display: flex;
    align-items: center;
}

.notification-dropdown-actions-left {
    justify-content: flex-start;
}

.notification-dropdown-actions-right {
    justify-content: flex-end;
}

.notification-action-btn {
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: #65758b;
    cursor: pointer;
    border-radius: 8px;
    padding: 0;
}

.notification-action-btn:hover {
    background: #f3f7fb;
    color: #17324d;
}

.notification-view-all-link {
    width: auto;
    height: auto;
    padding: 4px 0;
    font-size: 13px;
    font-weight: 700;
    color: #1f6feb;
    text-decoration: none;
    white-space: nowrap;
}

.notification-view-all-link:hover {
    background: transparent;
    color: #17324d;
}

.notification-dropdown-time {
    margin-top: 6px;
    font-size: 11px;
    color: #7b8a9b;
}

.notification-dropdown-header {
    display: grid;
    grid-template-columns: 42px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid #e5e7eb;
}

.notification-dropdown-header strong {
    text-align: center;
    font-size: 14px;
}

.notification-dropdown-actions-left {
    justify-content: flex-start;
}

.notification-dropdown-actions-right {
    justify-content: flex-end;
}

.notification-action-btn {
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: #65758b;
    cursor: pointer;
    border-radius: 8px;
    padding: 0;
}

.notification-action-btn:hover {
    background: #f3f7fb;
    color: #17324d;
}

.notification-view-all-link {
    width: auto;
    height: auto;
    padding: 4px 0;
    font-size: 13px;
    font-weight: 700;
    color: #1f6feb;
    text-decoration: none;
    white-space: nowrap;
}

.notification-view-all-link:hover {
    background: transparent;
    color: #17324d;
}

.notification-dropdown-time {
    margin-top: 6px;
    font-size: 11px;
    color: #7b8a9b;
}

/* ==========================================
   Usage Dashboard Fixes
========================================== */

.usage-filter-form {
    display: grid;
    gap: 18px;
}

.usage-filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 130px 1fr auto;
    gap: 14px;
    align-items: end;
}

.usage-filter-field label {
    display: block;
    margin-bottom: 7px;
    color: #17324d;
    font-size: 13px;
    font-weight: 800;
}

.usage-filter-field select,
.usage-filter-field input[type="search"] {
    width: 100%;
    height: 48px;
    margin: 0;
    padding: 0 12px;
    border: 1px solid #cfd8e3;
    border-radius: 12px;
    background: #fff;
    color: #17324d;
    font-size: 15px;
    box-sizing: border-box;
}

.usage-filter-field input[type="search"] {
    padding-right: 36px;
}

.usage-filter-check {
    height: 48px;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.usage-filter-check label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #17324d;
    font-size: 14px;
    font-weight: 800;
}

.usage-filter-check input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.usage-filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.usage-apply-button {
    width: auto;
    min-width: 145px;
    height: 48px;
    margin: 0;
    padding: 0 18px;
    border-radius: 14px;
}

.usage-clear-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 14px;
    background: #f1f5f9;
    color: #17324d;
    font-weight: 800;
    text-decoration: none;
}

.usage-clear-button:hover {
    background: #e2e8f0;
    text-decoration: none;
}

.status-card-grid {
    margin-top: 18px;
    margin-bottom: 18px;
}

.detail-card + .status-card-grid,
.status-card-grid + .detail-card,
.detail-card + .detail-grid,
.detail-grid + .detail-card {
    margin-top: 18px;
}

.pagination-summary {
    color: #65758b;
    font-size: 13px;
    font-weight: 800;
    background: #f3f6f9;
    border-radius: 999px;
    padding: 5px 10px;
}

.usage-pagination {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #e6edf5;
}

.usage-pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #17324d;
    color: white;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 12px;
    font-weight: 800;
}

.usage-pagination a:last-child {
    justify-self: end;
}

.usage-pagination span {
    color: #65758b;
    font-weight: 800;
}

@media (max-width: 1100px) {
    .usage-filter-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .usage-filter-check {
        align-items: end;
    }
}

@media (max-width: 700px) {
    .usage-filter-grid {
        grid-template-columns: 1fr;
    }

    .usage-filter-check {
        height: auto;
    }

    .usage-filter-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .usage-apply-button,
    .usage-clear-button {
        width: 100%;
        box-sizing: border-box;
    }

    .usage-pagination {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .usage-pagination a,
    .usage-pagination a:last-child {
        justify-self: stretch;
    }
}

/* ==========================================
   Maintenance List Filters + Pagination
========================================== */

.maintenance-list-filters {
    display: grid;
    gap: 16px;
}

.maintenance-list-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}

.maintenance-list-filter-field label {
    display: block;
    margin-bottom: 7px;
    color: #17324d;
    font-size: 13px;
    font-weight: 800;
}

.maintenance-list-filter-field select,
.maintenance-list-filter-field input[type="search"] {
    width: 100%;
    height: 48px;
    margin: 0;
    padding: 0 12px;
    border: 1px solid #cfd8e3;
    border-radius: 12px;
    background: #fff;
    color: #17324d;
    font-size: 15px;
    box-sizing: border-box;
}

.maintenance-list-search-field {
    grid-column: span 2;
}

.maintenance-list-filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.maintenance-list-filter-button {
    width: auto;
    min-width: 150px;
    height: 48px;
    margin: 0;
    padding: 0 18px;
    border-radius: 14px;
}

.maintenance-list-clear-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 14px;
    background: #f1f5f9;
    color: #17324d;
    font-weight: 800;
    text-decoration: none;
}

.maintenance-list-clear-button:hover {
    background: #e2e8f0;
    text-decoration: none;
}

.maintenance-list-pagination {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #e6edf5;
}

.maintenance-list-pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #17324d;
    color: white;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 12px;
    font-weight: 800;
}

.maintenance-list-pagination a:last-child {
    justify-self: end;
}

.maintenance-list-pagination span {
    color: #65758b;
    font-weight: 800;
}

@media (max-width: 950px) {
    .maintenance-list-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .maintenance-list-search-field {
        grid-column: 1 / -1;
    }
}

@media (max-width: 600px) {
    .maintenance-list-filter-grid {
        grid-template-columns: 1fr;
    }

    .maintenance-list-search-field {
        grid-column: auto;
    }

    .maintenance-list-filter-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .maintenance-list-filter-button,
    .maintenance-list-clear-button {
        width: 100%;
        box-sizing: border-box;
    }

    .maintenance-list-pagination {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .maintenance-list-pagination a,
    .maintenance-list-pagination a:last-child {
        justify-self: stretch;
    }
}

@media (max-width: 600px) {
    .maintenance-list-filters {
        display: none;
        margin-top: 14px;
    }

    .maintenance-list-filters.is-open {
        display: grid;
    }
}

/* ==========================================
   Maintenance Print
========================================== */

body.maintenance-print-page {
    color: #111;
    background: #f5f5f5;
    margin: 0;
    padding: 20px;
    font-size: 14px;
}

.maintenance-print-screen-panel {
    background: #fff;
    border: 1px solid #d5dde7;
    border-radius: 18px;
    padding: 22px;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.maintenance-print-panel-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.maintenance-print-panel-header h1 {
    margin: 0;
    font-size: 28px;
    color: #111;
}

.maintenance-print-panel-header p {
    margin: 6px 0 0;
    color: #65758b;
    font-weight: 600;
}

.maintenance-print-filter-form {
    display: grid;
    gap: 18px;
}

.maintenance-print-filter-grid {
    display: grid;
    grid-template-columns: 180px repeat(5, minmax(130px, auto));
    gap: 14px;
    align-items: end;
}

.maintenance-print-field label {
    display: block;
    margin-bottom: 7px;
    font-weight: 800;
    color: #17324d;
    font-size: 13px;
}

.maintenance-print-field select {
    width: 100%;
    height: 48px;
    margin: 0;
    padding: 0 12px;
    border: 1px solid #cfd8e3;
    border-radius: 12px;
    background: #fff;
    color: #17324d;
    font-size: 15px;
    box-sizing: border-box;
}

.maintenance-print-check {
    height: 48px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #17324d;
    font-weight: 800;
    white-space: nowrap;
}

.maintenance-print-check input {
    width: auto;
    margin: 0;
}

.maintenance-print-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.maintenance-print-button,
.maintenance-print-back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    width: auto;
    margin: 0;
    padding: 0 18px;
    border-radius: 12px;
    border: 0;
    background: #17324d;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 800;
}

.maintenance-print-back-link {
    background: #6b7280;
}

.maintenance-print-button:hover,
.maintenance-print-back-link:hover {
    opacity: 0.92;
    text-decoration: none;
}

.maintenance-print-title {
    display: none;
}

.maintenance-print-task {
    background: #fff;
    border: 1px solid #222;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
    page-break-inside: avoid;
}

.maintenance-print-task-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.maintenance-print-task-header strong {
    font-size: 20px;
    margin-right: 8px;
}

.maintenance-print-task-header span {
    font-size: 16px;
    font-weight: 800;
}

.maintenance-print-due-date {
    white-space: nowrap;
    font-size: 13px;
}

.maintenance-print-description,
.maintenance-print-conversation-notes {
    margin-bottom: 8px;
    line-height: 1.35;
}

.maintenance-print-conversation-notes {
    font-size: 13px;
    background: #f4f4f4;
    padding: 8px;
    border-radius: 6px;
}

.maintenance-print-scribble-area {
    height: 70px;
    border-top: 1px dashed #999;
    padding-top: 8px;
    margin-top: 8px;
    color: #444;
}

.maintenance-print-empty {
    background: #fff;
    border: 1px solid #ddd;
    padding: 20px;
    border-radius: 12px;
}

@media (max-width: 950px) {
    .maintenance-print-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .maintenance-print-panel-header {
        display: block;
    }

    .maintenance-print-back-link {
        margin-top: 12px;
    }
}

@media (max-width: 600px) {
    body.maintenance-print-page {
        padding: 12px;
    }

    .maintenance-print-filter-grid {
        grid-template-columns: 1fr;
    }

    .maintenance-print-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .maintenance-print-button,
    .maintenance-print-back-link {
        width: 100%;
        box-sizing: border-box;
    }
}

@media print {
    body.maintenance-print-page {
        background: #fff;
        padding: 0;
        font-size: 12px;
    }

    .maintenance-print-screen-panel {
        display: none;
    }

    .maintenance-print-title {
        display: block;
        margin-bottom: 10px;
        border-bottom: 2px solid #111;
        padding-bottom: 6px;
    }

    .maintenance-print-task {
        border-radius: 0;
    }
}

.maintenance-print-task-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.maintenance-print-priority {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    border: 1px solid #999;
}

.maintenance-print-priority.priority-high {
    background: #ffe0e0;
    color: #9d0000;
    border-color: #9d0000;
}

.maintenance-print-priority.priority-medium {
    background: #fff3cd;
    color: #7a5a00;
    border-color: #7a5a00;
}

.maintenance-print-priority.priority-low {
    background: #e7f3ff;
    color: #004c8c;
    border-color: #004c8c;
}

@media print {
    .maintenance-print-priority.priority-high {
        border: 2px solid #000;
        background: #fff;
        color: #000;
        text-transform: uppercase;
    }
}

.maintenance-print-due-date.overdue {
    color: #9d0000;
    font-weight: 800;
}

/* ==========================================
   Usage Dashboard Stat Cards
========================================== */

.usage-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: 18px 0;
}

.usage-stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border: 1px solid #e6edf5;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.06);
}

.usage-stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: #eef4fb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex: 0 0 auto;
}

.usage-stat-card strong {
    display: block;
    color: #17324d;
    font-size: 28px;
    line-height: 1;
    margin-bottom: 6px;
}

.usage-stat-card span {
    display: block;
    color: #65758b;
    font-size: 14px;
    font-weight: 700;
}

@media (max-width: 950px) {
    .usage-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .usage-stats-grid {
        grid-template-columns: 1fr;
    }

    .usage-stat-card {
        padding: 16px;
    }
}

.maintenance-multi-select {
    width: 100%;
    min-height: 260px;
    padding: 10px;
    border: 1px solid #d5dde7;
    border-radius: 14px;
    background: #fff;
    color: #17324d;
    font-size: 15px;
    box-sizing: border-box;
}

.maintenance-multi-select option {
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 4px;
    font-weight: 700;
}

.maintenance-multi-select option:checked {
    background: #17324d;
    color: #fff;
}

.maintenance-multi-select:focus {
    outline: none;
    border-color: #2b5f8a;
    box-shadow: 0 0 0 3px rgba(43, 95, 138, 0.15);
}

@media (max-width: 600px) {
    .maintenance-multi-select {
        min-height: 320px;
    }
}

.maintenance-search-input {
    width: 100%;
    margin-bottom: 12px;
}

.maintenance-apartment-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
    padding: 4px;
}

.maintenance-apartment-pill {
    position: relative;
    cursor: pointer;
}

.maintenance-apartment-pill input {
    display: none;
}

.maintenance-apartment-pill span {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 999px;
    background: #f4f6f8;
    border: 1px solid #d9dee5;
    font-size: 14px;
    font-weight: 600;
}

.maintenance-apartment-pill input:checked + span {
    background: #17324d;
    color: white;
    border-color: #17324d;
}

.account-passkey-button {
    width: 100%;
    border: 1px solid #e6edf5;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.account-passkey-button strong,
.account-passkey-button span {
    text-align: left;
}

.account-passkey-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.passkey-card {
    display: flex;
    align-items: center;
    gap: 16px;

    width: 100%;

    padding: 20px;

    background: #fff;
    border: 1px solid #dbe5ef;
    border-radius: 16px;

    cursor: pointer;

    transition: all 0.2s ease;
}

.passkey-card:hover {
    background: #f8fafc;
    border-color: #c7d6e5;
}

.passkey-card .status-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.passkey-card strong {
    display: block;
    font-size: 18px;
    color: #173a5b;
}

.passkey-card span {
    display: block;
    color: #667085;
    margin-top: 4px;
}

.login-primary-button,
.login-passkey-button {
    width: 100%;
    height: 56px;
    border: none;
    border-radius: 16px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 12px;
}

.login-primary-button {
    background: #17324d;
    color: #fff;
}

.login-passkey-button {
    background: #eef5ff;
    color: #17324d;
    border: 1px solid #c9d9ea;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-passkey-button:hover {
    background: #e4effc;
}

#passkeyLoginError {
    margin-top: 12px;
}

.account-security-intro {
    margin-bottom: 18px;
    line-height: 1.45;
}

.account-security-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.account-security-action {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 96px;
    padding: 18px;
    background: #f8fbff;
    border: 1px solid #dbe5ef;
    border-radius: 18px;
    color: #17324d;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

button.account-security-action {
    font-family: inherit;
}

.account-security-action:hover {
    background: #eef5ff;
    border-color: #bfd0e2;
    transform: translateY(-1px);
    text-decoration: none;
}

.account-security-action strong {
    display: block;
    font-size: 17px;
    font-weight: 800;
    color: #17324d;
}

.account-security-action span {
    display: block;
    margin-top: 4px;
    font-size: 14px;
    line-height: 1.35;
    color: #65758b;
}

.account-security-icon,
.account-passkey-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8f0fe;
    color: #17324d;
    flex: 0 0 auto;
}

.account-security-icon i,
.account-passkey-icon i {
    font-size: 20px;
}

.account-passkey-list {
    display: grid;
    gap: 10px;
}

.account-passkey-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: #f8fbff;
    border: 1px solid #dbe5ef;
    border-radius: 16px;
}

.account-passkey-item strong {
    display: block;
    color: #17324d;
    font-weight: 800;
}

.account-passkey-item span {
    display: block;
    margin-top: 4px;
    color: #65758b;
    font-size: 13px;
    line-height: 1.35;
}

#passkeyMessage {
    margin-top: 14px;
}

@media (max-width: 700px) {
    .account-security-actions {
        grid-template-columns: 1fr;
    }

    .account-security-action {
        min-height: auto;
        padding: 16px;
    }
}

.account-passkey-content {
    flex: 1;
    min-width: 0;
}

.account-passkey-delete-form {
    margin: 0;
    flex: 0 0 auto;
}

.account-passkey-delete {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 10px;
    background: #fee2e2;
    color: #dc2626;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.account-passkey-delete i {
    color: #dc2626;
    font-size: 14px;
}

.account-passkey-delete:hover {
    background: #fecaca;
}
