:root {
    --bg: #eef3fa;
    --paper: #ffffff;
    --text: #1e2430;
    --muted: #5f6b7f;
    --line: #d4dfeb;
    --brand: #0f3557;
    --brand-strong: #0b2640;
    --link: #0a66b8;
    --ok: #268c4c;
    --ok-strong: #1f723d;
    --danger: #bf2638;
    --danger-strong: #9a1d2c;
    --secondary: #697487;
    --secondary-strong: #525d70;
    --radius: 12px;
    --shadow: 0 10px 24px rgba(15, 53, 87, 0.1);
}

* {
    box-sizing: border-box;
}

body {
    font-family: "Trebuchet MS", "Segoe UI", "Helvetica Neue", sans-serif;
    background: linear-gradient(180deg, #f4f8fd 0%, #e9f1fb 45%, #eef3fa 100%);
    color: var(--text);
    margin: 0;
    padding: 0;
    line-height: 1.45;
}

.topbar {
    background: linear-gradient(120deg, var(--brand) 0%, #134974 100%);
    color: #fff;
    margin-bottom: 12px;
    box-shadow: 0 4px 18px rgba(11, 38, 64, 0.28);
}

.topbar-inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding-top: 12px;
    padding-bottom: 12px;
}

.brand {
    color: #fff;
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: 0.02em;
}

.brand:hover {
    text-decoration: none;
}

.topnav {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100%;
}

.topnav a {
    display: block;
    color: #eaf4ff;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
}

.topnav a:hover {
    background: rgba(255, 255, 255, 0.16);
    text-decoration: none;
}

.topnav form {
    margin: 0;
}

.container {
    width: min(100%, 52rem);
    margin: 0 auto;
    padding: 14px;
}

h1,
h2 {
    color: var(--text);
    line-height: 1.2;
}

h1 {
    margin-top: 10px;
    font-size: 1.45rem;
}

h2 {
    margin-top: 24px;
    font-size: 1.15rem;
}

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

a:hover {
    text-decoration: underline;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    background-color: var(--link);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 700;
    transition: background-color 0.2s ease;
}

.btn-small {
    min-height: 38px;
    padding: 8px 12px;
    font-size: 0.9rem;
}

.btn:hover {
    background-color: #0a5798;
    text-decoration: none;
}

.btn-success {
    background-color: var(--ok);
}

.btn-success:hover {
    background-color: var(--ok-strong);
}

.btn-danger {
    background-color: var(--danger);
}

.btn-danger:hover {
    background-color: var(--danger-strong);
}

.btn-secondary {
    background-color: var(--secondary);
}

.btn-secondary:hover {
    background-color: var(--secondary-strong);
}

.items-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
}

.items-list li {
    background-color: var(--paper);
    padding: 14px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.items-list a {
    font-weight: 700;
}

.items-list small {
    display: block;
    color: var(--muted);
    margin-top: 6px;
    font-size: 0.92rem;
}

.items-list form {
    margin-top: 10px;
}

.form-group {
    margin-bottom: 16px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
    color: var(--text);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-sizing: border-box;
    font-family: "Trebuchet MS", "Segoe UI", "Helvetica Neue", sans-serif;
    font-size: 1rem;
    background: #fff;
}

select[multiple] {
    min-height: 128px;
}

textarea {
    resize: vertical;
    min-height: 130px;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="datetime-local"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--link);
    box-shadow: 0 0 0 3px rgba(10, 102, 184, 0.18);
}

.form-container,
.item-container {
    background-color: var(--paper);
    padding: 14px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.item-date {
    color: var(--muted);
    font-size: 0.92rem;
    margin-bottom: 14px;
}

.item-description {
    line-height: 1.6;
    white-space: pre-wrap;
    margin: 12px 0;
    color: var(--text);
}

.button-group {
    margin-top: 16px;
    display: grid;
    gap: 10px;
}

.button-group form {
    display: block;
    margin: 0;
}

.error {
    color: var(--danger);
    font-size: 0.9rem;
    margin-top: 5px;
}

.inline {
    display: flex;
    align-items: center;
    gap: 10px;
}

.inline input[type="checkbox"] {
    width: auto;
    min-height: 0;
}

.flash-stack {
    margin-bottom: 14px;
}

.alert {
    padding: 12px;
    margin-bottom: 12px;
    border-radius: 10px;
    border: 1px solid transparent;
}

.alert-info {
    background-color: #dff1f6;
    color: #154d57;
    border-color: #bddfe8;
}

.alert-success {
    background-color: #d8efdf;
    color: #1b5b31;
    border-color: #b9e2c5;
}

.alert-error {
    background-color: #f7dde0;
    color: #6d1d27;
    border-color: #efbcc3;
}

@media (min-width: 760px) {
    .topbar {
        margin-bottom: 18px;
    }

    .topbar-inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        min-height: 66px;
        gap: 14px;
    }

    .topnav {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: max-content;
        align-items: center;
        justify-content: end;
        width: auto;
    }

    .topnav a {
        padding: 8px 10px;
        background: transparent;
    }

    .topnav a:hover {
        background: rgba(255, 255, 255, 0.12);
    }

    .container {
        padding: 20px;
    }

    .btn {
        width: auto;
    }

    .button-group {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
    }

    .button-group form {
        margin-right: 10px;
    }
}
