/* ===== VPN PORTAL — REDESIGNED ===== */
:root {
  /* Sidebar (dark navy) */
  --sb-bg:          #1b2240;
  --sb-border:      rgba(255,255,255,0.07);
  --sb-text:        #8892b4;
  --sb-text-hover:  #cdd3ee;
  --sb-text-active: #ffffff;
  --sb-active-bg:   rgba(94,115,214,0.18);
  --sb-hover-bg:    rgba(255,255,255,0.05);

  /* Content */
  --bg-body:   #f0f2f9;
  --bg-card:   #ffffff;
  --border:    #e3e7f0;
  --border-2:  #cdd3e8;

  /* Accent — one colour only */
  --accent:       #4f6cf7;
  --accent-dark:  #3b56e0;
  --accent-soft:  #eef1fd;
  --accent-mid:   #c7d0fb;

  /* Semantic */
  --green:       #0ea472;
  --green-soft:  #ebfbf5;
  --green-mid:   #99e6cc;
  --red:         #e5484d;
  --red-soft:    #fff0f0;
  --red-mid:     #fbb;
  --amber:       #c47d0a;
  --amber-soft:  #fffbeb;
  --amber-mid:   #fde68a;

  /* Typography */
  --t1: #1a2046;
  --t2: #5c6882;
  --t3: #9aa3be;

  /* Spacing */
  --sidebar-w:    250px;
  --topbar-h:     60px;
  --r:            10px;
  --r-lg:         14px;
  --ease:         all 0.15s ease;
  --shadow-xs:    0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm:    0 1px 4px rgba(0,0,0,0.07), 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.09), 0 1px 4px rgba(0,0,0,0.05);
  --shadow-lg:    0 12px 40px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-body);
  color: var(--t1);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== UTILITIES ===== */
.hidden { display: none !important; }
.page { display: none; height: 100vh; width: 100vw; }
.page.active { display: flex; }

/* ===== LOGIN ===== */
#login-page {
  align-items: center;
  justify-content: center;
  background: #f0f2f9;
  position: relative;
  overflow: hidden;
}

#login-page::before {
  content: '';
  position: absolute;
  top: -200px; left: -200px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(79,108,247,0.12) 0%, transparent 70%);
  pointer-events: none;
}
#login-page::after {
  content: '';
  position: absolute;
  bottom: -150px; right: -150px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(14,164,114,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.login-bg, .orb, .grid-overlay { display: none !important; }

.login-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  padding: 1.5rem;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 2rem;
}

.logo-icon { width: 44px; height: 44px; flex-shrink: 0; }
.logo-icon.small { width: 30px; height: 30px; }

.login-logo h1 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--t1);
  letter-spacing: -0.01em;
}
.login-logo p { font-size: 0.75rem; color: var(--t3); margin-top: 2px; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 1.1rem; }
.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--t2);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.input-wrapper { position: relative; display: flex; align-items: center; }

.input-wrapper .input-icon {
  position: absolute; left: 11px;
  width: 15px; height: 15px;
  color: var(--t3); pointer-events: none; z-index: 1;
}
.input-icon svg { width: 100%; height: 100%; }

.input-wrapper input,
.form-group input:not(.input-wrapper input),
.form-group textarea {
  width: 100%;
  padding: 0.65rem 0.875rem;
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--t1);
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: var(--ease);
}
.input-wrapper input { padding-left: 2.25rem; }
.form-group textarea { resize: vertical; }

.input-wrapper input:focus,
.form-group input:not(.input-wrapper input):focus,
.form-group textarea:focus {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-mid);
}
.search-box input:focus { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-mid); }

.toggle-pass {
  position: absolute; right: 10px;
  background: none; border: none;
  color: var(--t3); cursor: pointer;
  padding: 4px; width: 22px; height: 22px;
}
.toggle-pass svg { width: 100%; height: 100%; }
.toggle-pass:hover { color: var(--t2); }

.error-msg   { color: #9b1c1c; font-size: 0.8rem; padding: 0.65rem 0.9rem; background: var(--red-soft); border: 1px solid var(--red-mid); border-radius: var(--r); margin-bottom: 0.875rem; }
.success-msg { color: #065f46; font-size: 0.8rem; padding: 0.65rem 0.9rem; background: var(--green-soft); border: 1px solid var(--green-mid); border-radius: var(--r); margin-bottom: 0.875rem; }
.req { color: var(--red); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.58rem 1.1rem;
  border-radius: var(--r);
  font-size: 0.85rem; font-weight: 500;
  font-family: inherit; cursor: pointer; border: none;
  transition: var(--ease); text-decoration: none; white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-xs); }
.btn-primary:hover:not(:disabled) { background: var(--accent-dark); box-shadow: var(--shadow-sm); }

.btn-secondary { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-mid); }
.btn-secondary:hover:not(:disabled) { background: var(--accent-mid); }

.btn-ghost { background: var(--bg-card); color: var(--t2); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-body); color: var(--t1); border-color: var(--border-2); }

.btn-danger { background: var(--red-soft); color: var(--red); border: 1px solid var(--red-mid); }
.btn-danger:hover { background: var(--red-mid); }

.btn-icon {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px; cursor: pointer;
  color: var(--t3); transition: var(--ease); flex-shrink: 0;
}
.btn-icon svg { width: 15px; height: 15px; }
.btn-icon:hover { background: var(--bg-body); color: var(--t1); border-color: var(--border); }

/* sidebar btn-icon (dark bg) */
.sidebar .btn-icon { color: var(--sb-text); }
.sidebar .btn-icon:hover { background: var(--sb-hover-bg); color: var(--sb-text-hover); border-color: var(--sb-border); }

.btn-full { width: 100%; justify-content: center; padding: 0.8rem; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sb-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 50;
  transition: transform 0.25s ease;
  border-right: 1px solid var(--sb-border);
}

.sidebar-logo {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 1.2rem 1.1rem 1rem;
  border-bottom: 1px solid var(--sb-border);
}
.sidebar-logo span {
  font-size: 0.9rem; font-weight: 700;
  color: #fff; letter-spacing: -0.01em;
}

.sidebar-nav {
  flex: 1; padding: 0.75rem 0.6rem;
  overflow-y: auto; display: flex;
  flex-direction: column; gap: 1px;
}

.nav-section-label {
  font-size: 0.62rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: rgba(255,255,255,0.25);
  padding: 1.1rem 0.75rem 0.4rem;
}

.nav-item {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  color: var(--sb-text);
  text-decoration: none;
  font-size: 0.85rem; font-weight: 500;
  transition: var(--ease); cursor: pointer;
  position: relative;
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; }
.nav-item:hover { background: var(--sb-hover-bg); color: var(--sb-text-hover); }
.nav-item.active { background: var(--sb-active-bg); color: var(--sb-text-active); }
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 18%; height: 64%;
  width: 3px; background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.nav-badge {
  margin-left: auto;
  background: rgba(79,108,247,0.25);
  color: #a5b4fc;
  font-size: 0.68rem; font-weight: 600;
  padding: 1px 7px; border-radius: 99px;
}

.sidebar-footer {
  padding: 0.9rem 1rem;
  border-top: 1px solid var(--sb-border);
  display: flex; align-items: center; gap: 0.6rem;
}

.user-info { flex: 1; display: flex; align-items: center; gap: 0.65rem; min-width: 0; }

.user-avatar {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; color: #fff; flex-shrink: 0;
}

.user-details { min-width: 0; }
.user-name { font-size: 0.8rem; font-weight: 600; color: #e2e8f9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 0.68rem; color: var(--sb-text); }
.logout-btn { flex-shrink: 0; }

/* ===== MAIN CONTENT ===== */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--bg-body); }

/* ===== TOPBAR ===== */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}

.topbar-left { display: flex; align-items: center; gap: 0.875rem; }
.sidebar-toggle { display: none; }

.breadcrumb {
  font-size: 0.875rem; font-weight: 600; color: var(--t1);
}

.topbar-right { display: flex; align-items: center; gap: 0.875rem; }

.server-badge {
  display: flex; align-items: center; gap: 0.45rem;
  padding: 0.3rem 0.8rem;
  background: var(--green-soft);
  border: 1px solid var(--green-mid);
  border-radius: 99px;
  font-size: 0.73rem; font-weight: 500;
  color: var(--green);
  font-family: 'JetBrains Mono', monospace;
}

.dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.dot.green  { background: var(--green);  animation: blink 2s infinite; }
.dot.red    { background: var(--red); }
.dot.yellow { background: var(--amber); }

@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

.quota-bar { font-size: 0.75rem; color: var(--t2); }

/* ===== VIEW CONTAINER ===== */
.view-container { flex: 1; overflow-y: auto; padding: 1.5rem; }

.view { display: none; }
.view.active { display: block; animation: fadein 0.2s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.view-header {
  display: flex; align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem; gap: 1rem;
}
.view-header h2 { font-size: 1.35rem; font-weight: 700; color: var(--t1); letter-spacing: -0.02em; }
.view-header p  { font-size: 0.82rem; color: var(--t3); margin-top: 3px; }
.header-actions { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }

/* ===== STATS GRID ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.2rem 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: var(--ease);
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: var(--r-lg) 0 0 var(--r-lg);
}
.stat-card:nth-child(1)::after { background: var(--accent); }
.stat-card:nth-child(2)::after { background: var(--green); }
.stat-card:nth-child(3)::after { background: #8b5cf6; }
.stat-card:nth-child(4)::after { background: var(--amber); }
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.stat-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 20px; height: 20px; }
.stat-icon.indigo { background: var(--accent-soft);  color: var(--accent); }
.stat-icon.cyan   { background: var(--green-soft);   color: var(--green); }
.stat-icon.purple { background: #f5f3ff;              color: #7c3aed; }
.stat-icon.orange { background: var(--amber-soft);   color: var(--amber); }

.stat-value { font-size: 1.8rem; font-weight: 700; color: var(--t1); line-height: 1; letter-spacing: -0.03em; }
.stat-label { font-size: 0.73rem; color: var(--t3); margin-top: 4px; font-weight: 500; }

/* ===== RECENT ACTIVITY ===== */
.recent-section h3 {
  font-size: 0.9rem; font-weight: 600;
  color: var(--t2); margin-bottom: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.06em;
}

.activity-list { display: flex; flex-direction: column; gap: 1px; }

.activity-item {
  display: flex; align-items: center; gap: 0.875rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-size: 0.8rem;
  transition: var(--ease);
}
.activity-item:hover { border-color: var(--border-2); background: #fafbff; }
.activity-item + .activity-item { border-top: none; border-radius: 0; }
.activity-item:first-child { border-radius: var(--r) var(--r) 0 0; }
.activity-item:last-child  { border-radius: 0 0 var(--r) var(--r); border-top: none; }
.activity-item:only-child  { border-radius: var(--r); }

.activity-dot    { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.activity-actor  { font-weight: 600; color: var(--t1); }
.activity-action { color: var(--accent); font-weight: 500; }
.activity-target { color: var(--t2); }
.activity-time   { margin-left: auto; color: var(--t3); font-size: 0.71rem; white-space: nowrap; font-family: 'JetBrains Mono', monospace; }

/* ===== SEARCH BOX ===== */
.search-box { position: relative; display: flex; align-items: center; }
.search-box svg { position: absolute; left: 10px; width: 15px; height: 15px; color: var(--t3); pointer-events: none; }
.search-box input {
  padding: 0.5rem 0.875rem 0.5rem 2.1rem !important;
  width: 210px; border-radius: var(--r);
  background: var(--bg-body); border: 1px solid var(--border);
  color: var(--t1); font-size: 0.82rem; font-family: inherit;
  outline: none; transition: var(--ease);
}

/* ===== PROTOCOL FILTER ===== */
.protocol-filter { display: flex; gap: 0.4rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.filter-btn {
  padding: 0.35rem 0.875rem; border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--bg-card); color: var(--t2);
  font-size: 0.78rem; font-weight: 500;
  font-family: inherit; cursor: pointer; transition: var(--ease);
}
.filter-btn:hover { border-color: var(--border-2); color: var(--t1); }
.filter-btn.active { background: var(--accent-soft); border-color: var(--accent-mid); color: var(--accent); font-weight: 600; }

/* ===== CREDENTIALS GRID ===== */
.credentials-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 0.875rem; }

.cred-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.2rem;
  box-shadow: var(--shadow-sm);
  transition: var(--ease);
  position: relative;
  overflow: hidden;
}
.cred-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
}
.cred-card.wg::before    { background: var(--accent); }
.cred-card.l2tp::before  { background: var(--green); }
.cred-card.pptp::before  { background: var(--amber); }
.cred-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-2); transform: translateY(-1px); }

.cred-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 0.875rem; }
.cred-site { font-size: 0.95rem; font-weight: 700; color: var(--t1); }
.cred-user { font-size: 0.72rem; color: var(--t3); margin-top: 2px; font-family: 'JetBrains Mono', monospace; }

.proto-badge {
  font-size: 0.62rem; font-weight: 700;
  padding: 3px 8px; border-radius: 99px; letter-spacing: 0.04em;
}
.proto-badge.wg   { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-mid); }
.proto-badge.l2tp { background: var(--green-soft);  color: var(--green);  border: 1px solid var(--green-mid); }
.proto-badge.pptp { background: var(--amber-soft);  color: var(--amber);  border: 1px solid var(--amber-mid); }

.cred-details { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 0.875rem; }
.cred-detail { display: flex; justify-content: space-between; font-size: 0.77rem; }
.cred-detail-label { color: var(--t3); }
.cred-detail-value { color: var(--t2); font-family: 'JetBrains Mono', monospace; font-size: 0.73rem; }

.cred-actions { display: flex; gap: 0.4rem; }
.cred-actions .btn { font-size: 0.73rem; padding: 0.38rem 0.7rem; }

.status-dot { display: inline-flex; align-items: center; gap: 4px; }

/* ===== CREATE FORM ===== */
.create-layout { display: grid; grid-template-columns: 1fr 320px; gap: 1.25rem; align-items: start; }

.create-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.protocol-selector { display: flex; flex-direction: column; gap: 0.6rem; }
.proto-option { cursor: pointer; }
.proto-option input { display: none; }
.proto-card {
  display: flex; align-items: center; gap: 0.875rem;
  padding: 0.8rem 0.9rem;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--bg-body);
  transition: var(--ease);
}
.proto-card:hover { border-color: var(--accent-mid); background: var(--accent-soft); }
.proto-option input:checked + .proto-card {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent);
}

.proto-icon {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.63rem; font-weight: 800; flex-shrink: 0;
}
.proto-icon.wg { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-mid); }
.proto-icon.l2 { background: var(--green-soft);  color: var(--green);  border: 1px solid var(--green-mid); }
.proto-icon.pp { background: var(--amber-soft);  color: var(--amber);  border: 1px solid var(--amber-mid); }

.proto-info  { flex: 1; }
.proto-name  { display: block; font-size: 0.85rem; font-weight: 600; color: var(--t1); }
.proto-desc  { display: block; font-size: 0.71rem; color: var(--t3); margin-top: 1px; }

.proto-check {
  width: 17px; height: 17px; border-radius: 50%;
  border: 2px solid var(--border-2); flex-shrink: 0; transition: var(--ease);
}
.proto-option input:checked + .proto-card .proto-check {
  border-color: var(--accent); background: var(--accent);
}

/* ===== INFO PANEL ===== */
.create-info-panel { display: flex; flex-direction: column; gap: 0.875rem; }

.info-card, .quota-info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.1rem;
  box-shadow: var(--shadow-sm);
}
.info-card h4, .quota-info-card h4 {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--t3); margin-bottom: 0.875rem;
}
.info-item { margin-bottom: 0.875rem; }
.info-item:last-child { margin-bottom: 0; }
.info-item p { font-size: 0.77rem; color: var(--t2); margin-top: 0.35rem; line-height: 1.6; }

.badge-wg { font-size: 0.68rem; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-mid); }
.badge-l2 { font-size: 0.68rem; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: var(--green-soft);  color: var(--green);  border: 1px solid var(--green-mid); }
.badge-pp { font-size: 0.68rem; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: var(--amber-soft);  color: var(--amber);  border: 1px solid var(--amber-mid); }

.quota-display { display: flex; flex-direction: column; gap: 0.5rem; }
.quota-track { height: 5px; background: var(--border); border-radius: 99px; overflow: hidden; }
.quota-fill  { height: 100%; border-radius: 99px; background: var(--accent); transition: width 0.5s ease; }
.quota-text  { font-size: 0.77rem; color: var(--t2); }

/* ===== ADMINS GRID ===== */
.admins-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 0.875rem; }

.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.2rem;
  box-shadow: var(--shadow-sm);
  transition: var(--ease);
}
.admin-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-2); }

.admin-card-header { display: flex; align-items: center; gap: 0.875rem; margin-bottom: 0.875rem; }

.admin-avatar {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem; font-weight: 700; color: #fff; flex-shrink: 0;
}

.admin-name     { font-size: 0.9rem; font-weight: 600; color: var(--t1); }
.admin-username { font-size: 0.72rem; color: var(--t3); font-family: 'JetBrains Mono', monospace; }

.admin-stats { display: flex; gap: 0.75rem; margin-bottom: 0.875rem; }
.admin-stat  {
  flex: 1; text-align: center; padding: 0.55rem;
  background: var(--bg-body); border: 1px solid var(--border); border-radius: 8px;
}
.admin-stat-value { font-size: 1.15rem; font-weight: 700; color: var(--t1); }
.admin-stat-label { font-size: 0.62rem; color: var(--t3); margin-top: 2px; }

.admin-quota-bar   { margin-bottom: 0.875rem; }
.admin-quota-track { height: 4px; background: var(--border); border-radius: 99px; overflow: hidden; margin-top: 0.35rem; }
.admin-quota-fill  { height: 100%; border-radius: 99px; background: var(--accent); }
.admin-quota-label { font-size: 0.71rem; color: var(--t3); }

.admin-actions { display: flex; gap: 0.4rem; }

.admin-pass-row {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--bg-body); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.4rem 0.7rem; margin-bottom: 0.75rem;
}
.admin-pass-label { font-size: 0.7rem; color: var(--t3); white-space: nowrap; }
.admin-pass-val   { font-size: 0.78rem; color: var(--t2); flex: 1; word-break: break-all; }
.btn-icon-sm {
  background: none; border: none; cursor: pointer;
  color: var(--t3); padding: 2px 4px; border-radius: 4px;
  display: flex; align-items: center; transition: color 0.15s; flex-shrink: 0;
}
.btn-icon-sm:hover { color: var(--accent); }

/* ===== SESSIONS TABLE ===== */
.sessions-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: auto;
  box-shadow: var(--shadow-sm);
}
.sessions-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.sessions-table th {
  text-align: left; padding: 0.75rem 1rem;
  font-size: 0.68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--t3);
  border-bottom: 1px solid var(--border); white-space: nowrap;
  background: var(--bg-body);
}
.sessions-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--t2); vertical-align: middle;
}
.sessions-table tr:last-child td { border-bottom: none; }
.sessions-table tr:hover td { background: #fafbff; }
.sess-user { font-weight: 600; color: var(--t1); font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; }
.sess-iface { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; color: var(--accent); }
.sess-ip   { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; }
.sess-data { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; }
.sess-up   { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; color: var(--green); }
.online-dot { display:inline-flex; align-items:center; gap:5px; }
.no-sessions { text-align:center; color:var(--t3); padding:2rem; font-size:0.85rem; }

/* ===== LOGS TABLE ===== */
.logs-table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: auto;
  box-shadow: var(--shadow-sm);
}
.logs-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.logs-table th {
  text-align: left; padding: 0.8rem 1rem;
  font-size: 0.68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--t3);
  border-bottom: 1px solid var(--border); white-space: nowrap;
  background: var(--bg-body);
}
.logs-table td {
  padding: 0.68rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--t2); vertical-align: middle;
}
.logs-table tr:last-child td { border-bottom: none; }
.logs-table tr:hover td { background: #fafbff; }
.log-action { font-family: 'JetBrains Mono', monospace; font-size: 0.71rem; color: var(--accent); font-weight: 600; }
.log-time   { color: var(--t3); font-family: 'JetBrains Mono', monospace; font-size: 0.71rem; }

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(16,24,50,0.4);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 1rem;
  animation: fadein 0.15s ease;
}

.modal-box {
  width: 100%; max-width: 540px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.2s ease;
  max-height: 90vh; overflow-y: auto;
}
.modal-wide  { max-width: 700px; }
.modal-small { max-width: 400px; }

@keyframes modal-in {
  from { opacity: 0; transform: translateY(-10px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

.modal-header {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1rem; font-weight: 700; color: var(--t1); }

.modal-footer {
  display: flex; justify-content: flex-end; gap: 0.6rem;
  margin-top: 1.25rem; padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ===== VERSION PICKER ===== */
.version-pick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.875rem; margin-bottom: 0.5rem; }

.version-pick-btn {
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
  padding: 1.5rem 1rem;
  background: var(--bg-body); border: 1.5px solid var(--border);
  border-radius: var(--r-lg); cursor: pointer; transition: var(--ease); font-family: inherit;
}
.version-pick-btn:hover {
  border-color: var(--accent); background: var(--accent-soft);
  transform: translateY(-2px); box-shadow: var(--shadow-md);
}
.version-pick-label {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem; font-weight: 800; color: #fff;
}
.version-pick-name { font-size: 0.9rem; font-weight: 700; color: var(--t1); }
.version-pick-sub  { font-size: 0.71rem; color: var(--t3); }

/* ===== SCRIPT VIEW ===== */
.version-tabs { display: flex; gap: 0.4rem; margin-bottom: 0.875rem; }
.tab-btn {
  padding: 0.35rem 0.9rem;
  border-radius: var(--r); border: 1px solid var(--border);
  background: var(--bg-body); color: var(--t2);
  font-size: 0.78rem; font-weight: 500; font-family: inherit;
  cursor: pointer; transition: var(--ease);
}
.tab-btn.active { background: var(--accent-soft); border-color: var(--accent-mid); color: var(--accent); font-weight: 600; }

.script-container { position: relative; }

.copy-btn {
  position: absolute; top: 0.65rem; right: 0.65rem;
  display: flex; align-items: center; gap: 0.35rem;
  padding: 0.28rem 0.65rem;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px; color: #94a3b8;
  font-size: 0.72rem; font-weight: 500; font-family: inherit;
  cursor: pointer; transition: var(--ease); z-index: 1;
}
.copy-btn:hover { background: rgba(255,255,255,0.18); color: #e2e8f0; }
.copy-btn svg { width: 13px; height: 13px; }

.script-code {
  background: #1a2035;
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.77rem; color: #cbd5e1;
  line-height: 1.7; white-space: pre-wrap;
  word-break: break-all; max-height: 380px; overflow-y: auto;
}

/* ===== DETAIL MODAL ===== */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 0.875rem; }
.detail-field {
  background: var(--bg-body); border: 1px solid var(--border);
  border-radius: var(--r); padding: 0.8rem;
}
.detail-field-label { font-size: 0.67rem; color: var(--t3); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 0.35rem; }
.detail-field-value { font-size: 0.83rem; color: var(--t1); font-family: 'JetBrains Mono', monospace; word-break: break-all; }
.detail-field-value.password { color: var(--accent); }

/* ===== MISC ===== */
.loading-pulse {
  color: var(--t3); font-size: 0.85rem; padding: 2rem;
  text-align: center; animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

.glass { background: var(--bg-card); border: 1px solid var(--border); }
.glass:hover { border-color: var(--border-2); }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #b0bdd6; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .stats-grid    { grid-template-columns: repeat(2, 1fr); }
  .create-layout { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { position: fixed; transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sidebar-toggle { display: flex; }
  .stats-grid       { grid-template-columns: repeat(2, 1fr); }
  .form-row         { grid-template-columns: 1fr; }
  .credentials-grid { grid-template-columns: 1fr; }
  .admins-grid      { grid-template-columns: 1fr; }
}
