/* ═══════════════════════════════════════════════════════════════════════════
   AAIS Label Suite Portal — Premium Dark Theme
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --bg:           #060e1e;
  --bg-card:      #0d1b2e;
  --bg-card-2:    #112240;
  --border:       #1a3050;
  --border-light: #213a5c;
  --accent:       #38bdf8;
  --accent-dim:   rgba(56, 189, 248, 0.12);
  --accent-glow:  rgba(56, 189, 248, 0.25);
  --purple:       #818cf8;
  --purple-dim:   rgba(129, 140, 248, 0.12);
  --green:        #34d399;
  --green-dim:    rgba(52, 211, 153, 0.12);
  --red:          #f87171;
  --red-dim:      rgba(248, 113, 113, 0.12);
  --amber:        #fbbf24;
  --amber-dim:    rgba(251, 191, 36, 0.12);
  --text:         #e2e8f0;
  --text-dim:     #94a3b8;
  --text-muted:   #64748b;
  --sidebar-w:    265px;
  --topbar-h:     64px;
  --radius:       12px;
  --radius-sm:    8px;
  --shadow:       0 4px 24px rgba(0,0,0,.4);
  --shadow-lg:    0 8px 48px rgba(0,0,0,.6);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
  font-size: .85em;
}

/* ── Scrollbar ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════════════════════════════ */

body.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  overflow: hidden;
  position: relative;
}

.login-bg {
  position: fixed; inset: 0;
  background: radial-gradient(ellipse 80% 80% at 50% -20%, rgba(56,189,248,.15), transparent),
              radial-gradient(ellipse 60% 60% at 80% 80%, rgba(129,140,248,.1), transparent);
  pointer-events: none;
  z-index: 0;
}

.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .35;
  pointer-events: none;
}
.login-orb-1 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #0ea5e9, transparent 70%);
  top: -100px; left: -100px;
  animation: float 8s ease-in-out infinite;
}
.login-orb-2 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, #6366f1, transparent 70%);
  bottom: -80px; right: -80px;
  animation: float 10s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-30px) scale(1.05); }
}

.login-wrapper {
  position: relative; z-index: 1;
  width: 100%; max-width: 440px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  justify-content: center;
}

.login-brand-icon {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 800; color: #fff;
  box-shadow: 0 0 24px rgba(14,165,233,.4);
}

.login-brand-name {
  font-size: 1.25rem; font-weight: 700; color: var(--text);
  line-height: 1.2;
}

.login-brand-tag {
  font-size: .8rem; color: var(--text-muted);
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: var(--shadow-lg),
              0 0 0 1px rgba(255,255,255,.03) inset;
  backdrop-filter: blur(8px);
}

.login-card-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-card-header h2 {
  font-size: 1.5rem; font-weight: 700;
  margin-bottom: .25rem;
}

.login-card-header p {
  color: var(--text-dim);
  font-size: .9rem;
}

.login-form .form-group { margin-bottom: 1.25rem; }

.login-form label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .5rem;
}

.input-wrapper {
  position: relative;
}

.input-wrapper .input-icon {
  position: absolute;
  left: .875rem; top: 50%;
  transform: translateY(-50%);
  fill: var(--text-muted);
  width: 18px; height: 18px;
  pointer-events: none;
}

.input-wrapper input {
  width: 100%;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: .95rem;
  padding: .75rem .875rem .75rem 2.75rem;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}

.input-wrapper input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.input-toggle-pw {
  position: absolute;
  right: .75rem; top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: .25rem;
  fill: var(--text-muted);
  display: flex; align-items: center;
  transition: fill .2s;
}
.input-toggle-pw svg { width: 18px; height: 18px; fill: inherit; }
.input-toggle-pw:hover { fill: var(--accent); }

.login-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.8;
}

/* ═══════════════════════════════════════════════════════════════════════════
   DASHBOARD LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */

body.dashboard-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: 1fr;
  min-height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.sidebar {
  grid-column: 1;
  grid-row: 1;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 100;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.brand-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 800; color: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(14,165,233,.3);
}

.brand-name {
  display: block;
  font-size: .95rem; font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.brand-role {
  display: block;
  font-size: .72rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .06em;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem .75rem;
  overflow-y: auto;
}

.nav-section-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-muted);
  padding: .5rem .5rem .25rem;
  margin-top: .25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem .875rem;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
  text-decoration: none;
  margin-bottom: 2px;
}

.nav-item svg {
  width: 18px; height: 18px;
  fill: currentColor;
  flex-shrink: 0;
  opacity: .7;
}

.nav-item:hover {
  background: var(--accent-dim);
  color: var(--accent);
  text-decoration: none;
}

.nav-item:hover svg { opacity: 1; }

.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
}

.nav-item.active svg { opacity: 1; }

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  width: 3px;
  height: 24px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.nav-item { position: relative; }

.nav-logout { color: var(--red); margin-top: .25rem; }
.nav-logout:hover { background: var(--red-dim); color: var(--red); }

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
}

.sf-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #1e3a5f, #2d5a8e);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem; color: var(--accent);
  flex-shrink: 0;
}

.sf-name { font-size: .875rem; font-weight: 600; }
.sf-role { font-size: .72rem; color: var(--text-muted); }

/* ── Main wrapper ─────────────────────────────────────────────────────────── */
.main-wrapper {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.topbar {
  height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.75rem;
  flex-shrink: 0;
}

.topbar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  fill: var(--text-dim);
  padding: .5rem;
  border-radius: var(--radius-sm);
}
.topbar-toggle svg { width: 22px; height: 22px; fill: inherit; display: block; }
.topbar-toggle:hover { background: var(--accent-dim); fill: var(--accent); }

.topbar-title {
  font-size: 1.15rem; font-weight: 700;
  flex: 1;
}

.topbar-actions { display: flex; gap: .75rem; align-items: center; }

.topbar-badge {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(56,189,248,.25);
  border-radius: 999px;
  padding: .25rem .875rem;
  font-size: .8rem;
  font-weight: 600;
}

.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.75rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   COMPONENTS
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .625rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .18s;
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}

.btn svg { width: 16px; height: 16px; fill: currentColor; flex-shrink: 0; }

.btn-primary {
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 12px rgba(14,165,233,.3);
}
.btn-primary:hover {
  opacity: .9;
  box-shadow: 0 4px 20px rgba(14,165,233,.4);
  transform: translateY(-1px);
  text-decoration: none; color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--text-dim);
  border-color: var(--border-light);
}
.btn-outline:hover {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(56,189,248,.3);
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--bg-card-2); color: var(--text); text-decoration: none; }

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border-color: rgba(248,113,113,.25);
}
.btn-danger:hover { background: rgba(248,113,113,.25); text-decoration: none; }

.btn-success {
  background: var(--green-dim);
  color: var(--green);
  border-color: rgba(52,211,153,.25);
}

.btn-sm { padding: .45rem .875rem; font-size: .8rem; }
.btn-xs { padding: .3rem .6rem; font-size: .75rem; border-radius: 6px; }
.btn-full { width: 100%; justify-content: center; }

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  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: 1rem;
  font-weight: 700;
  display: flex; align-items: center; gap: .5rem;
}

.card-sub {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: .2rem;
}

.card-link {
  font-size: .8rem; color: var(--accent); font-weight: 500;
}

.mb-4 { margin-bottom: 1.25rem; }
.mt-4 { margin-top: 1.25rem; }
.mt-2 { margin-top: .5rem; }

/* ── Stats Grid ───────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 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: center;
  gap: 1rem;
  position: relative;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px;
  height: 100%;
}

.stat-blue::before  { background: linear-gradient(to bottom, var(--accent), #6366f1); }
.stat-green::before { background: linear-gradient(to bottom, var(--green), #059669); }
.stat-purple::before{ background: linear-gradient(to bottom, var(--purple), #7c3aed); }
.stat-amber::before { background: linear-gradient(to bottom, var(--amber), #d97706); }
.stat-red::before   { background: linear-gradient(to bottom, var(--red), #dc2626); }

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.stat-blue  .stat-icon { background: var(--accent-dim);  fill: var(--accent);  }
.stat-green .stat-icon { background: var(--green-dim);   fill: var(--green);   }
.stat-purple.stat-icon { background: var(--purple-dim);  fill: var(--purple);  }
.stat-amber .stat-icon { background: var(--amber-dim);   fill: var(--amber);   }
.stat-red   .stat-icon { background: var(--red-dim);     fill: var(--red);     }

.stat-icon svg { width: 22px; height: 22px; fill: inherit; }

.stat-value {
  font-size: 1.75rem; font-weight: 800;
  line-height: 1;
  margin-bottom: .2rem;
}

.stat-label {
  font-size: .78rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Tables ───────────────────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

.data-table thead tr {
  background: rgba(255,255,255,.02);
  border-bottom: 1px solid var(--border);
}

.data-table th {
  padding: .75rem 1.5rem;
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  white-space: nowrap;
}

.data-table td {
  padding: .875rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,.03);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: rgba(255,255,255,.02);
}

.data-table tbody tr:last-child td { border-bottom: none; }

.td-primary { font-weight: 600; }
.td-sub { font-size: .78rem; color: var(--text-muted); margin-top: .1rem; }
.td-muted { color: var(--text-muted); font-size: .85rem; }

.mid-code {
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: .2rem .5rem;
  font-size: .78rem;
  color: var(--accent);
  white-space: nowrap;
}

.act-code {
  background: rgba(52,211,153,.08);
  border: 1px solid rgba(52,211,153,.2);
  border-radius: 5px;
  padding: .2rem .5rem;
  font-family: monospace;
  font-size: .85rem;
  color: var(--green);
  letter-spacing: .05em;
  white-space: nowrap;
}

.mono { font-family: monospace; font-size: .85rem; color: var(--text-dim); }

.action-btns { display: flex; gap: .4rem; align-items: center; flex-wrap: nowrap; }

/* ── Badges ───────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .25rem .625rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.badge-green { background: var(--green-dim);  color: var(--green);  border: 1px solid rgba(52,211,153,.25); }
.badge-red   { background: var(--red-dim);    color: var(--red);    border: 1px solid rgba(248,113,113,.25); }
.badge-blue  { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(56,189,248,.25); }
.badge-amber { background: var(--amber-dim);  color: var(--amber);  border: 1px solid rgba(251,191,36,.25); }

/* ── Limit bar ────────────────────────────────────────────────────────────── */
.limit-bar {
  height: 6px;
  background: rgba(255,255,255,.07);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: .25rem;
}

.limit-bar.slim { height: 4px; }
.limit-bar.lg   { height: 10px; }

.limit-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #6366f1);
  border-radius: 99px;
  transition: width .4s ease;
}

.limit-fill.warn { background: linear-gradient(90deg, var(--amber), #d97706); }
.limit-fill.full { background: linear-gradient(90deg, var(--red), #dc2626); }

.activation-usage { display: flex; align-items: center; gap: .75rem; }
.activation-usage .limit-bar { flex: 1; margin-bottom: 0; }
.activation-usage span { font-size: .8rem; color: var(--text-muted); white-space: nowrap; }

/* ── Alerts ───────────────────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .875rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  margin-bottom: 1.25rem;
}

.alert svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }

.alert-danger  { background: var(--red-dim);   color: var(--red);   border: 1px solid rgba(248,113,113,.25); }
.alert-success { background: var(--green-dim);  color: var(--green); border: 1px solid rgba(52,211,153,.25); }
.alert-warning { background: var(--amber-dim);  color: var(--amber); border: 1px solid rgba(251,191,36,.25); }
.alert-info    { background: var(--accent-dim); color: var(--accent);border: 1px solid rgba(56,189,248,.25); }

/* ── Forms ────────────────────────────────────────────────────────────────── */
.form-layout { padding: 1.5rem; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
@media (max-width: 580px) { .form-row { grid-template-columns: 1fr; } }

.form-group { display: flex; flex-direction: column; }
.form-group label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .5rem;
}
.form-group label small { text-transform: none; font-weight: 400; color: var(--text-muted); }

.form-group input,
.form-group select,
.form-group textarea {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: .9rem;
  padding: .65rem .875rem;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-group textarea { resize: vertical; }

.form-group select option { background: var(--bg-card-2); }

.form-input { /* standalone inputs */
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: .875rem;
  padding: .55rem .875rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  min-width: 0;
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.form-input-sm { padding: .4rem .7rem; font-size: .825rem; }

.form-select {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: .875rem;
  padding: .55rem .875rem;
  outline: none;
  cursor: pointer;
}
.form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.form-select option { background: var(--bg-card-2); }

.form-actions { display: flex; gap: .75rem; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }

/* Toggle switch */
.toggle-label { display: flex; align-items: center; gap: .75rem; cursor: pointer; font-size: .875rem; }
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: rgba(255,255,255,.1);
  border-radius: 999px;
  transition: .3s;
  cursor: pointer;
}
.toggle-slider::after {
  content: '';
  position: absolute;
  left: 3px; top: 3px;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: .3s;
}
.toggle-switch input:checked + .toggle-slider { background: linear-gradient(135deg, #0ea5e9, #6366f1); }
.toggle-switch input:checked + .toggle-slider::after { transform: translateX(20px); }

/* Filter bar */
.filter-bar {
  display: flex;
  gap: .75rem;
  align-items: center;
  padding: 1rem 1.5rem;
  flex-wrap: wrap;
}

/* ── Grid layouts ─────────────────────────────────────────────────────────── */
.two-col-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 900px) { .two-col-grid { grid-template-columns: 1fr; } }

/* ── Empty state ──────────────────────────────────────────────────────────── */
.empty-state {
  padding: 3rem 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: .9rem;
  line-height: 1.8;
}

/* ── Pagination ───────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  gap: .35rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}

.page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  font-size: .8rem; font-weight: 600;
  color: var(--text-dim);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: .15s;
}
.page-btn:hover { background: var(--accent-dim); color: var(--accent); border-color: rgba(56,189,248,.3); text-decoration: none; }
.page-btn.active { background: linear-gradient(135deg, #0ea5e9, #6366f1); color: #fff; border-color: transparent; }

/* ── Welcome banner ───────────────────────────────────────────────────────── */
.welcome-banner {
  background: linear-gradient(135deg, rgba(14,165,233,.1), rgba(99,102,241,.1));
  border: 1px solid rgba(56,189,248,.2);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.welcome-text h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: .25rem; }
.welcome-text p  { color: var(--text-dim); font-size: .875rem; }

/* ── Activation box ───────────────────────────────────────────────────────── */
.activation-box {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
}

.activation-box .form-group { flex: 1; }

.activation-box .form-group label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .5rem;
  display: block;
}

.activation-box input {
  width: 100%;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: .95rem;
  padding: .7rem 1rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.activation-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* ── Activation result ────────────────────────────────────────────────────── */
.act-result {
  margin-top: 1.25rem;
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.5rem;
  animation: slideIn .25s ease;
}

.act-result.hidden { display: none; }

.act-result-success {
  background: rgba(52,211,153,.07);
  border: 1px solid rgba(52,211,153,.25);
}

.act-result-error {
  background: var(--red-dim);
  border: 1px solid rgba(248,113,113,.25);
  color: var(--red);
}

.result-label { font-size: .85rem; color: var(--green); font-weight: 600; margin-bottom: .75rem; }

.result-code {
  font-family: monospace;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: .12em;
  color: var(--green);
  background: rgba(52,211,153,.06);
  border: 1px dashed rgba(52,211,153,.3);
  border-radius: var(--radius-sm);
  padding: .75rem 1.25rem;
  display: inline-block;
  cursor: pointer;
  transition: background .2s, transform .1s;
  user-select: all;
}

.result-code:hover { background: rgba(52,211,153,.12); }
.result-code.copied { background: rgba(52,211,153,.2); transform: scale(1.02); }

.result-hint { font-size: .8rem; color: var(--text-muted); margin-top: .75rem; }
.result-sub  { font-size: .78rem; color: var(--text-muted); margin-top: .35rem; }

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Download page ────────────────────────────────────────────────────────── */
.download-hero {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem;
  background: var(--accent-dim);
  border: 1px solid rgba(56,189,248,.2);
  border-radius: var(--radius-sm);
}

.dl-icon {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.dl-icon svg { width: 28px; height: 28px; fill: #fff; }
.dl-name { font-size: 1.1rem; font-weight: 700; }
.dl-meta { font-size: .8rem; color: var(--text-muted); margin-top: .2rem; }

.dl-steps {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.dl-steps h4 { font-size: .9rem; font-weight: 700; margin-bottom: .875rem; color: var(--text-dim); }

.dl-steps ol { padding-left: 1.5rem; }
.dl-steps li { margin-bottom: .6rem; color: var(--text-dim); font-size: .875rem; line-height: 1.7; }
.dl-steps strong { color: var(--text); }

.dl-creds {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.dl-creds h4 { font-size: .85rem; font-weight: 700; margin-bottom: .75rem; color: var(--text-dim); }

.cred-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: .4rem;
  font-size: .875rem;
}

.cred-row span { color: var(--text-muted); width: 80px; }
.cred-row code {
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: .2rem .6rem;
  color: var(--accent);
}

/* ── Limit info card ──────────────────────────────────────────────────────── */
.limit-info { padding: 1rem 1.5rem; }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  body.dashboard-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: -100%;
    width: 100%;
    max-width: var(--sidebar-w);
    transition: left .25s;
    z-index: 999;
  }

  .sidebar.open { left: 0; }

  .topbar-toggle { display: flex; }

  .main-wrapper { grid-column: 1; }

  .activation-box { flex-direction: column; align-items: stretch; }

  .welcome-banner { flex-direction: column; text-align: center; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  .data-table th:nth-child(n+4),
  .data-table td:nth-child(n+4) { display: none; }

  .filter-bar { flex-direction: column; align-items: stretch; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .main-content { padding: 1rem; }
  .topbar { padding: 0 1rem; }
  .login-card { padding: 1.75rem 1.25rem; }
}
