:root {
    --bg: #0f172a;
    --surface: #111827;
    --surface-muted: #1f2937;
    --surface-hover: #27354a;
    --text: #ffffff;
    --muted: #cbd5e1;
    --brand: #0b1220;
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --danger: #ef4444;
    --success: #22c55e;
    --border: #334155;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: linear-gradient(135deg, #0b1120 0%, #0f172a 100%);
    color: var(--text);
}

code {
    font-family: "SFMono-Regular", Consolas, monospace;
    background: var(--surface-muted);
    padding: 2px 6px;
    border-radius: 6px;
    color: #e2e8f0;
}

.topbar {
    background: var(--brand);
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 28px;
    border-bottom: 1px solid var(--border);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.brand-link {
    color: #fff;
    text-decoration: none;
}

.brand {
    font-size: 1.45rem;
    font-weight: 700;
}

.language-switcher {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 0.95rem;
    color: var(--muted);
}

.language-switcher a,
.nav-links a {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
}

.nav-links {
    display: flex;
    gap: 16px;
}

.container {
    max-width: 1180px;
    margin: 24px auto;
    padding: 0 16px 40px;
}

.page-heading,
.card-header,
.form-actions,
.grid-two,
.inline-actions {
    display: flex;
    gap: 16px;
}

.page-heading,
.card-header,
.inline-actions {
    justify-content: space-between;
    align-items: center;
}

.page-heading {
    margin-bottom: 20px;
}

.card,
.auth-card {
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 16px 32px rgba(2, 6, 23, 0.35);
    border: 1px solid var(--border);
    padding: 24px;
}

.compact-card {
    max-width: 500px;
}

.auth-card {
    margin: 80px auto 0;
}

.grid-two {
    align-items: start;
    grid-template-columns: 380px 1fr;
    display: grid;
}

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

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

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

thead th {
    background: var(--surface-muted);
    color: #dbeafe;
}

tbody tr:hover {
    background: rgba(59, 130, 246, 0.08);
}

.actions,
.inline-form,
.user-action-group {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.user-action-group {
    justify-content: flex-end;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 15px;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    border: 0;
    text-decoration: none;
    cursor: pointer;
    font-weight: 700;
    white-space: nowrap;
}

.button:hover {
    background: var(--primary-dark);
}

.button-secondary { background: #1d4ed8; }
.button-light { background: #0ea5e9; color: #0f172a; }
.button-muted { background: #64748b; }
.button-danger { background: var(--danger); }

.flash {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 12px;
    font-weight: 700;
}

.flash-success {
    background: rgba(34, 197, 94, 0.2);
    color: #bbf7d0;
    border: 1px solid rgba(34, 197, 94, 0.5);
}

.flash-error {
    background: rgba(239, 68, 68, 0.2);
    color: #fecaca;
    border: 1px solid rgba(239, 68, 68, 0.5);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.single-column {
    grid-template-columns: 1fr;
}

label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-weight: 700;
    color: #dbeafe;
}

input,
select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    font: inherit;
    background: #0f172a;
    color: #fff;
}

input::placeholder {
    color: #94a3b8;
}

small,
.muted,
.card-header p,
.page-heading p,
.muted-inline {
    color: var(--muted);
    font-weight: 400;
}

.full-width {
    grid-column: 1 / -1;
}

.preview-box {
    border: 4px solid;
    border-radius: 16px;
    padding: 20px;
}

.preview-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 14px;
}

.preview-bar,
.preview-accent {
    height: 12px;
    border-radius: 999px;
    margin-top: 12px;
}

.empty-state {
    padding: 24px;
    text-align: center;
    background: var(--surface-muted);
    border-radius: 12px;
}

.form-logo-preview {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 10px;
    margin-top: 10px;
}

.photo-preview-block {
    display: flex;
    gap: 12px;
    align-items: center;
}

.radio-title-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

@media (max-width: 900px) {
    .form-grid,
    .grid-two {
        grid-template-columns: 1fr;
    }

    .page-heading,
    .card-header,
    .topbar,
    .topbar-right,
    .inline-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-links,
    .actions,
    .user-action-group {
        flex-wrap: wrap;
        justify-content: flex-start;
    }
}
