:root {
    --bg: #edf2f7;
    --surface: #ffffff;
    --surface-muted: #f8fafc;
    --text: #0f172a;
    --muted: #475569;
    --brand: #1e293b;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --danger: #ef4444;
    --success: #22c55e;
    --border: #dbe3ef;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
}

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

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

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

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

.nav-links a {
    color: #fff;
    text-decoration: none;
}

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

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

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

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

.card,
.auth-card {
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    padding: 24px;
}

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

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

.grid-two {
    align-items: start;
    grid-template-columns: 360px 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: top;
}

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

.actions {
    white-space: nowrap;
}

.embed-code {
    display: inline-block;
    white-space: normal;
    line-height: 1.6;
}

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

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

.button-secondary { background: #3b82f6; }
.button-light { background: #8ecae6; color: #0f172a; }
.button-muted { background: #94a3b8; }
.button-danger { background: var(--danger); }

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

.flash-success {
    background: #dcfce7;
    color: #166534;
}

.flash-error {
    background: #fee2e2;
    color: #991b1b;
}

.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;
}

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

small,
.muted,
.card-header p,
.page-heading p {
    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;
}

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

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

    .nav-links {
        flex-wrap: wrap;
    }
}
