/* =============================================
   HostPanel — Main Stylesheet
   Dark Professional Theme
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Core palette */
  --bg-base:       #0d1117;
  --bg-surface:    #161b22;
  --bg-elevated:   #1c2333;
  --bg-card:       #1e2636;
  --bg-hover:      #243044;

  /* Accent */
  --accent:        #3b82f6;
  --accent-hover:  #2563eb;
  --accent-glow:   rgba(59,130,246,0.18);
  --accent-light:  rgba(59,130,246,0.1);

  /* Text */
  --text-primary:  #e6edf3;
  --text-secondary:#8b949e;
  --text-muted:    #484f58;
  --text-inverse:  #0d1117;

  /* Borders */
  --border:        rgba(48,54,61,0.9);
  --border-focus:  rgba(59,130,246,0.5);

  /* Status */
  --success:       #3fb950;
  --success-bg:    rgba(63,185,80,0.12);
  --warning:       #d29922;
  --warning-bg:    rgba(210,153,34,0.12);
  --danger:        #f85149;
  --danger-bg:     rgba(248,81,73,0.12);
  --info:          #58a6ff;
  --info-bg:       rgba(88,166,255,0.12);
  --muted:         #8b949e;
  --muted-bg:      rgba(139,148,158,0.12);

  /* Typography */
  --font:       'Plus Jakarta Sans', sans-serif;
  --font-mono:  'JetBrains Mono', monospace;

  /* Layout */
  --sidebar-w:  240px;
  --topbar-h:   60px;
  --radius:     10px;
  --radius-lg:  16px;
  --shadow:     0 4px 24px rgba(0,0,0,0.4);
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.3);
}

/* ── Reset ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
input, select, textarea, button { font-family: inherit; }

/* ── Auth / Login page ───────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(59,130,246,0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(59,130,246,0.04) 0%, transparent 50%);
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow);
}
.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.auth-logo .logo-mark {
  width: 52px; height: 52px;
  background: var(--accent);
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 0 30px var(--accent-glow);
}
.auth-logo h1 { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); }
.auth-logo p  { font-size: 0.85rem; color: var(--text-secondary); margin-top: 0.2rem; }
.auth-card h2 { font-size: 1.25rem; font-weight: 600; margin-bottom: 1.5rem; }

/* ── App Layout ──────────────────────────────── */
.app { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform 0.25s ease;
}
.sidebar-logo {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.sidebar-logo .mark {
  width: 34px; height: 34px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  box-shadow: 0 0 16px var(--accent-glow);
}
.sidebar-logo span { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); }
.sidebar-logo small { font-size: 0.7rem; color: var(--text-secondary); display: block; }

.sidebar-nav { flex: 1; padding: 1rem 0; overflow-y: auto; }
.nav-section-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0.6rem 1.5rem 0.3rem;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 1.5rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0;
  transition: all 0.15s ease;
  cursor: pointer;
  position: relative;
}
.nav-item:hover { color: var(--text-primary); background: var(--bg-hover); text-decoration: none; }
.nav-item.active {
  color: var(--accent);
  background: var(--accent-light);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}
.nav-icon { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}
.user-avatar-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}
.avatar-name { font-size: 0.82rem; font-weight: 600; }
.avatar-role { font-size: 0.7rem; color: var(--text-secondary); }

/* Topbar */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title { font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.topbar-right  { margin-left: auto; display: flex; align-items: center; gap: 0.75rem; }
.topbar-btn {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.15s;
}
.topbar-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.hamburger { display: none; }

/* Main content */
.main-wrap { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; }
.content   { padding: 1.75rem; flex: 1; }

/* ── Cards ───────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-header {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.card-title { font-size: 0.95rem; font-weight: 600; }
.card-body  { padding: 1.5rem; }
.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}

/* ── Stat cards ──────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.stat-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.stat-icon.blue   { background: var(--info-bg);    color: var(--info); }
.stat-icon.green  { background: var(--success-bg); color: var(--success); }
.stat-icon.yellow { background: var(--warning-bg); color: var(--warning); }
.stat-icon.red    { background: var(--danger-bg);  color: var(--danger); }
.stat-value { font-size: 1.65rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 0.78rem; color: var(--text-secondary); margin-top: 0.3rem; }
.stat-change {
  font-size: 0.72rem;
  margin-top: 0.4rem;
  color: var(--success);
}

/* ── Tables ──────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}
tbody td {
  padding: 0.85rem 1rem;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-hover); }

/* ── Forms ───────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }
.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}
.form-control {
  width: 100%;
  padding: 0.6rem 0.85rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-control::placeholder { color: var(--text-muted); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-text { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.3rem; }

/* ── Buttons ─────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--bg-hover); }
.btn-success { background: var(--success-bg); color: var(--success); border-color: rgba(63,185,80,0.25); }
.btn-danger  { background: var(--danger-bg);  color: var(--danger);  border-color: rgba(248,81,73,0.25); }
.btn-warning { background: var(--warning-bg); color: var(--warning); border-color: rgba(210,153,34,0.25); }
.btn-sm  { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-lg  { padding: 0.75rem 1.5rem;  font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon { width: 32px; height: 32px; padding: 0; justify-content: center; border-radius: 8px; }
.btn[disabled], .btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Badges ──────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-info    { background: var(--info-bg);     color: var(--info); }
.badge-muted   { background: var(--muted-bg);    color: var(--muted); }

/* ── Alerts ──────────────────────────────────── */
.alert {
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  border: 1px solid transparent;
}
.alert span:first-child { flex-shrink: 0; font-weight: 600; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: rgba(63,185,80,0.2); }
.alert-error   { background: var(--danger-bg);  color: var(--danger);  border-color: rgba(248,81,73,0.2); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: rgba(210,153,34,0.2); }
.alert-info    { background: var(--info-bg);     color: var(--info);    border-color: rgba(88,166,255,0.2); }

/* ── Misc ────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
}
.page-title { font-size: 1.4rem; font-weight: 700; }
.page-subtitle { font-size: 0.82rem; color: var(--text-secondary); margin-top: 0.2rem; }

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 0.75rem; opacity: 0.5; }
.empty-state p { font-size: 0.875rem; }

.pagination {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 1.25rem;
}
.pagination a, .pagination span {
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: var(--bg-elevated);
  text-decoration: none;
}
.pagination a:hover { background: var(--bg-hover); color: var(--text-primary); }
.pagination .active { background: var(--accent); color: white; border-color: var(--accent); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.text-muted { color: var(--text-secondary); }
.text-sm    { font-size: 0.82rem; }
.text-mono  { font-family: var(--font-mono); font-size: 0.82rem; }
.fw-600     { font-weight: 600; }
.d-flex     { display: flex; }
.align-center { align-items: center; }
.gap-1 { gap: 0.5rem; } .gap-2 { gap: 1rem; }

/* Progress bar */
.progress { height: 6px; background: var(--bg-hover); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 99px; background: var(--accent); transition: width 0.4s ease; }

/* Plan card */
.plan-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.2s, transform 0.2s;
}
.plan-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.plan-card.featured { border-color: var(--accent); background: linear-gradient(180deg, var(--accent-light) 0%, var(--bg-card) 60%); }
.plan-name  { font-size: 1.1rem; font-weight: 700; }
.plan-price { font-size: 2rem; font-weight: 800; color: var(--accent); line-height: 1; }
.plan-price sup { font-size: 1rem; font-weight: 500; }
.plan-price span { font-size: 0.85rem; font-weight: 400; color: var(--text-secondary); }
.plan-features { list-style: none; padding: 0; margin: 0.75rem 0; }
.plan-features li { padding: 0.3rem 0; font-size: 0.875rem; color: var(--text-secondary); }
.plan-features li::before { content: '✓ '; color: var(--success); font-weight: 700; }

/* Search */
.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.45rem 0.85rem;
  gap: 0.5rem;
}
.search-bar input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.875rem;
  width: 220px;
}
.search-bar input::placeholder { color: var(--text-muted); }

/* ── Responsive ──────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-wrap { margin-left: 0; }
  .hamburger { display: flex; }
  .form-row { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .content { padding: 1rem; }
  .topbar { padding: 0 1rem; }
}
