:root { --sb-w: 250px; --brand: #4f46e5; --brand-dark: #3730a3; --bg: #f4f6fb; }
body { background: var(--bg); font-family: "Sarabun", "Noto Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sb-w); background: #111827; color: #cbd5e1; position: fixed; inset: 0 auto 0 0; z-index: 1030; overflow-y: auto; transition: transform .2s; }
.sidebar-brand { display: flex; gap: .75rem; align-items: center; padding: 1.1rem 1.25rem; font-weight: 700; color: #fff; font-size: 1.1rem; border-bottom: 1px solid #1f2937; }
.sidebar-brand i { color: #818cf8; }
.sidebar .nav-link { color: #cbd5e1; padding: .65rem 1.25rem; display: flex; align-items: center; gap: .85rem; font-size: .93rem; border-left: 3px solid transparent; }
.sidebar .nav-link i { width: 1.2rem; text-align: center; color: #94a3b8; }
.sidebar .nav-link:hover { background: #1f2937; color: #fff; }
.sidebar .nav-link.active { background: #1e1b4b; color: #fff; border-left-color: #818cf8; }
.sidebar .nav-link.active i { color: #a5b4fc; }
.main { margin-left: var(--sb-w); flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.content { flex: 1; }
.topbar { background: #fff; padding: .75rem 1.5rem; display: flex; align-items: center; gap: 1rem; border-bottom: 1px solid #e5e7eb; position: sticky; top: 0; z-index: 1020; }
.content { padding: 1.5rem; }
.card { border: 0; box-shadow: 0 1px 3px rgba(16,24,40,.08); border-radius: .75rem; }
.card-header { background: transparent; font-weight: 600; border-bottom: 1px solid #eef0f4; }
.stat-card .stat-value { font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.stat-card .stat-icon { width: 46px; height: 46px; border-radius: .75rem; display: grid; place-items: center; font-size: 1.2rem; }
.table > :not(caption) > * > * { padding: .65rem .75rem; vertical-align: middle; }
.table-sm > :not(caption) > * > * { padding: .4rem .6rem; }
.log-line { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; white-space: pre-wrap; word-break: break-word; }
.log-error, .log-critical { color: #b91c1c; } .log-warning { color: #b45309; }
.prompt-box { max-height: 420px; overflow: auto; background: #0f172a; color: #e2e8f0; border-radius: .5rem; padding: 1rem; font-size: .82rem; white-space: pre-wrap; }
.brand-mark { width: 64px; height: 64px; border-radius: 1rem; background: linear-gradient(135deg, #6366f1, #4338ca); color: #fff; display: inline-grid; place-items: center; font-size: 1.8rem; }
.login-body { min-height: 100vh; display: flex; flex-direction: column; background: linear-gradient(160deg, #eef2ff, #f8fafc); }
.login-body main { margin: auto; width: calc(100% - 2rem); max-width: 420px; }
.login-card { width: 100%; max-width: 420px; border-radius: 1rem; }
.captcha-img { border: 1px solid #c7d2fe; border-radius: .5rem; background: #eef2ff; }
.captcha-input { letter-spacing: .35em; font-weight: 600; font-family: ui-monospace, Menlo, monospace; }
.btn-primary { background: var(--brand); border-color: var(--brand); } .btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
iframe.preview { width: 100%; height: 70vh; border: 1px solid #e5e7eb; border-radius: .5rem; background: #fff; }
code.k { background: #eef2ff; color: #3730a3; padding: .1rem .35rem; border-radius: .25rem; }
@media (max-width: 991.98px) { .sidebar { transform: translateX(-100%); } .sidebar.show { transform: none; } .main { margin-left: 0; } .content { padding: 1rem; } }

.app-footer { border-top: 1px solid #e5e7eb; background: #fff; font-size: .82rem; }
.app-footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .35rem 1.5rem; padding: .85rem 1.5rem; }
.login-body .app-footer { background: transparent; border-top-color: #dfe3f0; }
@media (max-width: 575.98px) { .app-footer-inner { flex-direction: column; text-align: center; padding: .85rem 1rem; } }
