:root {
    --red: #e53935;
    --dark: #1f2937;
    --muted: #6b7280;
    --line: #e5e7eb;
    --bg: #f6f7fb;
    --panel: #fff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--dark);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

aside {
    position: fixed;
    inset: 0 auto 0 0;
    width: 230px;
    background: #fff;
    border-right: 1px solid var(--line);
    padding: 28px 20px;
}

aside strong {
    display: block;
    color: var(--red);
    font-size: 22px;
    margin-bottom: 28px;
}

nav a {
    display: block;
    padding: 12px 14px;
    border-radius: 9px;
    color: #374151;
    text-decoration: none;
    margin-bottom: 6px;
}

nav a.active,
nav a:hover {
    background: #fee2e2;
    color: var(--red);
}

main {
    margin-left: 230px;
    padding: 32px;
    max-width: 1280px;
}

header {
    margin-bottom: 22px;
}

h1 {
    margin: 0;
    font-size: 28px;
}

h2 {
    margin: 0 0 16px;
}

.panel,
.card,
.login-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.panel {
    padding: 22px;
    margin-bottom: 18px;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.card {
    padding: 20px;
}

.card strong {
    display: block;
    font-size: 30px;
}

.card span,
.muted {
    color: var(--muted);
}

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

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

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

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

a {
    color: #b91c1c;
}

.badge {
    display: inline-block;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    padding: 4px 10px;
    font-size: 13px;
}

.badge.warn {
    background: #fef3c7;
    color: #92400e;
}

.notice {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    border-radius: 10px;
    padding: 12px;
}

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

.detail {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px;
}

.detail span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 4px;
}

.detail strong {
    word-break: break-word;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    align-items: end;
}

label {
    display: block;
    font-weight: 600;
}

input,
select {
    width: 100%;
    margin-top: 6px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

button {
    border: 0;
    border-radius: 9px;
    background: var(--red);
    color: white;
    padding: 11px 16px;
    font-weight: 700;
    cursor: pointer;
}

.secondary {
    background: #374151;
}

.danger {
    background: #991b1b;
    white-space: nowrap;
}

.link-button {
    background: transparent;
    color: #6b7280;
    padding: 12px 14px;
}

.inline-form {
    display: inline-block;
    margin-top: 14px;
    margin-right: 10px;
}

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

.checkbox input {
    width: auto;
    margin: 0;
}

pre {
    background: #111827;
    color: #f9fafb;
    border-radius: 10px;
    padding: 16px;
    overflow: auto;
}

.login-panel {
    max-width: 420px;
    margin: 12vh auto;
    padding: 30px;
}

.login-panel h1 {
    color: var(--red);
    margin-bottom: 22px;
}

.error {
    background: #fee2e2;
    color: #991b1b;
    padding: 10px;
    border-radius: 8px;
}

.table-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.table-links a {
    display: inline-block;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 14px;
    text-decoration: none;
}

.table-links a.active,
.table-links a:hover {
    background: #fee2e2;
    border-color: #fecaca;
    color: var(--red);
}

@media (max-width: 800px) {
    aside {
        position: static;
        width: auto;
    }

    main {
        margin: 0;
        padding: 18px;
    }
}
