:root {
    --bg:#0d0d0f;
    --surface:#161618;
    --surface2:#1e1e22;
    --border:#2e2e36;
    --text:#f0f0f2;
    --muted:#9898a8;
    --accent:#ff5c5c;
    --accent2:#ff8c42;
    --green:#4caf50;
    --danger:#d9534f;
}

* {
    box-sizing:border-box;
}

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

a {
    color:inherit;
}

.topbar {
    height:60px;
    background:var(--surface);
    border-bottom:1px solid var(--border);
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:0 24px;
}

.logo {
    font-size:20px;
    font-weight:800;
    background:linear-gradient(135deg,var(--accent),var(--accent2));
    -webkit-background-clip:text;
    -webkit-text-fill-color:transparent;
}

.layout {
    display:grid;
    grid-template-columns:260px 1fr;
    min-height:calc(100vh - 60px);
}

.sidebar {
    background:var(--surface);
    border-right:1px solid var(--border);
    padding:20px;
}

.sidebar a {
    display:block;
    padding:12px;
    margin-bottom:8px;
    background:var(--surface2);
    border:1px solid var(--border);
    border-radius:10px;
    text-decoration:none;
}

.sidebar a:hover {
    border-color:var(--accent);
}

.main {
    padding:24px;
}

.card {
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:14px;
    padding:20px;
    margin-bottom:20px;
}

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

label {
    display:block;
    margin-top:14px;
    margin-bottom:6px;
    color:var(--muted);
}

input, textarea, select {
    width:100%;
    padding:12px;
    border-radius:10px;
    border:1px solid var(--border);
    background:var(--surface2);
    color:var(--text);
}

button, .btn {
    display:inline-block;
    margin-top:14px;
    padding:10px 14px;
    border:0;
    border-radius:10px;
    background:var(--accent);
    color:#fff;
    font-weight:700;
    text-decoration:none;
    cursor:pointer;
}

button.secondary, .btn.secondary {
    background:var(--surface2);
    border:1px solid var(--border);
}

button.success, .btn.success {
    background:var(--green);
}

button.danger, .btn.danger {
    background:var(--danger);
}

.btn.small {
    padding:7px 10px;
    font-size:12px;
}

.muted {
    color:var(--muted);
}

.small-text {
    font-size:13px;
    line-height:1.5;
}

.big {
    font-size:34px;
    font-weight:800;
}

.badge {
    display:inline-block;
    padding:4px 10px;
    border-radius:20px;
    background:var(--surface2);
    color:var(--muted);
    font-size:12px;
}

pre {
    background:#101014;
    border:1px solid var(--border);
    padding:14px;
    border-radius:10px;
    white-space:pre-wrap;
    overflow:auto;
}

.list-item {
    display:flex;
    justify-content:space-between;
    align-items:center;
    border-bottom:1px solid var(--border);
    padding:14px 0;
}

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

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

.login-body, .public-body {
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:20px;
}

.login-card, .public-card {
    width:100%;
    max-width:520px;
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:18px;
    padding:28px;
}

.alert {
    background:#4a1f1f;
    border:1px solid var(--danger);
    color:#fff;
    padding:12px;
    border-radius:10px;
    margin-bottom:14px;
}

.success-box {
    background:#183d25;
    border:1px solid var(--green);
    color:#fff;
    padding:14px;
    border-radius:10px;
}

.editor-wrap {
    display:grid;
    grid-template-columns:280px 1fr;
    gap:20px;
}

.editor-panel {
    background:var(--surface2);
    border:1px solid var(--border);
    border-radius:14px;
    padding:16px;
}

.canvas-box {
    background:#08080a;
    border:1px solid var(--border);
    border-radius:14px;
    padding:20px;
    overflow:auto;
    text-align:center;
}

canvas {
    max-width:100%;
    height:auto;
    background:#000;
}

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

    .sidebar {
        border-right:0;
        border-bottom:1px solid var(--border);
    }

    .editor-wrap {
        grid-template-columns:1fr;
    }
}