/* ─── EMDRAGO VPN — Design System ─────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Neutral ramp (OKLCH-inspired, dark theme) */
  --n-0:  #f8f9fc;
  --n-1:  #e8ecf4;
  --n-2:  #b8c2d8;
  --n-3:  #7e8fa8;
  --n-4:  #3c4a60;
  --n-5:  #1e2a3e;
  --n-6:  #141c2e;
  --n-7:  #0d1220;
  --n-8:  #08090f;

  /* Accent — indigo/violet shifted toward blue */
  --a-lo:  #2a1f5e;
  --a-mid: #5b3de8;
  --a-hi:  #8b6dff;
  --a-glow: rgba(91,61,232,0.28);

  /* Semantic */
  --success:      #18c97a;
  --success-bg:   rgba(24,201,122,0.10);
  --danger:       #f0455a;
  --danger-bg:    rgba(240,69,90,0.10);
  --warning:      #f5a623;
  --info:         #3ab3ff;

  /* Surfaces */
  --bg:           var(--n-8);
  --surface:      var(--n-7);
  --surface-2:    var(--n-6);
  --border:       rgba(255,255,255,0.06);
  --border-hi:    rgba(255,255,255,0.12);

  /* Text */
  --text:         var(--n-0);
  --text-muted:   var(--n-2);
  --text-dim:     var(--n-3);

  /* Radii */
  --r-sm:   8px;
  --r-md:   14px;
  --r-lg:   20px;
  --r-xl:   28px;
  --r-pill: 999px;

  /* Space rhythm (4px base) */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px;
  --sp-4: 16px; --sp-5: 20px; --sp-6: 24px;
  --sp-8: 32px; --sp-10: 40px; --sp-12: 48px;

  /* Transitions */
  --ease: cubic-bezier(.22,.68,0,1.2);
  --t: 160ms;
}

/* ─── RESET ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(91,61,232,0.22) 0%, transparent 65%),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(24,201,122,0.06) 0%, transparent 60%);
}
a { color: var(--a-hi); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ─── LAYOUT ─────────────────────────────────────────────────────────────── */
.page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: var(--sp-10) var(--sp-4); }
.container { width: 100%; max-width: 560px; }
.container-lg { width: 100%; max-width: 1060px; }

/* ─── CARD ─────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-8);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(255,255,255,0.025) 0%, transparent 55%);
  pointer-events: none;
  border-radius: inherit;
}
.card + .card { margin-top: var(--sp-4); }

/* ─── BRAND HEADER ──────────────────────────────────────────────────────── */
.brand {
  display: flex; align-items: center; gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}
.brand-logo {
  width: 44px; height: 44px; border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--a-mid), var(--a-hi));
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: #fff; letter-spacing: -.5px;
  flex-shrink: 0;
  box-shadow: 0 0 24px var(--a-glow);
}
.brand-name { font-size: 18px; font-weight: 700; color: var(--text); }
.brand-id   { font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* ─── STATUS BADGE ──────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 600;
}
.badge-active  { background: var(--success-bg); color: var(--success); border: 1px solid rgba(24,201,122,0.2); }
.badge-expired { background: var(--danger-bg);  color: var(--danger);  border: 1px solid rgba(240,69,90,0.2); }
.badge-blocked { background: var(--danger-bg);  color: var(--danger);  border: 1px solid rgba(240,69,90,0.2); }
.badge-admin   { background: rgba(91,61,232,0.12); color: var(--a-hi); border: 1px solid rgba(91,61,232,0.2); }
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .85; }

/* ─── TIME COUNTER ──────────────────────────────────────────────────────── */
.days-block {
  text-align: center; padding: var(--sp-6) 0 var(--sp-4);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-6);
}
.days-num {
  font-size: 72px; font-weight: 700; line-height: 1;
  background: linear-gradient(135deg, #fff 30%, var(--a-hi));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  font-variant-numeric: tabular-nums;
}
.days-label { font-size: 15px; color: var(--text-muted); margin-top: var(--sp-2); }
.days-expires { font-size: 13px; color: var(--text-dim); margin-top: var(--sp-1); }

/* ─── PROGRESS BAR ──────────────────────────────────────────────────────── */
.progress-wrap { margin: var(--sp-4) 0; }
.progress-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-dim); margin-bottom: var(--sp-2); }
.progress-bar { height: 6px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.progress-fill { height: 100%; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--a-mid), var(--a-hi)); transition: width .6s var(--ease); }

/* ─── STATS GRID ─────────────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); margin: var(--sp-5) 0; }
.stat-item { background: var(--surface-2); border-radius: var(--r-md); padding: var(--sp-4); border: 1px solid var(--border); }
.stat-label { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; }
.stat-val { font-size: 16px; font-weight: 600; color: var(--text); margin-top: var(--sp-1); font-variant-numeric: tabular-nums; }

/* ─── SECTION HEADING ─────────────────────────────────────────────────────── */
.section-title {
  font-size: 13px; font-weight: 600; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .08em;
  margin: var(--sp-6) 0 var(--sp-3);
}

/* ─── OS TABS ─────────────────────────────────────────────────────────────── */
.os-tabs { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.os-tab {
  padding: 6px 14px; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  background: var(--surface-2); border: 1px solid var(--border);
  cursor: pointer; transition: background var(--t), color var(--t), border-color var(--t);
}
.os-tab.active, .os-tab:hover {
  background: rgba(91,61,232,0.16); color: var(--a-hi);
  border-color: rgba(91,61,232,0.3);
}

/* ─── APP CARDS ──────────────────────────────────────────────────────────── */
.app-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.app-card {
  display: flex; align-items: center; gap: var(--sp-4);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: var(--sp-4);
  cursor: pointer; transition: border-color var(--t), background var(--t);
  text-decoration: none;
}
.app-card:hover { border-color: var(--border-hi); background: var(--n-6); text-decoration: none; }
.app-card.recommended { border-color: rgba(91,61,232,0.35); background: rgba(91,61,232,0.06); }
.app-icon { width: 40px; height: 40px; border-radius: var(--r-sm); background: var(--surface); display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.app-info { flex: 1; }
.app-name { font-size: 15px; font-weight: 600; color: var(--text); }
.app-desc { font-size: 13px; color: var(--text-muted); }
.app-rec-tag { font-size: 11px; font-weight: 600; color: var(--a-hi); background: rgba(91,61,232,0.12); padding: 2px 8px; border-radius: var(--r-pill); white-space: nowrap; }

/* ─── STEPS ──────────────────────────────────────────────────────────────── */
.steps { display: flex; flex-direction: column; gap: var(--sp-4); }
.step { display: flex; gap: var(--sp-4); }
.step-num {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--a-mid), var(--a-hi));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff;
  box-shadow: 0 0 16px var(--a-glow);
}
.step-body { flex: 1; padding-top: 5px; }
.step-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: var(--sp-1); }
.step-desc { font-size: 13px; color: var(--text-muted); line-height: 1.55; }

/* ─── LINK BOX ──────────────────────────────────────────────────────────── */
.link-row { display: flex; gap: var(--sp-2); align-items: center; margin-top: var(--sp-3); }
.linkbox {
  flex: 1; background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-muted); border-radius: var(--r-md); padding: 11px var(--sp-4);
  font-size: 13px; font-family: 'Menlo','Monaco','Courier New',monospace;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer; transition: border-color var(--t);
}
.linkbox:focus { outline: 2px solid var(--a-hi); outline-offset: 2px; border-color: var(--a-hi); }
.linkbox:hover { border-color: var(--border-hi); }

/* ─── BUTTONS ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px var(--sp-5); border-radius: var(--r-md);
  font-size: 14px; font-weight: 600; border: none;
  transition: opacity var(--t), transform var(--t), box-shadow var(--t);
  cursor: pointer; white-space: nowrap; text-decoration: none; color: #fff;
}
.btn:hover { opacity: .88; transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); opacity: 1; }
.btn-primary {
  background: linear-gradient(135deg, var(--a-mid), var(--a-hi));
  box-shadow: 0 4px 20px var(--a-glow);
}
.btn-secondary {
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text);
}
.btn-secondary:hover { border-color: var(--border-hi); }
.btn-danger {
  background: var(--danger-bg); border: 1px solid rgba(240,69,90,0.25);
  color: var(--danger);
}
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: var(--r-sm); }
.btn-full { width: 100%; margin-top: var(--sp-3); }

/* ─── FORM ELEMENTS ──────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: var(--sp-2); }
.field-label { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.field input, .field select {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 10px var(--sp-4);
  color: var(--text); font-size: 14px;
  transition: border-color var(--t);
}
.field input:focus, .field select:focus {
  outline: 2px solid var(--a-hi); outline-offset: 2px; border-color: var(--a-hi);
}

/* ─── TABLE ──────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: var(--sp-3); border-radius: var(--r-md); border: 1px solid var(--border); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl thead th {
  padding: var(--sp-3) var(--sp-4); text-align: left;
  color: var(--text-dim); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .07em;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
}
.tbl tbody tr { border-bottom: 1px solid var(--border); transition: background var(--t); }
.tbl tbody tr:last-child { border-bottom: none; }
.tbl tbody tr:hover { background: rgba(255,255,255,0.025); }
.tbl td { padding: var(--sp-3) var(--sp-4); color: var(--text-muted); vertical-align: middle; }
.tbl td code { font-size: 11px; background: var(--surface-2); padding: 2px 6px; border-radius: 4px; color: var(--a-hi); font-family: 'Menlo','Monaco','Courier New',monospace; }
.tbl .actions { display: flex; gap: 6px; flex-wrap: nowrap; }

/* ─── ADMIN LAYOUT ─────────────────────────────────────────────────────── */
.admin-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--sp-8); flex-wrap: wrap; gap: var(--sp-4);
}
.admin-title { font-size: 26px; font-weight: 700; }
.admin-section { margin-top: var(--sp-8); }
.admin-section-title {
  font-size: 11px; font-weight: 700; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .08em;
  margin-bottom: var(--sp-4); padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--border);
}
.create-form { display: flex; gap: var(--sp-3); align-items: flex-end; flex-wrap: wrap; }
.create-form .field { flex: 1; min-width: 140px; }

/* ─── STORE BUTTONS ──────────────────────────────────────────────────────── */
.store-btns { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-3); }
.store-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); font-size: 13px; font-weight: 500;
  transition: border-color var(--t), background var(--t);
  text-decoration: none;
}
.store-btn:hover { border-color: var(--border-hi); background: var(--n-6); text-decoration: none; }

/* ─── UTILITY ─────────────────────────────────────────────────────────────── */
.mt-1 { margin-top: var(--sp-1); } .mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); } .mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); } .mt-8 { margin-top: var(--sp-8); }
.flex { display: flex; } .flex-col { flex-direction: column; }
.items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-2 { gap: var(--sp-2); } .gap-3 { gap: var(--sp-3); }
.text-muted { color: var(--text-muted); } .text-dim { color: var(--text-dim); }
.text-sm { font-size: 13px; } .text-xs { font-size: 11px; }
.fw-600 { font-weight: 600; } .fw-700 { font-weight: 700; }

/* ─── REDUCED MOTION ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ─── RESPONSIVE ─────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .page { padding: var(--sp-4) var(--sp-3); }
  .card { padding: var(--sp-5); }
  .days-num { font-size: 56px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .os-tabs { flex-wrap: wrap; }
  .create-form { flex-direction: column; }
  .create-form .field { min-width: unset; }
  .admin-title { font-size: 20px; }
  .table-wrap { border-radius: 0; border-left: none; border-right: none; }
}
