/* Dnsway.1 — Design System v2 (Commercial) */

:root {
  --primary: #4f6ef7;
  --primary-light: #6b85f8;
  --primary-bg: #eef1ff;
  --primary-hover: #3b5de7;
  --gradient: linear-gradient(135deg, #4f6ef7, #6366f1);
  --gradient-glow: linear-gradient(135deg, rgba(79,110,247,0.15), rgba(99,102,241,0.08));
  --bg: #f0f2f5;
  --surface: #fff;
  --surface-hover: #fafbfc;
  --border: #e2e6ed;
  --border-light: #f0f2f5;
  --text: #111318;
  --text-secondary: #2d3140;
  --muted: #6b7280;
  --muted-light: #9ca3af;
  --red: #ef4444;
  --red-bg: #fef2f2;
  --green: #10b981;
  --green-bg: #ecfdf5;
  --orange: #f59e0b;
  --orange-bg: #fffbeb;
  --sidebar-w: 232px;
  --topbar-h: 54px;
  --sidebar-bg: #f8f9fb;
  --sidebar-hover: #eef1ff;
  --sidebar-text: #4b5563;
  --sidebar-active: #1a1d26;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.08);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  color: var(--text); background: var(--bg); min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w); min-width: var(--sidebar-w);
  background: var(--sidebar-bg); color: var(--sidebar-text);
  display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100; overflow-y: auto;
  border-right: 1px solid var(--border);
}
.sidebar-brand {
  padding: 18px 20px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand .logo {
  width: 34px; height: 34px;
  background: var(--gradient); color: #fff;
  border-radius: 9px; display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 700; box-shadow: 0 2px 8px rgba(79,110,247,0.3);
}
.sidebar-brand .name { font-size: 1.05rem; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.sidebar-nav { flex: 1; padding: 10px 0; }
.sidebar-nav .section-label {
  padding: 18px 20px 4px; font-size: 0.65rem; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--muted); font-weight: 600;
}
.sidebar-nav .nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 20px;
  cursor: pointer; font-size: 0.85rem; color: var(--sidebar-text);
  border-left: 3px solid transparent; transition: var(--transition);
  text-decoration: none; margin: 1px 8px; border-radius: 6px; border-left: none;
}
.sidebar-nav .nav-item:hover {
  color: var(--text); background: var(--sidebar-hover);
}
.sidebar-nav .nav-item.active {
  color: var(--sidebar-active); background: var(--primary-bg);
  font-weight: 600;
}
.sidebar-nav .nav-item .nav-icon {
  width: 20px; text-align: center; font-size: 0.85rem; color: var(--muted);
}
.sidebar-nav .nav-item.active .nav-icon { color: var(--primary); }
.sidebar-footer {
  padding: 14px 20px; border-top: 1px solid var(--border);
  font-size: 0.75rem; color: var(--muted);
}
.sidebar-link {
  color: var(--muted); text-decoration: none; font-size: 0.72rem;
  transition: color var(--transition);
}
.sidebar-link:hover { color: var(--primary); }

/* ── Main Area ── */
.main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  height: var(--topbar-h); background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: flex-end; padding: 0 28px;
  position: sticky; top: 0; z-index: 50; gap: 14px;
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.92);
}
.topbar .profile-select {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 5px 10px; font-size: 0.82rem; background: var(--bg);
  color: var(--text); cursor: pointer; outline: none;
  transition: var(--transition);
}
.topbar .profile-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,110,247,0.1); }
.topbar .status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); display: inline-block;
  box-shadow: 0 0 0 2px rgba(16,185,129,0.2);
}
.topbar .status-text { font-size: 0.8rem; color: var(--muted); }
.content {
  flex: 1; padding: 28px; max-width: 960px;
  animation: contentFadeIn 0.3s ease;
}
@keyframes contentFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Cards ── */
.section-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); margin-bottom: 20px; overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}
.section-card:hover { box-shadow: var(--shadow); }
.section-header { padding: 22px 22px 10px; }
.section-title { font-size: 1rem; font-weight: 600; margin-bottom: 4px; }
.section-desc { color: var(--muted); font-size: 0.82rem; margin-bottom: 12px; line-height: 1.5; }
.section-footer { padding: 14px 22px; background: var(--surface-hover); border-top: 1px solid var(--border); font-size: 0.82rem; color: var(--muted); }

/* ── Toggle Switch ── */
.toggle { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle .slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #d1d5db; border-radius: 24px; transition: var(--transition);
}
.toggle .slider::before {
  content: ''; position: absolute; height: 18px; width: 18px;
  left: 3px; bottom: 3px; background: white; border-radius: 50%;
  transition: var(--transition); box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle input:checked + .slider { background: var(--primary); }
.toggle input:checked + .slider::before { transform: translateX(18px); }

/* ── Table / Row Components ── */
.cat-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 22px; border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
}
.cat-row:last-child { border-bottom: none; }
.cat-row:hover { background: var(--surface-hover); }
.cat-row .cat-info { flex: 1; min-width: 0; }
.cat-row .cat-name { font-size: 0.88rem; font-weight: 500; }
.cat-row .cat-details { font-size: 0.78rem; color: var(--muted); margin-top: 1px; line-height: 1.4; }
.cat-row .cat-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.cat-tag {
  font-size: 0.68rem; padding: 2px 8px; border-radius: 4px;
  background: var(--primary-bg); color: var(--primary);
}
.cat-tag.blocked { background: var(--red-bg); color: var(--red); }

/* ── Input / Search ── */
.search-box {
  display: flex; gap: 8px; padding: 12px 22px; border-bottom: 1px solid var(--border-light);
}
.search-box input {
  flex: 1; padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.85rem; outline: none; transition: var(--transition);
}
.search-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,110,247,0.1); }
.search-box button {
  padding: 8px 16px; background: var(--primary); color: #fff; border: none;
  border-radius: var(--radius-sm); font-size: 0.82rem; cursor: pointer; font-weight: 500;
  transition: opacity var(--transition);
}
.search-box button:hover { opacity: 0.9; }
.search-box .btn-blocked { background: var(--red); }
.search-box .btn-blocked:hover { background: #dc2626; }

/* ── Tags List ── */
.tags-list { display: flex; gap: 6px; flex-wrap: wrap; }
.tag-item {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--primary-bg); color: var(--primary); font-size: 0.78rem;
  padding: 4px 10px; border-radius: var(--radius-sm);
}
.tag-item .tag-remove { cursor: pointer; font-weight: bold; margin-left: 2px; transition: color var(--transition); }
.tag-item .tag-remove:hover { color: var(--red); }

/* ── Language Selector ── */
.lang-select {
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 5px 10px;
  font-size: 0.76rem; background: var(--surface); color: var(--text);
  cursor: pointer; outline: none; transition: var(--transition);
  min-width: 80px;
}
.lang-select:hover { border-color: var(--primary); }
.lang-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,110,247,0.1); }
.lang-select-float {
  position: fixed; top: 14px; right: 14px; z-index: 1000;
}
.lang-select-float select {
  border: 1px solid rgba(255,255,255,0.2); border-radius: var(--radius-sm); padding: 6px 10px;
  font-size: 0.76rem; background: rgba(255,255,255,0.95); color: var(--text);
  cursor: pointer; outline: none; backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
}

/* ── Toast ── */
.toast {
  position: fixed; bottom: 28px; right: 28px;
  background: #1e2128; color: #fff;
  padding: 12px 20px; border-radius: var(--radius); font-size: 0.84rem;
  display: none; z-index: 9999;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  z-index: 200; display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
  animation: overlayIn 0.2s ease;
}
@keyframes overlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal-content {
  background: var(--surface); border-radius: var(--radius-lg); padding: 28px;
  max-width: 480px; width: 90vw; max-height: 80vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-title { font-size: 1.05rem; font-weight: 600; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

/* ── Badges ── */
.badge-block {
  background: var(--red-bg); color: var(--red); font-size: 0.72rem; font-weight: 600;
  padding: 2px 8px; border-radius: 4px;
}
.badge-allow {
  background: var(--green-bg); color: var(--green); font-size: 0.72rem; font-weight: 600;
  padding: 2px 8px; border-radius: 4px;
}

/* ── Buttons ── */
.btn { padding: 8px 20px; border: none; border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 500; cursor: pointer; transition: var(--transition); display: inline-flex; align-items: center; gap: 6px; }
.btn-primary { background: var(--gradient); color: #fff; box-shadow: 0 2px 8px rgba(79,110,247,0.25); }
.btn-primary:hover { box-shadow: 0 4px 14px rgba(79,110,247,0.35); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: var(--primary-bg); }
.btn-sm { padding: 5px 12px; font-size: 0.76rem; }
.btn-danger { background: var(--red); color: #fff; border: none; }
.btn-danger:hover { opacity: 0.85; }
.btn-icon { background: transparent; border: none; color: var(--muted); cursor: pointer; padding: 4px 8px; border-radius: var(--radius-sm); font-size: 0.85rem; }
.btn-icon:hover { background: var(--surface-hover); color: var(--text); }
.btn-icon.danger:hover { color: var(--red); background: var(--red-bg); }

/* ── Badges ── */
.badge-format { display: inline-block; font-size: 0.68rem; font-weight: 600; padding: 2px 7px; border-radius: 4px; background: var(--surface-hover); color: var(--muted); text-transform: uppercase; }

/* ── Helper ── */
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-muted { color: var(--muted); }
.text-sm { font-size: 0.85rem; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.p-20 { padding: 20px; }

/* ── Cards (higher-level) ── */
.card-elevated {
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 24px; box-shadow: var(--shadow-sm);
}
.gradient-border {
  border: 1px solid transparent;
  background-clip: padding-box;
  position: relative;
}
.gradient-border::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  padding: 1px; background: var(--gradient);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* ── Stats ── */
.stat-cards { display: flex; gap: 16px; }
.stat-card {
  flex: 1; background: var(--bg); border-radius: var(--radius);
  padding: 20px 16px; text-align: center;
  border: 1px solid var(--border-light);
  transition: var(--transition);
}
.stat-card:hover {
  border-color: var(--primary); box-shadow: 0 2px 12px rgba(79,110,247,0.1);
}
.stat-number { font-size: 1.8rem; font-weight: 700; color: var(--primary); line-height: 1.2; }
.stat-label { font-size: 0.78rem; color: var(--muted); margin-top: 4px; }

/* ── Pricing ── */
.pricing-header {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 16px 28px; display: flex; align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.92);
}
.pricing-header .brand {
  display: flex; align-items: center; gap: 10px;
}
.pricing-header .brand .logo-mark {
  width: 30px; height: 30px; background: var(--gradient); color: #fff;
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; box-shadow: 0 2px 8px rgba(79,110,247,0.3);
}
.pricing-header .brand .name { font-size: 1rem; font-weight: 700; }
.pricing-header .header-links { display: flex; align-items: center; gap: 14px; }
.pricing-header .header-links a {
  color: var(--primary); text-decoration: none; font-weight: 500; font-size: 0.88rem;
  transition: color var(--transition);
}
.pricing-header .header-links a:hover { color: var(--primary-hover); }
