:root {
    --bg: #f5f7fa;
    --surface: #ffffff;
    --primary: #0b5ed7;
    --primary-strong: #084298;
    --text: #1a1f2b;
    --muted: #6c757d;
    --border: #d8dee8;
    --success: #198754;
    --error: #dc3545;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
}

.brand {
    font-weight: 700;
}

.page-shell {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.grid.two-up {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.card,
.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
}

.login-card {
    width: min(420px, 100%);
    margin: 5rem auto;
}

.login-card h1 {
    margin-top: 0;
}

button,
input,
select,
textarea {
    font: inherit;
}

label {
    display: block;
    margin-bottom: 1rem;
}

label input,
label select,
label textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    margin-top: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fafbfc;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.25rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    color: #fff;
    background: var(--primary);
    transition: background 0.2s ease;
}

.button.secondary {
    background: #495057;
}

.button.small {
    padding: 0.5rem 0.75rem;
    font-size: 0.92rem;
}

.button:hover,
button:hover {
    background: var(--primary-strong);
}

.button-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.design-list {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.design-row {
    display: grid;
    grid-template-columns: minmax(160px, 2fr) minmax(110px, 1fr) minmax(90px, 1fr) minmax(120px, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
}

.design-row input,
.design-row select {
    width: 100%;
}

.header-row {
    font-weight: 600;
    color: var(--muted);
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border);
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    padding: 0.9rem 0.75rem;
}

tbody td {
    padding: 0.85rem 0.75rem;
    border-bottom: 1px solid #eef1f5;
}

.alert {
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.alert.success {
    background: #d1e7dd;
    color: #0f5132;
}

.alert.error {
    background: #f8d7da;
    color: #842029;
}

.note,
.subtitle {
    color: var(--muted);
    font-size: 0.95rem;
}

@media (max-width: 720px) {
    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}
