/* EVO Panel — Theme CSS v5 */
:root {
  --evo-bg: #0f1117;
  --evo-sidebar: #161b27;
  --evo-sidebar-border: #1e2535;
  --evo-card: #1a2133;
  --evo-card-border: #222d44;
  --evo-text: #e2e8f0;
  --evo-text-muted: #6b7a99;
  --evo-text-dim: #8899bb;
  --evo-primary: #3b82f6;
  --evo-success: #22c55e;
  --evo-warning: #f59e0b;
  --evo-danger: #ef4444;
  --evo-purple: #a855f7;
  --evo-cyan: #06b6d4;
  --evo-nav-hover: rgba(59,130,246,.12);
  --evo-nav-active: rgba(59,130,246,.18);
  --evo-sidebar-w: 240px;
  --evo-radius: 10px;
  --evo-transition: .18s ease;
}

[data-bs-theme="light"] {
  --evo-bg: #f0f4f9;
  --evo-sidebar: #ffffff;
  --evo-sidebar-border: #e2e8f0;
  --evo-card: #ffffff;
  --evo-card-border: #e2e8f0;
  --evo-text: #1e293b;
  --evo-text-muted: #64748b;
  --evo-text-dim: #94a3b8;
  --evo-nav-hover: rgba(59,130,246,.08);
  --evo-nav-active: rgba(59,130,246,.14);
}

* { box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background: var(--evo-bg); color: var(--evo-text); margin: 0; font-size: .9rem; }

/* ── Sidebar ── */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--evo-sidebar-w);
  background: var(--evo-sidebar);
  border-right: 1px solid var(--evo-sidebar-border);
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
  z-index: 100; transition: transform var(--evo-transition);
  scrollbar-width: thin;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--evo-card-border); border-radius: 4px; }

.brand { padding: 1.1rem 1.2rem .8rem; border-bottom: 1px solid var(--evo-sidebar-border); }
.brand h5 { margin: 0; font-weight: 700; font-size: 1rem; color: var(--evo-primary); letter-spacing: -.3px; }
.brand small { color: var(--evo-text-muted); font-size: .7rem; }

.sidebar-nav { padding: .5rem 0; }
.nav-section-label { font-size: .65rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--evo-text-muted); padding: .9rem 1.2rem .3rem; }
.nav-link { color: var(--evo-text-dim) !important; padding: .48rem 1.2rem; border-radius: 6px; margin: 1px .5rem; display: flex; align-items: center; gap: .55rem; font-size: .83rem; transition: all var(--evo-transition); text-decoration: none; }
.nav-link:hover { background: var(--evo-nav-hover); color: var(--evo-text) !important; }
.nav-link.active { background: var(--evo-nav-active); color: var(--evo-primary) !important; font-weight: 600; }
.nav-link i { font-size: .95rem; flex-shrink: 0; }

.sidebar-footer { border-top: 1px solid var(--evo-sidebar-border); padding: .8rem; position: relative; }
.profile-section { display: flex; align-items: center; gap: .6rem; padding: .5rem; border-radius: 8px; cursor: pointer; transition: background var(--evo-transition); }
.profile-section:hover { background: var(--evo-nav-hover); }
.profile-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--evo-primary), var(--evo-purple)); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 1.1rem; color: #fff; }
.profile-info { flex: 1; min-width: 0; }
.profile-name { display: block; font-size: .8rem; font-weight: 600; color: var(--evo-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-role { display: block; font-size: .7rem; color: var(--evo-text-muted); }
.profile-chevron { font-size: .75rem; color: var(--evo-text-muted); transition: transform var(--evo-transition); }
.profile-menu { display: none; position: absolute; bottom: calc(100% - .5rem); left: .8rem; right: .8rem; background: var(--evo-card); border: 1px solid var(--evo-card-border); border-radius: 8px; padding: .4rem; z-index: 200; box-shadow: 0 -8px 24px rgba(0,0,0,.25); }
.profile-menu.show { display: block; }
.profile-menu-item { display: flex; align-items: center; gap: .5rem; padding: .5rem .7rem; border-radius: 6px; color: var(--evo-text-dim) !important; text-decoration: none; font-size: .82rem; cursor: pointer; transition: all var(--evo-transition); }
.profile-menu-item:hover { background: var(--evo-nav-hover); color: var(--evo-text) !important; }
.profile-menu-item.text-danger { color: var(--evo-danger) !important; }
.profile-menu-divider { height: 1px; background: var(--evo-card-border); margin: .3rem 0; }

/* ── Main Content ── */
.main-content { margin-left: var(--evo-sidebar-w); padding: 1.5rem; min-height: 100vh; }

/* ── Cards ── */
.card { background: var(--evo-card); border: 1px solid var(--evo-card-border); border-radius: var(--evo-radius); }
.card-header { background: transparent; border-bottom: 1px solid var(--evo-card-border); font-weight: 600; font-size: .88rem; }

/* ── Stat Cards ── */
.stat-card { background: var(--evo-card); border: 1px solid var(--evo-card-border); border-radius: var(--evo-radius); padding: 1.1rem 1.2rem; position: relative; overflow: hidden; transition: transform var(--evo-transition); }
.stat-card:hover { transform: translateY(-1px); }
.stat-card .stat-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.stat-card .stat-value { font-size: 1.7rem; font-weight: 800; line-height: 1; margin: .4rem 0 .15rem; }
.stat-card .stat-label { font-size: .75rem; color: var(--evo-text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }

/* ── Tables ── */
.table { color: var(--evo-text); }
.table th { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--evo-text-muted); border-bottom: 1px solid var(--evo-card-border); white-space: nowrap; }
.table td { vertical-align: middle; font-size: .84rem; border-color: var(--evo-card-border); }
.table-hover tbody tr:hover { background: var(--evo-nav-hover); }
.table-responsive { border-radius: 8px; }

/* ── Badges ── */
.badge-guest { background: rgba(107,114,153,.2); color: #aab; }
.badge-registered { background: rgba(59,130,246,.18); color: #7eb3ff; }
.badge-premium { background: rgba(245,158,11,.18); color: #fbbf24; }
.badge-blocked { background: rgba(239,68,68,.18); color: #f87171; }
.badge-active { background: rgba(34,197,94,.18); color: #4ade80; }
.badge-used { background: rgba(107,114,153,.18); color: #9aa; }
.badge-expired { background: rgba(239,68,68,.18); color: #f87171; }

/* ── Buttons ── */
.btn-xs { padding: .2rem .55rem; font-size: .72rem; border-radius: 5px; }

/* ── Forms ── */
.form-control, .form-select { background: var(--evo-bg) !important; border-color: var(--evo-card-border) !important; color: var(--evo-text) !important; font-size: .85rem; }
.form-control:focus, .form-select:focus { border-color: var(--evo-primary) !important; box-shadow: 0 0 0 2px rgba(59,130,246,.15) !important; }
.form-label { font-size: .8rem; font-weight: 500; color: var(--evo-text-dim); margin-bottom: .35rem; }
.input-group-text { background: var(--evo-card) !important; border-color: var(--evo-card-border) !important; color: var(--evo-text-muted); }

/* ── Modals ── */
.modal-content { background: var(--evo-card); border: 1px solid var(--evo-card-border); border-radius: 12px; }
.modal-header { border-bottom: 1px solid var(--evo-card-border); }
.modal-footer { border-top: 1px solid var(--evo-card-border); }
.btn-close { filter: invert(1) grayscale(1); }
[data-bs-theme="light"] .btn-close { filter: none; }

/* ── Page Header ── */
.page-header { margin-bottom: 1.5rem; }
.page-header h4 { font-weight: 700; margin: 0; font-size: 1.25rem; }
.page-header p { color: var(--evo-text-muted); margin: .2rem 0 0; font-size: .82rem; }

/* ── Toast ── */
.toast-notification {
  position: fixed; bottom: 1.2rem; right: 1.2rem;
  z-index: 9999; min-width: 260px; max-width: 380px;
  border-radius: 10px; padding: .75rem 1rem;
  font-size: .84rem; font-weight: 500;
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
  transition: opacity .3s; pointer-events: none;
}

/* ── Login ── */
.login-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0a0e1a 0%, #0f1117 60%, #0d1420 100%); }
.login-card { background: var(--evo-card); border: 1px solid var(--evo-card-border); border-radius: 16px; padding: 2.2rem; width: 100%; max-width: 380px; }

/* ── Endpoint Flow Table ── */
.endpoint-row { display: flex; align-items: center; gap: .8rem; padding: .5rem .75rem; border-radius: 7px; margin-bottom: .3rem; background: rgba(255,255,255,.02); border: 1px solid var(--evo-card-border); }
.endpoint-step { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 700; flex-shrink: 0; background: rgba(59,130,246,.18); color: var(--evo-primary); }
.endpoint-method { font-size: .68rem; font-weight: 700; padding: .2rem .45rem; border-radius: 4px; flex-shrink: 0; }
.method-get { background: rgba(34,197,94,.15); color: #4ade80; }
.method-post { background: rgba(59,130,246,.15); color: #7eb3ff; }
.endpoint-path { font-family: monospace; font-size: .78rem; color: var(--evo-text); flex: 1; }
.endpoint-desc { font-size: .75rem; color: var(--evo-text-muted); }
.endpoint-status { width: 8px; height: 8px; border-radius: 50%; background: var(--evo-success); flex-shrink: 0; box-shadow: 0 0 6px var(--evo-success); }

/* ── Loading ── */
.loading-row td { text-align: center; padding: 2rem; color: var(--evo-text-muted); font-size: .85rem; }

/* ── Fade In ── */
.fade-in { animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ── Mobile ── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); box-shadow: 8px 0 32px rgba(0,0,0,.5); }
  .main-content { margin-left: 0; padding: 1rem; }
}

/* ── Progress Bar ── */
.progress { background: var(--evo-card-border); height: 6px; }

/* ── Nav pills ── */
.nav-pills .nav-link.active { background: var(--evo-primary); }
.nav-pills .nav-link { color: var(--evo-text-muted); font-size: .83rem; }
