:root {
    --bg: #0b1020;
    --panel: #111827;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --line: #e5e7eb;
    --accent: #ef233c;
    --accent2: #ff4d5e;
    --success: #16a34a;
    --danger: #dc2626;
    --shadow: 0 20px 60px rgba(15, 23, 42, .12);
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: #f4f7fb;
}
a { color: inherit; text-decoration: none; }
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 20% 10%, rgba(239, 35, 60, .35), transparent 32%),
        radial-gradient(circle at 80% 70%, rgba(59, 130, 246, .24), transparent 32%),
        var(--bg);
    padding: 24px;
}
.login-card {
    width: min(420px, 100%);
    background: rgba(255, 255, 255, .95);
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 28px;
    padding: 34px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .28);
    backdrop-filter: blur(14px);
}
.login-mark, .brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    font-weight: 900;
}
.login-card h1 { margin: 18px 0 26px; font-size: 30px; }
.shell { min-height: 100vh; display: flex; }
.sidebar {
    width: 260px;
    background: var(--panel);
    color: #fff;
    padding: 26px;
    position: sticky;
    top: 0;
    height: 100vh;
}
.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 30px; }
.brand-title { font-weight: 900; font-size: 19px; }
.brand-subtitle { color: #94a3b8; font-size: 13px; margin-top: 2px; }
.nav { display: grid; gap: 8px; }
.nav a {
    color: #cbd5e1;
    padding: 12px 14px;
    border-radius: 14px;
    transition: .18s ease;
}
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.content { flex: 1; padding: 34px; max-width: 1200px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
h1 { margin: 0; font-size: 32px; letter-spacing: -.03em; }
h2 { margin: 0 0 18px; font-size: 20px; letter-spacing: -.02em; }
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 22px;
}
.card.narrow { max-width: 560px; }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
label { display: block; font-weight: 700; font-size: 13px; margin: 0 0 8px; }
input[type="text"], input[type="password"], input[type="url"], input[type="date"], input[type="file"] {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 13px 14px;
    font: inherit;
    outline: none;
    background: #fff;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(239, 35, 60, .12); }
button, .secondary, .small, .api-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 14px;
    padding: 12px 16px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
}
button:hover, .secondary:hover, .small:hover, .api-link:hover { filter: brightness(.96); }
.secondary { background: #e2e8f0; color: #0f172a; }
.danger { background: var(--danger); color: #fff; }
.small { padding: 8px 11px; border-radius: 11px; font-size: 13px; }
.actions { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
.checkline { display: inline-flex; align-items: center; gap: 10px; margin-top: 18px; color: var(--muted); }
.alert { padding: 13px 16px; border-radius: 14px; margin: 0 0 18px; font-weight: 700; }
.alert.success { color: #166534; background: #dcfce7; }
.alert.error { color: #991b1b; background: #fee2e2; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 13px 15px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; background: #f8fafc; }
tr:last-child td { border-bottom: 0; }
.right { text-align: right; }
.action-buttons { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.action-buttons form { display: inline; margin: 0; }
code, .json-preview { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.pill { display: inline-flex; border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 800; }
.pill.on { color: #166534; background: #dcfce7; }
.pill.off { color: #991b1b; background: #fee2e2; }
.empty { color: var(--muted); padding: 18px; text-align: center; border: 1px dashed var(--line); border-radius: 16px; }
.preview-box {
    height: 190px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: #0f172a;
    display: grid;
    place-items: center;
    overflow: hidden;
    margin-bottom: 12px;
}
.preview-box img { max-width: 100%; max-height: 100%; display: block; }
.background-preview img { width: 100%; height: 100%; object-fit: cover; }
.small-empty { margin-bottom: 12px; }
@media (max-width: 900px) {
    .shell { display: block; }
    .sidebar { width: 100%; height: auto; position: static; }
    .nav { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .content { padding: 22px; }
    .grid.two, .grid.three { grid-template-columns: 1fr; }
    .topbar { display: block; }
}
@media (max-width: 620px) {
    .nav { grid-template-columns: 1fr 1fr; }
    .action-buttons { justify-content: flex-start; flex-wrap: wrap; }
}
