:root {
    --navy: #003DA5;
    --gold: #F9A800;
    --red: #D50032;
    --text: #1f2937;
    --muted: #6b7280;
    --white: #ffffff;
    --bg: #f5f7fb;
    --border: #dbe2ef;
    --card: #ffffff;
    --success: #0f9d58;
    --warning: #cc8b00;
    --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background: var(--bg);
}

body {
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

.auth-body {
    background: linear-gradient(140deg, rgba(0, 61, 165, 0.98), rgba(0, 29, 92, 0.92));
}

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 32px;
}

.auth-brand {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 24px;
}

.brand-mark {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gold), #ffd363);
    color: var(--navy);
    font-weight: 700;
    letter-spacing: 0.08em;
}

.brand-mark.large {
    width: 64px;
    height: 64px;
    font-size: 1.1rem;
}

.auth-brand h1,
.brand-block h2,
.topbar h1,
.panel-card h2,
.panel-heading h2 {
    margin: 0;
}

.auth-brand p,
.brand-block p,
.topbar .subtitle,
.panel-heading p,
.auth-footer p {
    margin: 4px 0 0;
    color: var(--muted);
}

.app-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: linear-gradient(180deg, #002c77, var(--navy));
    color: var(--white);
    padding: 24px;
}

.brand-block {
    display: flex;
    gap: 14px;
    align-items: center;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 24px;
}

.nav-link {
    padding: 12px 14px;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.9);
    transition: background 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(249, 168, 0, 0.18);
    color: var(--white);
    transform: translateX(2px);
}

.logout-link {
    margin-top: 12px;
    background: rgba(213, 0, 50, 0.15);
}

.main-panel {
    display: flex;
    flex-direction: column;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    padding: 28px 32px 12px;
}

.topbar-user {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    color: var(--muted);
}

.topbar-role {
    display: inline-block;
    margin-top: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(249, 168, 0, 0.18);
    color: var(--navy);
    font-size: 0.82rem;
    font-weight: 700;
}

.page-content {
    padding: 12px 32px 32px;
}

.summary-grid,
.content-grid,
.filter-grid {
    display: grid;
    gap: 20px;
}

.summary-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-bottom: 24px;
}

.summary-card {
    background: linear-gradient(150deg, rgba(0, 61, 165, 0.96), rgba(0, 39, 106, 0.96));
    color: var(--white);
    border: 2px solid rgba(249, 168, 0, 0.75);
    border-radius: 18px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.summary-card.alert {
    border-color: rgba(213, 0, 50, 0.65);
}

.summary-label {
    display: block;
    font-size: 0.95rem;
    opacity: 0.88;
}

.summary-value {
    display: block;
    margin-top: 12px;
    font-size: 2rem;
    font-weight: 700;
}

.panel-section,
.panel-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.panel-section {
    padding: 24px;
    margin-top: 24px;
}

.panel-card {
    padding: 24px;
}

.content-grid.two-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.stack-form,
.inline-form,
.filter-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.inline-form {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.compact-form {
    max-width: 520px;
}

.filter-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: end;
}

.report-filter-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.report-summary-grid {
    margin-top: 24px;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-group span {
    font-size: 0.95rem;
    font-weight: 600;
}

.field-group input,
.field-group select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    background: #fff;
    color: var(--text);
}

.field-group input:focus,
.field-group select:focus {
    outline: none;
    border-color: rgba(0, 61, 165, 0.45);
    box-shadow: 0 0 0 4px rgba(0, 61, 165, 0.08);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 12px;
    padding: 12px 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--navy);
    color: var(--white);
}

.btn-light {
    background: #eef3fb;
    color: var(--navy);
}

.btn-danger {
    background: var(--red);
    color: var(--white);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-warning {
    background: var(--gold);
    color: #1a1a1a;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 0.88rem;
}

.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.align-end {
    align-self: end;
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.data-table th,
.data-table td {
    text-align: left;
    padding: 14px 12px;
    border-bottom: 1px solid #edf1f7;
    vertical-align: top;
}

.data-table th {
    color: var(--muted);
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.actions-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
}

.badge-vacant {
    background: rgba(15, 157, 88, 0.12);
    color: #0b7a44;
}

.badge-occupied {
    background: rgba(0, 61, 165, 0.12);
    color: var(--navy);
}

.badge-maintenance {
    background: rgba(249, 168, 0, 0.16);
    color: #8c6200;
}

.badge-paid {
    background: rgba(15, 157, 88, 0.12);
    color: #0b7a44;
}

.badge-unpaid {
    background: rgba(213, 0, 50, 0.12);
    color: var(--red);
}

.table-meta,
.mini-label {
    display: inline-block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.82rem;
}

.mini-label {
    margin-top: 0;
    margin-left: 8px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(0, 61, 165, 0.1);
    color: var(--navy);
}

.flash-message {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 14px;
    font-weight: 600;
}

.flash-message.success {
    background: rgba(15, 157, 88, 0.12);
    color: #0b7a44;
}

.flash-message.error {
    background: rgba(213, 0, 50, 0.1);
    color: #a10026;
}

.flash-message.warning {
    background: rgba(249, 168, 0, 0.16);
    color: #8c6200;
}

.view-toggle {
    display: flex;
    gap: 8px;
}

.view-toggle .is-active {
    box-shadow: inset 0 0 0 2px rgba(249, 168, 0, 0.45);
}

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

.unpaid-room-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px;
    background: linear-gradient(180deg, #fff, #f8fbff);
}

.unpaid-room-card h3 {
    margin: 0 0 12px;
    font-size: 1.05rem;
}

.card-meta {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
    color: var(--muted);
}

.empty-state,
.empty-cell {
    text-align: center;
    color: var(--muted);
    padding: 32px 16px;
}

.info-card {
    background: #f8fbff;
    border: 1px dashed rgba(0, 61, 165, 0.25);
    border-radius: 16px;
    padding: 18px;
}

.bullet-list {
    margin: 14px 0 0;
    padding-left: 18px;
    color: var(--muted);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.48);
    z-index: 1000;
}

.modal-backdrop.is-open {
    display: flex;
}

.modal-card {
    width: 100%;
    max-width: 480px;
    background: var(--white);
    border-radius: 18px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.modal-card h3 {
    margin-top: 0;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
}

@media (max-width: 1180px) {
    .summary-grid,
    .content-grid.two-column,
    .dashboard-grid,
    .filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

    .sidebar {
        padding-bottom: 16px;
    }

    .sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .topbar,
    .page-content {
        padding-left: 20px;
        padding-right: 20px;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 720px) {
    .summary-grid,
    .content-grid.two-column,
    .dashboard-grid,
    .filter-grid {
        grid-template-columns: 1fr;
    }

    .panel-heading {
        flex-direction: column;
        align-items: flex-start;
    }

    .actions-cell {
        min-width: 240px;
    }
}