* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    line-height: 1.5;
    color: #1c2733;
    background: #f4f6f8;
}

.site-header {
    background: #ffffff;
    border-bottom: 1px solid #dde3e9;
}

.site-header nav {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.brand {
    font-weight: 700;
    text-decoration: none;
    color: #1c2733;
}

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

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

.site-footer {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem;
    color: #66707a;
    font-size: 0.85rem;
}

a { color: #0b5fa5; }

h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }

.card {
    background: #ffffff;
    border: 1px solid #dde3e9;
    border-radius: 8px;
    padding: 1.25rem;
    margin: 1rem 0;
}

form.card { max-width: 34rem; }

label { display: block; margin: 0.75rem 0; }
label.radio { font-weight: normal; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"],
select,
textarea {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.5rem;
    border: 1px solid #b8c2cc;
    border-radius: 4px;
    font: inherit;
}

button {
    font: inherit;
    padding: 0.5rem 1.25rem;
    border: none;
    border-radius: 4px;
    background: #0b5fa5;
    color: #ffffff;
    cursor: pointer;
}

button:disabled { opacity: 0.6; cursor: default; }

button.linklike {
    background: none;
    color: #0b5fa5;
    padding: 0;
    text-decoration: underline;
}

button.danger { color: #b02a37; }

.inline { display: inline; }

.muted { color: #66707a; font-size: 0.9rem; }

.flash {
    padding: 0.65rem 1rem;
    border-radius: 4px;
    margin: 0.75rem 0;
}

.flash-info { background: #e2ecf5; }
.flash-success { background: #ddf2e2; }
.flash-error { background: #f8dfe2; }

.home-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 1.5rem;
    align-items: start;
}

.home-grid h1 { margin-top: 0.5rem; }

.feature-list {
    margin: 0.5rem 0 1rem;
    padding-left: 1.25rem;
}

.feature-list li { margin: 0.35rem 0; }

a.button {
    display: inline-block;
    background: #0b5fa5;
    color: #ffffff;
    padding: 0.5rem 1.25rem;
    border-radius: 4px;
    text-decoration: none;
}

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

.table-wrap {
    overflow-x: auto;
    margin: 1rem 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border: 1px solid #dde3e9;
    border-radius: 8px;
}

.table-wrap table { margin: 0; }

th, td {
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #eef1f4;
    font-size: 0.92rem;
    word-break: break-word;
}

th { background: #f8fafb; }

td.actions { white-space: nowrap; }
td.actions form { margin-left: 0.5rem; }

code {
    background: #eef1f4;
    padding: 0.15rem 0.35rem;
    border-radius: 3px;
    word-break: break-all;
}

.progress {
    height: 10px;
    background: #eef1f4;
    border-radius: 5px;
    overflow: hidden;
    margin: 0.75rem 0 0.25rem;
}

.progress-bar {
    height: 100%;
    width: 0;
    background: #0b5fa5;
    transition: width 0.15s ease;
}

@media (max-width: 700px) {
    .table-wrap { overflow-x: visible; }

    table, tbody, tr, td { display: block; width: 100%; }
    thead { display: none; }

    table {
        border: none;
        background: none;
    }

    tr {
        background: #ffffff;
        border: 1px solid #dde3e9;
        border-radius: 8px;
        margin-bottom: 0.75rem;
        padding: 0.25rem 0.75rem;
    }

    td {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 1rem;
        padding: 0.4rem 0;
        border-bottom: 1px solid #eef1f4;
    }

    tr td:last-child { border-bottom: none; }

    td::before {
        content: attr(data-label);
        font-weight: 600;
        flex-shrink: 0;
    }

    td[data-label=""]::before { display: none; }

    td.actions {
        white-space: normal;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    td.actions form { margin-left: 0; }
}
