/* ============================================================
   License Server — Editorial-Profesional v2.0
   Aliniat cu DocuPRO main app design tokens (24 mai 2026).
   Sursa de adevăr: /opt/docupro/frontend/src/styles/tokens.css
   ============================================================ */

:root {
  /* Backgrounds — Light & Friendly (redesign v3, 1 iunie 2026) */
  --bg-base:       #F7F8FA;
  --bg-surface:    #FFFFFF;
  --bg-elevated:   #F2F3F7;
  --bg-hover:      #ECEEF3;
  --bg-pressed:    #E2E5EC;

  /* Text — near-black ink hierarchy */
  --text-primary:   #1A1D29;
  --text-secondary: #5B6172;
  --text-muted:     #9CA3B0;
  --text-disabled:  #C2C7D2;

  /* Borders */
  --border-subtle:  #EEF0F4;
  --border-default: #E8EAF0;
  --border-strong:  #CDD0DA;
  --border-hover:   #B9BDCB;

  /* Accents — indigo */
  --accent-primary: #4F46E5;
  --accent-hover:   #6366F1;
  --accent-subtle:  #EEF0FE;
  --accent-glow:    rgba(79, 70, 229, 0.18);

  --color-success:        #10b981;
  --color-success-subtle: #E6F8F2;
  --color-warning:        #f59e0b;
  --color-warning-subtle: #FEF3DD;
  --color-error:          #ef4444;
  --color-error-subtle:   #FDECEC;

  /* Fonts — Plex Sans (Playfair eliminat pentru claritate, ca în app) */
  --font-display: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --font-body:    'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --font-mono:    'IBM Plex Mono', 'Courier New', monospace;

  /* Sizing */
  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-md: 16px;
  --text-lg: 20px;
  --text-xl: 24px;
  --text-2xl: 32px;
  --text-3xl: 48px;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Shadows */
  --shadow-card:   0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-modal:  0 16px 48px rgba(16, 24, 40, 0.12);
  --shadow-focus:  0 0 0 3px rgba(79, 70, 229, 0.30);
  --shadow-accent: 0 0 0 3px rgba(79, 70, 229, 0.25);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 220ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --topbar-height: 60px;
  --content-max-width: 1400px;

  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--bg-base);
  /* Atmospheric dot grid — 32px (din DocuPRO main) */
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 32px 32px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent-primary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--accent-hover); }

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

.muted { color: var(--text-muted); font-size: var(--text-sm); }
.error { color: var(--color-error); background: var(--color-error-subtle); border: 1px solid rgba(239, 68, 68, 0.25); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); margin: var(--space-2) 0; font-size: var(--text-sm); }
.ok    { color: var(--color-success); background: var(--color-success-subtle); border: 1px solid rgba(16, 185, 129, 0.25); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); margin: var(--space-2) 0; font-size: var(--text-sm); }

/* ── Login (split screen editorial) ───────────────────────── */
.login-body {
  display: grid;
  grid-template-columns: 1fr 460px;
  min-height: 100vh;
  background: var(--bg-base);
}

.login-hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-12);
  position: relative;
  overflow: hidden;
  /* Atmospheric mesh — gradients radiali pe colțuri */
  background:
    radial-gradient(ellipse at 20% 30%, rgba(37, 99, 235, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(16, 185, 129, 0.08) 0%, transparent 50%),
    var(--bg-base);
}
.login-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: .5;
  pointer-events: none;
}
.login-hero-content {
  position: relative;
  max-width: 580px;
  animation: fadeUp 480ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.login-hero .eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: var(--space-2) var(--space-3);
  background: var(--accent-subtle);
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-6);
}
.login-hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 900;
  font-style: italic;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-5);
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 60%, var(--color-success) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.login-hero .tagline {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: var(--space-8);
  max-width: 480px;
}
.login-hero .trust-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  list-style: none;
  padding: 0;
  margin: 0;
}
.login-hero .trust-list li {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-muted);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full, 9999px);
}
.login-hero .trust-list li::before {
  content: '●';
  color: var(--color-success);
  font-size: 8px;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
}
.login-card {
  width: 100%;
  max-width: 380px;
  animation: fadeUp 480ms cubic-bezier(0.16, 1, 0.3, 1) 150ms both;
}
.login-card h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  margin: 0 0 var(--space-2);
  color: var(--text-primary);
}
.login-card .sub {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-6);
}
.login-card form { display: flex; flex-direction: column; gap: var(--space-4); }
.login-card label {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}
.login-card input {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  text-transform: none;
  letter-spacing: normal;
}
.login-card input[inputmode="numeric"] { font-family: var(--font-mono); letter-spacing: 0.15em; }
.login-card input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-accent);
  background: var(--bg-surface);
}
.login-card button[type="submit"] {
  font-family: var(--font-body);
  background: var(--accent-primary);
  color: #fff;
  border: 0;
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-top: var(--space-2);
}
.login-card button[type="submit"]:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 12px var(--accent-glow); }

@media (max-width: 900px) {
  .login-body { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .login-panel { padding: var(--space-6); }
}

/* ── Topbar (dashboard) ───────────────────────────────────── */
header.topbar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--topbar-height);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
}
header.topbar .brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
header.topbar h1 {
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}
header.topbar h1 .accent {
  color: var(--accent-primary);
  font-style: italic;
}
header.topbar nav { display: flex; gap: var(--space-1); }
header.topbar nav a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}
header.topbar nav a:hover { background: var(--bg-elevated); color: var(--text-primary); }
header.topbar nav a.active { background: var(--accent-subtle); color: var(--accent-hover); }
header.topbar .right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--text-sm);
}
header.topbar #meUser {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
}
header.topbar button {
  font-family: var(--font-body);
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--text-xs);
  font-weight: 500;
  transition: all var(--transition-fast);
}
header.topbar button:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-strong); }

/* ── Content area ─────────────────────────────────────────── */
main.content {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: var(--space-6);
}

section {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin-bottom: var(--space-5);
  box-shadow: var(--shadow-card);
  animation: fadeUp 320ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

section h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 var(--space-5);
  letter-spacing: -0.01em;
}
section h2 a { font-family: var(--font-body); font-size: var(--text-sm); margin-right: var(--space-3); }

section h3 {
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text-secondary);
  margin: var(--space-6) 0 var(--space-3);
}

/* ── Stat grid ───────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
}
.stat {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-fast);
}
.stat::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 2px;
  background: var(--accent-primary);
  opacity: 0.6;
}
.stat:hover { border-color: var(--border-default); transform: translateY(-2px); box-shadow: var(--shadow-card); }
.stat .label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
}
.stat .value {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-top: var(--space-2);
  font-variant-numeric: tabular-nums;
}

/* ── Table ───────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--text-sm);
}
th {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-elevated);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--border-default);
}
th:first-child { border-top-left-radius: var(--radius-md); }
th:last-child { border-top-right-radius: var(--radius-md); }
td {
  padding: var(--space-4);
  border-top: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: top;
}
tr:hover td { background: var(--bg-elevated); }
td.actions { white-space: nowrap; }

/* Tabular numbers + mono pentru ID / date */
td code, .badge { font-variant-numeric: tabular-nums; }

/* ── Badge / status ──────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid transparent;
}
.badge.active     { background: var(--color-success-subtle); color: var(--color-success); border-color: rgba(16, 185, 129, 0.25); }
.badge.revoked    { background: var(--color-error-subtle); color: var(--color-error); border-color: rgba(239, 68, 68, 0.25); }
.badge.expired    { background: var(--color-warning-subtle); color: var(--color-warning); border-color: rgba(245, 158, 11, 0.25); }
.badge.superseded { background: var(--bg-elevated); color: var(--text-muted); border-color: var(--border-default); }
.badge.mismatch   { background: var(--color-error-subtle); color: var(--color-error); border-color: rgba(239, 68, 68, 0.25); }
.badge.trial      { background: rgba(79, 70, 229, 0.12); color: var(--accent-primary); border-color: rgba(79, 70, 229, 0.25); }
.badge.churned    { background: var(--bg-elevated); color: var(--text-muted); border-color: var(--border-default); }
/* Drift hardware — necesită aprobare re-emitere (redesign) */
.badge.drift      { background: var(--color-warning-subtle); color: var(--color-warning); border-color: rgba(245, 158, 11, 0.30); margin-left: 6px; }
tr.row-drift      { background: var(--color-warning-subtle); }
.badge.suspended  { background: var(--color-warning-subtle); color: var(--color-warning); border-color: rgba(245, 158, 11, 0.25); }
.badge.deleted    { background: var(--color-error-subtle); color: var(--color-error); border-color: rgba(239, 68, 68, 0.25); }
.badge.active::before     { content: '●'; color: var(--color-success); font-size: 8px; }
.badge.revoked::before    { content: '●'; color: var(--color-error); font-size: 8px; }
.badge.expired::before    { content: '●'; color: var(--color-warning); font-size: 8px; }
.badge.trial::before      { content: '◇'; color: var(--accent-primary); font-size: 8px; }
.badge.suspended::before  { content: '⏸'; color: var(--color-warning); font-size: 9px; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-xs);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
  margin-right: var(--space-1);
}
.btn:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-strong); }
.btn.primary { background: var(--accent-primary); color: #fff; border-color: var(--accent-primary); }
.btn.primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 2px 8px var(--accent-glow); }
.btn.danger { background: var(--color-error-subtle); color: var(--color-error); border-color: rgba(239, 68, 68, 0.25); }
.btn.danger:hover { background: rgba(239, 68, 68, 0.2); }

/* ── Filters bar ─────────────────────────────────────────── */
.filters {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  align-items: center;
}
.filters input, .filters select {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}
.filters input { flex: 1; max-width: 480px; }
.filters input:focus, .filters select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-accent);
}

/* ── Modal ───────────────────────────────────────────────── */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(8, 14, 28, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 200ms both;
}
.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  padding: var(--space-6);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
  max-width: 560px;
  width: 92%;
  max-height: 92vh;
  overflow-y: auto;
  animation: fadeUp 280ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.modal h3 {
  font-family: var(--font-display);
  color: var(--text-primary);
  margin: 0 0 var(--space-4);
  font-size: var(--text-lg);
  font-weight: 700;
}
.modal form { display: flex; flex-direction: column; gap: var(--space-3); }
.modal label {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}
.modal input, .modal select, .modal textarea {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  text-transform: none;
  letter-spacing: normal;
  transition: all var(--transition-fast);
}
.modal input:focus, .modal select:focus, .modal textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-accent);
}
.modal textarea { resize: vertical; min-height: 72px; }
.modal .row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.modal .footer { display: flex; gap: var(--space-2); justify-content: flex-end; margin-top: var(--space-4); }

/* ── Detail view ─────────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--space-2) var(--space-5);
  font-size: var(--text-sm);
  padding: var(--space-4);
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}
.detail-grid dt {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-top: 2px;
}
.detail-grid dd {
  margin: 0;
  color: var(--text-primary);
}

/* ── Animations ──────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Hidden utility */
[hidden] { display: none !important; }

/* Scrollbar styling (Webkit) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: var(--radius-md); }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }
