/* ══════════════════════════════════════════════
   RainStress — App Shell & Pages
══════════════════════════════════════════════ */

/* ════════════════════════════════════════════════
   APP SHELL
════════════════════════════════════════════════ */
.app-shell {
  display: flex;
  height: 100vh;
  position: relative;
  z-index: 1;
}

/* ── SIDEBAR ──────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-dim);
  display: flex;
  flex-direction: column;
  padding: 0;
  position: relative;
  z-index: 10;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px 16px;
  font-size: 17px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.3px;
  border-bottom: 1px solid var(--border-dim);
}

.sidebar-brand { opacity: 0.95; }

.sidebar-nav {
  flex: 1;
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 6px 10px 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  position: relative;
}
.nav-item:hover { background: var(--bg-hover); color: var(--accent); }
.nav-item.active { background: rgba(255,255,255,0.06); color: var(--white); }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 25%; bottom: 25%;
  width: 2px;
  background: var(--white);
  border-radius: 0 2px 2px 0;
}
.nav-item svg { flex-shrink: 0; }

.sidebar-footer {
  padding: 12px 10px 16px;
  border-top: 1px solid var(--border-dim);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  background: var(--bg-hover);
}

.user-avatar {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-dim); }

.logout-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  display: flex;
}
.logout-btn:hover { color: var(--text); background: rgba(255,255,255,0.06); }

/* ── ADMIN NAV ──────────────────────────────── */
.nav-item.admin-nav,
.nav-section-label.admin-section { display: none; }
.nav-item.admin-nav.visible,
.nav-section-label.admin-section.visible { display: flex; }
.nav-section-label.admin-section.visible { display: block; }

/* ── MAIN CONTENT ─────────────────────────────── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.main-content::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('https://d8j0ntlcm91z4.cloudfront.net/user_3HBvpZNbeNJYV261K5rITSEu8uF/hf_20261016_200013_e212f7ca-f8d2-497b-822c-d9467c73bae6.png');
  background-size: cover;
  background-position: center;
  opacity: 0.03;
  pointer-events: none;
  z-index: 0;
}

/* ── TOP BAR ──────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border-dim);
  background: rgba(6,6,6,0.8);
  backdrop-filter: blur(8px);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.page-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.3px;
  line-height: 1;
}

.breadcrumb {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.agent-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
}

.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #555;
  transition: background 0.3s;
}
.dot.online { background: #aaa; box-shadow: 0 0 6px #aaa; animation: dotPulse 2s ease-in-out infinite; }

@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 4px #aaa; }
  50%       { box-shadow: 0 0 10px #ddd; }
}

/* ── PAGES ────────────────────────────────────── */
.page {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  animation: pageFadeIn 0.3s ease both;
  position: relative;
  z-index: 1;
}
.page.active { display: block; }

@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── STAT CARDS ───────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  overflow: hidden;
  animation: cardIn 0.4s ease both;
  animation-delay: calc(var(--i, 0) * 0.06s);
  transition: border-color 0.2s, transform 0.15s;
}
.stat-card:hover { border-color: #2a2a2a; transform: translateY(-1px); }
.stat-card.highlight { border-color: rgba(255,255,255,0.1); background: rgba(255,255,255,0.03); }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.stat-icon {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}
.stat-info { flex: 1; }
.stat-value { font-size: 24px; font-weight: 700; color: var(--white); letter-spacing: -0.5px; font-family: 'JetBrains Mono', monospace; line-height: 1; }
.stat-label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; }
.stat-badge { position: absolute; top: 12px; right: 14px; font-size: 10px; font-weight: 500; color: var(--text-muted); background: rgba(255,255,255,0.04); border-radius: 20px; padding: 2px 8px; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-badge.running { color: #ccc; background: rgba(255,255,255,0.08); animation: badgePulse 2s ease-in-out infinite; }

@keyframes badgePulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

/* ── LOWER GRID ───────────────────────────────── */
.lower-grid { display: grid; grid-template-columns: 1fr 360px; gap: 14px; }

/* ── CARDS ────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: cardIn 0.4s ease both;
  transition: border-color 0.2s;
}
.card:hover { border-color: #252525; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-dim);
  flex-shrink: 0;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 9px;
  font-family: 'JetBrains Mono', monospace;
}

/* ── ANNOUNCEMENTS ────────────────────────────── */
.announce-card { min-height: 200px; }
.announce-list { padding: 16px 20px; display: flex; flex-direction: column; gap: 16px; }
.announce-item { display: flex; gap: 14px; align-items: flex-start; }
.announce-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-dim); margin-top: 6px; flex-shrink: 0; }
.announce-title { font-size: 13.5px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.announce-meta { font-size: 12px; color: var(--text-dim); }

/* ── ACCOUNT CARD ─────────────────────────────── */
.account-card { padding-bottom: 20px; }
.account-rows { padding: 14px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.account-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border-dim); }
.account-row:last-child { border-bottom: none; }
.ar-label { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; }
.ar-value { font-size: 13px; font-weight: 600; color: var(--text); font-family: 'JetBrains Mono', monospace; }
.plan-badge { background: rgba(255,255,255,0.08); padding: 2px 8px; border-radius: 4px; font-size: 11px; }
.account-card .btn-outline { margin: 0 20px 4px; }

/* ── BUTTONS ──────────────────────────────────── */
.btn-outline {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  text-decoration: none;
}
.btn-outline:hover { background: var(--bg-hover); color: var(--text); border-color: #2f2f2f; }

.btn-primary {
  background: var(--white);
  color: #000;
  border: none;
  border-radius: 6px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary:hover { background: #ddd; }

.btn-danger {
  padding: 9px 20px;
  background: var(--danger);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-danger:hover { opacity: 0.85; }

.btn-sm { font-size: 11px; padding: 4px 10px; border-radius: 5px; border: 1px solid var(--border); background: var(--bg-hover); color: var(--text); cursor: pointer; white-space: nowrap; }
.btn-sm:hover { background: rgba(255,255,255,0.08); }

.btn-xs { font-size: 10.5px; padding: 3px 8px; border-radius: 4px; border: 1px solid var(--border); background: var(--bg-hover); color: var(--text-dim); cursor: pointer; }
.btn-xs:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.btn-xs.danger:hover { background: rgba(224,85,85,0.15); color: #e05555; border-color: rgba(224,85,85,0.3); }

.btn-success {
  background: rgba(74,222,128,0.1);
  color: #4ade80;
  border: 1px solid rgba(74,222,128,0.25);
  border-radius: 6px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}
.btn-success:hover { background: rgba(74,222,128,0.18); }

/* ════════════════════════════════════════════════
   PANEL PAGE
════════════════════════════════════════════════ */
.panel-grid {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 14px;
  height: calc(100vh - 130px);
}
.attack-form-card { overflow: auto; }

.layer-toggle { display: flex; background: var(--bg); border: 1px solid var(--border); border-radius: 7px; padding: 3px; gap: 2px; }
.layer-btn { padding: 5px 14px; border: none; border-radius: 5px; background: transparent; color: var(--text-dim); font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer; transition: background 0.15s, color 0.15s; }
.layer-btn.active { background: rgba(255,255,255,0.1); color: var(--white); }

.form-grid { padding: 18px 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }

.btn-launch {
  margin: 0 20px 20px;
  width: calc(100% - 40px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 9px;
  color: var(--white);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.02em;
}
.btn-launch:hover { background: rgba(255,255,255,0.1); box-shadow: 0 0 24px rgba(255,255,255,0.06); }
.btn-launch:active { transform: scale(0.99); }
.btn-launch.firing { animation: launchFire 0.6s ease forwards; }

@keyframes launchFire {
  0%   { box-shadow: 0 0 0 rgba(255,255,255,0.3); }
  50%  { box-shadow: 0 0 40px rgba(255,255,255,0.12); }
  100% { box-shadow: 0 0 0 rgba(255,255,255,0); }
}

.launch-ring {
  position: absolute;
  top: 50%; left: 50%;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid rgba(255,255,255,0.5);
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
}
.btn-launch.firing .launch-ring { animation: ringExpand 0.6s ease forwards; }
@keyframes ringExpand { to { transform: translate(-50%, -50%) scale(20); opacity: 0; } }

.launch-msg { margin: 0 20px 16px; padding: 10px 14px; border-radius: 7px; font-size: 13px; text-align: center; }
.launch-msg.success { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12); color: var(--accent); }
.launch-msg.error { background: rgba(224,85,85,0.08); border: 1px solid rgba(224,85,85,0.2); color: var(--danger); }

.active-card { overflow: hidden; }
.attack-list { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }

.empty-state { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 48px 24px; color: var(--text-muted); font-size: 13px; }

.attack-item { background: var(--bg); border: 1px solid var(--border); border-radius: 9px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; animation: atkIn 0.3s ease both; position: relative; overflow: hidden; }
.attack-item::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: rgba(255,255,255,0.2); animation: atkPulse 2s ease-in-out infinite; }

@keyframes atkPulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 0.8; } }
@keyframes atkIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: translateX(0); } }

.atk-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.atk-method { font-size: 12px; font-weight: 700; color: var(--white); background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.1); border-radius: 4px; padding: 2px 7px; font-family: 'JetBrains Mono', monospace; text-transform: uppercase; }
.atk-target { font-size: 13px; color: var(--text-dim); font-family: 'JetBrains Mono', monospace; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.atk-stop { flex-shrink: 0; display: flex; align-items: center; gap: 5px; padding: 5px 10px; background: rgba(224,85,85,0.08); border: 1px solid rgba(224,85,85,0.2); border-radius: 5px; color: #cc6666; font-family: inherit; font-size: 11px; font-weight: 600; cursor: pointer; transition: background 0.15s; }
.atk-stop:hover { background: rgba(224,85,85,0.14); }

.atk-bar-wrap { height: 3px; background: var(--bg-hover); border-radius: 3px; overflow: hidden; }
.atk-bar { height: 100%; background: rgba(255,255,255,0.3); border-radius: 3px; transition: width 1s linear; }
.atk-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }

/* ════════════════════════════════════════════════
   PLANS PAGE
════════════════════════════════════════════════ */
.plans-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding-bottom: 24px; }
.plan-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 28px 24px; display: flex; flex-direction: column; gap: 20px; animation: cardIn 0.4s ease both; transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s; animation-delay: calc(var(--i, 0) * 0.1s); }
.plan-card:hover { border-color: #2a2a2a; transform: translateY(-2px); box-shadow: 0 12px 40px rgba(0,0,0,0.4); }
.plan-card.featured { border-color: rgba(255,255,255,0.15); background: rgba(255,255,255,0.02); }
.plan-name { font-size: 16px; font-weight: 700; color: var(--white); margin-bottom: 8px; }
.plan-price { display: flex; align-items: baseline; gap: 3px; }
.plan-price .amount { font-size: 32px; font-weight: 700; color: var(--white); font-family: 'JetBrains Mono', monospace; }
.plan-price .currency { font-size: 16px; color: var(--text-dim); }
.plan-price .period { font-size: 13px; color: var(--text-muted); margin-left: 4px; }
.plan-features { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.plan-features li { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-dim); }
.plan-features li::before { content: ''; width: 16px; height: 16px; flex-shrink: 0; background: rgba(255,255,255,0.06); border-radius: 50%; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10' fill='none'%3E%3Cpath d='M2 5L4.5 7.5L8 3' stroke='%23888' stroke-width='1.3' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: center; background-size: 14px; }
.plan-btn { width: 100%; padding: 11px; background: rgba(255,255,255,0.06); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-family: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background 0.15s, border-color 0.15s; margin-top: auto; }
.plan-btn:hover { background: rgba(255,255,255,0.1); border-color: #333; }
.plan-card.featured .plan-btn { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); color: var(--white); }

/* PAYMENTS */
.payments-card { max-width: 500px; margin: 0 auto; }
.payments-body { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 48px 32px; text-align: center; }
.payments-body h3 { font-size: 18px; font-weight: 700; color: var(--text); }
.payments-body p { font-size: 14px; color: var(--text-dim); max-width: 300px; }

/* SCROLLBAR */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #252525; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #333; }

/* ════════════════════════════════════════════════
   ADMIN PAGE
════════════════════════════════════════════════ */
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.admin-list { padding: 8px; display: flex; flex-direction: column; gap: 4px; max-height: 420px; overflow-y: auto; }
.admin-agent-row, .admin-user-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 7px; background: var(--bg); border: 1px solid var(--border-dim); font-size: 12.5px; }
.admin-user-row { align-items: center; gap: 8px; }
.admin-user-info { display: flex; align-items: center; gap: 7px; flex: 1; min-width: 0; }
.admin-user-sub  { display: flex; flex-direction: column; gap: 2px; margin-right: 4px; }
.admin-user-meta { font-size: 10.5px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }
.admin-user-actions { display: flex; gap: 5px; flex-shrink: 0; }
.admin-status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; transition: background 0.3s; }
.admin-status-dot.online  { background: #aaa; box-shadow: 0 0 6px #aaa; }
.admin-status-dot.offline { background: #444; }
.admin-agent-host { font-weight: 600; color: var(--text); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-agent-url { color: var(--text-dim); font-family: 'JetBrains Mono', monospace; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.admin-agent-time { color: var(--text-muted); font-size: 11px; font-family: 'JetBrains Mono', monospace; flex-shrink: 0; }
.admin-user-name { font-weight: 600; color: var(--text); flex: 1; font-family: 'JetBrains Mono', monospace; }
.admin-role-badge { font-size: 10px; padding: 2px 7px; border-radius: 20px; background: rgba(255,255,255,0.06); color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; flex-shrink: 0; }
.admin-role-badge.admin { background: rgba(255,255,255,0.12); color: var(--text); }
.admin-user-plan { font-size: 11px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }

/* ── USER MODAL ───────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; z-index: 99999; background: rgba(0,0,0,0.75); display: flex; align-items: center; justify-content: center; backdrop-filter: blur(6px); }
.modal-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; width: 100%; max-width: 420px; box-shadow: 0 24px 60px rgba(0,0,0,0.6); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 14px; border-bottom: 1px solid var(--border-dim); font-size: 14px; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 16px; line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 13px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border-dim); display: flex; justify-content: flex-end; gap: 8px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: 11.5px; color: var(--text-dim); }
.form-group input, .form-group select { background: var(--bg-input); border: 1px solid var(--border); border-radius: 6px; color: var(--text); padding: 7px 10px; font-size: 13px; font-family: inherit; outline: none; }
.form-group input:focus, .form-group select:focus { border-color: #444; }
.form-group select option { background: var(--bg-card); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal-error { background: rgba(224,85,85,0.12); border: 1px solid rgba(224,85,85,0.3); color: #e05555; border-radius: 6px; padding: 8px 12px; font-size: 12.5px; }
.custom-msg-box { max-width: 420px; }
.custom-msg-text { font-size: 14px; color: var(--text-dim); line-height: 1.7; padding: 4px 0; }

/* ════════════════════════════════════════════════
   STATUS CHECK
════════════════════════════════════════════════ */
.status-check-card { display: flex; flex-direction: column; gap: 20px; }
.status-form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.status-form .field { margin: 0; }
.status-form select { appearance: none; -webkit-appearance: none; width: 100%; background: var(--bg-input); border: 1px solid var(--border); border-radius: 7px; color: var(--text); font-family: inherit; font-size: 13px; padding: 10px 32px 10px 12px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2 4L6 8L10 4' stroke='%23888' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; transition: border-color 0.2s; }
.status-form select:focus { outline: none; border-color: var(--accent); }
.btn-check { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 0 22px; background: var(--accent); color: var(--bg); border: none; border-radius: 8px; font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: opacity 0.15s, transform 0.1s; height: 40px; flex-shrink: 0; }
.btn-check:hover { opacity: 0.88; }
.btn-check:active { transform: scale(0.97); }
.status-result { border-radius: 10px; overflow: hidden; }
.status-checking { display: flex; align-items: center; gap: 10px; padding: 16px; color: var(--text-dim); font-size: 13px; }
.status-spinner { width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.status-result-row { display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--bg-hover); border-radius: 10px; border: 1px solid var(--border); }
.status-dot-lg { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.status-dot-lg.online  { background: #4ade80; box-shadow: 0 0 8px rgba(74,222,128,.5); }
.status-dot-lg.offline { background: var(--danger); box-shadow: 0 0 8px rgba(224,85,85,.4); }
.status-dot-sm { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-dot-sm.online  { background: #4ade80; }
.status-dot-sm.offline { background: var(--danger); }
.status-result-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.status-result-host   { font-size: 14px; font-weight: 600; color: var(--text); }
.status-result-detail { font-size: 12px; color: var(--text-dim); font-family: 'JetBrains Mono', monospace; }
.status-result-badge { padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; }
.status-result-badge.online  { background: rgba(74,222,128,0.12); color: #4ade80; border: 1px solid rgba(74,222,128,0.2); }
.status-result-badge.offline { background: rgba(224,85,85,0.12);  color: var(--danger); border: 1px solid rgba(224,85,85,0.2); }
.status-error { padding: 14px 16px; background: rgba(224,85,85,0.08); border: 1px solid rgba(224,85,85,0.2); border-radius: 8px; color: var(--danger); font-size: 13px; }
.status-history { display: flex; flex-direction: column; gap: 0; }
.status-history-title { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); padding: 4px 0 10px; }
.status-hist-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border-dim); font-size: 13px; }
.status-hist-row:last-child { border-bottom: none; }
.shist-host { flex: 1; font-family: 'JetBrains Mono', monospace; color: var(--text); }
.shist-type { color: var(--text-muted); font-size: 11px; font-weight: 600; text-transform: uppercase; }
.shist-lat  { color: var(--text-dim); font-size: 12px; min-width: 50px; text-align: right; }
.shist-age  { color: var(--text-muted); font-size: 11px; min-width: 55px; text-align: right; }
.shist-badge { padding: 2px 8px; border-radius: 20px; font-size: 10px; font-weight: 700; }
.shist-badge.online  { background: rgba(74,222,128,0.12); color: #4ade80; }
.shist-badge.offline { background: rgba(224,85,85,0.12);  color: var(--danger); }

/* ════════════════════════════════════════════════
   CUSTOM DROPDOWN
════════════════════════════════════════════════ */
.custom-dd { position: relative; width: 100%; }
.dd-trigger { width: 100%; display: flex; align-items: center; justify-content: space-between; background: var(--bg-input); border: 1px solid var(--border); border-radius: 7px; color: var(--text); font-family: inherit; font-size: 13px; padding: 10px 14px; cursor: pointer; transition: border-color 0.2s; text-align: left; }
.dd-trigger:hover { border-color: #333; }
.dd-trigger svg { flex-shrink: 0; color: var(--text-muted); transition: transform 0.2s; }
.dd-list { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; overflow-y: auto; max-height: 240px; display: none; box-shadow: 0 12px 40px rgba(0,0,0,0.7); }
.dd-list.open { display: block; }
.dd-item { padding: 9px 14px; font-size: 12.5px; color: var(--text-dim); cursor: pointer; font-family: 'JetBrains Mono', monospace; transition: background 0.1s, color 0.1s; }
.dd-item:hover  { background: var(--bg-hover); color: var(--text); }
.dd-item.selected { background: rgba(255,255,255,0.04); color: var(--white); }

/* ════════════════════════════════════════════════
   PROFILE PAGE
════════════════════════════════════════════════ */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.profile-full { grid-column: 1 / -1; }

.profile-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.backup-codes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.backup-code {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--accent);
  text-align: center;
  letter-spacing: 1px;
  user-select: all;
}

.backup-codes-warning {
  font-size: 12px;
  color: #fbbf24;
  background: rgba(251,191,36,0.08);
  border: 1px solid rgba(251,191,36,0.2);
  border-radius: 6px;
  padding: 8px 12px;
  line-height: 1.5;
}

.profile-theme-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.theme-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: border-color 0.15s, background 0.15s;
}
.theme-option:hover { background: var(--bg-hover); }
.theme-option.active { border-color: var(--accent); background: var(--bg-hover); }

.theme-dot-lg {
  width: 26px; height: 26px;
  border-radius: 50%;
}
.theme-dot-lg[data-theme="void"]    { background: radial-gradient(circle, #d4d4d4, #888); }
.theme-dot-lg[data-theme="cyber"]   { background: radial-gradient(circle, #3b9eff, #0044aa); }
.theme-dot-lg[data-theme="inferno"] { background: radial-gradient(circle, #ff8800, #ff2200); }
.theme-dot-lg[data-theme="matrix"]  { background: radial-gradient(circle, #00ff41, #007720); }
.theme-dot-lg[data-theme="pulse"]   { background: radial-gradient(circle, #dd44ff, #8800cc); }

.theme-option-label { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; }

.profile-2fa-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-info-text {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
}

/* ════════════════════════════════════════════════
   MOBILE HAMBURGER + SIDEBAR OVERLAY
════════════════════════════════════════════════ */
.hamburger-btn { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 36px; height: 36px; background: none; border: 1px solid var(--border); border-radius: 7px; cursor: pointer; padding: 8px; flex-shrink: 0; }
.hamburger-btn span { display: block; width: 100%; height: 2px; background: var(--text-dim); border-radius: 2px; transition: background 0.15s; }
.hamburger-btn:hover span { background: var(--text); }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 9; backdrop-filter: blur(2px); }
.sidebar-overlay.open { display: block; }

/* ════════════════════════════════════════════════
   RESPONSIVE / MOBILE
════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .hamburger-btn { display: flex; }
  .sidebar { position: fixed; left: -260px; top: 0; bottom: 0; z-index: 20; transition: left 0.25s ease; width: 240px; }
  .sidebar.open { left: 0; }
  .app-shell { flex-direction: column; }
  .main-content { width: 100%; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .lower-grid { grid-template-columns: 1fr; }
  .panel-grid { grid-template-columns: 1fr; height: auto; }
  .admin-grid { grid-template-columns: 1fr; }
  .plans-grid { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .profile-full { grid-column: 1; }
  .topbar { padding: 12px 16px; gap: 10px; }
  .page { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: 1; }
  .modal-box { margin: 0 16px; }
}
