/* LicenseForge — Shared UI Styles */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&family=DM+Mono:wght@400;500&display=swap');

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

:root {
  --bg: #0f1117;
  --bg2: #161b26;
  --bg3: #1c2333;
  --border: rgba(255,255,255,0.08);
  --border2: rgba(255,255,255,0.14);
  --text: #e8eaf0;
  --muted: #8892a4;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --green: #10b981;
  --red: #ef4444;
  --amber: #f59e0b;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,0.4);
}

body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
code { font-family: 'DM Mono', monospace; font-size: 13px; }

/* ── Shell Layout ──────────────────────────────────────────────────── */
.shell { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 0;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 15px;
}
.sidebar-nav { flex: 1; padding: 12px 10px; }
.nav-link {
  display: block; padding: 9px 12px; border-radius: 7px;
  color: var(--muted); font-weight: 500; transition: all .15s;
  margin-bottom: 2px;
}
.nav-link:hover { background: var(--bg3); color: var(--text); }
.nav-link.active { background: rgba(99,102,241,0.15); color: var(--accent); }
.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--muted);
}
.sidebar-footer a { font-size: 12px; color: var(--muted); }
.sidebar-footer a:hover { color: var(--red); }

.main { flex: 1; overflow-y: auto; padding: 28px 32px; }

/* ── Page Header ──────────────────────────────────────────────────── */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.page-header h1 { font-size: 22px; font-weight: 600; }

/* ── Stats Grid ──────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px;
}
.stat-num { font-size: 32px; font-weight: 700; color: var(--accent); line-height: 1; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 6px; font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }

/* ── Cards ──────────────────────────────────────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.card-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.card-header h2 { font-size: 15px; font-weight: 600; }
.empty-card { padding: 48px; text-align: center; }
.empty-icon { font-size: 36px; margin-bottom: 12px; }
.empty-card p { color: var(--muted); line-height: 1.8; }

/* ── Tables ──────────────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 11px 20px; text-align: left; }
.table th { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); border-bottom: 1px solid var(--border); }
.table td { border-bottom: 1px solid var(--border); }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: rgba(255,255,255,0.02); }
.empty { text-align: center; color: var(--muted); padding: 24px; }

/* ── Badges ──────────────────────────────────────────────────────── */
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.badge.green { background: rgba(16,185,129,0.15); color: #10b981; }
.badge.red   { background: rgba(239,68,68,0.15);  color: #ef4444; }

/* ── Buttons ─────────────────────────────────────────────────────── */
button, .btn-primary, .btn-secondary, .btn-sm, .btn-xs {
  cursor: pointer; border: none; border-radius: 7px; font-family: inherit; font-weight: 500; transition: all .15s;
}
.btn-primary { background: var(--accent); color: #fff; padding: 9px 18px; font-size: 14px; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary.full { width: 100%; padding: 11px; font-size: 15px; }
.btn-secondary { background: var(--bg3); color: var(--text); padding: 9px 18px; font-size: 14px; border: 1px solid var(--border2); }
.btn-secondary:hover { border-color: var(--border2); background: var(--bg); }
.btn-sm { background: var(--bg3); color: var(--text); padding: 6px 14px; font-size: 13px; border: 1px solid var(--border); }
.btn-sm:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-xs { background: var(--bg3); color: var(--text); padding: 3px 10px; font-size: 12px; border-radius: 5px; border: 1px solid var(--border); }
.btn-xs:hover { background: var(--bg); }
.btn-xs.danger:hover { background: rgba(239,68,68,0.15); color: var(--red); border-color: rgba(239,68,68,0.3); }
.btn-copy { background: transparent; border: none; color: var(--muted); padding: 2px 6px; font-size: 14px; }
.btn-copy:hover { color: var(--accent); }

/* ── Forms ──────────────────────────────────────────────────────── */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 12px; background: var(--bg);
  border: 1px solid var(--border2); border-radius: 7px;
  color: var(--text); font-family: inherit; font-size: 14px;
  transition: border-color .15s;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); }
.field select option { background: var(--bg2); }

/* ── Modals ──────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 14px; width: 440px; max-width: 96vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-header button { background: transparent; border: none; color: var(--muted); font-size: 18px; cursor: pointer; }
.modal form { padding: 20px 22px 0; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 22px 20px; }

/* ── Alerts ──────────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; font-size: 14px; }
.alert.success { background: rgba(16,185,129,0.12); color: #10b981; border: 1px solid rgba(16,185,129,0.25); }
.alert.error   { background: rgba(239,68,68,0.12);  color: #ef4444;  border: 1px solid rgba(239,68,68,0.25); }

/* ── Auth Page ──────────────────────────────────────────────────── */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-card { width: 380px; background: var(--bg2); border: 1px solid var(--border2); border-radius: 16px; padding: 36px; }
.auth-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; margin-bottom: 24px; }
.auth-card h1 { font-size: 20px; font-weight: 600; margin-bottom: 6px; }

/* ── Licences ─────────────────────────────────────────────────────── */
.key-display { background: var(--bg3); padding: 3px 8px; border-radius: 5px; color: var(--accent); letter-spacing: 1px; }
.activation-count { font-weight: 600; }
.activation-count.full { color: var(--red); }
.machine-id { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--muted); margin-left: 8px; }
.text-muted { color: var(--muted); }

.activations-panel { background: var(--bg); border-top: 1px solid var(--border); padding: 12px 20px; }
.activations-header { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 10px; }
.activation-row {
  display: flex; align-items: center; gap: 16px; padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.activation-row:last-child { border-bottom: none; }
.activation-row > div:first-child { flex: 1; }
