:root {
    --bg: #0f172a;
    --card: #111827;
    --muted: #94a3b8;
    --accent: #38bdf8;
    --accent-strong: #0ea5e9;
    --text: #e5e7eb;
    --border: #1f2937;
    --danger: #f87171;
    --success: #34d399;
    --warning: #facc15;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Inter", system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #0b1021, #111827 35%, #0b1021);
    color: var(--text);
    min-height: 100vh;
    padding: 32px 24px 48px;
}

a {
    color: inherit;
}

.admin-shell {
    width: min(1100px, 100%);
    margin: 0 auto;
    background: rgba(17, 24, 39, 0.88);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 28px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(6px);
}

.page-header {
    margin-bottom: 24px;
}

h1 {
    margin: 0 0 8px;
    font-size: clamp(24px, 3vw, 32px);
    letter-spacing: -0.02em;
}

h2 {
    margin: 0 0 10px;
    font-size: 18px;
}

.muted {
    color: var(--muted);
    font-size: 14px;
    margin: 0;
    line-height: 1.6;
}

.helper-text {
    color: var(--muted);
    font-size: 13px;
    margin-top: 6px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
    transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.card:hover {
    transform: translateY(-2px);
    border-color: rgba(56, 189, 248, 0.35);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.3);
}

.status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    background: rgba(148, 163, 184, 0.2);
    color: var(--text);
    margin-right: 8px;
}

.status.ok {
    background: rgba(52, 211, 153, 0.2);
    color: #a7f3d0;
}

.status.ko {
    background: rgba(248, 113, 113, 0.2);
    color: #fecaca;
}

.status.pending {
    background: rgba(250, 204, 21, 0.2);
    color: #fde68a;
}

button,
.button-link,
.download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: var(--accent-strong);
    color: #0b1120;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: transform 120ms ease, background 120ms ease, box-shadow 120ms ease;
    box-shadow: 0 10px 20px rgba(14, 165, 233, 0.25);
}

button:hover:not(:disabled),
.button-link:hover,
.download:hover {
    transform: translateY(-1px);
    background: #38bdf8;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

button:focus-visible,
.button-link:focus-visible,
.download:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.links ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
    display: grid;
    gap: 8px;
}

.links li {
    margin: 0;
}

.field {
    margin-bottom: 16px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 12px;
}

.list-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

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

input[type="text"],
textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #0f172a;
    color: var(--text);
}

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

input[type="number"],
input[type="date"],
select {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #0f172a;
    color: var(--text);
}

select {
    appearance: none;
}

input::placeholder,
textarea::placeholder {
    color: rgba(148, 163, 184, 0.7);
}

.status-row {
    margin-top: 16px;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.label {
    font-weight: 600;
}

.value {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.7);
    min-width: 72px;
    text-align: center;
    font-weight: 600;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

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

.table th {
    text-align: left;
    color: var(--muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.table tbody tr:hover {
    background: rgba(148, 163, 184, 0.08);
}

.notice {
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
}

.notice.success {
    background: rgba(52, 211, 153, 0.15);
    color: #a7f3d0;
}

.notice.error {
    background: rgba(248, 113, 113, 0.15);
    color: #fecaca;
}

.filter-form {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    align-items: end;
    margin-bottom: 16px;
}

.filter-form .actions {
    margin-top: 0;
}

.inline-form {
    display: grid;
    gap: 8px;
}

.log-block {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    font-family: "JetBrains Mono", "Fira Code", monospace;
    max-height: 480px;
    overflow: auto;
    white-space: pre-wrap;
    font-size: 12px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.12);
    color: #bae6fd;
    font-size: 12px;
    font-weight: 600;
}

.value.ok {
    background: rgba(52, 211, 153, 0.15);
    border-color: rgba(52, 211, 153, 0.5);
    color: #a7f3d0;
}

.value.ko {
    background: rgba(248, 113, 113, 0.15);
    border-color: rgba(248, 113, 113, 0.5);
    color: #fecaca;
}

.audio-block {
    margin-top: 16px;
    display: none;
}

.detail,
.meta,
.status {
    line-height: 1.6;
}

.meta,
.detail,
.status {
    font-size: 14px;
}

.error {
    color: #fecaca;
}

.download {
    background: #1f2937;
    color: var(--text);
    box-shadow: none;
    margin-left: 10px;
}

.download:hover {
    background: #334155;
}

.card p {
    color: var(--muted);
    margin: 8px 0 12px;
    line-height: 1.6;
}

.card .message {
    color: var(--text);
}

.feedback {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.7);
    margin: 0 0 16px;
}

.feedback.success {
    border-color: rgba(52, 211, 153, 0.5);
    color: #a7f3d0;
}

.feedback.error {
    border-color: rgba(248, 113, 113, 0.5);
    color: #fecaca;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    font-size: 14px;
}

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

.table th {
    text-align: left;
    background: rgba(15, 23, 42, 0.8);
    color: var(--muted);
    font-weight: 600;
}

@media (max-width: 600px) {
    body {
        padding: 24px 16px 32px;
    }

    .admin-shell {
        padding: 22px;
    }
}
