:root {
  --bg: #07081a;
  --bg-alt: #0b0f26;
  --bg-card: #0f1730;
  --bg-hover: rgba(148,163,196,0.08);
  --border: rgba(148,163,196,0.15);
  --border-strong: rgba(148,163,196,0.3);
  --fg: #e6e9f0;
  --fg-dim: #b6bdd4;
  --muted: #9ca3c0;
  --accent: #7c3aed;
  --accent2: #06b6d4;
  --gold: #c9a84c;
  --gold2: #e5c97a;
  --red: #ef4444;
  --green: #10b981;
  --amber: #f59e0b;
  --blue: #3b82f6;
  --sidebar-w: 260px;
  --topbar-h: 56px;
  --radius: 12px;
  --shadow-sm: 0 4px 12px rgba(0,0,0,0.2);
  --shadow-md: 0 12px 32px rgba(0,0,0,0.3);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
[hidden] { display: none !important; }
body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === Aurora background === */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurora span {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.35;
  animation: drift 20s ease-in-out infinite alternate;
}
.aurora span:nth-child(1) { width: 500px; height: 500px; background: var(--accent); top: -100px; left: -100px; }
.aurora span:nth-child(2) { width: 400px; height: 400px; background: var(--accent2); bottom: -100px; right: -100px; animation-delay: -5s; }
.aurora span:nth-child(3) { width: 350px; height: 350px; background: var(--gold); top: 40%; left: 40%; animation-delay: -10s; }
@keyframes drift {
  0% { transform: translate(0,0) scale(1); }
  100% { transform: translate(60px,-40px) scale(1.1); }
}

/* === Login === */
.view-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px;
  padding: 40px 32px; width: 100%; max-width: 420px; text-align: center;
  box-shadow: var(--shadow-lg);
}
.login-icon {
  font-size: 48px; margin-bottom: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent2), var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.login-card h1 { margin: 0 0 8px; font-size: 24px; font-weight: 800; }
.login-card > p { margin: 0 0 24px; font-size: 14px; }
.login-foot { margin-top: 24px; color: var(--muted); font-size: 12px; display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; }
.login-foot a { color: var(--muted); }
.login-foot .dot { opacity: 0.5; }

/* === Forms === */
.form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.form input, .form select, .form textarea {
  background: #070a1a; border: 1px solid var(--border); color: var(--fg);
  padding: 11px 14px; border-radius: 10px; font-size: 14px; font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.form input:focus, .form select:focus, .form textarea:focus {
  outline: 0; border-color: var(--accent); background: #0a0e22;
}
.form input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .form .row { grid-template-columns: 1fr; } }
.form .checkbox-row { flex-direction: row; align-items: center; gap: 10px; color: var(--fg); font-size: 14px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: rgba(148,163,196,0.04); cursor: pointer; }
.form .checkbox-row:hover { border-color: var(--border-strong); }

/* === Buttons === */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: rgba(148,163,196,0.08); border: 1px solid var(--border); color: var(--fg);
  padding: 9px 14px; border-radius: 10px; font-size: 13px; font-weight: 600; cursor: pointer;
  text-decoration: none; transition: all 0.15s;
}
.btn:hover { background: rgba(148,163,196,0.16); border-color: var(--border-strong); text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border: 0; color: white; padding: 11px 16px;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 30px rgba(124,58,237,0.4); }
.btn-danger { background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.4); color: #fca5a5; }
.btn-danger:hover { background: rgba(239,68,68,0.22); }
.btn-warning { background: rgba(245,158,11,0.12); border-color: rgba(245,158,11,0.4); color: #fcd34d; }
.btn-warning:hover { background: rgba(245,158,11,0.22); }
.btn-success { background: rgba(16,185,129,0.12); border-color: rgba(16,185,129,0.4); color: #6ee7b7; }
.btn-success:hover { background: rgba(16,185,129,0.22); }
.btn-ghost { background: transparent; border: 0; color: var(--muted); padding: 6px 10px; }
.btn-ghost:hover { color: var(--fg); background: var(--bg-hover); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.btn-icon { padding: 7px; width: 32px; height: 32px; border-radius: 8px; }

.icon-btn {
  background: transparent; border: 1px solid var(--border); color: var(--fg);
  width: 38px; height: 38px; border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; transition: border-color 0.15s;
}
.icon-btn:hover { border-color: var(--border-strong); }

/* === Alerts === */
.alert { padding: 10px 14px; border-radius: 10px; font-size: 13px; margin: 0; }
.alert-error { color: var(--red); background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); }
.alert-info { color: var(--accent2); background: rgba(6,182,212,0.08); border: 1px solid rgba(6,182,212,0.3); }
.alert-success { color: var(--green); background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.3); }
.alert-warn { color: var(--amber); background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.3); }

/* === Shell layout === */
#shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, rgba(15,23,48,0.95), rgba(7,8,26,0.95));
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  backdrop-filter: blur(12px);
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px; padding: 16px 20px;
  border-bottom: 1px solid var(--border); font-size: 15px;
}
.brand-mark {
  font-size: 22px;
  background: linear-gradient(135deg, var(--accent), var(--accent2), var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-text { flex: 1; }
.brand-text b { font-weight: 800; }
.sidebar-toggle { display: none; background: transparent; border: 0; color: var(--muted); cursor: pointer; font-size: 18px; padding: 4px 8px; }
.sidebar-nav { flex: 1; padding: 12px 10px; }
.nav-section { padding: 14px 10px 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  color: var(--fg-dim); cursor: pointer; font-size: 14px; transition: background 0.15s, color 0.15s;
  user-select: none; position: relative;
}
.nav-item:hover { background: var(--bg-hover); color: var(--fg); }
.nav-item.active { background: linear-gradient(90deg, rgba(124,58,237,0.2), rgba(6,182,212,0.05)); color: var(--fg); }
.nav-item.active::before { content: ''; position: absolute; left: -10px; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: linear-gradient(180deg, var(--accent), var(--accent2)); }
.nav-item .nav-ico { font-size: 16px; line-height: 1; flex-shrink: 0; }
.nav-item .nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .nav-badge { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px; background: var(--bg-hover); color: var(--muted); }
.nav-item.status-offline .nav-badge { color: var(--red); background: rgba(239,68,68,0.12); }
.nav-item.status-online .nav-badge { color: var(--green); background: rgba(16,185,129,0.12); }
.nav-item.status-error .nav-badge, .nav-item.status-timeout .nav-badge { color: var(--amber); background: rgba(245,158,11,0.12); }
.sidebar-foot { padding: 14px 20px; border-top: 1px solid var(--border); font-size: 11px; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px; height: var(--topbar-h);
  background: rgba(7,8,26,0.7); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.hamburger { display: none; background: transparent; border: 1px solid var(--border); color: var(--fg); width: 36px; height: 36px; border-radius: 8px; cursor: pointer; font-size: 16px; }
.breadcrumb { flex: 1; font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breadcrumb b { color: var(--fg); font-weight: 600; }
.breadcrumb .sep { opacity: 0.4; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.main-body { padding: 24px; max-width: 1400px; width: 100%; align-self: center; }

.user-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white; font-size: 12px; font-weight: 700;
}

/* === Dropdown === */
.dropdown {
  position: absolute; top: calc(100% + 4px); right: 0; list-style: none;
  background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: 10px;
  padding: 6px; margin: 0; min-width: 180px; box-shadow: var(--shadow-md); z-index: 100;
  animation: pop 0.12s ease-out;
}
@keyframes pop { from { transform: translateY(-6px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.dropdown li { padding: 8px 12px; cursor: pointer; border-radius: 6px; font-size: 14px; display: flex; align-items: center; gap: 10px; }
.dropdown li:hover { background: var(--bg-hover); }
.dropdown-sep { height: 1px; background: var(--border); padding: 0 !important; margin: 4px 0 !important; cursor: default !important; }
.dropdown-sep:hover { background: var(--border) !important; }
.lang, .user { position: relative; }

/* === Cards === */
.card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; transition: border-color 0.15s, transform 0.15s, box-shadow 0.2s;
  position: relative;
}
.card-accent::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: var(--radius) var(--radius) 0 0;
}
.card-interactive { cursor: pointer; }
.card-interactive:hover { transform: translateY(-2px); border-color: rgba(124,58,237,0.4); box-shadow: var(--shadow-md); }

.view-title { margin: 0 0 8px; font-size: 26px; font-weight: 800; letter-spacing: -0.01em; }
.view-sub { margin: 0 0 24px; color: var(--muted); font-size: 14px; }

/* === Stats grid === */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px; margin-bottom: 28px;
}
.stat {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 20px; position: relative; overflow: hidden;
}
.stat .stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.stat .stat-value { font-size: 28px; font-weight: 800; margin-top: 4px; }
.stat .stat-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat-accent .stat-value { background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* === App grid === */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.app-card { padding: 18px; }
.app-card .head { display: flex; align-items: center; gap: 10px; }
.app-card .ico { font-size: 28px; line-height: 1; }
.app-card h3 { margin: 0; font-size: 16px; font-weight: 700; }
.app-card .tag { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 2px; }
.app-card .status-pill { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.status-pill.online { background: rgba(16,185,129,0.15); color: var(--green); border: 1px solid rgba(16,185,129,0.3); }
.status-pill.offline { background: rgba(239,68,68,0.15); color: var(--red); border: 1px solid rgba(239,68,68,0.3); }
.status-pill.error, .status-pill.timeout { background: rgba(245,158,11,0.15); color: var(--amber); border: 1px solid rgba(245,158,11,0.3); }
.status-pill .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
.app-card .actions { display: flex; gap: 6px; margin-top: 14px; }

/* === Tables === */
.table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; background: var(--bg-card); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left; padding: 10px 14px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); font-weight: 700; background: rgba(148,163,196,0.05); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--bg-hover); }
.cell-actions { display: flex; gap: 4px; justify-content: flex-end; }
td.muted, .cell-muted { color: var(--muted); font-size: 12px; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; text-transform: uppercase; background: var(--bg-hover); }
.pill-green { background: rgba(16,185,129,0.15); color: var(--green); }
.pill-red   { background: rgba(239,68,68,0.15); color: var(--red); }
.pill-amber { background: rgba(245,158,11,0.15); color: var(--amber); }
.pill-accent { background: rgba(124,58,237,0.15); color: #c4b5fd; }
.pill-blue  { background: rgba(59,130,246,0.15); color: #93c5fd; }

/* === Tabs === */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab { padding: 10px 16px; cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--fg); }
.tab.active { color: var(--fg); border-bottom-color: var(--accent2); }

/* === Filters bar === */
.filterbar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px;
  padding: 10px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
}
.filterbar input, .filterbar select {
  background: #070a1a; border: 1px solid var(--border); color: var(--fg);
  padding: 8px 12px; border-radius: 8px; font-size: 13px;
}
.filterbar .spacer { flex: 1; }

/* === Modal === */
.modal {
  position: fixed; inset: 0; background: rgba(7,8,26,0.8); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; z-index: 200; padding: 20px;
  animation: fadeIn 0.15s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: 16px;
  max-width: 560px; width: 100%; max-height: 85vh; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s ease-out;
}
@keyframes modalIn { from { transform: scale(0.96) translateY(8px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
.modal-card.wide { max-width: 780px; }
.modal-card header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-card h2 { margin: 0; font-size: 17px; font-weight: 700; }
.modal-card .close { background: transparent; border: 0; color: var(--muted); cursor: pointer; font-size: 18px; padding: 4px 8px; border-radius: 6px; }
.modal-card .close:hover { background: var(--bg-hover); color: var(--fg); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-foot { display: flex; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); justify-content: flex-end; flex-wrap: wrap; }

/* === Feed === */
.feed { display: flex; flex-direction: column; gap: 6px; }
.feed-item {
  display: flex; gap: 12px; align-items: flex-start; padding: 10px 14px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  font-size: 13px;
}
.feed-item .feed-icon { width: 28px; height: 28px; border-radius: 8px; background: rgba(148,163,196,0.08); display: inline-flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.feed-item .feed-body { flex: 1; min-width: 0; }
.feed-item .feed-title { font-weight: 600; color: var(--fg); }
.feed-item .feed-meta { color: var(--muted); font-size: 11px; margin-top: 2px; }
.feed-empty { padding: 30px 10px; text-align: center; color: var(--muted); font-size: 13px; }

/* === QR / TOTP === */
.qr-box { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 20px; background: rgba(148,163,196,0.04); border: 1px solid var(--border); border-radius: 12px; }
.qr-box img { border-radius: 8px; background: white; padding: 8px; }
.totp-secret { font-family: 'SF Mono', 'Consolas', monospace; font-size: 13px; letter-spacing: 0.05em; background: #070a1a; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border); user-select: all; word-break: break-all; }

/* === Toast === */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--bg-card); border: 1px solid var(--border-strong); color: var(--fg);
  padding: 12px 20px; border-radius: 12px; font-size: 13px; font-weight: 600;
  z-index: 500; box-shadow: var(--shadow-lg);
  animation: toastIn 0.2s ease-out;
  max-width: calc(100% - 40px);
}
@keyframes toastIn { from { transform: translate(-50%,20px); opacity: 0; } to { transform: translate(-50%,0); opacity: 1; } }

/* === Konami === */
.konami-flash { animation: konami 1.2s ease-out; }
@keyframes konami {
  0% { box-shadow: inset 0 0 0 0 rgba(255,255,255,0); }
  20% { box-shadow: inset 0 0 120px 0 rgba(124,58,237,0.5); }
  100% { box-shadow: inset 0 0 0 0 rgba(255,255,255,0); }
}

/* === Spinner === */
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(148,163,196,0.3); border-top-color: var(--accent2); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* === Empty state === */
.empty {
  text-align: center; padding: 60px 20px; color: var(--muted);
  background: var(--bg-card); border: 1px dashed var(--border); border-radius: var(--radius);
}
.empty .empty-ico { font-size: 40px; margin-bottom: 12px; opacity: 0.6; }
.empty .empty-title { color: var(--fg); font-weight: 600; margin-bottom: 4px; font-size: 15px; }

/* === Responsive === */
@media (max-width: 880px) {
  #shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 300; width: 280px;
    transform: translateX(-100%); transition: transform 0.25s ease-out;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: inline-flex; margin-left: auto; }
  .hamburger { display: inline-flex; align-items: center; justify-content: center; }
  .main-body { padding: 18px 14px; }
  .view-title { font-size: 22px; }
  .stat .stat-value { font-size: 24px; }
  body.sidebar-open::before { content: ''; position: fixed; inset: 0; background: rgba(7,8,26,0.8); backdrop-filter: blur(4px); z-index: 299; }
}
@media (max-width: 480px) {
  .topbar { padding: 8px 12px; gap: 8px; }
  .breadcrumb { font-size: 13px; }
  .main-body { padding: 14px 10px; }
  .modal { padding: 0; align-items: flex-end; }
  .modal-card { max-height: 92vh; border-radius: 16px 16px 0 0; }
  .dropdown { min-width: 160px; }
  thead th, tbody td { padding: 8px 10px; font-size: 12px; }
  .hide-sm { display: none !important; }
}

/* ====================================================
   v0.2.0 PRO additions — page heads, KPI grid, app
   cards, modal v2, rows, language picker, tables,
   features grid, status pills, links, dropdown-right
   ==================================================== */

/* Page head */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 22px; flex-wrap: wrap; }
.page-head h2 { margin: 0 0 4px; font-size: 24px; font-weight: 800; letter-spacing: -0.01em; }
.page-head p.muted { margin: 0; font-size: 13px; }
.page-head-left { display: flex; align-items: center; gap: 14px; }
.page-icon { width: 48px; height: 48px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }
.row-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* KPI grid */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin: 0 0 24px; }
.kpi-grid .stat { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; position: relative; overflow: hidden; }
.kpi-grid .stat::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent, var(--accent2)); }
.kpi-grid .stat-ico { font-size: 14px; color: var(--accent, var(--accent2)); opacity: 0.8; margin-bottom: 4px; }
.kpi-grid .stat-val { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; color: var(--fg); line-height: 1.1; }
.kpi-grid .stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 4px; }

/* Card head */
.card { display: block; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.card-head p.muted { margin: 0; font-size: 12px; }

/* Apps grid (dashboard) */
.apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.app-card { padding: 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s; position: relative; overflow: hidden; cursor: pointer; }
.app-card::before { content: ''; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: var(--accent, var(--accent2)); opacity: 0.7; }
.app-card:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.app-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.app-icon { width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; }
.app-card h4 { margin: 0 0 4px; font-size: 15px; font-weight: 700; }
.app-card p.muted { margin: 0 0 12px; font-size: 12px; }
.app-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border); }
.app-card-foot .small { font-size: 11px; }

/* Status pills (v2) */
.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.status-pill.status-online   { background: rgba(16,185,129,0.15); color: var(--green); border: 1px solid rgba(16,185,129,0.3); }
.status-pill.status-offline  { background: rgba(239,68,68,0.15);  color: var(--red);   border: 1px solid rgba(239,68,68,0.3); }
.status-pill.status-error,
.status-pill.status-timeout  { background: rgba(245,158,11,0.15); color: var(--amber); border: 1px solid rgba(245,158,11,0.3); }

/* Pills (v2 additions) */
.pill-ok    { background: rgba(16,185,129,0.15); color: var(--green); }
.pill-warn  { background: rgba(245,158,11,0.15); color: var(--amber); }
.pill-ghost { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.pill-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* Sidebar nav (v2) */
.nav-sep { padding: 18px 14px 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); opacity: 0.7; }
.nav-apps { display: flex; flex-direction: column; gap: 2px; }
.nav-app .nav-ico { width: 22px; height: 22px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }

/* Breadcrumb */
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--fg); }
.breadcrumb .bc-sep { opacity: 0.4; margin: 0 4px; }
.breadcrumb strong { color: var(--fg); font-weight: 600; }

/* Dropdown right alignment */
.dropdown-right { right: 0; left: auto; }

/* Modal v2 (matches app.js DOM) */
.modal { display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(7,8,26,0.7); backdrop-filter: blur(6px); animation: fadeIn 0.2s; }
.modal-card { position: relative; max-width: 520px; width: 100%; max-height: 88vh; display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }

/* Form rows */
.row-end { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 6px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .row-2 { grid-template-columns: 1fr; } }
.input-row { display: flex; gap: 6px; }
.input-row input { flex: 1; }

/* Tables (v2) */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table thead th { text-align: left; padding: 10px 12px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table tbody td { padding: 10px 12px; border-bottom: 1px solid rgba(148,163,196,0.08); vertical-align: middle; }
.table tbody tr:hover { background: var(--bg-hover); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .small { font-size: 11px; }
.cell-actions { text-align: right; white-space: nowrap; }
.cell-actions .icon-btn { width: 30px; height: 30px; padding: 4px; font-size: 13px; }
.icon-btn.icon-danger { color: var(--red); border-color: rgba(239,68,68,0.3); }
.icon-btn.icon-danger:hover { background: rgba(239,68,68,0.1); }

/* Filterbar (v2) */
.filterbar { display: flex; gap: 8px; align-items: center; padding: 12px 14px; flex-wrap: wrap; }
.filterbar input, .filterbar select { padding: 8px 10px; background: rgba(148,163,196,0.04); border: 1px solid var(--border); color: var(--fg); border-radius: 8px; font-size: 13px; min-width: 160px; }
.filterbar input:focus, .filterbar select:focus { border-color: var(--accent2); outline: 0; }
.filterbar input[type=search] { flex: 1; min-width: 220px; }
.filterbar .btn { margin-left: auto; }

/* Tabs (anchor variant) */
.tab { text-decoration: none; }
.tab.active { color: var(--fg); }

/* Feed (v2) */
.feed-item { display: flex; gap: 12px; padding: 10px 6px; border-bottom: 1px solid rgba(148,163,196,0.06); align-items: flex-start; }
.feed-item:last-child { border-bottom: 0; }
.feed-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 7px; box-shadow: 0 0 0 3px rgba(148,163,196,0.06); }
.feed-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.feed-meta { margin-top: 2px; }

/* Loading wrapper */
.loading { padding: 40px 20px; text-align: center; }
.loading .spinner { width: 22px; height: 22px; border-width: 3px; }

/* Links */
.link-sm { font-size: 12px; color: var(--accent2); text-decoration: none; font-weight: 600; }
.link-sm:hover { color: var(--fg); }

/* Features grid */
.features-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
@media (max-width: 600px) { .features-grid { grid-template-columns: 1fr; } }
.feature-toggle { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.feature-toggle:hover { border-color: var(--border-strong); }
.feature-toggle input { margin-top: 2px; flex-shrink: 0; }
.feature-toggle strong { display: block; font-size: 13px; color: var(--fg); }
.feature-toggle .muted { display: block; }

/* Language settings cards */
.lang-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.lang-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; transition: transform 0.15s, border-color 0.15s; color: var(--fg); }
.lang-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.lang-card.active { border-color: var(--accent); background: linear-gradient(180deg, rgba(124,58,237,0.1), transparent); box-shadow: 0 0 0 1px rgba(124,58,237,0.4); }
.lang-flag { font-size: 32px; }
.lang-name { font-weight: 700; font-size: 14px; }
.lang-code { font-size: 10px; color: var(--muted); letter-spacing: 0.1em; font-weight: 700; }

/* Definition list */
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 18px; margin: 0; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--fg); }
.kv a { color: var(--accent2); }
@media (max-width: 600px) { .kv { grid-template-columns: 1fr; gap: 4px 0; } .kv dt { margin-top: 8px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; } }

/* Toast variants */
.toast-success { border-left: 3px solid var(--green); }
.toast-error   { border-left: 3px solid var(--red); }
.toast-info    { border-left: 3px solid var(--accent2); }
.toast-warning { border-left: 3px solid var(--amber); }

/* Sidebar mobile open */
@media (max-width: 880px) {
  body.sidebar-open .sidebar { transform: translateX(0); }
  .kpi-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .apps-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .apps-grid { grid-template-columns: 1fr; }
  .kpi-grid .stat-val { font-size: 22px; }
  .page-head h2 { font-size: 20px; }
  .page-icon { width: 40px; height: 40px; font-size: 20px; }
  .filterbar { padding: 10px; }
  .filterbar input[type=search] { min-width: 100%; }
}
