:root {
    color-scheme: light;
    --background: #f4f6f8;
    --surface: #ffffff;
    --surface-muted: #eef2f5;
    --text: #17212b;
    --muted: #617080;
    --primary: #1f5f8b;
    --primary-dark: #174868;
    --border: #d9e0e6;
    --danger: #a12622;
    --success: #1f7044;
    --shadow: 0 8px 24px rgba(24, 39, 54, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

a {
    color: var(--primary);
}

.container {
    width: min(1120px, calc(100% - 2rem));
    margin-inline: auto;
}

.site-header {
    background: #15293a;
    color: #fff;
    box-shadow: var(--shadow);
}

.site-header .container {
    display: flex;
    min-height: 64px;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    text-decoration: none;
}

.navigation {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navigation a,
.link-button {
    border: 0;
    background: transparent;
    color: #dbe7ef;
    cursor: pointer;
    font: inherit;
    padding: 0.6rem 0.75rem;
    text-decoration: none;
}

.navigation a:hover,
.navigation a[aria-current="page"],
.link-button:hover {
    color: #fff;
    text-decoration: underline;
}

main.container {
    padding-block: 2rem 3rem;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

h1,
h2 {
    line-height: 1.2;
}

h1 {
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    margin: 0;
}

h2 {
    font-size: 1.15rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 1.25rem;
}

.auth-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 1rem;
}

.auth-card {
    width: min(440px, 100%);
}

.auth-card .brand-mark {
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
}

.muted {
    color: var(--muted);
}

.grid {
    display: grid;
    gap: 1rem;
}

.stats {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stat strong {
    display: block;
    font-size: 1.8rem;
}

.form-grid {
    display: grid;
    gap: 1rem;
}

.field label,
.field legend {
    display: block;
    font-weight: 650;
    margin-bottom: 0.35rem;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="url"],
.field input[type="number"],
.field select,
.field textarea {
    width: 100%;
    border: 1px solid #aebbc6;
    border-radius: 8px;
    font: inherit;
    padding: 0.7rem 0.75rem;
}

.field textarea {
    resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(31, 95, 139, 0.15);
    outline: none;
}

fieldset {
    border: 1px solid var(--border);
    border-radius: 8px;
    margin: 0;
    padding: 0.85rem;
}

fieldset[hidden] {
    display: none;
}

.check-list {
    display: grid;
    gap: 0.55rem;
}

.check-row {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.25rem;
}

.button {
    display: inline-block;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-weight: 650;
    padding: 0.65rem 0.9rem;
    text-decoration: none;
}

.button-primary {
    background: var(--primary);
    color: #fff;
}

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

.button-secondary {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

.alert {
    border-radius: 8px;
    margin-bottom: 1rem;
    padding: 0.8rem 1rem;
}

.alert-success {
    background: #e5f4eb;
    border: 1px solid #acd4bb;
    color: var(--success);
}

.alert-error {
    background: #f9e8e7;
    border: 1px solid #e4b5b2;
    color: var(--danger);
}

.error {
    color: var(--danger);
    display: block;
    font-size: 0.9rem;
    margin-top: 0.3rem;
}

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

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

th,
td {
    border-bottom: 1px solid var(--border);
    padding: 0.8rem;
    text-align: left;
    vertical-align: top;
}

th {
    background: var(--surface-muted);
    font-size: 0.9rem;
}

.badge {
    background: var(--surface-muted);
    border-radius: 999px;
    display: inline-block;
    font-size: 0.8rem;
    margin: 0.1rem;
    padding: 0.2rem 0.55rem;
}

.status-active {
    color: var(--success);
    font-weight: 700;
}

.status-inactive {
    color: var(--danger);
    font-weight: 700;
}

.pagination {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
}

.break-word {
    max-width: 28rem;
    overflow-wrap: anywhere;
}

.visually-hidden {
    width: 1px;
    height: 1px;
    position: absolute;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

@media (max-width: 700px) {
    .site-header .container,
    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .site-header .container {
        padding-block: 0.75rem;
    }

    .navigation {
        flex-wrap: wrap;
    }
}
