:root {
    --background: #f3f5f7;
    --surface: #ffffff;
    --primary: #0b4f6c;
    --primary-hover: #083f56;
    --text: #1f2933;
    --muted: #68737d;
    --border: #d9e0e5;
    --danger-background: #fdeaea;
    --danger-text: #9b1c1c;
    --shadow: 0 12px 32px rgba(20, 35, 50, 0.12);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--background);
    color: var(--text);
}

body {
    min-height: 100vh;
}

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 40px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.brand {
    margin-bottom: 32px;
    text-align: center;
}

.brand h1 {
    margin: 0;
    color: var(--primary);
    font-size: 42px;
    letter-spacing: 0.5px;
}

.brand p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 17px;
}

form {
    display: flex;
    flex-direction: column;
}

label {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 700;
}

input {
    width: 100%;
    margin-bottom: 20px;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #ffffff;
    color: var(--text);
    font-size: 16px;
}

input:focus {
    border-color: var(--primary);
    outline: 3px solid rgba(11, 79, 108, 0.14);
}

button,
.button {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border: 0;
    border-radius: 7px;
    background: var(--primary);
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

button:hover,
.button:hover {
    background: var(--primary-hover);
}

.alert {
    margin-bottom: 20px;
    padding: 12px 14px;
    border-radius: 7px;
    background: var(--danger-background);
    color: var(--danger-text);
    font-size: 14px;
}

.portal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 22px 32px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.portal-header h1 {
    margin: 0;
    color: var(--primary);
    font-size: 26px;
}

.portal-header p {
    margin: 6px 0 0;
    color: var(--muted);
}

.portal-container {
    width: min(1200px, calc(100% - 40px));
    margin: 0 auto;
    padding: 40px 0;
}

.page-heading {
    margin-bottom: 28px;
}

.page-heading h2 {
    margin: 0 0 8px;
    font-size: 30px;
}

.page-heading p {
    margin: 0;
    color: var(--muted);
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 560px));
    gap: 32px;
    justify-content: start;
}

.report-card {
    display: flex;
    min-height: 300px;
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(20, 35, 50, 0.08);
}

.report-card h3 {
    margin: 0 0 12px;
    font-size: 22px;
}

.report-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.secondary-button {
    background: #e8edf1;
    color: var(--text);
}

.secondary-button:hover {
    background: #dce3e8;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.empty-state {
    padding: 36px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-align: center;
}

.empty-state h3 {
    margin-top: 0;
}

.report-page {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

.report-viewer {
    flex: 1;
    min-height: 0;
}

.report-viewer iframe {
    display: block;
    width: 100%;
    height: calc(100vh - 91px);
    border: 0;
    background: #ffffff;
}

@media (max-width: 700px) {
    .portal-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 20px;
    }

    .header-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .header-actions .button {
        flex: 1;
    }

    .portal-container {
        width: min(100% - 28px, 1200px);
        padding: 28px 0;
    }

    .report-grid {
        grid-template-columns: 1fr;
    }

    .report-viewer iframe {
        height: calc(100vh - 170px);
    }
}

@media (max-width: 520px) {
    .login-card {
        padding: 28px 22px;
    }

    .brand h1 {
        font-size: 36px;
    }
}

.success-message {
    margin-bottom: 20px;
    padding: 12px 14px;
    border-radius: 7px;
    background: #e8f5e9;
    color: #1b5e20;
    font-size: 14px;
}

.admin-panel {
    margin-bottom: 32px;
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(20, 35, 50, 0.06);
}

.admin-panel h2 {
    margin-top: 0;
}

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

.checkbox-field {
    display: flex;
    align-items: center;
}

.checkbox-field label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.checkbox-field input {
    width: auto;
    margin: 0;
}

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

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

.admin-table th,
.admin-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.admin-table th {
    background: #f7f9fa;
    font-size: 14px;
}

.inline-form {
    display: inline;
}

.small-button {
    min-height: 36px;
    padding: 8px 14px;
    font-size: 14px;
}

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

    .admin-panel {
        padding: 20px;
    }
}
select {
    width: 100%;
    margin-bottom: 20px;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #ffffff;
    color: var(--text);
    font-size: 16px;
}

select:focus {
    border-color: var(--primary);
    outline: 3px solid rgba(11, 79, 108, 0.14);
}

.access-list {
    display: grid;
    gap: 14px;
    margin-bottom: 24px;
}

.access-option {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin: 0;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #f9fbfc;
    cursor: pointer;
}

.access-option:hover {
    border-color: var(--primary);
    background: #f3f8fa;
}

.access-option input {
    width: 20px;
    height: 20px;
    margin: 2px 0 0;
    flex: 0 0 auto;
}

.access-option span {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.access-option strong {
    font-size: 16px;
}

.access-option small {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.4;
}

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