/* ============================================================
   Lucifer License System — Style Sheet
   Philosophy: utility tool, not SaaS landing page
   Palette: near-black + amber accent, monospace for codes
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Neutral palette */
  --c-bg:       #0d0d0d;
  --c-surface:  #141414;
  --c-border:   #2a2a2a;
  --c-muted:    #555;
  --c-text:     #d4d4d4;
  --c-heading:  #f0f0f0;

  /* Accent: amber */
  --c-accent:   #e8a020;
  --c-accent-dim: #7a510f;

  /* Status colours */
  --c-active:   #22c55e;
  --c-expired:  #ef4444;
  --c-revoked:  #6366f1;
  --c-voided:   #6b7280;

  /* Typography */
  --f-sans:  'IBM Plex Sans', system-ui, sans-serif;
  --f-mono:  'IBM Plex Mono', 'Courier New', monospace;

  --text-xs:  0.72rem;
  --text-sm:  0.82rem;
  --text-base: 0.92rem;
  --text-lg:  1.1rem;
  --text-xl:  1.4rem;
  --text-2xl: 1.8rem;
}

html { font-size: 16px; }
body {
  font-family: var(--f-sans);
  font-size: var(--text-base);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  min-height: 100vh;
}

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

code, .mono { font-family: var(--f-mono); }

/* ── Layout helpers ────────────────────────────────────────── */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.container--wide {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ── Public layout ─────────────────────────────────────────── */
.pub-header {
  border-bottom: 1px solid var(--c-border);
  padding: 1rem 0;
  margin-bottom: 2.5rem;
  position: sticky;
  top: 0;
  background: rgba(13, 13, 13, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
  transition: background-color 0.25s ease;
}

html[data-theme="light"] .pub-header {
  background: rgba(248, 250, 252, 0.8);
}

.pub-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.pub-logo {
  font-family: var(--f-mono);
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--c-accent);
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: opacity 0.2s;
}
.pub-logo:hover { text-decoration: none; opacity: 0.9; }

.pub-header__actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.pub-discord-link {
  color: var(--c-text);
  opacity: 0.65;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s, color 0.2s, transform 0.2s;
}
.pub-discord-link:hover {
  color: #5865F2;
  opacity: 1;
  transform: translateY(-1px);
  text-decoration: none;
}

.pub-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 20px;
  height: 14px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 101;
}
.pub-menu-toggle .bar {
  width: 100%;
  height: 2px;
  background-color: var(--c-text);
  transition: all 0.2s ease;
}
.pub-menu-toggle.active .bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.pub-menu-toggle.active .bar:nth-child(2) {
  opacity: 0;
}
.pub-menu-toggle.active .bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.pub-nav { display: flex; gap: 1.75rem; }
.pub-nav a {
  color: var(--c-text);
  opacity: 0.65;
  font-size: var(--text-sm);
  font-weight: 500;
  transition: opacity 0.15s, color 0.15s;
}
.pub-nav a:hover, .pub-nav a.active { color: var(--c-accent); opacity: 1; text-decoration: none; }

@media (max-width: 640px) {
  .pub-menu-toggle {
    display: flex;
  }
  .pub-nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(20, 20, 20, 0.95);
    border-bottom: 1px solid var(--c-border);
    padding: 1.5rem 1.25rem;
    gap: 1.25rem;
    z-index: 99;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: background-color 0.25s ease;
  }
  html[data-theme="light"] .pub-nav {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  }
  .pub-nav.active {
    display: flex;
  }
  .pub-nav a {
    font-size: var(--text-base);
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  }
  html[data-theme="light"] .pub-nav a {
    border-bottom-color: rgba(0, 0, 0, 0.05);
  }
  .pub-nav a:last-child {
    border-bottom: none;
  }
}

.pub-main { padding-bottom: 4rem; }

/* ── Page title ────────────────────────────────────────────── */
.page-title {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--c-heading);
  margin-bottom: 0.3rem;
  letter-spacing: -0.02em;
}
.page-subtitle {
  color: var(--c-muted);
  font-size: var(--text-sm);
  margin-bottom: 1.75rem;
}

/* ── Forms ─────────────────────────────────────────────────── */
.form-block { margin-bottom: 2rem; }

.form-group {
  margin-bottom: 1rem;
}

label {
  display: block;
  font-size: var(--text-sm);
  color: var(--c-muted);
  margin-bottom: 0.35rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-weight: 500;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  color: var(--c-heading);
  padding: 0.55rem 0.75rem;
  font-family: var(--f-sans);
  font-size: var(--text-base);
  border-radius: 4px;
  outline: none;
  transition: border-color 0.15s;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="datetime-local"]:focus,
select:focus,
textarea:focus {
  border-color: var(--c-accent);
}

input.mono-input {
  font-family: var(--f-mono);
  letter-spacing: 0.06em;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  font-size: var(--text-sm);
  font-family: var(--f-sans);
  font-weight: 500;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
  text-decoration: none;
}
.btn:hover { opacity: 0.88; text-decoration: none; }
.btn:active { opacity: 0.7; }

.btn-primary { background: var(--c-accent); color: #0d0d0d; }
.btn-ghost   { background: transparent; color: var(--c-text); border: 1px solid var(--c-border); }
.btn-ghost:hover { border-color: var(--c-muted); background: var(--c-surface); }
.btn-danger  { background: var(--c-expired); color: #fff; }
.btn-sm      { padding: 0.3rem 0.7rem; font-size: var(--text-xs); }

/* ── Alerts ────────────────────────────────────────────────── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 4px;
  font-size: var(--text-sm);
  margin-bottom: 1.25rem;
  border-left: 3px solid;
}
.alert-error  { background: #1a0808; border-color: var(--c-expired); color: #fca5a5; }
.alert-success { background: #071a10; border-color: var(--c-active); color: #86efac; }
.alert-info   { background: #12100a; border-color: var(--c-accent); color: #fcd34d; }

/* ── Status badges ─────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.55rem;
  font-size: var(--text-xs);
  font-family: var(--f-mono);
  border-radius: 2px;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.badge::before { content: '●'; font-size: 0.6em; }
.badge-active  { background: rgba(34,197,94,0.1);  color: var(--c-active);  }
.badge-expired { background: rgba(239,68,68,0.1);  color: var(--c-expired); }
.badge-revoked { background: rgba(99,102,241,0.1); color: var(--c-revoked); }
.badge-used    { background: rgba(255,255,255,0.06); color: var(--c-muted); }
.badge-unused  { background: rgba(232,160,32,0.1); color: var(--c-accent); }
.badge-voided  { background: rgba(107,114,128,0.1); color: var(--c-voided); }

/* ── Tables ────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--c-border);
  border-radius: 4px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

thead {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
}

th {
  text-align: left;
  padding: 0.55rem 0.85rem;
  font-weight: 500;
  font-size: var(--text-xs);
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

td {
  padding: 0.5rem 0.85rem;
  border-bottom: 1px solid var(--c-border);
  vertical-align: middle;
  white-space: nowrap;
}

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

tbody tr:hover td { background: rgba(255,255,255,0.02); }

.td-mono { font-family: var(--f-mono); font-size: var(--text-xs); letter-spacing: 0.04em; }

/* ── Pagination ────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  font-size: var(--text-sm);
  color: var(--c-muted);
}
.pagination a {
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--c-border);
  border-radius: 3px;
  color: var(--c-text);
}
.pagination a:hover { border-color: var(--c-accent); text-decoration: none; }
.pagination .active {
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--c-accent);
  border-radius: 3px;
  color: var(--c-accent);
}

/* ── Admin sidebar layout ──────────────────────────────────── */
.admin-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  background: var(--c-surface);
  border-right: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-logo {
  font-family: var(--f-mono);
  font-size: var(--text-sm);
  color: var(--c-accent);
  padding: 0 1.1rem 1.25rem;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
}

.sidebar-section-label {
  font-size: var(--text-xs);
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.6rem 1.1rem 0.3rem;
  font-weight: 500;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1.1rem;
  color: var(--c-text);
  font-size: var(--text-sm);
  transition: background 0.12s, color 0.12s;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.04); text-decoration: none; }
.sidebar-nav a.active { color: var(--c-accent); background: rgba(232,160,32,0.06); border-right: 2px solid var(--c-accent); }

.sidebar-bottom {
  margin-top: auto;
  padding: 1rem 1.1rem 0;
  border-top: 1px solid var(--c-border);
}
.sidebar-admin-name {
  font-size: var(--text-xs);
  color: var(--c-muted);
  margin-bottom: 0.5rem;
}

.admin-content {
  padding: 2rem 2rem;
  overflow: auto;
}

/* ── Admin header bar ──────────────────────────────────────── */
.admin-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.admin-page-title {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--c-heading);
  letter-spacing: -0.02em;
}

/* ── Stat cards (dashboard) ────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 4px;
  padding: 1rem 1.25rem;
}

.stat-label {
  font-size: var(--text-xs);
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.stat-value {
  font-size: var(--text-2xl);
  font-family: var(--f-mono);
  font-weight: 500;
  color: var(--c-heading);
  line-height: 1;
}

.stat-value.accent { color: var(--c-accent); }
.stat-value.danger { color: var(--c-expired); }

/* ── Filter bar ────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}
.filter-bar .form-group { margin-bottom: 0; flex: 1 1 140px; }
.filter-bar label { font-size: var(--text-xs); }
.filter-bar select, .filter-bar input { font-size: var(--text-sm); padding: 0.4rem 0.6rem; }

/* ── Voucher code display ──────────────────────────────────── */
.voucher-code-list {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 4px;
  padding: 1rem;
  font-family: var(--f-mono);
  font-size: var(--text-sm);
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
  line-height: 2;
  color: var(--c-accent);
  letter-spacing: 0.06em;
}

/* ── Utility ────────────────────────────────────────────────── */
.text-muted { color: var(--c-muted); }
.text-mono  { font-family: var(--f-mono); }
.text-sm    { font-size: var(--text-sm); }
.text-xs    { font-size: var(--text-xs); }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.flex { display: flex; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.grow { flex: 1; }

/* ── Section divider ────────────────────────────────────────── */
.section-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--c-border);
}

/* ── Public check result ────────────────────────────────────── */
.result-block {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 4px;
  padding: 1.25rem;
  margin-top: 1.5rem;
}
.result-username {
  font-family: var(--f-mono);
  font-size: var(--text-lg);
  color: var(--c-heading);
  margin-bottom: 1rem;
}
.result-username span { color: var(--c-muted); font-size: var(--text-sm); }

.no-license {
  color: var(--c-muted);
  font-size: var(--text-sm);
  padding: 1.5rem 0;
  text-align: center;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    border-right: none;
    border-bottom: 1px solid var(--c-border);
  }
  .admin-content { padding: 1rem; }
}

/* ── Custom split container for manage page ── */
@media (max-width: 768px) {
  .manage-split-container {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
}
.manage-split-container {
  margin-top: 1rem;
}

/* ── Theme Definitions ── */
html[data-theme="light"] {
  --c-bg:       #f8fafc;
  --c-surface:  #ffffff;
  --c-border:   #cbd5e1;
  --c-muted:    #64748b;
  --c-text:     #334155;
  --c-heading:  #0f172a;

  /* Accent: slightly stronger amber for readability on white bg */
  --c-accent:   #d97706;
  --c-accent-dim: #fef3c7;
}

html[data-theme="light"] .alert-error  { background: #fef2f2; border-color: var(--c-expired); color: #991b1b; }
html[data-theme="light"] .alert-success { background: #f0fdf4; border-color: var(--c-active); color: #166534; }
html[data-theme="light"] .alert-info   { background: #fffbeb; border-color: var(--c-accent); color: #92400e; }

/* ── Theme Toggle Button ── */
.pub-theme-toggle {
  background: transparent;
  border: none;
  color: var(--c-text);
  opacity: 0.65;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border-radius: 6px;
  transition: opacity 0.2s, color 0.2s, background-color 0.2s, transform 0.2s;
}
.pub-theme-toggle:hover {
  color: var(--c-accent);
  opacity: 1;
  background-color: rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}
html[data-theme="light"] .pub-theme-toggle:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

html[data-theme="light"] .theme-icon-sun {
  display: none;
}
html[data-theme="dark"] .theme-icon-moon {
  display: none;
}

/* ── Public Layout UI Enhancement ── */
.pub-main {
  font-size: 1.05rem; /* Increase overall font scale slightly */
}

.pub-main .page-title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--c-heading);
}

.pub-main .page-subtitle {
  font-size: 0.95rem;
  margin-bottom: 2rem;
  color: var(--c-muted);
}

.pub-main input[type="text"],
.pub-main input[type="password"],
.pub-main input[type="number"],
.pub-main select,
.pub-main textarea {
  padding: 0.85rem 1.1rem;
  font-size: 1.05rem;
  border-radius: 6px;
  background: var(--c-surface);
  border-color: var(--c-border);
  color: var(--c-heading);
  transition: all 0.25s ease;
}

.pub-main input[type="text"]:focus,
.pub-main input[type="password"]:focus,
.pub-main select:focus {
  border-color: var(--c-accent);
  background: var(--c-surface);
  box-shadow: 0 0 0 3px rgba(232, 160, 32, 0.15);
}

.pub-main label {
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  color: var(--c-muted);
}

.pub-main .btn {
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 6px;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.pub-main .btn-primary {
  background: var(--c-accent);
  color: #0d0d0d;
  box-shadow: 0 4px 12px rgba(232, 160, 32, 0.2);
}

.pub-main .btn-primary:hover {
  background: #f0ab2a;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(232, 160, 32, 0.35);
}

.pub-main .btn-primary:active {
  transform: translateY(1px);
}

.pub-main .btn-ghost {
  border-color: var(--c-border);
  background: transparent;
  color: var(--c-text);
}

.pub-main .btn-ghost:hover {
  border-color: var(--c-accent);
  color: var(--c-accent);
  background: rgba(232, 160, 32, 0.06);
  transform: translateY(-1px);
}

.pub-main .btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.pub-main .alert {
  padding: 1rem 1.25rem;
  font-size: 0.95rem;
  border-radius: 6px;
  line-height: 1.5;
}

.pub-main table th {
  padding: 0.85rem 1rem;
  font-size: 0.8rem;
}

.pub-main table td {
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
}

.pub-main .result-block {
  border-radius: 8px;
  padding: 1.5rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
}

.pub-main .tips-block {
  border: 1px solid var(--c-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02) !important;
}
html[data-theme="light"] .pub-main .tips-block {
  background: rgba(0, 0, 0, 0.02) !important;
}

