:root {
    --navy: #090747;
    --blue: #1312c6;
    --bg: #181818;
    --surface: #242424;
    --surface-raised: #2d2d2d;
    --text: #ededed;
    --muted: #a4a4a4;
    --border: #414141;
    --green: #49b675;
    --red: #d45149
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Mulish,system-ui,-apple-system,sans-serif
}

a {
    color: inherit
}

.topnav {
    height: 52px;
    padding: 0 22px;
    display: flex;
    align-items: center;
    color: var(--text);
    background: #242424;
    border-bottom: 1px solid #0f0f0f;
    gap: 20px
}

.brand {
    font-size: 15px;
    font-weight: 800;
    text-decoration: none
}

.topnav .spacer {
    flex: 1
}

.topnav a {
    color: #ccc;
    text-decoration: none;
    font-size: 13px
}

.topnav a:hover {
    color: #fff
}

.nav-user {
    font-size: 12px;
    color: var(--muted)
}

.theme-toggle {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text);
    background: var(--surface-raised);
    cursor: pointer
}

.container {
    width: min(1220px,calc(100% - 48px));
    margin: 38px auto
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 12px 36px rgba(0,0,0,.18);
    padding: 24px
}

.login {
    width: min(440px,calc(100% - 32px));
    margin: 10vh auto
}

.login h1 {
    margin-top: 0
}

.field {
    display: grid;
    gap: 7px;
    margin: 16px 0
}

.field label {
    font-size: 13px;
    font-weight: 700
}

.field input,.field select {
    width: 100%;
    padding: 11px 12px;
    color: var(--text);
    background: #1d1d1d;
    border: 1px solid var(--border);
    border-radius: 5px;
    font: inherit
}

.field input:focus,.field select:focus {
    border-color: var(--blue);
    outline: 2px solid rgba(19,18,198,.2)
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--blue);
    border-radius: 5px;
    padding: 9px 14px;
    background: var(--blue);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none
}

.button:hover {
    filter: brightness(1.08)
}

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

.button.danger {
    background: var(--red);
    border-color: var(--red)
}

.button.small {
    padding: 7px 10px;
    font-size: 12px
}

.header-row {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 22px
}

.header-row h1 {
    font-size: 27px;
    margin: 0
}

.header-row .spacer {
    flex: 1
}

.flash,.error {
    padding: 12px 14px;
    border-radius: 5px;
    margin: 14px 0
}

.error {
    background: #54201d;
    color: #ffb5af
}

.flash {
    background: #193c27;
    color: #a5edbf
}

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

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

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

tbody tr {
    transition: background .12s ease
}

tbody tr:hover {
    background: rgba(255,255,255,.025)
}

th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted)
}

.badge {
    display: inline-block;
    border-radius: 3px;
    padding: 5px 9px;
    font-size: 11px;
    font-weight: 800;
    background: #493b19;
    color: #ffd77a
}

.badge.done {
    background: #193c27;
    color: #8ee5ad
}

.actions {
    display: flex;
    gap: 7px;
    flex-wrap: wrap
}

.empty {
    text-align: center;
    padding: 55px 20px
}

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

.inline .field {
    flex: 1
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.68);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(3px)
}

.modal.open {
    display: flex
}

.modal .card {
    width: min(480px,100%)
}

html[data-theme="light"] {
    --bg: #ededed;
    --surface: #fff;
    --surface-raised: #f5f5f5;
    --text: #222;
    --muted: #686868;
    --border: #cdcdcd
}

html[data-theme="light"] .topnav {
    background: #f5f5f5;
    border-bottom-color: #c7c7c7
}

html[data-theme="light"] .topnav a {
    color: #444
}

html[data-theme="light"] .topnav a:hover {
    color: #000
}

html[data-theme="light"] .field input,html[data-theme="light"] .field select {
    background: #fff
}

html[data-theme="light"] tbody tr:hover {
    background: rgba(0,0,0,.025)
}

html[data-theme="light"] .badge {
    background: #fff0c9;
    color: #855400
}

html[data-theme="light"] .badge.done {
    background: #dcfae6;
    color: #166534
}

@media(max-width: 750px) {
    .container {
        width:min(100% - 20px,1180px);
        margin: 20px auto
    }

    .topnav {
        padding: 0 12px;
        gap: 10px
    }

    .topnav>a:not(.brand) {
        display: none
    }

    .nav-user {
        display: none
    }

    table thead {
        display: none
    }

    table,tr,td {
        display: block
    }

    tr {
        padding: 14px 0;
        border-bottom: 1px solid var(--border)
    }

    td {
        border: 0;
        padding: 5px 0
    }

    .header-row {
        align-items: flex-start;
        flex-wrap: wrap
    }
}
