* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; background: #f4f6f8; color: #1f2937; }
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: #111827; color: white; padding: 24px 18px; display: flex; flex-direction: column; }
.brand { font-size: 22px; font-weight: 700; margin-bottom: 24px; }
.sidebar nav { display: grid; gap: 8px; }
.sidebar nav a { color: #d1d5db; text-decoration: none; padding: 10px 12px; border-radius: 8px; }
.sidebar nav a:hover { background: #1f2937; color: white; }
.sidebar-user { margin-top: auto; padding-top: 20px; font-size: 14px; color: #d1d5db; }
.main { flex: 1; padding: 24px; }
.main.full { display: grid; place-items: center; }
.card { background: white; border-radius: 12px; padding: 20px; box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.grid.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.stat .label { color: #6b7280; margin-bottom: 8px; }
.stat .value { font-size: 30px; font-weight: 700; }
.split { display: grid; grid-template-columns: 360px 1fr; gap: 16px; align-items: start; }
.wide { min-width: 0; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; border-bottom: 1px solid #e5e7eb; padding: 10px 8px; vertical-align: top; }
form { display: grid; gap: 10px; }
input, select, textarea, button { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid #cbd5e1; font: inherit; }
textarea { min-height: 96px; resize: vertical; }
button { background: #111827; color: white; border: 0; cursor: pointer; }
button:hover { opacity: 0.94; }
.toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 12px; }
.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; }
.alert.success { background: #dcfce7; color: #166534; }
.alert.error { background: #fee2e2; color: #991b1b; }
.auth-wrap { width: 100%; max-width: 420px; }
.auth-card { width: 100%; }
.muted { color: #6b7280; font-size: 13px; }
.checks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (max-width: 1100px) {
    .split { grid-template-columns: 1fr; }
    .grid.cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
    .shell { display: block; }
    .sidebar { width: 100%; }
    .grid.cards { grid-template-columns: 1fr; }
}

.viewer-wrap { display:grid; grid-template-columns: minmax(0, 1fr) 320px; gap:16px; min-height:560px; }
#viewerCanvas { min-height:560px; border:1px solid #dbe3ea; border-radius:12px; overflow:hidden; background:#f8fafc; }
.viewer-side { display:grid; gap:16px; }
.viewer-block { background:#f8fafc; border:1px solid #e5e7eb; border-radius:12px; padding:16px; }
.prop-panel { white-space:pre-wrap; word-break:break-word; max-height:420px; overflow:auto; background:#111827; color:#e5e7eb; border-radius:8px; padding:12px; }
code { background:#f3f4f6; padding:2px 6px; border-radius:6px; }
a { color:#1d4ed8; text-decoration:none; }
a:hover { text-decoration:underline; }
@media (max-width: 1100px) { .viewer-wrap { grid-template-columns: 1fr; } }
