/* ═══════════════════════════════════════════════════════
   Sites Symbol Admin — Premium Design v2
   Modern, Rounded, Gradient-powered UI
═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Core palette */
  --bg-base:        #f4f6f8;
  --bg-surface:     #ffffff;
  --bg-card:        #ffffff;
  --bg-card-hover:  #fdfdfd;
  --sidebar-bg:     #ffffff;

  /* Text */
  --text-primary:   #1e293b;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;

  /* Accent gradient */
  --grad-primary:   linear-gradient(135deg, #ef4444 0%, #dc2626 50%, #b91c1c 100%);
  --grad-hover:     linear-gradient(135deg, #f87171 0%, #ef4444 50%, #dc2626 100%);
  --grad-success:   linear-gradient(135deg, #10b981 0%, #059669 100%);
  --grad-warning:   linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --grad-danger:    linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  --grad-info:      linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  --grad-teal:      linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
  --grad-pink:      linear-gradient(135deg, #ec4899 0%, #db2777 100%);
  --grad-orange:    linear-gradient(135deg, #f97316 0%, #ea580c 100%);

  /* Solid refs */
  --primary:        #dc2626;
  --success:        #10b981;
  --warning:        #f59e0b;
  --danger:         #ef4444;
  --info:           #3b82f6;

  /* Borders & Shadows */
  --border:         #e2e8f0;
  --border-focus:   rgba(220, 38, 38, 0.5);
  --shadow-sm:      0 2px 8px rgba(0,0,0,0.05);
  --shadow-md:      0 8px 24px rgba(0,0,0,0.08);
  --shadow-lg:      0 20px 48px rgba(0,0,0,0.12);
  --shadow-glow:    0 0 32px rgba(220, 38, 38, 0.25);

  /* Layout */
  --sidebar-width:  268px;
  --radius-sm:      8px;
  --radius-md:      14px;
  --radius-lg:      20px;
  --radius-xl:      28px;
  --radius-full:    9999px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: #a5b4fc; }

/* ─── UTILITIES ─────────────────────────────────────── */
.text-muted     { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-danger    { color: var(--danger); }
.text-success   { color: var(--success); }
.text-primary   { color: var(--primary); }
.text-center    { text-align: center; }
.text-right     { text-align: right; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 2rem; }

.d-flex { display: flex; }
.flex-col { flex-direction: column; }
.align-items-center { align-items: center; }
.align-items-start  { align-items: flex-start; }
.justify-content-between { justify-content: space-between; }
.justify-content-end     { justify-content: flex-end; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.w-100 { width: 100%; }

/* ─── BUTTONS ───────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.8125rem;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.22s cubic-bezier(0.4,0,0.2,1);
  text-decoration: none !important;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.btn:active { transform: scale(0.97); }

.btn-sm   { padding: 0.35rem 0.8rem; font-size: 0.75rem; }
.btn-lg   { padding: 0.75rem 1.75rem; font-size: 0.9375rem; }
.btn-block{ width: 100%; }
.btn-icon { padding: 0.45rem; border-radius: var(--radius-sm); }

.btn-primary {
  background: var(--grad-primary);
  color: white;
  box-shadow: 0 4px 14px rgba(220, 38, 38,0.35);
}
.btn-primary:hover {
  background: var(--grad-hover);
  box-shadow: 0 6px 20px rgba(220, 38, 38,0.5);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--grad-success);
  color: white;
  box-shadow: 0 4px 14px rgba(16,185,129,0.3);
}
.btn-success:hover { box-shadow: 0 6px 20px rgba(16,185,129,0.45); transform: translateY(-1px); }

.btn-danger {
  background: var(--grad-danger);
  color: white;
  box-shadow: 0 4px 14px rgba(239,68,68,0.3);
}
.btn-danger:hover { box-shadow: 0 6px 20px rgba(239,68,68,0.45); transform: translateY(-1px); }

.btn-warning {
  background: var(--grad-warning);
  color: white;
  box-shadow: 0 4px 14px rgba(245,158,11,0.3);
}
.btn-warning:hover { transform: translateY(-1px); }

.btn-secondary {
  background: rgba(0,0,0,0.07);
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-secondary:hover { background: rgba(0,0,0,0.12); color: var(--text-primary); }

.btn-outline {
  background: transparent;
  border-color: rgba(220, 38, 38,0.35);
  color: var(--primary);
}
.btn-outline:hover { background: rgba(220, 38, 38,0.08); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover { background: rgba(0,0,0,0.06); color: var(--text-primary); }

/* ─── FORMS ─────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }
.form-row   { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }

label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 500;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.form-control {
  width: 100%;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: rgba(0,0,0,0.04);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: all 0.2s;
  outline: none;
}
.form-control::placeholder { color: var(--text-muted); }
.form-control:focus {
  border-color: var(--primary);
  background: rgba(220, 38, 38,0.04);
  box-shadow: 0 0 0 3px rgba(220, 38, 38,0.12);
}
.form-control:hover:not(:focus) { border-color: rgba(0,0,0,0.12); }

textarea.form-control { resize: vertical; min-height: 80px; }
.code-input { font-family: 'Fira Code', 'Consolas', monospace; background: #f1f5f9; color: #334155; color: #93c5fd; font-size: 0.8rem; }

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%238b92b8' viewBox='0 0 20 20'%3E%3Cpath d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1.25rem;
  padding-right: 2.5rem;
}

/* Color picker */
.color-input {
  width: 44px; height: 44px;
  padding: 3px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: transparent;
}
.color-input::-webkit-color-swatch-wrapper { padding: 0; }
.color-input::-webkit-color-swatch { border: none; border-radius: 6px; }
.color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1rem; }

/* Toggle Switch */
.switch-toggle { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch-toggle input { opacity: 0; width: 0; height: 0; }
.switch-toggle .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #cbd5e1; transition: .3s; }
.switch-toggle .slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .3s; }
.switch-toggle input:checked + .slider { background-color: #10B981; }
.switch-toggle input:checked + .slider:before { transform: translateX(20px); }
.switch-toggle .slider.round { border-radius: 34px; }
.switch-toggle .slider.round:before { border-radius: 50%; }

/* File upload */
.file-upload-group {
  padding: 1.5rem 1rem;
  border-radius: var(--radius-lg);
  border: 1.5px dashed rgba(220, 38, 38,0.25);
  background: rgba(220, 38, 38,0.04);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.file-upload-group:hover { border-color: rgba(220, 38, 38,0.5); background: rgba(220, 38, 38,0.08); }
.image-upload-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.25rem; }
.img-preview { width: 100%; height: 100px; object-fit: contain; margin-bottom: 0.5rem; border-radius: var(--radius-sm); background: rgba(0,0,0,0.3); }

/* ─── LAYOUT ─────────────────────────────────────────── */
.admin-layout { display: flex; min-height: 100vh; }

/* ─── SIDEBAR ────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 200;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  overflow-y: auto;
}

.sidebar-logo {
  padding: 1.5rem 1.4rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo-icon {
  width: 36px; height: 36px;
  background: var(--grad-primary);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(220, 38, 38,0.4);
  flex-shrink: 0;
}
.sidebar-logo h2 {
  font-size: 1rem;
  font-weight: 700;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}
.sidebar-logo small {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  -webkit-text-fill-color: var(--text-muted);
  font-weight: 400;
}

.sidebar-section-label {
  padding: 1rem 1.4rem 0.4rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.sidebar-nav {
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
}

.sidebar-nav a {
  padding: 0.65rem 0.9rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.7rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.18s;
  text-decoration: none !important;
}
.sidebar-nav a .nav-icon {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
  background: rgba(0,0,0,0.04);
  flex-shrink: 0;
  transition: all 0.18s;
}
.sidebar-nav a:hover {
  color: var(--text-primary);
  background: rgba(0,0,0,0.05);
}
.sidebar-nav a:hover .nav-icon { background: rgba(220, 38, 38,0.15); }
.sidebar-nav a.active {
  color: white;
  background: var(--grad-primary);
  box-shadow: 0 4px 14px rgba(220, 38, 38,0.3);
}
.sidebar-nav a.active .nav-icon { background: rgba(0,0,0,0.15); }

.sidebar-nav a.nav-danger:hover { color: var(--danger); background: rgba(239,68,68,0.06); }
.sidebar-nav a.nav-danger:hover .nav-icon { background: rgba(239,68,68,0.12); }

.sidebar-divider { height: 1px; background: var(--border); margin: 0.5rem 0; }

.sidebar-user {
  margin: 0.5rem 0.75rem 1rem;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  background: rgba(0,0,0,0.04);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.sidebar-user-avatar {
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  background: var(--grad-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}
.sidebar-user-info p { font-size: 0.8rem; font-weight: 600; margin: 0; line-height: 1.2; }
.sidebar-user-info small { font-size: 0.7rem; color: var(--text-muted); }

/* ─── MAIN CONTENT ───────────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg-base);
}

.top-bar {
  height: 60px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
}
.top-bar-left { display: flex; align-items: center; gap: 0.75rem; }
.breadcrumb { font-size: 0.8125rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.3rem; }
.breadcrumb span { color: var(--text-secondary); }

.content-wrapper { padding: 1.75rem; flex: 1; max-width: 1400px; }

.mobile-toggle {
  display: none;
  background: rgba(0,0,0,0.06);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 1.1rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
}

/* ─── PAGE HEADER ────────────────────────────────────── */
.page-header { margin-bottom: 1.75rem; }
.page-header h1 {
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
  margin-bottom: 0.3rem;
}
.page-header p { color: var(--text-muted); font-size: 0.875rem; }

/* ─── GLASS CARD ─────────────────────────────────────── */
.glass, .card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-hover:hover {
  border-color: rgba(220, 38, 38,0.2);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.card-header h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
}
.card-body { padding: 1.5rem; }

/* ─── BADGES ─────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.badge-success { background: rgba(16,185,129,0.12); color: #34d399; border: 1px solid rgba(16,185,129,0.2); }
.badge-warning { background: rgba(245,158,11,0.12); color: #fbbf24; border: 1px solid rgba(245,158,11,0.2); }
.badge-danger  { background: rgba(239,68,68,0.12);  color: #f87171; border: 1px solid rgba(239,68,68,0.2); }
.badge-primary { background: rgba(220, 38, 38,0.12); color: #a5b4fc; border: 1px solid rgba(220, 38, 38,0.2); }
.badge-info    { background: rgba(59,130,246,0.12);  color: #93c5fd; border: 1px solid rgba(59,130,246,0.2); }
.badge-muted   { background: rgba(0,0,0,0.06); color: var(--text-muted); border: 1px solid var(--border); }

/* Dot indicator */
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* ─── STATS GRID ─────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  padding: 1.4rem 1.4rem 1.2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: all 0.22s;
  background: var(--bg-card);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 120px; height: 120px;
  border-radius: 50%;
  opacity: 0.08;
  transform: translate(30%, -30%);
}
.stat-card:hover { border-color: rgba(220, 38, 38,0.2); transform: translateY(-3px); box-shadow: var(--shadow-md); }

.stat-card.card-purple::before { background: var(--primary); }
.stat-card.card-green::before  { background: var(--success); }
.stat-card.card-amber::before  { background: var(--warning); }
.stat-card.card-blue::before   { background: var(--info); }
.stat-card.card-pink::before   { background: #ec4899; }
.stat-card.card-teal::before   { background: #14b8a6; }

.stat-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}
.stat-card.card-purple .stat-icon { background: rgba(220, 38, 38,0.15); }
.stat-card.card-green .stat-icon  { background: rgba(16,185,129,0.15); }
.stat-card.card-amber .stat-icon  { background: rgba(245,158,11,0.15); }
.stat-card.card-blue .stat-icon   { background: rgba(59,130,246,0.15); }
.stat-card.card-pink .stat-icon   { background: rgba(236,72,153,0.15); }
.stat-card.card-teal .stat-icon   { background: rgba(20,184,166,0.15); }

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.3rem;
  background: var(--text-color, #1e293b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-label { font-size: 0.8125rem; color: var(--text-secondary); font-weight: 500; }
.stat-sub   { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.2rem; }

/* ─── CHARTS ─────────────────────────────────────────── */
.dashboard-charts {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}
.chart-canvas-wrap { padding: 1rem; }

/* ─── FUNNEL ─────────────────────────────────────────── */
.funnel-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}
.funnel-item:last-child { border-bottom: none; }
.funnel-bar-wrap { flex: 1; height: 8px; background: rgba(0,0,0,0.06); border-radius: var(--radius-full); overflow: hidden; }
.funnel-bar { height: 100%; border-radius: var(--radius-full); transition: width 0.8s ease; }
.funnel-label { font-size: 0.8rem; color: var(--text-secondary); width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.funnel-count { font-size: 0.9rem; font-weight: 700; width: 50px; text-align: right; }

/* ─── TABLES ─────────────────────────────────────────── */
.table-responsive { overflow-x: auto; border-radius: var(--radius-lg); }
.table { width: 100%; border-collapse: collapse; }
.table th {
  padding: 0.75rem 1.1rem;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.02);
}
.table td {
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  font-size: 0.875rem;
  vertical-align: middle;
}
.table tbody tr { transition: background 0.15s; }
.table tbody tr:hover td { background: rgba(0,0,0,0.025); }
.table tbody tr:last-child td { border-bottom: none; }

/* ─── SITES GRID ─────────────────────────────────────── */
.sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.site-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.22s cubic-bezier(0.4,0,0.2,1);
}
.site-card:hover {
  border-color: rgba(220, 38, 38,0.25);
  box-shadow: 0 12px 36px rgba(0,0,0,0.5);
  transform: translateY(-4px);
}

.site-card-banner {
  height: 6px;
  background: var(--grad-primary);
}
.site-card-banner.status-paused  { background: var(--grad-warning); }
.site-card-banner.status-deleted { background: var(--grad-danger); }
.site-card-banner.status-active  { background: var(--grad-primary); }

.site-card-header {
  padding: 1.25rem 1.25rem 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.site-card-title { font-size: 1rem; font-weight: 700; margin-bottom: 0.25rem; }
.site-card-domain { font-size: 0.75rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.3rem; }

.site-card-body { padding: 0 1.25rem 1rem; flex: 1; }

.site-stats {
  display: flex;
  gap: 1.25rem;
  padding: 0.75rem;
  background: rgba(0,0,0,0.03);
  border-radius: var(--radius-md);
  margin-top: 0.75rem;
}
.site-stat { text-align: center; flex: 1; }
.site-stat strong { display: block; font-size: 1.1rem; font-weight: 700; }
.site-stat small { font-size: 0.7rem; color: var(--text-muted); }

.site-card-actions {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.site-card-actions::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
  background: rgba(0,0,0,0.15);
}

/* ─── TABS ───────────────────────────────────────────── */
.tabs, .edit-tabs {
  display: flex;
  gap: 0.2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  padding: 0.65rem 1.1rem;
  background: transparent;
  border: none;
  border-bottom: 2.5px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8125rem;
  transition: all 0.18s;
  white-space: nowrap;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.tab-btn:hover { color: var(--text-primary); background: rgba(0,0,0,0.04); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); background: rgba(220, 38, 38,0.06); }

/* ─── MODALS ─────────────────────────────────────────── */
.modal {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(6px);
  animation: fadeIn 0.15s ease;
}
.modal.active { display: flex; }
.modal-content {
  width: 100%;
  max-width: 540px;
  background: var(--bg-card);
  border: 1px solid rgba(220, 38, 38,0.2);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 64px rgba(0,0,0,0.7), 0 0 0 1px rgba(0,0,0,0.04);
  overflow: hidden;
  animation: slideUp 0.2s cubic-bezier(0.4,0,0.2,1);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.modal-header {
  padding: 1.4rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(220, 38, 38,0.06);
}
.modal-header h4 { font-weight: 700; font-size: 1rem; }
.modal-content form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.modal-body { 
  padding: 1.5rem; 
  overflow-y: auto; 
  flex: 1;
}
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: rgba(0,0,0,0.2);
}
.close-btn {
  background: rgba(0,0,0,0.07);
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.55rem;
  transition: all 0.15s;
}
.close-btn:hover { background: rgba(239,68,68,0.15); color: var(--danger); }

/* ─── SNIPPETS ───────────────────────────────────────── */
.snippet-card {
  background: rgba(0,0,0,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  transition: all 0.18s;
}
.snippet-card:hover { border-color: rgba(220, 38, 38,0.2); }
.snippet-preview { background: #f1f5f9; color: #334155; padding: 0.75rem 1rem; border-radius: var(--radius-md); font-family: monospace; font-size: 0.75rem; color: #93c5fd; overflow: hidden; max-height: 80px; margin-top: 0.6rem; }

/* Position badges */
.pos-head_top    { background: rgba(220, 38, 38,0.12); color: #a5b4fc; }
.pos-head_bottom { background: rgba(59,130,246,0.12); color: #93c5fd; }
.pos-body_top    { background: rgba(16,185,129,0.12); color: #6ee7b7; }
.pos-body_bottom { background: rgba(245,158,11,0.12); color: #fbbf24; }

/* ─── DNS CARD ───────────────────────────────────────── */
.dns-record-row {
  display: grid;
  grid-template-columns: 80px 80px 1fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.85rem 1rem;
  background: rgba(0,0,0,0.03);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 0.6rem;
  font-family: monospace;
  font-size: 0.825rem;
}
.dns-type { font-weight: 700; color: var(--primary); }
.copy-btn { margin-left: auto; }

/* ─── FLASH / ALERTS ─────────────────────────────────── */
.flash-message {
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.875rem;
  font-weight: 500;
  animation: slideDown 0.25s ease-out;
}
.flash-success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.25); color: #34d399; }
.flash-error   { background: rgba(239,68,68,0.1);  border: 1px solid rgba(239,68,68,0.25);  color: #f87171; }
.flash-info    { background: rgba(59,130,246,0.1);  border: 1px solid rgba(59,130,246,0.25); color: #93c5fd; }

.alert { padding: 0.85rem 1.1rem; border-radius: var(--radius-md); margin-bottom: 1rem; font-size: 0.875rem; }
.alert-info { background: rgba(59,130,246,0.08); border: 1px solid rgba(59,130,246,0.2); color: #93c5fd; }

/* ─── LOGIN PAGE ─────────────────────────────────────── */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 70% 20%, rgba(220, 38, 38,0.18) 0%, transparent 60%),
              radial-gradient(ellipse at 20% 80%, rgba(139,92,246,0.12) 0%, transparent 50%),
              var(--bg-base);
  padding: 1rem;
  position: relative;
  overflow: hidden;
}
.login-wrapper::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(220, 38, 38,0.08) 0%, transparent 70%);
  top: -200px; right: -100px;
  pointer-events: none;
}
.login-wrapper::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139,92,246,0.06) 0%, transparent 70%);
  bottom: -100px; left: -100px;
  pointer-events: none;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: rgba(19,21,31,0.9);
  border: 1px solid rgba(220, 38, 38,0.2);
  border-radius: var(--radius-xl);
  padding: 2.75rem 2.5rem;
  box-shadow: 0 32px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(0,0,0,0.04);
  backdrop-filter: blur(20px);
  animation: slideUp 0.3s cubic-bezier(0.4,0,0.2,1);
  position: relative;
  z-index: 1;
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}
.login-logo-wrap {
  width: 60px; height: 60px;
  background: var(--grad-primary);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.75rem;
  margin: 0 auto 1.25rem;
  box-shadow: 0 8px 24px rgba(220, 38, 38,0.45);
}
.login-header h1 {
  font-size: 1.7rem;
  font-weight: 800;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.35rem;
}
.login-header p { color: var(--text-muted); font-size: 0.875rem; }

.login-form .form-group { margin-bottom: 1.1rem; }
.login-form label { color: var(--text-secondary); }
.login-form .form-control {
  background: rgba(0,0,0,0.05);
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
}
.login-form .btn-primary { padding: 0.8rem 1.5rem; font-size: 0.9375rem; margin-top: 0.5rem; }

.login-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.25);
  color: #f87171;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  margin-bottom: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ─── FILTER / SEARCH BAR ────────────────────────────── */
.filters-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}
.search-input {
  flex: 1;
  min-width: 200px;
  position: relative;
}
.search-input input { padding-left: 2.2rem; }
.search-icon {
  position: absolute;
  left: 0.7rem; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.875rem;
  pointer-events: none;
}

.status-tabs { display: flex; gap: 0.35rem; }
.status-tab-btn {
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
}
.status-tab-btn:hover { color: var(--text-primary); border-color: rgba(0,0,0,0.15); }
.status-tab-btn.active { background: var(--grad-primary); border-color: transparent; color: white; box-shadow: 0 4px 12px rgba(220, 38, 38,0.3); }

/* ─── COLOR PREVIEW ──────────────────────────────────── */
.color-preview-bar {
  height: 6px;
  border-radius: var(--radius-full);
  margin-top: 0.5rem;
  transition: background 0.3s;
}

/* ─── ANIMATIONS ─────────────────────────────────────── */
@keyframes fadeIn  { from { opacity: 0; }              to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideDown { from { transform: translateY(-8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes pulse   { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

.loader { width: 16px; height: 16px; border: 2px solid rgba(0,0,0,0.3); border-top-color: white; border-radius: 50%; display: inline-block; animation: spin 0.7s linear infinite; }

/* Fade-in for page content */
.content-wrapper > * { animation: fadeIn 0.25s ease-out; }

/* ─── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 1024px) {
  .dashboard-charts { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); box-shadow: 8px 0 32px rgba(0,0,0,0.6); }
  .main-content { margin-left: 0; }
  .mobile-toggle { display: block; }
  .sites-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .content-wrapper { padding: 1rem; }
  .form-row { grid-template-columns: 1fr; }
  .login-card { padding: 2rem 1.5rem; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}

/* ─── LOGIN PAGE ─────────────────────────────────────── */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(-45deg, #f4f6f8, #ffffff, #fee2e2, #fecaca);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  padding: 1rem;
  position: relative;
  overflow: hidden;
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.login-wrapper::before,
.login-wrapper::after {
  content: '';
  position: absolute;
  background: rgba(220, 38, 38, 0.1);
  border-radius: 50%;
  animation: float 10s infinite ease-in-out;
}

.login-wrapper::before {
  width: 300px;
  height: 300px;
  top: -100px;
  left: -100px;
}

.login-wrapper::after {
  width: 400px;
  height: 400px;
  bottom: -150px;
  right: -100px;
  animation-delay: -5s;
  background: rgba(220, 38, 38, 0.05);
}

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-30px) scale(1.05); }
}

.login-card {
  background: var(--bg-card);
  width: 100%;
  max-width: 420px;
  padding: 2.5rem;
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 60px rgba(0,0,0,0.1), 0 0 0 1px var(--border);
  position: relative;
  z-index: 10;
  text-align: center;
}

.login-header {
  margin-bottom: 2rem;
}

.login-header img {
  width: 180px;
  margin-bottom: 1rem;
}

.login-header h1 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.login-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.login-form .form-group {
  text-align: left;
}

.login-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.25);
  color: #dc2626;
  padding: 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}

/* Site Card Action Buttons */
.site-card-actions .btn-action {
  background: var(--primary);
  color: #ffffff;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  transition: all 0.2s ease;
}
.site-card-actions .btn-action:hover {
  background: #b91c1c; /* slightly darker red */
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
  color: #ffffff;
}
