* { box-sizing: border-box; }
:root {
    color-scheme: light;
    --ink: #161b29;
    --muted: #535e72;
    --line: #d9dfeb;
    --accent: #4436ce;
    --surface: #fff;
    font: 16px/1.5 system-ui, sans-serif;
    color: var(--ink);
    background: #eef2f8;
}
body { margin: 0; }
.admin { display: grid; grid-template-columns: 14rem minmax(0, 1fr); min-height: 100vh; }
.sidebar { display: flex; flex-direction: column; gap: 2rem; padding: 1.5rem 1rem; background: #202430; color: white; }
.brand { padding-inline: .65rem; color: inherit; font-size: 1.6rem; font-weight: 750; text-decoration: none; }
.sidebar nav { display: grid; gap: .35rem; }
.sidebar nav a, .logout { display: block; color: white; text-decoration: none; padding: .65rem .8rem; border-radius: .55rem; }
.sidebar nav a:hover, .logout:hover { background: #333949; color: white; }
.sidebar nav a[aria-current] { background: var(--accent); }
.sidebar form { margin-top: auto; }
.logout { background: transparent; border-color: transparent; }
.workspace { width: 100%; max-width: 85rem; padding: clamp(1rem, 4vw, 3rem); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 1rem; }
h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); letter-spacing: -.035em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.1rem; }
.panel, .recipient, .table-wrap, .login-card, .empty {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: .8rem;
    padding: clamp(1rem, 2.5vw, 1.5rem);
    margin-bottom: 1rem;
}
.panel .recipient { background: #f8fafc; }
.layout { display: grid; grid-template-columns: minmax(13rem, 1fr) minmax(0, 2.5fr); gap: 1rem; align-items: start; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
label { display: block; font-weight: 650; }
input:not([type=hidden]), textarea, select {
    display: block; width: 100%; margin: .3rem 0 .9rem; padding: .6rem .75rem;
    border: 1px solid #aab4c6; border-radius: .45rem; background: white; color: inherit; font: inherit;
}
input[type=file] { background: #f3f6fb; }
textarea { resize: vertical; }
button, .button { border: 1px solid var(--accent); border-radius: .5rem; background: white; color: var(--accent); padding: .55rem .9rem; font: inherit; font-weight: 650; cursor: pointer; text-decoration: none; }
button:hover, .button:hover { background: #ebe8ff; }
button[type=submit]:not(.logout):not(.danger), .primary { background: var(--accent); color: white; }
.danger { color: #9d202d; border-color: #d38c95; margin-bottom: 1rem; }
:focus-visible { outline: 3px solid #7668f7; outline-offset: 3px; }
.actions, .tabs, .picker, .recipient-title { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; }
.actions .primary { margin-inline-start: auto; }
.recipient-title { justify-content: space-between; margin-bottom: 1rem; }
.recipient-title h2, .picker select { margin: 0; }
.picker select { flex: 1 1 16rem; }
.list-link, .tabs a { display: block; padding: .55rem .75rem; color: var(--ink); text-decoration: none; border-radius: .45rem; overflow-wrap: anywhere; }
.list-link.active, .tabs a.active { background: #e7e3ff; color: #3326a6; font-weight: 650; }
.layout form + h3, .tabs { margin: 1rem 0; }
.table-wrap { overflow: auto; padding: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .8rem 1rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #f8fafc; }
td:first-child { white-space: nowrap; }
code { white-space: pre-wrap; overflow-wrap: anywhere; }
.badge { display: inline-block; padding: .15rem .55rem; border-radius: 1rem; background: #fce7eb; color: #8b1d2b; white-space: nowrap; }
.badge.ok, .notice { background: #def7eb; color: #11603f; }
.badge.blocked { background: #fff1cc; color: #805000; }
.notice, .error { margin-bottom: 1rem; padding: .75rem; border-radius: .5rem; }
.error { background: #fce7eb; color: #8b1d2b; }
.login { display: grid; min-height: 100vh; place-items: center; padding: 1rem; }
.login-card { width: min(100%, 28rem); }
.login-card button { width: 100%; }
.hint { color: var(--muted); }
@media (max-width: 760px) {
    .admin, .layout, .field-grid { grid-template-columns: minmax(0, 1fr); }
    .sidebar { gap: .6rem; }
    .sidebar nav { display: flex; flex-wrap: wrap; }
}

.admin { grid-template-columns: 14rem minmax(0, 1fr) 13rem; grid-template-areas: "nav main release"; }
.sidebar { grid-area: nav; }
.workspace { grid-area: main; }
.release { grid-area: release; align-self: start; margin: clamp(1rem, 4vw, 3rem) 1rem 1rem 0; }
.release p { margin: .5rem 0; }
@media (max-width: 980px) {
    .admin { grid-template-columns: 14rem minmax(0, 1fr); grid-template-areas: "nav main" "nav release"; grid-template-rows: 1fr auto; }
    .release { margin: 0 1rem 1rem; }
}
@media (max-width: 760px) {
    .admin { grid-template-columns: minmax(0, 1fr); grid-template-areas: "nav" "main" "release"; grid-template-rows: auto 1fr auto; }
}


/* Shared admin theme */
:root {
    --ink: #18181b;
    --muted: #52525b;
    --line: #e4e4e7;
    --accent: #946200;
    --accent-surface: #fff5db;
    --action: #f6bb45;
    background: #fafafa;
}
.sidebar { background: #fff; color: var(--ink); border-inline-end: 1px solid var(--line); }
.brand { letter-spacing: -.035em; }
.sidebar nav a, .logout { color: var(--muted); font-weight: 600; }
.sidebar nav a:hover, .logout:hover { background: #f4f4f5; color: var(--ink); }
.sidebar nav a[aria-current], .list-link.active, .tabs a.active {
    background: var(--accent-surface);
    color: #744b00;
    font-weight: 700;
}
.sidebar form { padding-top: .75rem; border-top: 1px solid var(--line); }
.panel, .recipient, .table-wrap, .login-card, .empty {
    box-shadow: 0 1px 2px rgb(24 24 27 / .06);
    border-radius: .85rem;
}
.recipient-title { border-bottom: 1px solid var(--line); padding-bottom: .85rem; }
input:not([type=hidden]), textarea, select { border-color: #d4d4d8; }
input[type=file], th, .panel .recipient { background: #fafafa; }
input::file-selector-button {
    background: white; color: var(--ink); border: 1px solid #d4d4d8;
    border-radius: .4rem; font: inherit; padding: .25rem .65rem; margin-inline-end: .65rem; cursor: pointer;
}
button, .button { color: var(--ink); border-color: #d4d4d8; }
button:hover, .button:hover { background: #f4f4f5; }
button[type=submit]:not(.logout):not(.danger), .primary {
    background: var(--action); border-color: #db9d26; color: #302000;
}
button[type=submit]:not(.logout):not(.danger):hover { background: #efad2c; }
.logout, .attachment-toggle { border-color: transparent; }
.attachment-toggle { color: #744b00; }
.attachment-toggle:hover { background: var(--accent-surface); }
.extra-attachment label { margin-top: .6rem; }
[hidden] { display: none !important; }
:focus-visible { outline-color: #ae7605; }
.danger { color: #9d202d; border-color: #d38c95; }
.release h2 { font-size: .9rem; }
.release p, .release dt { font-size: .875rem; color: var(--muted); }
.login { background: radial-gradient(ellipse at top, #fff5db, #fafafa 55%); }
@media (max-width: 760px) {
    .sidebar { border-inline-end: 0; border-bottom: 1px solid var(--line); }
}

