/* ═══════════════════════════════════════════════════════════
   ATLAS LICENSE MANAGER — Premium Admin Stylesheet
   ═══════════════════════════════════════════════════════════ */

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

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

:root {
  --bg-base:       #0a0a14;
  --bg-card:       rgba(255,255,255,0.035);
  --bg-card-hover: rgba(255,255,255,0.06);
  --bg-input:      rgba(255,255,255,0.06);
  --border:        rgba(255,255,255,0.09);
  --border-focus:  rgba(99,102,241,0.6);

  --indigo:        #6366f1;
  --indigo-light:  #818cf8;
  --violet:        #8b5cf6;
  --emerald:       #10b981;
  --amber:         #f59e0b;
  --rose:          #f43f5e;
  --cyan:          #06b6d4;

  --text-primary:  #f1f5f9;
  --text-secondary:#94a3b8;
  --text-muted:    #64748b;

  --radius-sm:     8px;
  --radius-md:     12px;
  --radius-lg:     16px;
  --radius-xl:     20px;

  --shadow-glow:   0 0 40px rgba(99,102,241,0.15);
  --shadow-card:   0 4px 24px rgba(0,0,0,0.4);
  --transition:    all 0.2s cubic-bezier(0.4,0,0.2,1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-base);
  background-image:
    radial-gradient(ellipse 80% 60% at 10% 10%, rgba(99,102,241,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 90%, rgba(139,92,246,0.06) 0%, transparent 60%);
  min-height: 100vh;
  color: var(--text-primary);
  line-height: 1.6;
}

/* ── Scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.03); }
::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.4); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(99,102,241,0.7); }

/* ══════════════════════════════════════════════════════
   LOGIN PAGE
══════════════════════════════════════════════════════ */
.login-page {
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center; padding: 24px;
}

.login-card {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%; max-width: 400px;
  padding: 48px 40px;
  box-shadow: var(--shadow-glow), var(--shadow-card);
  animation: slideUp 0.4s ease;
}

.login-logo { text-align: center; margin-bottom: 36px; }
.login-logo .icon-wrap {
  width: 72px; height: 72px; margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  border-radius: 20px; display: flex; align-items: center;
  justify-content: center; font-size: 2rem;
  box-shadow: 0 8px 32px rgba(99,102,241,0.4);
}
.login-logo h1 { font-size: 1.5rem; font-weight: 800; color: var(--text-primary); }
.login-logo p  { font-size: 0.82rem; color: var(--text-secondary); margin-top: 4px; }

/* ══════════════════════════════════════════════════════
   LAYOUT — SIDEBAR + MAIN
══════════════════════════════════════════════════════ */
.app-layout {
  display: flex; min-height: 100vh;
}

.sidebar {
  width: 240px; flex-shrink: 0;
  background: rgba(255,255,255,0.025);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 24px 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}

.sidebar-brand {
  padding: 0 24px 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.sidebar-brand .brand-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  border-radius: 10px; display: flex; align-items: center;
  justify-content: center; font-size: 1.1rem; margin-bottom: 10px;
}
.sidebar-brand h2 { font-size: 0.95rem; font-weight: 700; color: var(--text-primary); }
.sidebar-brand p  { font-size: 0.72rem; color: var(--text-muted); }

.nav-label {
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-muted);
  padding: 12px 24px 6px;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 24px; font-size: 0.85rem; font-weight: 500;
  color: var(--text-secondary); cursor: pointer;
  text-decoration: none; transition: var(--transition);
  border-left: 2px solid transparent;
}
.nav-item:hover   { color: var(--text-primary); background: rgba(255,255,255,0.04); }
.nav-item.active  { color: var(--indigo-light); border-left-color: var(--indigo); background: rgba(99,102,241,0.1); }
.nav-item .nav-icon { font-size: 1rem; width: 20px; text-align: center; }

.sidebar-footer {
  margin-top: auto; padding: 16px 24px 0;
  border-top: 1px solid var(--border);
}
.sidebar-footer a {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.82rem; color: var(--text-muted);
  text-decoration: none; padding: 8px 0;
  transition: var(--transition);
}
.sidebar-footer a:hover { color: var(--rose); }

/* ── Main Content ──────────────────────────────────── */
.main-content {
  flex: 1; overflow-x: hidden;
  padding: 32px;
  display: flex; flex-direction: column; gap: 28px;
}

/* ── Page Header ───────────────────────────────────── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
}
.page-header h1 { font-size: 1.5rem; font-weight: 800; color: var(--text-primary); }
.page-header p  { font-size: 0.85rem; color: var(--text-secondary); margin-top: 2px; }

/* ── Stat Cards ────────────────────────────────────── */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  transition: var(--transition);
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--accent-from,#6366f1), var(--accent-to,#8b5cf6));
  opacity: 0; transition: var(--transition);
  border-radius: inherit;
}
.stat-card:hover::before { opacity: 0.05; }
.stat-card:hover { border-color: rgba(255,255,255,0.15); transform: translateY(-2px); }
.stat-card .label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em; }
.stat-card .value { font-size: 2rem; font-weight: 800; color: var(--text-primary); margin-top: 6px; }
.stat-card .icon  { font-size: 1.8rem; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); opacity: 0.2; }
.stat-card.emerald { --accent-from:#10b981; --accent-to:#059669; }
.stat-card.amber   { --accent-from:#f59e0b; --accent-to:#d97706; }
.stat-card.rose    { --accent-from:#f43f5e; --accent-to:#e11d48; }
.stat-card.cyan    { --accent-from:#06b6d4; --accent-to:#0891b2; }

/* ── Card ──────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.card-header h2 { font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.card-body { padding: 24px; }

/* ── Form Elements ─────────────────────────────────── */
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }

label {
  font-size: 0.78rem; font-weight: 600;
  color: var(--text-secondary); letter-spacing: 0.03em;
}

input[type="text"], input[type="email"], input[type="password"],
input[type="date"], select, textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.88rem; font-family: inherit;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
input:focus, select:focus, textarea:focus {
  border-color: var(--border-focus);
  background: rgba(99,102,241,0.06);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
select option { background: #1e1e2e; }
textarea { resize: vertical; min-height: 80px; }

/* ── Buttons ───────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 0.85rem; font-weight: 600; font-family: inherit;
  cursor: pointer; border: none; transition: var(--transition);
  white-space: nowrap; letter-spacing: 0.02em; text-decoration: none;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  color: #fff;
  box-shadow: 0 4px 16px rgba(99,102,241,0.3);
}
.btn-primary:hover { opacity: 0.9; box-shadow: 0 6px 24px rgba(99,102,241,0.45); transform: translateY(-1px); }

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 4px 16px rgba(16,185,129,0.25);
}
.btn-success:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-danger {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: #fff;
  box-shadow: 0 4px 16px rgba(244,63,94,0.25);
}
.btn-danger:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-ghost {
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }

.btn-sm { padding: 6px 12px; font-size: 0.78rem; }
.btn-lg { padding: 14px 28px; font-size: 0.95rem; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ── Table ─────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.83rem; }
thead tr { border-bottom: 1px solid var(--border); }
thead th {
  padding: 12px 16px; text-align: left;
  font-size: 0.72rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em;
}
tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: var(--transition);
}
tbody tr:hover { background: rgba(255,255,255,0.03); }
tbody tr:last-child { border-bottom: none; }
tbody td { padding: 14px 16px; color: var(--text-secondary); vertical-align: middle; }
tbody td strong { color: var(--text-primary); font-weight: 600; }
.mono { font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 0.8rem; }

/* ── Badges ────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 99px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
}
.badge-active   { background: rgba(16,185,129,0.15); color: #34d399; border: 1px solid rgba(16,185,129,0.25); }
.badge-inactive { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.25); }
.badge-revoked  { background: rgba(244,63,94,0.15);  color: #fb7185; border: 1px solid rgba(244,63,94,0.25);  }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ── Alert ─────────────────────────────────────────── */
.alert {
  padding: 14px 18px; border-radius: var(--radius-sm);
  font-size: 0.85rem; display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 20px;
}
.alert-success { background: rgba(16,185,129,0.1);  border: 1px solid rgba(16,185,129,0.3);  color: #6ee7b7; }
.alert-danger  { background: rgba(244,63,94,0.1);   border: 1px solid rgba(244,63,94,0.3);   color: #fda4af; }
.alert-info    { background: rgba(99,102,241,0.1);  border: 1px solid rgba(99,102,241,0.3);  color: #a5b4fc; }
.alert-warning { background: rgba(245,158,11,0.1);  border: 1px solid rgba(245,158,11,0.3);  color: #fde68a; }

/* ── Copy Key ──────────────────────────────────────── */
.key-display {
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-family: monospace; font-size: 0.95rem; font-weight: 600;
  color: var(--indigo-light); letter-spacing: 0.08em;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  cursor: pointer; transition: var(--transition);
}
.key-display:hover { border-color: rgba(99,102,241,0.4); background: rgba(99,102,241,0.05); }

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

/* ── Utilities ─────────────────────────────────────── */
.text-muted    { color: var(--text-muted); }
.text-secondary{ color: var(--text-secondary); }
.text-primary  { color: var(--text-primary); }
.text-indigo   { color: var(--indigo-light); }
.text-emerald  { color: #34d399; }
.text-rose     { color: #fb7185; }
.flex          { display: flex; }
.items-center  { align-items: center; }
.gap-2         { gap: 8px; }
.gap-3         { gap: 12px; }
.mt-1          { margin-top: 4px; }
.mb-4          { margin-bottom: 16px; }
.font-mono     { font-family: monospace; }
.text-sm       { font-size: 0.82rem; }
.text-xs       { font-size: 0.72rem; }
.fw-600        { font-weight: 600; }
.d-none        { display: none !important; }

/* ── Modal Overlay ─────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: #12121f;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%; max-width: 520px;
  padding: 32px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-header h3 { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); }
.modal-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 1.4rem; cursor: pointer; padding: 4px;
  transition: var(--transition); line-height: 1;
}
.modal-close:hover { color: var(--text-primary); }

/* ── Animations ────────────────────────────────────── */
@keyframes slideUp {
  from { opacity:0; transform: translateY(24px); }
  to   { opacity:1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity:0; }
  to   { opacity:1; }
}
.animate-in { animation: slideUp 0.35s ease both; }

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 768px) {
  .app-layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: relative; flex-direction: row; flex-wrap: wrap; padding: 12px; gap: 4px; }
  .sidebar-brand { display: none; }
  .nav-label { display: none; }
  .nav-item { padding: 8px 14px; border-left: none; border-radius: var(--radius-sm); border-bottom: 2px solid transparent; }
  .nav-item.active { border-bottom-color: var(--indigo); border-left: none; }
  .sidebar-footer { display: none; }
  .main-content { padding: 16px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
