/* logs.kings.id — login/app UI aligned with dashboard.kings.id */

:root {
  --bg: #070b14;
  --sidebar-bg: #0a1020;
  --page-bg: #eef2f7;
  --card: #fff;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #6366f1;
  --accent-dark: #4f46e5;
  --danger: #dc2626;
  --ok: #16a34a;
  --border: #e2e8f0;
  --sidebar-width: 196px;
  --btn-primary-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  --btn-primary-shadow: 0 8px 22px rgba(79, 70, 229, 0.38);
  --btn-primary-shadow-hover: 0 12px 28px rgba(79, 70, 229, 0.45);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  line-height: 1.6;
  background: var(--page-bg);
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 600;
}

/* —— Login (dashboard-like) —— */
.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 20% 15%, rgba(99, 102, 241, 0.18) 0%, transparent 45%),
    radial-gradient(circle at 80% 85%, rgba(56, 189, 248, 0.12) 0%, transparent 40%),
    linear-gradient(160deg, #070b14 0%, #0f172a 55%, #111827 100%);
}
.login-container {
  width: 100%;
  max-width: 420px;
  padding: 20px;
}
.login-box {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 20px;
  padding: 28px 32px 24px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 28px 60px rgba(2, 6, 23, 0.35);
  text-align: center;
}
.login-logo { margin-bottom: 14px; }
.login-logo-img {
  width: 200px;
  max-width: 78%;
  height: auto;
  display: block;
  margin: 0 auto;
}
.login-title {
  font-size: clamp(1.05rem, 4.5vw, 1.2rem);
  line-height: 1.3;
  font-weight: 700;
  margin: 0 auto 0.25rem;
  max-width: 18em;
  color: var(--text);
}
.login-subtitle {
  margin: 0 auto 1.15rem;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.login-honeypot {
  position: absolute !important;
  left: -9999px !important;
  height: 0 !important;
  width: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.login-form { text-align: left; }

.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.875rem;
  font-weight: 500;
}
.form-group input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  background: #fff;
  color: var(--text);
}
.form-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  text-align: left;
}
.alert-error {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
}
.alert-ok {
  background: #f0fdf4;
  color: var(--ok);
  border: 1px solid #bbf7d0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.65rem 1.1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary {
  color: #fff;
  background: var(--btn-primary-gradient);
  box-shadow: var(--btn-primary-shadow);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: var(--btn-primary-shadow-hover);
  transform: translateY(-1px);
}
.btn-block { width: 100%; }
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-dark); }

.front-page-footer {
  margin-top: 0.85rem;
  text-align: center;
}
.front-page-footer-version,
.front-page-footer-credit,
.front-page-footer-stack {
  margin: 0;
  font-size: 0.62rem;
  line-height: 1.5;
  color: rgba(148, 163, 184, 0.85);
  letter-spacing: 0.02em;
}
.front-page-footer-credit {
  margin-top: 0.2rem;
  font-size: 0.58rem;
}
.front-page-footer-credit a {
  color: inherit;
  text-decoration: none;
}
.front-page-footer-credit a:hover {
  color: #e2e8f0;
  text-decoration: underline;
}
.front-page-footer-credit .love {
  color: #f87171;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.front-page-footer-stack {
  margin-top: 0.15rem;
  font-size: 0.55rem;
  color: rgba(148, 163, 184, 0.7);
  letter-spacing: 0.03em;
}


/* ==========================================================================
   Admin shell — colors & layout aligned with dashboard.kings.id
   ========================================================================== */

.app-layout {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  background: var(--page-bg);
  overflow-x: hidden;
}

/* —— Sidebar —— */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg);
  color: #e2e8f0;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  align-self: flex-start;
  min-height: 100vh;
  z-index: 40;
  border-right: 1px solid rgba(148, 163, 184, 0.08);
  /* sticky is positioned — absolute glow stays inside sidebar */
  overflow: hidden;
  transition: width 0.2s ease;
}
/* Desktop collapse control (top-right of sidebar) — icon button, not text */
.sidebar-collapse-btn {
  position: absolute;
  top: 0.4rem;
  right: 0.3rem;
  z-index: 6;
  width: 1.85rem;
  height: 1.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.92);
  color: #e2e8f0;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.sidebar-collapse-btn:hover {
  background: rgba(99, 102, 241, 0.45);
  border-color: rgba(129, 140, 248, 0.65);
  color: #fff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}
.sidebar-collapse-btn:active {
  transform: scale(0.96);
}
.sidebar-collapse-icon {
  display: block;
  width: 14px;
  height: 14px;
  background-color: currentColor;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}
/* chevrons-left « collapse */
.sidebar-collapse-icon--collapse {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='11 17 6 12 11 7'/%3E%3Cpolyline points='18 17 13 12 18 7'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='11 17 6 12 11 7'/%3E%3Cpolyline points='18 17 13 12 18 7'/%3E%3C/svg%3E");
}
/* chevrons-right » expand */
.sidebar-collapse-icon--expand {
  display: none;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='13 17 18 12 13 7'/%3E%3Cpolyline points='6 17 11 12 6 7'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='13 17 18 12 13 7'/%3E%3Cpolyline points='6 17 11 12 6 7'/%3E%3C/svg%3E");
}
body.sidebar-collapsed .sidebar-collapse-icon--collapse {
  display: none;
}
body.sidebar-collapsed .sidebar-collapse-icon--expand {
  display: block;
}
/* Collapsed: icon rail only */
body.sidebar-collapsed {
  --sidebar-width: 58px;
}
body.sidebar-collapsed .sidebar-inner {
  padding: 2rem 0.35rem 0.75rem;
}
body.sidebar-collapsed .sidebar-brand {
  margin-bottom: 0.75rem;
}
body.sidebar-collapsed .sidebar-brand-tagline,
body.sidebar-collapsed .sidebar-brand-login,
body.sidebar-collapsed .sidebar-brand-uptime,
body.sidebar-collapsed .sidebar-link > span:not(.sidebar-icon),
body.sidebar-collapsed .sidebar-logout-label,
body.sidebar-collapsed .sidebar-build-label {
  display: none !important;
}
body.sidebar-collapsed .sidebar-brand-logo-wrap {
  padding: 0.35rem;
}
body.sidebar-collapsed .sidebar-brand-logo {
  width: 32px;
  height: 32px;
}
body.sidebar-collapsed .sidebar-brand-link {
  padding: 0.35rem;
  justify-content: center;
}
body.sidebar-collapsed .sidebar-link {
  justify-content: center;
  padding: 0.6rem 0.35rem;
  gap: 0;
}
body.sidebar-collapsed .sidebar-logout-btn {
  justify-content: center;
  padding: 0.55rem 0.35rem;
}
body.sidebar-collapsed .sidebar-collapse-btn {
  right: 50%;
  transform: translateX(50%);
}
.sidebar-backdrop-glow {
  pointer-events: none !important;
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(99, 102, 241, 0.18) 0%, transparent 45%),
    radial-gradient(circle at 80% 100%, rgba(56, 189, 248, 0.08) 0%, transparent 40%);
  opacity: 0.9;
}
.sidebar-inner {
  position: relative;
  z-index: 1;
  padding: 0.9rem 0.55rem 0.85rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  box-sizing: border-box;
  pointer-events: auto;
}
.sidebar-nav {
  position: relative;
  z-index: 2;
  pointer-events: auto;
}
.sidebar-nav .sidebar-link {
  pointer-events: auto;
  cursor: pointer;
  position: relative;
  z-index: 2;
}
.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.15rem;
  text-align: center;
}
.sidebar-brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.55rem;
  border-radius: 14px;
  color: inherit;
  text-decoration: none;
  transition: background 0.15s ease;
  width: 100%;
}
.sidebar-brand-link--stacked {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.55rem;
}
.sidebar-brand-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
}
.sidebar-brand-logo-wrap {
  flex-shrink: 0;
  padding: 0.55rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}
.sidebar-brand-logo {
  width: 64px;
  height: 64px;
  display: block;
  border-radius: 10px;
  object-fit: contain;
}
.sidebar-brand-tagline {
  display: block;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
  line-height: 1.35;
  max-width: 100%;
}
.sidebar-brand-login {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: #e2e8f0;
  line-height: 1.35;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Same pattern as dashboard.kings.id sidebar-brand-uptime (under Login) */
.sidebar-brand-uptime {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.55rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: none;
  color: #94a3b8;
  line-height: 1.25;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-brand-uptime[hidden] {
  display: none !important;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  flex: 1;
  overflow-y: auto;
  padding-right: 0.15rem;
  margin-bottom: 0.85rem;
  justify-content: flex-start;
  align-content: flex-start;
}
/* Account + Logout glued together (not pushed to bottom) */
.sidebar-nav-tail {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  flex: 0 0 auto;
  margin-top: 0;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.55rem;
  border-radius: 8px;
  color: #94a3b8;
  font-weight: 500;
  font-size: 0.82rem;
  text-decoration: none;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.sidebar-link.is-active,
.sidebar-link:hover {
  background: rgba(99, 102, 241, 0.22);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--accent);
}

.sidebar-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: inline-block;
  background-color: currentColor;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  opacity: 0.95;
}
.sidebar-icon-home {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M3 10.5 12 3l9 7.5'/%3E%3Cpath d='M5 10v10h14V10'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M3 10.5 12 3l9 7.5'/%3E%3Cpath d='M5 10v10h14V10'/%3E%3C/svg%3E");
}
.sidebar-icon-log {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01'/%3E%3C/svg%3E");
}
.sidebar-icon-syslog {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M4 19h16M7 16V9m5 7V5m5 11v-4'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M4 19h16M7 16V9m5 7V5m5 11v-4'/%3E%3C/svg%3E");
}
.sidebar-icon-device {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='12' rx='2'/%3E%3Cpath d='M8 20h8M12 16v4'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='12' rx='2'/%3E%3Cpath d='M8 20h8M12 16v4'/%3E%3C/svg%3E");
}
.sidebar-icon-setup {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4'/%3E%3C/svg%3E");
}
.sidebar-icon-api {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M4 7h6M4 12h16M4 17h10'/%3E%3Ccircle cx='16' cy='7' r='2'/%3E%3Ccircle cx='10' cy='17' r='2'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M4 7h6M4 12h16M4 17h10'/%3E%3Ccircle cx='16' cy='7' r='2'/%3E%3Ccircle cx='10' cy='17' r='2'/%3E%3C/svg%3E");
}
.sidebar-icon-user {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 20c0-4 4-6 8-6s8 2 8 6'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 20c0-4 4-6 8-6s8 2 8 6'/%3E%3C/svg%3E");
}
.sidebar-icon-logout {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M9 21H5a2 2 0 01-2-2V5a2 2 0 012-2h4M16 17l5-5-5-5M21 12H9'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M9 21H5a2 2 0 01-2-2V5a2 2 0 012-2h4M16 17l5-5-5-5M21 12H9'/%3E%3C/svg%3E");
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
/* Logout — under Account in nav (match dashboard red style) */
.sidebar-logout-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.62rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(248, 113, 113, 0.28);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.14) 0%, rgba(127, 29, 29, 0.22) 100%);
  color: #fecaca;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.22);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}
.sidebar-logout-btn--nav {
  margin-top: 0;
  flex: 0 0 auto;
}
.sidebar-logout-btn:hover {
  color: #fff;
  background: linear-gradient(180deg, rgba(248, 113, 113, 0.28) 0%, rgba(185, 28, 28, 0.38) 100%);
  border-color: rgba(252, 165, 165, 0.55);
  box-shadow: 0 10px 22px rgba(127, 29, 29, 0.28);
  transform: translateY(-1px);
}
.sidebar-logout-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.2);
}
.sidebar-logout-btn .sidebar-icon {
  width: 17px;
  height: 17px;
  background-color: currentColor;
  flex-shrink: 0;
}
.sidebar-logout-label {
  letter-spacing: 0.02em;
}
.sidebar-build-label {
  margin: 0;
  text-align: center;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  color: #64748b;
}

/* API access panel */
.api-status-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  align-items: center;
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #f8fafc;
  font-size: 0.85rem;
}
.api-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.78rem;
}
.api-scopes-fieldset {
  margin: 0.75rem 0 1rem;
  padding: 0.75rem 0.9rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
}
.api-scopes-fieldset legend {
  padding: 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.api-scopes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.35rem 0.75rem;
}
.api-scope-label {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  font-size: 0.82rem;
  cursor: pointer;
  user-select: none;
}
.api-scope-label input {
  margin-top: 0.2rem;
}
.api-token-once {
  margin: 0.75rem 0;
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
}
.api-example {
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.78rem;
  line-height: 1.45;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
/* Compact whitelist + catalog (same idea as SysLOG fixed columns) */
.api-whitelist-table,
.api-catalog-table {
  table-layout: fixed;
  width: 100%;
}
.api-whitelist-table th,
.api-whitelist-table td,
.api-catalog-table th,
.api-catalog-table td {
  padding: 0.4rem 0.4rem;
  vertical-align: top;
}
.api-whitelist-wrap {
  max-height: none;
  min-height: 0;
  margin-bottom: 0.5rem;
}
.api-whitelist-table .api-col-name { width: 11rem; }
.api-whitelist-table .api-col-prefix { width: 7rem; }
.api-whitelist-table .api-col-scopes { width: 6rem; }
.api-whitelist-table .api-col-status { width: 5rem; }
.api-whitelist-table .api-col-used { width: 8rem; }
.api-whitelist-table .api-col-actions { width: 12rem; white-space: nowrap; }
.api-whitelist-table tr[data-token-id] td {
  background: #fafbff;
}
.api-catalog-table .api-cat-group { width: 4.5rem; }
.api-catalog-table .api-cat-method { width: 5.5rem; }
.api-catalog-table .api-cat-path { width: 14rem; }
.api-catalog-table .api-cat-auth { width: 8.5rem; }
.api-catalog-table .api-cat-scope { width: 5rem; }
.api-catalog-table .api-cat-desc { width: auto; }
.api-catalog-table .api-cat-path,
.api-catalog-table td:nth-child(3) {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.74rem;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.api-catalog-table .api-cat-desc,
.api-catalog-table td:nth-child(6) {
  font-size: 0.78rem;
  color: var(--muted);
  word-break: break-word;
}
.api-catalog-table .badge-scope,
.api-whitelist-table .badge-scope {
  background: #eef2ff;
  color: #4338ca;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  display: inline-block;
  max-width: 100%;
  white-space: normal;
  line-height: 1.25;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
}
.api-catalog-table .badge-group-service {
  background: #ecfdf5;
  color: #047857;
}
.api-catalog-table .badge-group-session {
  background: #f1f5f9;
  color: #475569;
}
.mono-prefix {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-toggle {
  display: none;
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 60;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  border: none;
  background: var(--bg);
  color: #fff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.25);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  padding: 0;
}
.sidebar-toggle-bar {
  display: block;
  width: 16px;
  height: 2px;
  background: #e2e8f0;
  border-radius: 2px;
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 45;
  backdrop-filter: blur(2px);
}

/* —— Main content ——
 * Always fills remaining width beside sidebar (expands when sidebar collapses).
 */
.main-content.dash-module-main,
.dash-module-page .main-content {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  max-width: none;
  margin: 0;
  padding: 1.25rem 1.75rem 2.5rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: padding 0.2s ease;
}
/* Children stretch full content width */
.main-content.dash-module-main > *,
.dash-module-page .main-content > * {
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}
body.sidebar-collapsed .main-content.dash-module-main,
body.sidebar-collapsed .dash-module-page .main-content {
  /* slightly more side padding when rail is narrow */
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* —— Overview hero (exact dashboard palette) —— */
.overview-hero {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 38%, #312e81 72%, #4338ca 100%);
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.22);
}
.overview-hero-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 88% 12%, rgba(56, 189, 248, 0.28) 0%, transparent 38%),
    radial-gradient(circle at 8% 88%, rgba(129, 140, 248, 0.32) 0%, transparent 42%);
  pointer-events: none;
}
.overview-hero-grid {
  position: absolute;
  inset: 0;
  opacity: 0.14;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.35) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
  pointer-events: none;
}
.overview-hero-inner {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.75rem 1.85rem 1.35rem;
}
.overview-hero-badge {
  display: inline-flex;
  padding: 0.24rem 0.65rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #bae6fd;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  margin-bottom: 0.6rem;
}
.overview-hero-copy h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.45rem, 3vw, 1.95rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #fff;
  line-height: 1.2;
}
.overview-hero-copy p {
  margin: 0;
  max-width: 34rem;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.94rem;
  line-height: 1.55;
}
.overview-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-top: 1rem;
}
.overview-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #bbf7d0;
  background: rgba(22, 163, 74, 0.18);
  border: 1px solid rgba(74, 222, 128, 0.35);
}
.overview-live-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.25);
  animation: overview-pulse 2s ease-in-out infinite;
}
@keyframes overview-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.65; transform: scale(0.92); }
}
.overview-hero-meta-item {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.72);
}
.overview-hero-meta-item strong {
  color: #fff;
  font-weight: 700;
}

/* —— Stat cards —— */
.overview-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.15rem;
}
.overview-stats--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.overview-stats--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.overview-stats--5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.overview-stat-card--replica-size::after {
  background: linear-gradient(90deg, #0e7490, #67e8f9);
}
.overview-stat-card--replica-size .overview-stat-icon {
  background: #0e7490;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cellipse cx='12' cy='5' rx='8' ry='3'/%3E%3Cpath d='M4 5v6c0 1.7 3.6 3 8 3s8-1.3 8-3V5M4 11v6c0 1.7 3.6 3 8 3s8-1.3 8-3v-6'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cellipse cx='12' cy='5' rx='8' ry='3'/%3E%3Cpath d='M4 5v6c0 1.7 3.6 3 8 3s8-1.3 8-3V5M4 11v6c0 1.7 3.6 3 8 3s8-1.3 8-3v-6'/%3E%3C/svg%3E");
}
.overview-stat-card--device::after {
  background: linear-gradient(90deg, #4f46e5, #818cf8);
}
.overview-stat-card--device .overview-stat-icon {
  background: #4f46e5;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='12' rx='2'/%3E%3Cpath d='M8 20h8M12 16v4'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='12' rx='2'/%3E%3Cpath d='M8 20h8M12 16v4'/%3E%3C/svg%3E");
}
.overview-stat-card--udp::after {
  background: linear-gradient(90deg, #0891b2, #22d3ee);
}
.overview-stat-card--udp .overview-stat-icon {
  background: #0891b2;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M5 12a7 7 0 0 1 14 0M2 12a10 10 0 0 1 20 0'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M5 12a7 7 0 0 1 14 0M2 12a10 10 0 0 1 20 0'/%3E%3C/svg%3E");
}
.overview-stat-card--tcp::after {
  background: linear-gradient(90deg, #7c3aed, #a78bfa);
}
.overview-stat-card--tcp .overview-stat-icon {
  background: #7c3aed;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M4 7h16M4 12h16M4 17h10'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M4 7h16M4 12h16M4 17h10'/%3E%3C/svg%3E");
}
.overview-stat-card--disabled::after {
  background: linear-gradient(90deg, #94a3b8, #cbd5e1);
}
.overview-stat-card--disabled .overview-stat-value {
  color: #64748b;
}
.overview-stat-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1.1rem 1.15rem;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.overview-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.09);
}
.overview-stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 16px 16px 0 0;
}
.overview-stat-card--total::after { background: linear-gradient(90deg, #6366f1, #818cf8); }
.overview-stat-card--up::after { background: linear-gradient(90deg, #16a34a, #4ade80); }
.overview-stat-card--down::after { background: linear-gradient(90deg, #dc2626, #f87171); }
.overview-stat-card--logs::after { background: linear-gradient(90deg, #0f766e, #14b8a6); }
.overview-stat-card--database::after { background: linear-gradient(90deg, #78716c, #a8a29e); }
.overview-stat-icon {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 12px;
  background: #f1f5f9;
  mask-size: 55%;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-size: 55%;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}
.overview-stat-card--total .overview-stat-icon {
  background: #6366f1;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='2' y='3' width='20' height='14' rx='2'/%3E%3Cpath d='M8 21h8M12 17v4'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='2' y='3' width='20' height='14' rx='2'/%3E%3Cpath d='M8 21h8M12 17v4'/%3E%3C/svg%3E");
}
.overview-stat-card--up .overview-stat-icon {
  background: #16a34a;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M22 11.08V12a10 10 0 11-5.93-9.14'/%3E%3Cpath d='M22 4L12 14.01l-3-3'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M22 11.08V12a10 10 0 11-5.93-9.14'/%3E%3Cpath d='M22 4L12 14.01l-3-3'/%3E%3C/svg%3E");
}
.overview-stat-card--database .overview-stat-icon {
  background: #78716c;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cellipse cx='12' cy='5' rx='8' ry='3'/%3E%3Cpath d='M4 5v6c0 1.7 3.6 3 8 3s8-1.3 8-3V5M4 11v6c0 1.7 3.6 3 8 3s8-1.3 8-3v-6'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cellipse cx='12' cy='5' rx='8' ry='3'/%3E%3Cpath d='M4 5v6c0 1.7 3.6 3 8 3s8-1.3 8-3V5M4 11v6c0 1.7 3.6 3 8 3s8-1.3 8-3v-6'/%3E%3C/svg%3E");
}
.overview-stat-card--logs .overview-stat-icon {
  background: #0f766e;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z'/%3E%3Cpath d='M14 2v6h6M16 13H8M16 17H8M10 9H8'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z'/%3E%3Cpath d='M14 2v6h6M16 13H8M16 17H8M10 9H8'/%3E%3C/svg%3E");
}
.overview-stat-body {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.overview-stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.overview-stat-value {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.15;
}
.overview-stat-hint {
  font-size: 0.75rem;
  color: var(--muted);
}

/* —— Content panels —— */
.view-panel[hidden] { display: none !important; }
/* Host metrics bar (dashboard.kings.id) */
.overview-host-metrics-card {
  margin: 0 0 1.15rem;
  padding: 1rem 1.35rem 1.05rem;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  text-align: center;
}
.overview-host-metrics-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.65rem 1.25rem;
}
.overview-host-metrics-item {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.overview-host-metrics-item--cpu { color: #0284c7; }
.overview-host-metrics-item--mem { color: #7c3aed; }
.overview-host-metrics-item--disk { color: #d97706; }
.overview-host-metrics-item--iops { color: #059669; }

/* Host stack (OS / Nginx / …) — dashboard OverviewHostStack layout */
.overview-host-stack-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}
.overview-host-stack-wrap:empty {
  display: none;
}
.overview-host-stack-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 0.45rem 0.65rem;
  width: 100%;
}
.overview-host-stack-item {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  min-width: 6.5rem;
  padding: 0.42rem 0.55rem;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.12);
  text-align: center;
  line-height: 1.25;
}
.overview-host-stack-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}
.overview-host-stack-value {
  font-size: 0.74rem;
  font-weight: 600;
  color: #475569;
  word-break: break-word;
}
.overview-host-stack-item--os .overview-host-stack-label { color: #2563eb; }
.overview-host-stack-item--os .overview-host-stack-value { color: #1d4ed8; }
.overview-host-stack-item--nginx .overview-host-stack-label { color: #059669; }
.overview-host-stack-item--nginx .overview-host-stack-value { color: #047857; }
.overview-host-stack-item--nodejs .overview-host-stack-label { color: #65a30d; }
.overview-host-stack-item--nodejs .overview-host-stack-value { color: #4d7c0f; }
.overview-host-stack-item--postgresql .overview-host-stack-label { color: #0284c7; }
.overview-host-stack-item--postgresql .overview-host-stack-value { color: #0369a1; }
.overview-host-stack-item--openssl .overview-host-stack-label { color: #d97706; }
.overview-host-stack-item--openssl .overview-host-stack-value { color: #b45309; }
.overview-host-stack-item--ssl .overview-host-stack-label { color: #db2777; }
.overview-host-stack-item--ssl .overview-host-stack-value { color: #be185d; }

.overview-panel-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
  overflow: hidden;
  margin-bottom: 1rem;
}
.overview-panel-head {
  padding: 1.1rem 1.25rem 0.65rem;
  border-bottom: 1px solid var(--border);
}
.overview-panel-head h2 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}
.overview-panel-head .muted { margin: 0; }
.overview-panel-body {
  padding: 1rem 1.25rem 1.25rem;
}
.feature-list {
  margin: 0;
  padding-left: 1.15rem;
}
.feature-list li { margin: 0.35rem 0; }
.account-form {
  max-width: 420px;
}

/* Data tables (SysLOG / Device) */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.data-table th,
.data-table td {
  padding: 0.45rem 0.55rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.data-table th {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 1;
}
.data-table tbody tr:hover {
  background: rgba(148, 163, 184, 0.08);
}
.data-table .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
}
.data-table .nowrap {
  white-space: nowrap;
}
#syslogTableBody.is-loading {
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.syslog-table-wrap {
  /* 2× previous height — show many more of the 200 rows */
  max-height: min(234vh, 2760px);
  min-height: 1260px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}
.device-table-wrap {
  max-height: min(62vh, 560px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}
.syslog-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}
.syslog-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.65rem;
  align-items: center;
}
.syslog-toolbar-row--search .syslog-input {
  flex: 0 1 18rem;
  width: 18rem;
  min-width: 12rem;
  max-width: 22rem;
}
.syslog-toolbar-row--filters .syslog-select {
  flex: 0 1 auto;
}
.syslog-input,
.syslog-select {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  min-width: 0;
}
.syslog-input {
  flex: 0 1 18rem;
  width: 18rem;
  min-width: 12rem;
  max-width: 22rem;
}
.syslog-select {
  flex: 0 1 auto;
}
.syslog-date {
  min-width: 8.5rem;
  max-width: 11rem;
}
.syslog-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1rem;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.syslog-pager-info {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  min-width: 12rem;
  text-align: center;
}
.syslog-live-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
  user-select: none;
}
.syslog-meta {
  margin: 0 0 0.55rem;
}
/*
 * SysLOG columns (6): Time · Device · Network · Sev · Host · Message
 * Fixed layout: meta cols compact; Message takes remaining width.
 * (Old 7-col widths after Category removal stretched empty space.)
 */
.syslog-table {
  table-layout: fixed;
  width: 100%;
}
.syslog-table th,
.syslog-table td {
  padding: 0.4rem 0.4rem;
}
/* 1 Time */
.syslog-table th:nth-child(1),
.syslog-table td.syslog-time {
  width: 5.4rem;
  white-space: normal;
  vertical-align: top;
  padding-right: 0.35rem;
}
.syslog-time {
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.syslog-time-date,
.syslog-time-clock {
  display: block;
  font-size: 0.72rem;
  font-weight: 400;
  font-family: inherit;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.syslog-time-clock {
  margin-top: 0.1rem;
}
/* 2 Device */
.syslog-table th:nth-child(2),
.syslog-table td.syslog-device {
  width: 7.5rem;
  max-width: 7.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 3 Network */
.syslog-table th:nth-child(3),
.syslog-table td.syslog-network {
  width: 6rem;
  max-width: 6rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 4 Sev */
.syslog-table th:nth-child(4),
.syslog-table td.syslog-sev {
  width: 4rem;
  max-width: 4rem;
  white-space: nowrap;
}
/* 5 Host */
.syslog-table th:nth-child(5),
.syslog-table td.syslog-host {
  width: 9rem;
  max-width: 9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 6 Message — all remaining width */
.syslog-table th:nth-child(6),
.syslog-table td.syslog-msg {
  width: auto;
}
.syslog-msg {
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: none;
}
/* Search match highlight */
.syslog-hl,
.syslog-table strong.syslog-hl {
  font-weight: 800;
  color: #0f172a;
  background: #fef08a;
  padding: 0 0.12em;
  border-radius: 2px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.badge-net .syslog-hl {
  background: #fde68a;
  color: #1e1b4b;
}
/* Sev is 4th col: Time, Device, Network, Sev, Host, Message */
.syslog-table tr.sev-crit td.syslog-sev { color: #b91c1c; font-weight: 700; }
.syslog-table tr.sev-err td.syslog-sev { color: #c2410c; font-weight: 600; }
.syslog-table tr.sev-warn td.syslog-sev { color: #b45309; font-weight: 600; }
.syslog-table tr.sev-info td.syslog-sev { color: #0369a1; }

.device-form {
  margin-bottom: 1.15rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.device-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem 1rem;
}
.device-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.35rem;
}
.form-group--check {
  display: flex;
  align-items: flex-end;
  padding-bottom: 0.35rem;
}
.check-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
}
.device-actions {
  white-space: nowrap;
  text-align: right;
}
.col-order {
  width: 4.5rem;
  text-align: center;
}
.device-order-btns {
  display: inline-flex;
  flex-direction: column;
  gap: 0.15rem;
  align-items: center;
}
.device-order-btns .btn {
  min-width: 2rem;
  padding: 0.15rem 0.4rem;
  line-height: 1.1;
  font-weight: 700;
}
.device-order-btns .btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.device-table tbody tr[data-device-id] {
  cursor: grab;
}
.device-table tbody tr[data-device-id].is-dragging {
  opacity: 0.45;
  background: #eff6ff;
  cursor: grabbing;
}
.device-table tbody tr[data-device-id].drag-over-above {
  box-shadow: inset 0 2px 0 0 #2563eb;
}
.device-table tbody tr[data-device-id].drag-over-below {
  box-shadow: inset 0 -2px 0 0 #2563eb;
}
.device-table tbody tr[data-device-id].is-reorder-busy {
  pointer-events: none;
  opacity: 0.7;
}
.badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
}
.badge-ok {
  background: #d1fae5;
  color: #047857;
}
.badge-off {
  background: #f1f5f9;
  color: #64748b;
}
.badge-host {
  background: #e0f2fe;
  color: #0369a1;
}
.badge-net {
  background: #ede9fe;
  color: #6d28d9;
}
.badge-cat {
  letter-spacing: 0.06em;
}
.badge-cat-router {
  background: #ffedd5;
  color: #c2410c;
}
.badge-cat-switch {
  background: #dbeafe;
  color: #1d4ed8;
}
.badge-cat-server {
  background: #e0e7ff;
  color: #4338ca;
}
.badge-cat-appliance {
  background: #fce7f3;
  color: #be185d;
}
.badge-brand {
  background: #ecfdf5;
  color: #047857;
  letter-spacing: 0.02em;
}

/* Setup panel */
.setup-proto-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.setup-proto-card {
  margin: 0;
  padding: 0.9rem 1rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
  min-width: 0;
}
.setup-proto-card legend {
  padding: 0 0.25rem;
}
.setup-ports {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0.55rem 0 0.65rem;
}
.setup-port-row {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}
.setup-port-input {
  flex: 1;
  font: inherit;
  font-size: 0.9rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  max-width: 10rem;
}
.setup-port-add {
  min-width: 2rem;
  font-weight: 700;
}
.setup-live-meta {
  margin: 0 0 0.75rem;
}
.setup-section-title {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}
.setup-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1.35rem 0 1.15rem;
}
.device-form-grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.device-form-grid--5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.device-form-grid--6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.device-form-grid--7 {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.device-select {
  width: 100%;
  font: inherit;
  font-size: 0.9rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}
@media (max-width: 1200px) {
  .device-form-grid--6,
  .device-form-grid--7 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 1100px) {
  .device-form-grid--5 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  .device-form-grid--4,
  .device-form-grid--5,
  .device-form-grid--6,
  .device-form-grid--7 {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 800px) {
  .setup-proto-grid {
    grid-template-columns: 1fr;
  }
  .device-form-grid--4,
  .device-form-grid--5,
  .device-form-grid--6,
  .device-form-grid--7 {
    grid-template-columns: 1fr;
  }
}
.btn-sm {
  padding: 0.28rem 0.55rem;
  font-size: 0.75rem;
  border-radius: 7px;
}
.btn-secondary {
  background: #f1f5f9;
  color: #0f172a;
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: #e2e8f0;
}
/* Soft blue Edit — same as dashboard.kings.id .overview-detail-btn */
.btn-edit {
  color: var(--accent, #6366f1);
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  box-shadow: none;
}
.btn-edit:hover:not(:disabled) {
  color: #fff;
  background: var(--accent, #6366f1);
  border-color: var(--accent, #6366f1);
  transform: none;
}
/* Solid red — same as dashboard.kings.id Cancel / danger */
.btn-danger {
  background: var(--danger, #dc2626);
  color: #fff;
  border: 1px solid var(--danger, #dc2626);
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.28);
}
.btn-danger:hover {
  background: #b91c1c;
  color: #fff;
  border-color: #b91c1c;
  box-shadow: 0 8px 22px rgba(220, 38, 38, 0.34);
}
@media (max-width: 900px) {
  .device-form-grid {
    grid-template-columns: 1fr;
  }
}

.build-log {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: min(60vh, 520px);
  overflow: auto;
}
.build-log-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
  padding: 0.7rem 0.85rem;
}
.build-log-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  margin-bottom: 0.25rem;
}
.build-log-head time {
  color: var(--muted);
  font-size: 0.75rem;
  white-space: nowrap;
}
.build-log-item p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--text);
}

body.sidebar-open { overflow: hidden; }

@media (max-width: 1200px) {
  .overview-stats--5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .overview-stats,
  .overview-stats--3,
  .overview-stats--4,
  .overview-stats--5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.3);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-overlay { display: block; }
  .sidebar-toggle { display: flex; }
  /* Mobile uses hamburger drawer; hide desktop collapse control */
  .sidebar-collapse-btn { display: none; }
  body.sidebar-collapsed { --sidebar-width: 196px; }
  body.sidebar-collapsed .sidebar-brand-tagline,
  body.sidebar-collapsed .sidebar-brand-login,
  body.sidebar-collapsed .sidebar-brand-uptime,
  body.sidebar-collapsed .sidebar-link > span:not(.sidebar-icon),
  body.sidebar-collapsed .sidebar-logout-label,
  body.sidebar-collapsed .sidebar-build-label {
    display: revert !important;
  }
  body.sidebar-collapsed .sidebar-brand-logo {
    width: 64px;
    height: 64px;
  }
  body.sidebar-collapsed .sidebar-link {
    justify-content: flex-start;
    padding: 0.55rem 0.55rem;
    gap: 0.45rem;
  }
  .main-content.dash-module-main,
  .dash-module-page .main-content {
    padding: 3.5rem 1rem 1.5rem;
  }
}
@media (max-width: 560px) {
  .login-box { padding: 22px 18px 18px; }
  .overview-stats,
  .overview-stats--3,
  .overview-stats--4,
  .overview-stats--5 { grid-template-columns: 1fr; }
  .overview-hero-inner { padding: 1.35rem 1.15rem 1.15rem; }
}
