:root {
    color-scheme: light;
    --bg: #f5f7f9;
    --surface: #ffffff;
    --border: #d7dde4;
    --text: #15202b;
    --muted: #5f6b7a;
    --accent: #0f6b5f;
    --accent-strong: #0a4f46;
    --danger: #a93226;
    --warning: #8a5a00;
    --inactive: #6d7480;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    letter-spacing: 0;
}

a {
    color: var(--accent-strong);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.brand {
    font-weight: 700;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 24px auto 48px;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.login-panel {
    max-width: 420px;
    margin: 80px auto;
}

h1,
h2 {
    margin: 0 0 16px;
    line-height: 1.2;
}

h1 {
    font-size: 1.7rem;
}

h2 {
    font-size: 1.2rem;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

input[type="email"],
input[type="number"],
input[type="password"],
input[type="text"],
textarea {
    width: 100%;
    min-height: 42px;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font: inherit;
}

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

.field {
    margin-bottom: 14px;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.checkbox-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0 16px;
}

.checkbox-line label {
    margin: 0;
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid var(--accent);
    border-radius: 6px;
    background: var(--accent);
    color: #ffffff;
    font: inherit;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
}

.button.secondary,
button.secondary {
    background: #ffffff;
    color: var(--accent-strong);
}

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

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

.flash {
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 14px;
    border: 1px solid var(--border);
    background: #eef8f5;
}

.flash.error {
    background: #fff0ee;
    border-color: #efb5ad;
}

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

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

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

th {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

code {
    overflow-wrap: anywhere;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 0.92em;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #e7f5ef;
    color: var(--accent-strong);
    font-size: 0.86rem;
    font-weight: 700;
}

.badge.inactive {
    background: #eef0f3;
    color: var(--inactive);
}

.badge.released {
    background: #fff3d8;
    color: var(--warning);
}

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

.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.55fr);
    gap: 20px;
}

.inline-form {
    display: inline;
}

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

    .field-grid,
    .split {
        grid-template-columns: 1fr;
    }

    .container {
        width: min(100% - 20px, 1180px);
        margin-top: 16px;
    }
}
