/* ============================================================
   NETCLICK — Panel CSS (Client + Admin)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  --dark:       #0a0f1e;
  --dark-2:     #0d1426;
  --dark-3:     #111827;
  --card-bg:    #131c30;
  --border:     rgba(255,255,255,0.07);
  --primary:    #0ea5e9;
  --primary-dk: #0284c7;
  --accent:     #f97316;
  --success:    #22c55e;
  --warning:    #f59e0b;
  --danger:     #ef4444;
  --text-muted: #94a3b8;
  --sidebar-w:  260px;
  --topbar-h:   64px;
  --radius:     12px;
  --radius-sm:  8px;
  --transition: 0.25s ease;
  --shadow:     0 4px 24px rgba(0,0,0,0.35);
}

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

body {
  font-family: 'Outfit', sans-serif;
  background: var(--dark);
  color: #e2e8f0;
  font-size: 0.9375rem;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; }

/* ---- LAYOUT ---- */
.panel-layout { display: flex; min-height: 100vh; }

/* ---- SIDEBAR ---- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--dark-2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: transform var(--transition);
}
.sidebar-brand {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  min-height: var(--topbar-h);
}
.sidebar-brand img { height: 36px; width: auto; }
.sidebar-brand-label {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-muted);
}
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}
.sidebar-nav::-webkit-scrollbar {
  width: 5px;
}
.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 99px;
  transition: background var(--transition);
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(14, 165, 233, 0.35);
}
.nav-section-label {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-muted);
  padding: 1rem 1.5rem 0.4rem;
}
.nav-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.65rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.875rem; font-weight: 500;
  border-radius: 0; cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,0.04); }
.nav-item.active {
  color: var(--primary);
  background: rgba(14,165,233,0.08);
  border-right: 3px solid var(--primary);
}
.nav-item i { width: 18px; text-align: center; font-size: 0.9rem; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--danger); color: #fff;
  font-size: 0.65rem; font-weight: 700;
  padding: 2px 7px; border-radius: 999px;
}
.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 0.75rem;
}
.sidebar-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dk));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem; color: #fff; flex-shrink: 0;
}
.sidebar-user-name { font-size: 0.85rem; font-weight: 600; color: #fff; }
.sidebar-user-role { font-size: 0.72rem; color: var(--text-muted); }
.sidebar-logout { margin-left: auto; color: var(--text-muted); font-size: 1rem; transition: color var(--transition); }
.sidebar-logout:hover { color: var(--danger); }

/* ---- MAIN CONTENT ---- */
.panel-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex; flex-direction: column;
  min-height: 100vh;
  min-width: 0; /* Flexbox overflow fix */
}

/* ---- TOPBAR ---- */
.topbar {
  height: var(--topbar-h);
  background: var(--dark-2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem;
  position: sticky; top: 0; z-index: 100;
}
.topbar-title { font-size: 1.1rem; font-weight: 700; color: #fff; }
.topbar-right { display: flex; align-items: center; gap: 1.25rem; }
.topbar-icon-btn {
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 0.9rem;
  cursor: pointer; transition: all var(--transition); position: relative;
}
.topbar-icon-btn:hover { border-color: var(--primary); color: var(--primary); }
.topbar-notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger); border: 2px solid var(--dark-2);
}
.mob-toggle {
  display: none; background: none; border: none;
  color: #fff; font-size: 1.2rem; cursor: pointer;
}

/* ---- PAGE CONTENT ---- */
.panel-content { flex: 1; padding: 2rem; }
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 1.4rem; font-weight: 800; color: #fff; }
.page-header p { font-size: 0.875rem; color: var(--text-muted); margin-top: 0.25rem; }

/* ---- STAT CARDS ---- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.25rem; margin-bottom: 2rem; }
.stat-card {
  background: linear-gradient(135deg, rgba(19,28,48,0.7) 0%, rgba(13,20,38,0.8) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  display: flex; align-items: center; gap: 1.25rem;
  transition: all var(--transition);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.stat-card:hover {
  border-color: rgba(14,165,233,0.3);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25), 0 0 20px rgba(14,165,233,0.05);
}
.stat-icon {
  width: 46px; height: 46px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.stat-icon.blue   { background: rgba(14,165,233,0.12); color: var(--primary); }
.stat-icon.orange { background: rgba(249,115,22,0.12);  color: var(--accent); }
.stat-icon.green  { background: rgba(34,197,94,0.12);   color: var(--success); }
.stat-icon.red    { background: rgba(239,68,68,0.12);   color: var(--danger); }
.stat-icon.purple { background: rgba(139,92,246,0.12);  color: #8b5cf6; }
.stat-value { font-size: 1.75rem; font-weight: 800; color: #fff; line-height: 1; }
.stat-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.25rem; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-sub   { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.35rem; }
.stat-sub.up   { color: var(--success); }
.stat-sub.warn { color: var(--warning); }

/* ---- CARDS ---- */
.panel-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.card-header h3 { font-size: 0.95rem; font-weight: 700; color: #fff; }
.card-body { padding: 1.5rem; }

/* ---- TABLES ---- */
.table-wrapper {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: 
    linear-gradient(to right, var(--card-bg) 30%, rgba(19,28,48,0)),
    linear-gradient(to right, rgba(19,28,48,0), var(--card-bg) 70%) 0 100%,
    radial-gradient(farthest-side at 0 50%, rgba(0,0,0,.4), rgba(0,0,0,0)),
    radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.4), rgba(0,0,0,0)) 0 100%;
  background-repeat: no-repeat;
  background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
  background-attachment: local, local, scroll, scroll;
}
table.ptable { width: 100%; border-collapse: collapse; }
table.ptable th {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-muted);
  padding: 0.75rem 1rem; text-align: left;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.ptable td {
  padding: 0.875rem 1rem; font-size: 0.875rem; color: #cbd5e1;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}
table.ptable tr:last-child td { border-bottom: none; }
table.ptable tr:hover td { background: rgba(255,255,255,0.02); }
.t-name { font-weight: 600; color: #fff; }

/* ---- BADGES ---- */
.badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em;
  padding: 0.25rem 0.6rem; border-radius: 999px; white-space: nowrap;
}
.badge-green  { background: rgba(34,197,94,0.12);  color: #4ade80; border: 1px solid rgba(34,197,94,0.2); }
.badge-blue   { background: rgba(14,165,233,0.12); color: #38bdf8; border: 1px solid rgba(14,165,233,0.2); }
.badge-orange { background: rgba(249,115,22,0.12); color: #fb923c; border: 1px solid rgba(249,115,22,0.2); }
.badge-red    { background: rgba(239,68,68,0.12);  color: #f87171; border: 1px solid rgba(239,68,68,0.2); }
.badge-purple { background: rgba(139,92,246,0.12); color: #a78bfa; border: 1px solid rgba(139,92,246,0.2); }
.badge-gray   { background: rgba(255,255,255,0.06); color: var(--text-muted); border: 1px solid var(--border); }

/* ---- FORMS ---- */
.form-row { display: grid; gap: 1rem; margin-bottom: 1rem; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-label { font-size: 0.8rem; font-weight: 600; color: #94a3b8; letter-spacing: 0.03em; }
.form-control {
  background: var(--dark-3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: #e2e8f0;
  padding: 0.65rem 0.875rem; font-size: 0.875rem; font-family: inherit;
  transition: border-color var(--transition);
  width: 100%;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14,165,233,0.1); }
.form-control::placeholder { color: var(--text-muted); }
select.form-control option { background: var(--dark-3); }

/* ---- BUTTONS ---- */
.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.6rem 1.25rem; border-radius: var(--radius-sm); font-weight: 600; font-size: 0.875rem; font-family: inherit; border: 1px solid transparent; cursor: pointer; transition: all var(--transition); white-space: nowrap; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dk); }
.btn-danger  { background: rgba(239,68,68,0.12); color: var(--danger); border-color: rgba(239,68,68,0.25); }
.btn-danger:hover  { background: var(--danger); color: #fff; }
.btn-success { background: rgba(34,197,94,0.12); color: var(--success); border-color: rgba(34,197,94,0.25); }
.btn-success:hover { background: var(--success); color: #fff; }
.btn-outline { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.78rem; }
.btn-icon { width: 32px; height: 32px; padding: 0; justify-content: center; border-radius: var(--radius-sm); }

/* ---- ALERTS / FLASH ---- */
.alert { padding: 0.875rem 1.25rem; border-radius: var(--radius-sm); font-size: 0.875rem; margin-bottom: 1.5rem; display: flex; align-items: center; gap: 0.75rem; }
.alert-success { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.2); color: #4ade80; }
.alert-error   { background: rgba(239,68,68,0.1);  border: 1px solid rgba(239,68,68,0.2);  color: #f87171; }
.alert-info    { background: rgba(14,165,233,0.1); border: 1px solid rgba(14,165,233,0.2); color: #38bdf8; }

/* ---- PLAN CARD (CLIENT) ---- */
.plan-status-card {
  background: linear-gradient(135deg, var(--primary-dk), #075985);
  border-radius: var(--radius); padding: 2rem;
  position: relative; overflow: hidden;
}
.plan-status-card::before {
  content: ''; position: absolute; top: -50%; right: -20%;
  width: 300px; height: 300px; border-radius: 50%;
  background: rgba(255,255,255,0.04);
}

/* ---- RESPONSIVE ---- */
.sidebar-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10, 15, 30, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close-btn { display: block !important; }
  .panel-main { margin-left: 0; }
  .mob-toggle { display: block; }
  .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 0 1.25rem; }
  .panel-content { padding: 1.25rem; }
}
@media (max-width: 480px) {
  .panel-content { padding: 1rem; }
  .stats-grid { grid-template-columns: 1fr; }
}
