/* ═══════════════════════════════════════════════════════════════
   Jaffar Ali Tech — License Manager  |  Premium UI Styles
   ═══════════════════════════════════════════════════════════════ */

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

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --accent:     #e85d04;
  --accent2:    #f48c06;
  --accent3:    #ffb703;
  --green:      #2b9348;
  --green2:     #40916c;
  --red:        #dc3545;
  --blue:       #0096c7;
  --bg:         #09090f;
  --bg2:        #111118;
  --bg3:        #16161f;
  --card:       rgba(22,22,34,0.85);
  --border:     rgba(255,255,255,0.08);
  --text:       #e8e8f0;
  --muted:      #7a7a99;
  --sidebar-w:  260px;
  --radius:     14px;
  --shadow:     0 8px 32px rgba(0,0,0,0.5);
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent2); }

/* ── Animated Background ───────────────────────────────────── */
.bg-canvas {
  position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
}
.bg-canvas::before {
  content: '';
  position: absolute; inset: -60%;
  background: conic-gradient(
    from 0deg at 30% 50%,
    rgba(232,93,4,0.12) 0deg,
    transparent 60deg,
    rgba(244,140,6,0.08) 120deg,
    transparent 180deg,
    rgba(43,147,72,0.06) 240deg,
    transparent 300deg,
    rgba(232,93,4,0.10) 360deg
  );
  animation: bgSpin 28s linear infinite;
}
.bg-canvas::after {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 20% 40%, rgba(232,93,4,0.07) 0%, transparent 70%),
    radial-gradient(ellipse 50% 70% at 80% 60%, rgba(244,140,6,0.06) 0%, transparent 70%),
    radial-gradient(ellipse 80% 40% at 50% 10%,  rgba(43,147,72,0.04) 0%, transparent 70%);
  animation: bgPulse 10s ease-in-out infinite alternate;
}
@keyframes bgSpin  { to { transform: rotate(360deg); } }
@keyframes bgPulse { from { opacity: 0.6; } to { opacity: 1; } }

/* Floating orbs */
.orb {
  position: fixed; border-radius: 50%; filter: blur(80px);
  pointer-events: none; z-index: 0;
}
.orb-1 { width: 400px; height: 400px; background: rgba(232,93,4,0.10); top: -100px; left: -100px; animation: float1 18s ease-in-out infinite; }
.orb-2 { width: 500px; height: 500px; background: rgba(244,140,6,0.07); bottom: -150px; right: -150px; animation: float2 22s ease-in-out infinite; }
.orb-3 { width: 300px; height: 300px; background: rgba(0,150,199,0.05); top: 40%; left: 40%; animation: float3 15s ease-in-out infinite; }
@keyframes float1 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(80px,60px)} }
@keyframes float2 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(-80px,-60px)} }
@keyframes float3 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(40px,-40px) scale(1.2)} }

/* Grid lines overlay */
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* ── Layout ─────────────────────────────────────────────────── */
.page-wrap { position: relative; z-index: 1; display: flex; min-height: 100vh; }

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: rgba(10,10,18,0.92);
  backdrop-filter: blur(24px);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}
.sidebar-brand {
  padding: 28px 24px 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand .logo {
  display: flex; align-items: center; gap: 12px;
}
.sidebar-brand .logo-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(232,93,4,0.4);
}
.sidebar-brand .logo-text {
  font-size: 0.82rem; font-weight: 700; color: var(--text);
  line-height: 1.3; letter-spacing: 0.3px;
}
.sidebar-brand .logo-text span { color: var(--accent2); display: block; font-size: 0.7rem; font-weight: 400; color: var(--muted); }

.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.nav-section-label {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--muted);
  padding: 4px 12px 8px; margin-top: 8px;
}
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 10px;
  color: var(--muted); font-size: 0.88rem; font-weight: 500;
  transition: all 0.2s; margin-bottom: 2px;
  position: relative;
}
.nav-link:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.nav-link.active {
  background: linear-gradient(135deg, rgba(232,93,4,0.2), rgba(244,140,6,0.12));
  color: var(--accent2);
  border: 1px solid rgba(232,93,4,0.25);
}
.nav-link.active::before {
  content: ''; position: absolute; left: 0; top: 25%; bottom: 25%;
  width: 3px; background: linear-gradient(to bottom, var(--accent), var(--accent2));
  border-radius: 0 3px 3px 0;
}
.nav-link .nav-icon { width: 18px; text-align: center; font-size: 1rem; flex-shrink: 0; }
.nav-link .badge {
  margin-left: auto; font-size: 0.7rem; font-weight: 700;
  background: var(--accent); color: #fff;
  padding: 1px 7px; border-radius: 20px;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}
.sidebar-footer .nav-link { color: var(--red); }
.sidebar-footer .nav-link:hover { background: rgba(220,53,69,0.1); }

/* ── Main Content ───────────────────────────────────────────── */
.main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 32px;
  background: rgba(10,10,18,0.6);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 1.1rem; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.admin-pill {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  border-radius: 30px; padding: 6px 14px 6px 8px;
  font-size: 0.82rem; font-weight: 500; color: var(--text);
}
.admin-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; color: #fff; flex-shrink: 0;
}

.content { padding: 32px; flex: 1; }

/* ── Page Header ────────────────────────────────────────────── */
.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.5px; }
.page-header p  { color: var(--muted); font-size: 0.9rem; margin-top: 4px; }

/* ── Stat Cards ─────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: blur(16px);
  position: relative; overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
}
.stat-card:hover { transform: translateY(-2px); border-color: rgba(232,93,4,0.3); }
.stat-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--c1, var(--accent)), var(--c2, var(--accent2)));
}
.stat-card.green   { --c1: #2b9348; --c2: #57cc99; }
.stat-card.red     { --c1: #dc3545; --c2: #ff6b6b; }
.stat-card.blue    { --c1: #0096c7; --c2: #48cae4; }
.stat-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: rgba(232,93,4,0.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; margin-bottom: 16px;
}
.stat-card.green .stat-icon { background: rgba(43,147,72,0.15); }
.stat-card.red   .stat-icon { background: rgba(220,53,69,0.15); }
.stat-card.blue  .stat-icon { background: rgba(0,150,199,0.15); }
.stat-val { font-size: 2.4rem; font-weight: 800; letter-spacing: -1px; line-height: 1; }
.stat-lbl { font-size: 0.82rem; color: var(--muted); margin-top: 6px; font-weight: 500; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
  overflow: hidden;
  margin-bottom: 24px;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: 0.95rem; font-weight: 700; }
.card-body { padding: 24px; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: 9px;
  font-size: 0.85rem; font-weight: 600;
  border: none; cursor: pointer;
  transition: all 0.18s; white-space: nowrap;
  text-decoration: none;
}
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(232,93,4,0.4); color: #fff; }
.btn-success { background: linear-gradient(135deg, var(--green), var(--green2)); color: #fff; }
.btn-success:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(43,147,72,0.4); color: #fff; }
.btn-danger  { background: rgba(220,53,69,0.15); color: #ff6b6b; border: 1px solid rgba(220,53,69,0.3); }
.btn-danger:hover  { background: rgba(220,53,69,0.3); color: #ff6b6b; }
.btn-ghost   { background: rgba(255,255,255,0.06); color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover   { background: rgba(255,255,255,0.10); color: var(--text); }
.btn-sm { padding: 5px 12px; font-size: 0.78rem; border-radius: 7px; }
.btn-warning { background: rgba(255,183,3,0.15); color: #ffb703; border: 1px solid rgba(255,183,3,0.3); }
.btn-warning:hover { background: rgba(255,183,3,0.28); color: #ffb703; }
.btn-info    { background: rgba(0,150,199,0.15); color: #90e0ef; border: 1px solid rgba(0,150,199,0.3); }
.btn-info:hover    { background: rgba(0,150,199,0.28); color: #90e0ef; }

/* ── Tables ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
thead th {
  text-align: left; padding: 12px 16px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--muted);
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
}
tbody tr { border-bottom: 1px solid rgba(255,255,255,0.03); transition: background 0.15s; }
tbody tr:hover { background: rgba(255,255,255,0.03); }
tbody td { padding: 13px 16px; vertical-align: middle; }
tbody tr:last-child { border-bottom: none; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
}
.badge-active   { background: rgba(43,147,72,0.18);  color: #57cc99; border: 1px solid rgba(43,147,72,0.3); }
.badge-pending  { background: rgba(255,183,3,0.15);  color: #ffb703; border: 1px solid rgba(255,183,3,0.3); }
.badge-inactive { background: rgba(255,255,255,0.06);color: var(--muted); border: 1px solid var(--border); }
.badge-blocked  { background: rgba(220,53,69,0.15);  color: #ff6b6b; border: 1px solid rgba(220,53,69,0.3); }
.badge::before  { content: '●'; font-size: 0.55rem; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 0.83rem; font-weight: 600; margin-bottom: 7px; color: var(--text); }
.form-label span { color: var(--accent); }
.form-control {
  width: 100%; padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 9px; color: var(--text);
  font-size: 0.88rem; font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232,93,4,0.15);
  background: rgba(255,255,255,0.06);
}
.form-control::placeholder { color: var(--muted); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
select.form-control option { background: var(--bg2); }
.form-hint { font-size: 0.75rem; color: var(--muted); margin-top: 5px; }

/* ── Alerts ─────────────────────────────────────────────────── */
.alert { padding: 13px 18px; border-radius: 10px; font-size: 0.87rem; margin-bottom: 20px; display: flex; align-items: flex-start; gap: 10px; }
.alert-success { background: rgba(43,147,72,0.12); border: 1px solid rgba(43,147,72,0.3); color: #57cc99; }
.alert-danger   { background: rgba(220,53,69,0.12); border: 1px solid rgba(220,53,69,0.3); color: #ff6b6b; }
.alert-warning  { background: rgba(255,183,3,0.10); border: 1px solid rgba(255,183,3,0.3); color: #ffb703; }
.alert-info     { background: rgba(0,150,199,0.10); border: 1px solid rgba(0,150,199,0.3); color: #90e0ef; }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.active { display: flex; animation: fadeIn 0.2s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 18px; width: 100%; max-width: 500px;
  box-shadow: var(--shadow);
  animation: slideUp 0.25s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 1rem; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1.4rem; line-height: 1; transition: color 0.15s; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ── Key display box ────────────────────────────────────────── */
.key-box {
  background: rgba(43,147,72,0.08); border: 2px dashed rgba(43,147,72,0.4);
  border-radius: 12px; padding: 20px; text-align: center; margin: 16px 0;
}
.key-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.4rem; font-weight: 600; color: #57cc99;
  letter-spacing: 2px; word-break: break-all;
}
.key-lbl { font-size: 0.75rem; color: var(--muted); margin-bottom: 8px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }

/* ── Upload progress ────────────────────────────────────────── */
.progress-bar-wrap { background: rgba(255,255,255,0.05); border-radius: 6px; height: 8px; overflow: hidden; margin-top: 12px; }
.progress-bar { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--green), var(--green2)); transition: width 0.4s; }

/* ── Mono text ──────────────────────────────────────────────── */
.mono { font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; color: var(--accent2); }

/* ── Welcome banner ─────────────────────────────────────────── */
.welcome-banner {
  background: linear-gradient(135deg, rgba(232,93,4,0.12), rgba(244,140,6,0.08));
  border: 1px solid rgba(232,93,4,0.25);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 28px;
  display: flex; align-items: center; justify-content: space-between;
  position: relative; overflow: hidden;
}
.welcome-banner::before {
  content: ''; position: absolute;
  top: -50%; right: -80px; width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(244,140,6,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.welcome-title { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.5px; }
.welcome-title span { background: linear-gradient(135deg, var(--accent), var(--accent2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.welcome-sub { color: var(--muted); font-size: 0.87rem; margin-top: 4px; }
.voice-btn {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 16px; color: var(--text); font-size: 0.82rem;
  cursor: pointer; transition: all 0.2s; font-weight: 600; white-space: nowrap;
}
.voice-btn:hover { background: rgba(255,255,255,0.1); }
.voice-btn.playing { border-color: var(--accent); color: var(--accent2); }

/* ── Empty state ────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 24px; color: var(--muted); }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state h3 { font-size: 1rem; color: var(--text); margin-bottom: 6px; }
.empty-state p  { font-size: 0.85rem; }

/* ── Login page ─────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.login-card {
  width: 100%; max-width: 420px;
  background: rgba(16,16,26,0.9); border: 1px solid var(--border);
  border-radius: 22px; padding: 44px 40px;
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow), 0 0 80px rgba(232,93,4,0.08);
}
.login-logo {
  display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 32px;
}
.login-logo .icon {
  width: 52px; height: 52px; border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 6px 24px rgba(232,93,4,0.4);
}
.login-logo .brand { font-size: 0.9rem; font-weight: 700; line-height: 1.3; }
.login-logo .brand span { color: var(--muted); font-weight: 400; font-size: 0.8rem; display: block; }
.login-title { font-size: 1.5rem; font-weight: 800; text-align: center; margin-bottom: 6px; }
.login-sub   { text-align: center; color: var(--muted); font-size: 0.85rem; margin-bottom: 28px; }

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

/* ── Tooltip ────────────────────────────────────────────────── */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute; bottom: 120%; left: 50%; transform: translateX(-50%);
  background: #1a1a2e; border: 1px solid var(--border);
  color: var(--text); font-size: 0.75rem; padding: 5px 10px;
  border-radius: 6px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
[data-tip]:hover::after { opacity: 1; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .content { padding: 20px; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 12px 16px; }
}
