:root {
    --bg: #f5f7fa;
    --surface: #ffffff;
    --surface-muted: #edf1f7;
    --text: #12263a;
    --text-muted: #50627a;
    --primary: #006b8f;
    --primary-contrast: #ffffff;
    --radius: 16px;
    --shadow: 0 14px 40px rgba(17, 24, 39, 0.08);
    --danger: #b42318;
    --success: #166534;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Manrope", sans-serif;
    background: radial-gradient(circle at top right, #d7e8f5, var(--bg));
    color: var(--text);
}

main {
    max-width: 1100px;
    margin: 2rem auto 4rem;
    padding: 0 1rem;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.2rem;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(18, 38, 58, 0.08);
}

.brand {
    text-decoration: none;
    color: var(--text);
    font-weight: 800;
    letter-spacing: 0.02em;
}

nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

nav a,
.link-button {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    background: transparent;
    border: 0;
    cursor: pointer;
    font: inherit;
    padding: 0;
}

h1,
h2,
h3 {
    line-height: 1.15;
}

.hero,
.panel,
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero {
    padding: 2rem;
    margin-bottom: 1.4rem;
}

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

.card {
    padding: 1rem;
}

.button,
button,
a.button {
    display: inline-block;
    background: var(--primary);
    color: var(--primary-contrast);
    border: none;
    padding: 0.65rem 1rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
}

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

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

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

.tag {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: var(--surface-muted);
    padding: 0.2rem 0.55rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
}

.filter-row,
.form-grid,
.inline-form-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.form-grid {
    flex-direction: column;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid #d5dbe7;
    border-radius: 12px;
    padding: 0.62rem 0.7rem;
    font: inherit;
    background: #fff;
}

label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-weight: 600;
    color: var(--text);
}

.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.checkbox input {
    width: auto;
}

.help-text {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.flash-stack {
    margin-bottom: 1rem;
    display: grid;
    gap: 0.5rem;
}

.flash {
    margin: 0;
    padding: 0.65rem 0.8rem;
    border-radius: 10px;
    background: #e2e8f0;
    color: var(--text);
    font-weight: 600;
}

.flash-success {
    background: #dcfce7;
    color: var(--success);
}

.flash-error {
    background: #fee2e2;
    color: var(--danger);
}

.errorlist {
    margin: 0;
    padding-left: 1rem;
    color: var(--danger);
    font-size: 0.9rem;
}

.toolbar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

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

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

.section-table th {
    color: var(--text-muted);
}

.section-table tr[draggable="true"] {
    cursor: grab;
}

.section-table tr.dragging {
    opacity: 0.45;
}

.drag-handle {
    user-select: none;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.12em;
}

@media (max-width: 700px) {
    nav {
        gap: 0.7rem;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .hero {
        padding: 1.4rem;
    }
}
