/* ============================================================
   LINKIX — app.css  |  Dark theme, glassmorphism, modern UI
   ============================================================ */

:root {
  --black: #0A0A0A;
  --black2: #111111;
  --black3: #161616;
  --black4: #1c1c1c;
  --border: rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.12);
  --purple: #7C3AED;
  --purple-light: #9d5ff5;
  --blue: #2563EB;
  --blue-light: #3b82f6;
  --white: #FFFFFF;
  --gray: #888;
  --gray2: #555;
  --green: #10b981;
  --red: #ef4444;
  --yellow: #f59e0b;
  --text: #e5e5e5;
  --text2: #999;
  --glass: rgba(255,255,255,0.04);
  --glass-border: rgba(255,255,255,0.08);
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.6);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--black);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
input, button, textarea { font-family: inherit; }
img { max-width: 100%; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--black2); }
::-webkit-scrollbar-thumb { background: var(--black4); border-radius: 3px; }

/* ── Container ── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }

/* ── Glass ── */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* ── Gradient text ── */
.gradient-text {
  background: linear-gradient(135deg, var(--purple), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,10,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.navbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}
.brand-name { color: var(--white); }
.navbar-links { display: flex; align-items: center; gap: 0.25rem; }
.nav-link {
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--gray);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
}
.nav-link:hover { color: var(--white); background: rgba(255,255,255,0.06); }
.nav-admin { color: var(--purple-light); }
.nav-admin:hover { background: rgba(124,58,237,0.15); }
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--gray);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.5rem;
}
.mobile-menu {
  display: none;
  flex-direction: column;
  padding: 0.5rem 1.5rem 1rem;
  border-top: 1px solid var(--border);
  gap: 0.25rem;
}
.mobile-menu.open { display: flex; }
.mobile-menu .nav-link { padding: 0.6rem 0.75rem; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(124,58,237,0.35);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(124,58,237,0.5);
}
.btn-ghost {
  background: transparent;
  color: var(--text2);
  border-color: var(--border2);
}
.btn-ghost:hover { color: var(--white); border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.05); }
.btn-danger:hover { color: var(--red) !important; border-color: rgba(239,68,68,0.3) !important; }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.8125rem; }
.btn-xs { padding: 0.3rem 0.6rem; font-size: 0.75rem; }
.btn-full { width: 100%; justify-content: center; padding: 0.75rem; }
.btn.loading { opacity: 0.7; pointer-events: none; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  padding: 5rem 0 3rem;
  text-align: center;
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
}
.blob-1 {
  width: 500px; height: 500px;
  background: var(--purple);
  top: -150px; left: -100px;
  animation: blobMove 8s ease-in-out infinite alternate;
}
.blob-2 {
  width: 400px; height: 400px;
  background: var(--blue);
  bottom: -100px; right: -50px;
  animation: blobMove 10s ease-in-out infinite alternate-reverse;
}
@keyframes blobMove {
  from { transform: translate(0,0) scale(1); }
  to { transform: translate(30px,20px) scale(1.05); }
}
.grid-overlay {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(124,58,237,0.1);
  border: 1px solid rgba(124,58,237,0.25);
  color: var(--purple-light);
  padding: 0.35rem 1rem;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}
.badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--purple-light);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.hero-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--white);
  margin-bottom: 1rem;
}
.hero-sub {
  font-size: 1.05rem;
  color: var(--text2);
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

/* ── Shorten Card ── */
.shorten-card {
  max-width: 720px;
  margin: 0 auto 2.5rem;
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: left;
}
.input-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.input-wrap {
  flex: 1;
  position: relative;
}
.input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray2);
  font-size: 0.875rem;
}
.url-input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border2);
  color: var(--white);
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  transition: border-color 0.2s;
  outline: none;
}
.url-input:focus { border-color: var(--purple); }
.url-input::placeholder { color: var(--gray2); }
.btn-shorten { flex-shrink: 0; padding: 0.75rem 1.5rem; }
.options-row {
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.option-group { display: flex; flex-direction: column; gap: 0.35rem; }
.option-label { font-size: 0.75rem; color: var(--gray); font-weight: 500; }
.alias-wrap {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.alias-prefix {
  padding: 0 0.75rem;
  font-size: 0.8rem;
  color: var(--gray);
  border-right: 1px solid var(--border2);
  white-space: nowrap;
  height: 38px;
  display: flex;
  align-items: center;
}
.alias-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--white);
  padding: 0 0.75rem;
  font-size: 0.875rem;
  outline: none;
  height: 38px;
}
.option-input {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border2);
  color: var(--white);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  outline: none;
  width: 100%;
  transition: border-color 0.2s;
}
.option-input:focus { border-color: var(--purple); }
input[type="datetime-local"] { color-scheme: dark; }
.btn-options-toggle {
  background: none;
  border: none;
  color: var(--gray);
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0;
  transition: color 0.2s;
}
.btn-options-toggle:hover { color: var(--purple-light); }

/* Result */
.result-card { padding-top: 0.5rem; }
.result-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.result-icon {
  width: 40px; height: 40px;
  background: rgba(16,185,129,0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green);
  flex-shrink: 0;
}
.result-label { font-weight: 600; color: var(--white); font-size: 0.9rem; }
.result-original { font-size: 0.78rem; color: var(--gray); margin-top: 2px; }
.result-url-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.result-url {
  font-size: 1rem;
  font-weight: 600;
  color: var(--purple-light);
}
.result-url:hover { text-decoration: underline; }
.result-actions { display: flex; gap: 0.4rem; }

/* Stats bar */
.stats-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2.5rem;
  padding: 1.25rem 2rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  max-width: 520px;
  margin: 0 auto;
}
.stat-item { text-align: center; }
.stat-num {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
}
.stat-label { font-size: 0.75rem; color: var(--gray); }
.stat-divider { width: 1px; height: 30px; background: var(--border2); }

/* ============================================================
   FEATURES
   ============================================================ */
.features {
  padding: 5rem 0;
}
.section-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  text-align: center;
  letter-spacing: -0.03em;
  color: var(--white);
  margin-bottom: 0.5rem;
}
.section-sub {
  text-align: center;
  color: var(--text2);
  margin-bottom: 3rem;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}
.feature-card {
  padding: 1.5rem;
  border-radius: var(--radius);
  transition: transform 0.2s, box-shadow 0.2s;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.feature-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 1rem;
}
.feature-card h3 { font-size: 1rem; font-weight: 600; color: var(--white); margin-bottom: 0.4rem; }
.feature-card p { font-size: 0.875rem; color: var(--text2); line-height: 1.5; }

/* ============================================================
   API SECTION
   ============================================================ */
.api-section { padding: 3rem 0 5rem; }
.api-card {
  border-radius: var(--radius);
  padding: 3rem;
  display: flex;
  gap: 3rem;
  align-items: center;
  flex-wrap: wrap;
}
.api-text { flex: 1; min-width: 280px; }
.api-text h2 { font-size: 1.8rem; font-weight: 700; color: var(--white); margin-bottom: 0.75rem; letter-spacing: -0.02em; }
.api-text p { color: var(--text2); margin-bottom: 1.5rem; line-height: 1.7; }
.api-code { flex: 1; min-width: 280px; }
.code-header {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--black3);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  padding: 0.6rem 1rem;
}
.code-dot { width: 10px; height: 10px; border-radius: 50%; }
.code-dot.red { background: #ff5f57; }
.code-dot.yellow { background: #febc2e; }
.code-dot.green { background: #28c840; }
.code-lang { font-size: 0.75rem; color: var(--gray); margin-left: 0.5rem; }
.code-block {
  background: var(--black3);
  border: 1px solid var(--border);
  padding: 1rem;
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  color: #a78bfa;
  overflow-x: auto;
  line-height: 1.6;
}
.code-response { margin-top: 0.5rem; }
.code-status {
  display: inline-block;
  background: rgba(16,185,129,0.15);
  color: var(--green);
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.4rem;
  font-family: monospace;
}
.code-block:last-child { border-radius: 0 0 var(--radius-sm) var(--radius-sm); }

/* ============================================================
   DASHBOARD PAGE
   ============================================================ */
.dashboard-page { padding: 2.5rem 0 4rem; }
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.75rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.page-title i { color: var(--purple); }
.page-sub { font-size: 0.875rem; color: var(--gray); }
.search-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
}
.search-icon { color: var(--gray2); font-size: 0.875rem; flex-shrink: 0; }
.search-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--white);
  padding: 0.75rem 0;
  font-size: 0.9rem;
  outline: none;
}
.search-input::placeholder { color: var(--gray2); }
.search-clear { color: var(--gray); font-size: 0.875rem; }
.dash-stats { display: flex; gap: 1rem; margin-bottom: 1.5rem; }
.dash-stat {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 1.25rem;
}
.dash-stat-num { font-size: 1.1rem; font-weight: 700; color: var(--white); display: block; }
.dash-stat-label { font-size: 0.75rem; color: var(--gray); }
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}
.link-card {
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: transform 0.2s, border-color 0.2s;
}
.link-card:hover { transform: translateY(-2px); border-color: var(--border2); }
.link-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}
.link-title { font-size: 0.875rem; font-weight: 600; color: var(--white); margin-bottom: 2px; }
.link-short { font-size: 0.875rem; color: var(--purple-light); font-weight: 500; }
.link-short:hover { text-decoration: underline; }
.link-badges { display: flex; gap: 0.3rem; flex-shrink: 0; }
.link-original {
  font-size: 0.78rem;
  color: var(--gray);
  margin-bottom: 0.75rem;
  word-break: break-all;
}
.link-stats-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.link-stat {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--gray);
}
.link-actions {
  display: flex;
  gap: 0.35rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-green { background: rgba(16,185,129,0.15); color: #34d399; }
.badge-red { background: rgba(239,68,68,0.15); color: #f87171; }
.badge-yellow { background: rgba(245,158,11,0.15); color: #fbbf24; }
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  border-radius: var(--radius);
}
.empty-state i { font-size: 3rem; color: var(--gray2); margin-bottom: 1rem; display: block; }
.empty-state h3 { color: var(--white); margin-bottom: 0.5rem; }
.empty-state p { color: var(--gray); margin-bottom: 1.5rem; }
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}
.page-info { color: var(--gray); font-size: 0.875rem; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.active { display: flex; }
.modal {
  border-radius: var(--radius);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.2s ease;
}
.modal-lg { max-width: 750px; }
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1rem; font-weight: 600; color: var(--white); display: flex; align-items: center; gap: 0.5rem; }
.modal-close {
  background: none;
  border: none;
  color: var(--gray);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.25rem;
  border-radius: 4px;
  transition: color 0.2s;
}
.modal-close:hover { color: var(--white); }
.modal-body { padding: 1.5rem; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  margin-top: 1.25rem;
}
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: 0.8rem; font-weight: 500; color: var(--gray); margin-bottom: 0.4rem; }
.form-input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border2);
  color: var(--white);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--purple); }
.form-input::placeholder { color: var(--gray2); }

/* ── QR ── */
.qr-container { margin-bottom: 1rem; min-height: 100px; display: flex; justify-content: center; align-items: center; }
.qr-img { border-radius: var(--radius-sm); border: 1px solid var(--border2); }
.qr-url { font-size: 0.875rem; color: var(--gray); margin-bottom: 1rem; }

/* ============================================================
   STATS IN MODAL
   ============================================================ */
.stats-summary {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.stat-box {
  flex: 1;
  min-width: 100px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  text-align: center;
}
.stat-big { display: block; font-size: 1.5rem; font-weight: 700; color: var(--white); }
.stat-box span:last-child { font-size: 0.75rem; color: var(--gray); }
.stats-link-info { margin-bottom: 1.25rem; }
.stats-short-url { font-size: 1rem; font-weight: 600; color: var(--purple-light); }
.stats-orig-url { font-size: 0.78rem; color: var(--gray); margin-top: 3px; word-break: break-all; }
.stats-charts { display: flex; flex-direction: column; gap: 1.25rem; }
.chart-section { }
.chart-section h4 { font-size: 0.8rem; font-weight: 600; color: var(--gray); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.75rem; }
.charts-row { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.chart-section.half { flex: 1; min-width: 200px; }
.country-list { display: flex; flex-direction: column; gap: 0.5rem; }
.country-row { display: flex; align-items: center; gap: 0.75rem; font-size: 0.8rem; }
.country-row span:first-child { width: 100px; color: var(--text2); flex-shrink: 0; }
.country-bar-wrap { flex: 1; height: 6px; background: rgba(255,255,255,0.06); border-radius: 3px; overflow: hidden; }
.country-bar { height: 100%; background: linear-gradient(90deg, var(--purple), var(--blue)); border-radius: 3px; transition: width 0.5s; }
.country-count { color: var(--gray); font-size: 0.75rem; flex-shrink: 0; }
.country-name { color: var(--text2); font-size: 0.8rem; }
.ref-list { display: flex; flex-direction: column; gap: 0.4rem; }
.ref-row { display: flex; justify-content: space-between; font-size: 0.8rem; padding: 0.4rem 0.6rem; background: rgba(255,255,255,0.03); border-radius: 4px; }
.ref-name { color: var(--text2); }
.ref-count { color: var(--purple-light); font-weight: 600; }
.loading-spinner { text-align: center; padding: 2rem; color: var(--gray); }

/* ============================================================
   ADMIN PAGE
   ============================================================ */
.admin-page { padding: 2.5rem 0 4rem; }
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.kpi-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: var(--radius);
  transition: transform 0.2s;
}
.kpi-card:hover { transform: translateY(-2px); }
.kpi-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.kpi-num { font-size: 1.5rem; font-weight: 700; color: var(--white); display: block; }
.kpi-label { font-size: 0.75rem; color: var(--gray); }
.admin-charts-row {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.admin-chart-card {
  flex: 1;
  min-width: 280px;
  border-radius: var(--radius);
  padding: 1.25rem;
}
.chart-card-header { margin-bottom: 1rem; }
.chart-card-header h3 { font-size: 0.9rem; font-weight: 600; color: var(--white); }
.admin-section {
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.section-heading {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.section-heading i { color: var(--purple); }
.admin-two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; margin-bottom: 1.25rem; }
.top-links-list, .activity-list { display: flex; flex-direction: column; gap: 0; }
.top-link-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}
.top-link-row:last-child { border-bottom: none; }
.top-link-rank { font-size: 0.75rem; color: var(--gray); width: 24px; flex-shrink: 0; }
.top-link-info { flex: 1; min-width: 0; }
.top-link-short { font-size: 0.875rem; font-weight: 600; color: var(--purple-light); }
.top-link-orig { font-size: 0.75rem; color: var(--gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-link-right { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.top-link-clicks { font-size: 0.8rem; font-weight: 600; color: var(--white); }
.top-link-clicks small { color: var(--gray); font-weight: 400; }
.activity-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.activity-row:last-child { border-bottom: none; }
.activity-icon { width: 28px; text-align: center; font-size: 0.875rem; flex-shrink: 0; }
.activity-info { flex: 1; min-width: 0; }
.activity-code { font-size: 0.8rem; font-weight: 600; color: var(--white); display: block; }
.activity-meta { font-size: 0.72rem; color: var(--gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.activity-time { font-size: 0.72rem; color: var(--gray2); flex-shrink: 0; }
.empty-msg { color: var(--gray); font-size: 0.875rem; padding: 1rem 0; }
.country-bars { display: flex; flex-direction: column; gap: 0.6rem; }
.country-name { width: 120px; font-size: 0.8rem; color: var(--text2); flex-shrink: 0; }
/* Data table */
.admin-links-table { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text2);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }
.table-link { color: var(--purple-light); font-weight: 600; }
.table-url { max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.click-badge {
  background: rgba(124,58,237,0.15);
  color: var(--purple-light);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.8rem;
}

/* ============================================================
   AUTH PAGE
   ============================================================ */
.auth-page {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  border-radius: var(--radius);
  padding: 2rem;
}
.auth-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--white);
}
.auth-card h2 { font-size: 1.4rem; font-weight: 700; color: var(--white); margin-bottom: 0.4rem; }
.auth-sub { font-size: 0.875rem; color: var(--gray); margin-bottom: 1.5rem; }
.auth-form { display: flex; flex-direction: column; gap: 0; }
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.alert-error { background: rgba(239,68,68,0.1); color: #f87171; border: 1px solid rgba(239,68,68,0.2); }
.pw-wrap { position: relative; }
.pw-wrap .form-input { padding-right: 2.5rem; }
.pw-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--gray);
  cursor: pointer;
  font-size: 0.875rem;
}
.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--gray);
  font-size: 0.8rem;
  margin-top: 1.25rem;
  transition: color 0.2s;
}
.auth-back:hover { color: var(--white); }

/* ============================================================
   ERROR PAGE
   ============================================================ */
.error-page {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}
.error-code { font-size: 6rem; font-weight: 800; line-height: 1; margin-bottom: 1rem; }
.error-content h2 { font-size: 1.5rem; color: var(--white); margin-bottom: 0.5rem; }
.error-content p { color: var(--gray); margin-bottom: 1.5rem; }

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 220px;
  max-width: 360px;
  backdrop-filter: blur(20px);
  border: 1px solid var(--border2);
  animation: toastIn 0.3s ease;
  box-shadow: var(--shadow);
}
.toast-success { background: rgba(16,185,129,0.15); color: #34d399; }
.toast-error { background: rgba(239,68,68,0.15); color: #f87171; }
.toast-info { background: rgba(37,99,235,0.15); color: #60a5fa; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ============================================================
   HIDE-MOBILE
   ============================================================ */
.hide-mobile { display: inline; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .navbar-links { display: none; }
  .menu-toggle { display: block; }
  .hide-mobile { display: none; }
  .hero { padding: 3rem 0 2rem; }
  .hero-title { font-size: 2rem; }
  .input-row { flex-direction: column; }
  .btn-shorten { width: 100%; justify-content: center; }
  .stats-bar { gap: 1.25rem; padding: 1rem; }
  .api-card { flex-direction: column; padding: 2rem 1.5rem; }
  .features-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-two-col { grid-template-columns: 1fr; }
  .admin-charts-row { flex-direction: column; }
  .admin-chart-card { max-width: 100% !important; }
  .result-url-row { flex-direction: column; align-items: flex-start; }
  .modal { max-height: 95vh; }
  .charts-row { flex-direction: column; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .links-grid { grid-template-columns: 1fr; }
  .stats-summary { flex-direction: column; }
}
