* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f5f7fb;
    color: #172033;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
}

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

.app-header {
    background: #1f3a5f;
    color: #fff;
    padding: 18px 28px;
}

.app-header__inner {
    align-items: center;
    display: flex;
    gap: 24px;
    justify-content: space-between;
    margin: 0 auto;
    max-width: 1180px;
}

.brand {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand img {
    height: 36px;
    width: auto;
}

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

.nav a,
.nav-button {
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: #dbeafe;
    cursor: pointer;
    font: inherit;
    padding: 8px 10px;
}

.nav a:hover,
.nav a.active,
.nav-button:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.login-page {
    align-items: center;
    display: flex;
    min-height: 100vh;
    padding: 18px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before, .login-page::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
}
.login-page::before {
    width: 500px;
    height: 500px;
    top: -150px;
    left: -150px;
}
.login-page::after {
    width: 300px;
    height: 300px;
    bottom: -50px;
    right: -50px;
}

.login-card {
    background: #ffffff;
    border: none;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    margin: 0 auto;
    max-width: 420px;
    padding: 40px 32px;
    width: 100%;
    position: relative;
    z-index: 10;
}

.login-card h1 {
    margin: 0 0 8px;
    color: #1e3c72;
    font-size: 28px;
    font-weight: 700;
    text-align: center;
}

.login-card p {
    color: #64748b;
    margin: 0 0 28px;
    text-align: center;
    font-size: 15px;
}

.container {
    margin: 0 auto;
    max-width: 1180px;
    padding: 28px;
}

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

.page-title {
    margin: 0;
    font-size: 24px;
}

.page-subtitle {
    color: #64748b;
    margin: 6px 0 0;
}

.eyebrow {
    color: #2f7dd1;
    font-size: 12px;
    font-weight: 700;
    margin: 0 0 6px;
    text-transform: uppercase;
}

.dashboard-hero {
    align-items: center;
    background: #fff;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    margin-bottom: 18px;
    padding: 22px;
}

.panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 18px;
}

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

.stat {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #2f7dd1;
    border-radius: 8px;
    padding: 18px;
}

.stats-dashboard .stat {
    min-height: 132px;
}

.stat-blue {
    border-left-color: #2f7dd1;
}

.stat-green {
    border-left-color: #16a34a;
}

.stat-amber {
    border-left-color: #d97706;
}

.stat-gray {
    border-left-color: #64748b;
}

.stat__label {
    color: #64748b;
    margin-bottom: 8px;
}

.stat__value {
    font-size: 30px;
    font-weight: 700;
}

.stat__meta {
    color: #64748b;
    margin-top: 8px;
}

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

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

.section-head h2 {
    font-size: 18px;
    margin: 0;
}

.section-head p {
    color: #64748b;
    margin: 4px 0 0;
}

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

.block-row,
.room-row {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
}

.block-row {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.block-row span,
.room-row span {
    color: #64748b;
    display: block;
    margin-top: 4px;
}

.block-row__count {
    background: #dbeafe;
    border-radius: 999px;
    color: #1f3a5f;
    font-weight: 700;
    min-width: 38px;
    padding: 7px 10px;
    text-align: center;
}

.room-row__top,
.room-row__bottom {
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.progress {
    background: #e2e8f0;
    border-radius: 999px;
    height: 8px;
    margin: 10px 0;
    overflow: hidden;
}

.progress span {
    background: #2f7dd1;
    display: block;
    height: 100%;
    margin: 0;
}

.dashboard-table {
    min-width: 520px;
}

.dashboard-table a {
    color: #1d4ed8;
    font-weight: 700;
}

.empty-text {
    color: #64748b;
    margin: 0;
}

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

.table-actions {
    align-items: center;
    flex-wrap: nowrap;
    min-width: 210px;
}

.table-actions form {
    margin: 0;
}

.table-actions .btn {
    min-height: 32px;
    padding: 6px 10px;
    white-space: nowrap;
}

.btn {
    align-items: center;
    background: #e2e8f0;
    border: 0;
    border-radius: 6px;
    color: #172033;
    cursor: pointer;
    display: inline-flex;
    font-weight: 600;
    min-height: 36px;
    padding: 8px 12px;
}

.btn-primary {
    background: #2f7dd1;
    color: #fff;
}

.btn-danger {
    background: #dc2626;
    color: #fff;
}

.btn-light {
    background: #f1f5f9;
}

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

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

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

.table th {
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    text-transform: uppercase;
}

.text-truncate {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

label {
    color: #334155;
    font-weight: 700;
}

.required {
    color: #dc2626;
    font-weight: 700;
}

.field-note {
    color: #64748b;
    font-size: 12px;
}

input,
select,
textarea {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    min-height: 40px;
    padding: 9px 10px;
    width: 100%;
}

textarea {
    min-height: 90px;
}

.error {
    color: #dc2626;
    font-size: 12px;
}

.alert {
    border-radius: 8px;
    margin-bottom: 16px;
    padding: 12px 14px;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
}

.filter {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 16px;
}

.filter-5 {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-bottom: 16px;
}

.badge {
    border-radius: 999px;
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
}

.badge-active {
    background: #dcfce7;
    color: #166534;
}

.badge-muted {
    background: #e2e8f0;
    color: #475569;
}

.photo {
    border-radius: 8px;
    height: 42px;
    object-fit: cover;
    width: 42px;
}

.photo-large {
    border-radius: 8px;
    height: 180px;
    object-fit: cover;
    width: 180px;
}

.pagination {
    margin-top: 16px;
}

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

.pagination-info {
    color: #64748b;
}

.pagination-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pagination-link {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: #172033;
    display: inline-flex;
    font-weight: 600;
    min-height: 34px;
    padding: 7px 10px;
}

.pagination-link.active {
    background: #2f7dd1;
    border-color: #2f7dd1;
    color: #fff;
}

.pagination-link.disabled {
    color: #94a3b8;
    cursor: not-allowed;
}

@media (max-width: 760px) {
    .app-header {
        padding: 14px 18px;
    }

    .app-header__inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .nav {
        width: 100%;
        margin-top: 4px;
        gap: 6px;
    }

    .nav a,
    .nav form {
        flex-grow: 1;
    }

    .nav a,
    .nav-button {
        display: block;
        width: 100%;
        text-align: center;
        padding: 10px 8px;
        font-size: 13px;
        background: rgba(255, 255, 255, 0.08);
    }

    .dashboard-hero {
        align-items: flex-start;
        flex-direction: column;
        padding: 18px;
        gap: 14px;
    }

    .page-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }

    .container {
        padding: 18px;
    }

    .stats,
    .dashboard-grid,
    .filter,
    .filter-5,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .actions {
        width: 100%;
        margin-top: 8px;
        gap: 8px;
    }

    .actions .btn,
    .actions form {
        flex-grow: 1;
    }

    .actions .btn {
        justify-content: center;
        width: 100%;
    }

    .actions form .btn {
        width: 100%;
    }

    .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .photo-large {
        margin: 0 auto 16px;
        display: block;
    }

    .pagination-bar {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .pagination-links {
        width: 100%;
        justify-content: center;
    }
}
