:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e5e7eb;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #1d4ed8;
  --primary-2: #2563eb;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
  --sidebar: #0f172a;
  --sidebar-2: #111827;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  --radius: 16px;
}
html, body { min-height: 100%; }
body { background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif; }
a { color: var(--primary); }
a:hover, a:focus { color: var(--primary-2); text-decoration: none; }
.guest-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.auth-shell { width: 100%; max-width: 430px; }
.auth-card, .panel, .stat-card, .welcome-card, .content-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.panel { margin-bottom: 24px; }
.panel-default, .panel-primary { border-color: var(--border); }
.panel-heading { background: linear-gradient(180deg, #fff, #f8fafc) !important; border-bottom: 1px solid var(--border) !important; padding: 16px 20px !important; font-size: 16px; }
.panel-body { padding: 20px !important; }
.panel-footer { background: var(--surface-2); border-top: 1px solid var(--border); }
.table { margin-bottom: 0; }
.table > thead > tr > th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--border); }
.table > tbody > tr > td { border-top: 1px solid #eef2f7; }
.table-hover > tbody > tr:hover { background: #f8fbff; }
.form-control { height: 42px; border-radius: 10px; border: 1px solid #dbe2ea; box-shadow: none; }
textarea.form-control { height: auto; min-height: 110px; }
.form-control:focus { border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12); }
label { font-weight: 600; color: #334155; }
.btn { border-radius: 10px; font-weight: 600; padding: 9px 14px; border: 0; transition: .2s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); }
.btn-primary:hover { background: var(--primary-2); }
.btn-default { background: #e2e8f0; color: #0f172a; }
.btn-default:hover { background: #cbd5e1; color: #0f172a; }
.btn-success { background: #16a34a; }
.btn-warning { background: #f59e0b; color: #111827; }
.btn-danger { background: #dc2626; }
.btn-info { background: #0891b2; }
.btn-link { padding-left: 0; padding-right: 0; }
.alert { border-radius: 12px; border: 0; box-shadow: var(--shadow); }
.app-shell { display: flex; min-height: 100vh; }
.app-sidebar { width: 270px; background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2)); color: #e5eefc; padding: 24px 18px; position: sticky; top: 0; height: 100vh; }
.app-brand { font-size: 20px; font-weight: 800; line-height: 1.2; margin-bottom: 28px; display: block; color: #fff; }
.app-brand small { display: block; color: #94a3b8; font-size: 12px; font-weight: 500; margin-top: 6px; }
.sidebar-user { padding: 14px; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.05); border-radius: 14px; margin-bottom: 24px; }
.sidebar-user .name { font-weight: 700; color: #fff; }
.sidebar-user .role { font-size: 12px; color: #94a3b8; }
.sidebar-nav a { display: flex; align-items: center; gap: 10px; padding: 11px 14px; margin-bottom: 8px; border-radius: 12px; color: #dbeafe; }
.sidebar-nav a:hover, .sidebar-nav a.active { background: rgba(59,130,246,.16); color: #fff; }
.sidebar-footer { position: absolute; bottom: 18px; left: 18px; right: 18px; font-size: 12px; color: #94a3b8; }
.app-main { flex: 1; min-width: 0; }
.topbar { background: rgba(255,255,255,.9); backdrop-filter: blur(6px); border-bottom: 1px solid var(--border); padding: 18px 28px; display: flex; justify-content: space-between; align-items: center; }
.topbar-title h1 { margin: 0; font-size: 24px; font-weight: 800; }
.topbar-title p { margin: 4px 0 0; color: var(--muted); }
.topbar-actions { color: var(--muted); font-weight: 600; }
.page-wrap { padding: 28px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.welcome-card { padding: 28px; margin-bottom: 24px; background: linear-gradient(135deg, #eff6ff, #ffffff); }
.welcome-card h2 { margin: 0 0 8px; font-size: 28px; font-weight: 800; }
.welcome-card p { color: var(--muted); margin: 0; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-top: 20px; }
.stat-card { padding: 22px; }
.stat-card .label { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.stat-card .value { font-size: 34px; font-weight: 800; margin: 8px 0; }
.stat-card .link { font-weight: 700; }
.empty-state { padding: 28px; text-align: center; color: var(--muted); }
.inline-meta { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.detail-item { padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); }
.detail-item .k { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 6px; }
.detail-item .v { font-weight: 600; }
.checkbox label { display: block; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.checkbox + .checkbox { margin-top: 10px; }
.footer-note { margin-top: 18px; color: var(--muted); font-size: 13px; }
@media (max-width: 991px) {
  .app-shell { display: block; }
  .app-sidebar { width: 100%; height: auto; position: relative; }
  .sidebar-footer { position: static; margin-top: 16px; }
  .topbar, .page-wrap { padding: 20px; }
}
.badge-status { display:inline-block; padding:4px 10px; border-radius:999px; font-size:12px; font-weight:700; }
.badge-ok { background:#dcfce7; color:#166534; }
.badge-off { background:#fee2e2; color:#991b1b; }
.badge-plain { background:#e0f2fe; color:#075985; }
.json-box { background:#0f172a; color:#e2e8f0; border-radius:12px; padding:14px; min-height:240px; white-space:pre-wrap; word-break:break-word; }
