/* ==========================================================================
   Novaeona License Admin — Modern, CSP-safe, responsive, dark-mode aware
   Drop in as /public/app.css and <link> it in your EJS <head>.
   ========================================================================== */

/* Design tokens */
:root {
  --bg: #0b0e13;
  --panel: #121722;
  --elev: #161c28;
  --elev-2: #1b2333;
  --text: #e6edf3;
  --text-dim: #a9b4c0;
  --muted: #7f8aa1;
  --primary: #6ea8ff;
  --primary-600: #5292ff;
  --primary-700: #3c7ef7;
  --success: #3ccf91;
  --warn: #f1b561;
  --danger: #ff6b6b;
  --outline: 1px solid rgba(255,255,255,0.06);
  --ring: 0 0 0 3px rgba(110,168,255,0.25);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-1: 0 6px 24px rgba(0,0,0,0.28), 0 2px 8px rgba(0,0,0,0.25);
  --shadow-2: 0 18px 60px rgba(0,0,0,0.35), 0 6px 20px rgba(0,0,0,0.28);
  --grid-gap: clamp(14px, 2vw, 20px);
  --pad: clamp(16px, 2.2vw, 24px);
  --pad-lg: clamp(22px, 3vw, 32px);
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Inter, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji","Segoe UI Emoji";
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f7fb;
    --panel: #ffffff;
    --elev: #ffffff;
    --elev-2: #ffffff;
    --text: #12161f;
    --text-dim: #5a6473;
    --muted: #7a879b;
    --outline: 1px solid rgba(10,14,23,0.08);
    --shadow-1: 0 6px 24px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.06);
    --shadow-2: 0 18px 60px rgba(0,0,0,0.12), 0 6px 20px rgba(0,0,0,0.10);
  }
}

/* Base */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: radial-gradient(1200px 800px at 10% -10%, rgba(110,168,255,0.12), transparent 60%),
              radial-gradient(1000px 700px at 110% -20%, rgba(92,225,230,0.08), transparent 55%),
              var(--bg);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

main {
  max-width: 1100px;
  margin: 40px auto;
  padding: 0 var(--pad);
}

h1, h2, h3 {
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(28px, 3.2vw, 38px); font-weight: 800; }
h2 { font-size: clamp(20px, 2.2vw, 26px); font-weight: 700; color: var(--text); }
h3 { font-size: clamp(18px, 2vw, 22px); font-weight: 700; color: var(--text); }

.spacer { height: 18px; }
hr {
  border: none;
  border-top: var(--outline);
  margin: 18px 0;
  opacity: .6;
}

/* Header / toolbar */
.header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--pad) 0;
}
.header .brand {
  display: flex; gap: 12px; align-items: center;
  font-weight: 800; font-size: 18px; color: var(--text);
}
.header .brand .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #5ce1e6);
  box-shadow: 0 0 0 4px rgba(110,168,255,0.15);
}
.header .actions { display: flex; gap: 10px; }

/* Buttons */
button, .btn {
  appearance: none;
  border: 0;
  background: linear-gradient(180deg, var(--primary), var(--primary-600));
  color: white;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  letter-spacing: .01em;
  box-shadow: var(--shadow-1);
  transition: transform .06s ease, filter .15s ease, box-shadow .15s ease;
  cursor: pointer;
}
button:hover, .btn:hover { filter: brightness(1.05); }
button:active, .btn:active { transform: translateY(1px); box-shadow: var(--shadow-2); }

.btn--subtle {
  background: linear-gradient(180deg, #2a3345, #232a3b);
  color: var(--text);
}
@media (prefers-color-scheme: light) {
  .btn--subtle { background: linear-gradient(180deg, #eef2f8, #e9eef6); }
}

.btn--danger { background: linear-gradient(180deg, #ff7b7b, #ff6060); }
.btn--warn   { background: linear-gradient(180deg, #ffd27a, #ffbf59); color: #2a2a2a; }

/* Cards & panels */
.card {
  background: linear-gradient(180deg, var(--elev), var(--elev-2));
  border-radius: var(--radius);
  border: var(--outline);
  padding: var(--pad-lg);
  box-shadow: var(--shadow-1);
  backdrop-filter: saturate(120%) blur(6px);
}
.card--tight { padding: var(--pad); }

.kbd {
  background: rgba(255,255,255,0.08);
  border: var(--outline);
  padding: 2px 6px; border-radius: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px; color: var(--text-dim);
}

/* Forms */
form.card { width: 100%; }
.input-row {
  display: grid; gap: 8px; margin-bottom: 14px;
  font-weight: 600; color: var(--text);
}
.input-row input, .input-row select, .input-row textarea {
  width: 100%;
  background: #0f1420;
  color: var(--text);
  border: var(--outline);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  transition: box-shadow .15s ease, border-color .15s ease, transform .06s ease;
}
.input-row textarea { min-height: 120px; resize: vertical; }
.input-row input:focus, .input-row select:focus, .input-row textarea:focus {
  box-shadow: var(--ring);
  border-color: rgba(110,168,255,0.55);
}
.help { color: var(--text-dim); font-size: 13px; }

.error {
  background: rgba(255, 64, 64, 0.12);
  border: 1px solid rgba(255, 64, 64, 0.25);
  color: #ffc9c9;
  padding: 10px 12px; border-radius: 12px; margin: 0 0 12px;
}
.success {
  background: rgba(60, 207, 145, 0.14);
  border: 1px solid rgba(60, 207, 145, 0.25);
  color: #b8f3da;
  padding: 10px 12px; border-radius: 12px; margin: 0 0 12px;
}

/* Tables */
.table-wrap { overflow: auto; border-radius: var(--radius); border: var(--outline); }
table {
  width: 100%; border-collapse: separate; border-spacing: 0; min-width: 720px;
  background: linear-gradient(180deg, var(--elev), var(--elev-2));
}
thead th {
  text-align: left; font-weight: 800; font-size: 13px; color: var(--text-dim);
  letter-spacing: .06em; text-transform: uppercase; padding: 14px;
  border-bottom: var(--outline);
}
tbody td {
  padding: 14px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
tbody tr:hover td { background: rgba(110,168,255,0.06); }
tbody tr:last-child td { border-bottom: 0; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 999px; font-weight: 700; font-size: 12px;
  border: var(--outline); background: #0f1420; color: var(--text);
}
.badge--full   { background: linear-gradient(180deg, rgba(60,207,145,0.18), rgba(60,207,145,0.10)); border-color: rgba(60,207,145,0.25); color: #b8f3da; }
.badge--trial  { background: linear-gradient(180deg, rgba(110,168,255,0.18), rgba(110,168,255,0.10)); border-color: rgba(110,168,255,0.25); color: #cfe2ff; }
.badge--danger { background: linear-gradient(180deg, rgba(255,107,107,0.18), rgba(255,107,107,0.10)); border-color: rgba(255,107,107,0.25); color: #ffc9c9; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }

/* Grid utilities */
.grid {
  display: grid;
  gap: var(--grid-gap);
}
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
@media (max-width: 900px) {
  .grid.cols-3 { grid-template-columns: 1fr; }
  .grid.cols-2 { grid-template-columns: 1fr; }
}

/* Toolbar / filters */
.toolbar {
  display: flex; gap: 10px; align-items: center; justify-content: space-between; margin: 14px 0 18px;
}
.toolbar .left, .toolbar .right { display: flex; gap: 10px; align-items: center; }

/* Code block (for full reg code text view) */
.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  background: #0f1420; color: #d6e2f1;
  border: var(--outline); border-radius: 12px; padding: 12px 14px; overflow: auto;
  word-break: break-all;
}

/* Empty states */
.empty {
  border: var(--outline); border-radius: var(--radius);
  padding: 28px; text-align: center; color: var(--text-dim);
  background: linear-gradient(180deg, var(--elev), var(--elev-2));
}
.empty .emoji { font-size: 28px; display: block; margin-bottom: 8px; }

/* Mini chips for OS/kinds */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 6px 10px; border-radius: 999px;
  background: rgba(255,255,255,0.06); border: var(--outline); color: var(--text-dim);
  font-weight: 700; font-size: 12px;
}

/* Footer */
.footer {
  margin: 36px 0 14px; color: var(--text-dim); font-size: 12.5px; text-align: center;
  opacity: .8;
}

/* Small helper classes */
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.right { margin-left: auto; }
.m0 { margin: 0; }
.mb8 { margin-bottom: 8px; }
.mb12 { margin-bottom: 12px; }
.mb16 { margin-bottom: 16px; }
.mt8 { margin-top: 8px; }
.mt16 { margin-top: 16px; }
.w100 { width: 100%; }
.center { text-align: center; }
.hide-mobile { display: block; }
@media (max-width: 640px) { .hide-mobile { display: none; } }
