:root {
    --bg: #0f1329;
    --surface: #ffffff;
    --surface-alt: #eef3ff;
    --text: #1c1f3f;
    --muted: #51607d;
    --border: #d6def8;
    --accent: #00a9f4;
    --accent-strong: #0087d3;
    --accent-secondary: #9a1aff;
    --accent-soft: #50e3c2;
    --danger: #c0394f;
    --success: #178f70;
    --shadow: 0 18px 42px rgba(18, 9, 44, 0.14);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Avenir Next", "Montserrat", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top right, rgba(154, 26, 255, 0.26), transparent 28%),
        radial-gradient(circle at top left, rgba(0, 169, 244, 0.2), transparent 30%),
        linear-gradient(180deg, #161c42 0%, #12092c 100%);
    color: #eef3ff;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.site-header {
    background: rgba(18, 9, 44, 0.82);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    z-index: 10;
}

.nav {
    max-width: 1120px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}

.brand {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.03em;
    color: #fff;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.nav-links a,
.button-secondary,
button {
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 0.7rem 1rem;
    font: inherit;
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.nav-links a,
.button-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: #eef3ff;
    border-color: rgba(255, 255, 255, 0.08);
}

.nav-links a.active {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
    color: #fff;
    box-shadow: 0 10px 24px rgba(0, 169, 244, 0.28);
}

button {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(0, 169, 244, 0.24);
}

.nav-links a:hover,
.button-secondary:hover,
button:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

button:hover {
    background: linear-gradient(135deg, var(--accent-strong) 0%, #7e18d3 100%);
}

.button-secondary {
    display: inline-flex;
    align-items: center;
}

.page {
    max-width: 1120px;
    margin: 0 auto;
    padding: 1.5rem 1rem 4rem;
}

.page-head {
    margin-bottom: 1.25rem;
}

.page-head .button-secondary {
    margin-top: 0.4rem;
}

.page-head h1 {
    margin-bottom: 0.35rem;
}

.page-head p,
.meta-note,
small {
    color: #c8d2ee;
}

.card,
.auth-card,
.stat-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 249, 255, 0.96) 100%);
    border: 1px solid rgba(214, 222, 248, 0.72);
    border-radius: 20px;
    box-shadow: var(--shadow);
    color: var(--text);
}

.auth-card {
    max-width: 460px;
    margin: 3rem auto;
    padding: 2.2rem;
}

.card {
    padding: 1.25rem;
}

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

.form-grid,
.filters-grid,
.stats-grid,
.summary-columns {
    display: grid;
    gap: 1rem;
}

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

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

.filters-grid .wide {
    grid-column: span 2;
}

.actions-row {
    display: flex;
    gap: 0.75rem;
    align-items: end;
}

label,
fieldset {
    display: grid;
    gap: 0.4rem;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.75rem 0.85rem;
    font: inherit;
    background: #fff;
    color: var(--text);
}

fieldset {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1rem;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.6rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    background: var(--surface-alt);
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.checkbox-label input {
    width: auto;
}

.alert {
    border-radius: 14px;
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
}

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

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

.field-error {
    color: var(--danger);
}

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

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

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

th {
    color: var(--muted);
    font-size: 0.92rem;
}

tr:hover td {
    background: rgba(80, 227, 194, 0.06);
}

.pagination {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}

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

.stat-card {
    padding: 1.2rem;
    display: grid;
    gap: 0.5rem;
}

.stat-card span {
    color: var(--muted);
}

.stat-card strong {
    font-size: 1.8rem;
    color: var(--text);
}

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

.site-footer {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
    color: #c8d2ee;
}

input:focus,
select:focus,
textarea:focus,
button:focus,
.button-secondary:focus,
.nav-links a:focus {
    outline: 2px solid rgba(0, 169, 244, 0.4);
    outline-offset: 2px;
    border-color: rgba(0, 169, 244, 0.45);
}

@media (max-width: 768px) {
    .nav {
        align-items: flex-start;
        flex-direction: column;
    }

    .filters-grid .wide {
        grid-column: span 1;
    }

    .actions-row {
        align-items: stretch;
        flex-direction: column;
    }
}
