/* ═══════════════════════════════════════════════════════════════
   Subdomain Shop — VQL.VN — Design v6 (MaxDeepSeek-style)
   Dark admin console · Orange accent #ea580c · Inter font
   ═══════════════════════════════════════════════════════════════ */

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

:root {
  --bg: #0a0a0b;
  --bg-soft: #121214;
  --card: #18181b;
  --card-hover: #1f1f23;
  --border: #27272a;
  --border-soft: #1f1f22;
  --text: #fafafa;
  --text-dim: #a1a1aa;
  --text-muted: #71717a;
  --accent: #ea580c;
  --accent-hover: #f97316;
  --accent-soft: rgba(234, 88, 12, 0.12);
  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.12);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.12);
  --yellow: #eab308;
  --yellow-soft: rgba(234, 179, 8, 0.12);
  --blue: #3b82f6;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.6);
  --sidebar-width: 252px;
}

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

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

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; }
input, select, textarea { font-family: inherit; }

/* ═══ SIDEBAR ══════════════════════════════════════════ */
.app-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-soft);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 20;
}
.sidebar-brand {
  padding: 22px 20px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand .logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  display: grid; place-items: center;
  font-weight: 800; font-size: 17px; color: #fff;
  box-shadow: 0 2px 8px var(--accent-soft);
}
.sidebar-brand .name { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.sidebar-brand .name span { color: var(--accent); }
.sidebar-brand .sub { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.sidebar-nav { flex: 1; padding: 14px 12px; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); padding: 12px 12px 6px; font-weight: 600; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-dim); font-weight: 500; font-size: 14px;
  transition: all 0.15s; cursor: pointer; text-decoration: none; border: none; background: none;
}
.nav-item:hover { background: var(--card); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-hover); }
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-footer { padding: 14px 12px; border-top: 1px solid var(--border); }

/* ═══ MAIN + TOPBAR ════════════════════════════════════ */
.main { margin-left: var(--sidebar-width); width: calc(100vw - var(--sidebar-width)); display: flex; flex-direction: column; min-width: 0; overflow-x: hidden; }
.topbar {
  height: 60px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; background: rgba(10,10,11,0.8); backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 10;
}
.topbar h1 { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }
.content { padding: 28px; flex: 1; max-width: 1280px; width: 100%; }

/* ═══ CARD ═════════════════════════════════════════════ */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card-title { font-size: 13px; color: var(--text-dim); font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }

/* ═══ STAT CARDS ═══════════════════════════════════════ */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.stat-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; position: relative; overflow: hidden;
}
.stat-card .label { font-size: 13px; color: var(--text-dim); font-weight: 500; }
.stat-card .value { font-size: 28px; font-weight: 700; margin-top: 8px; letter-spacing: -0.02em; }
.stat-card .hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.icon-box {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--accent-soft); display: grid; place-items: center; color: var(--accent-hover);
}
.stat-card .icon-box { position: absolute; top: 18px; right: 18px; }

/* ═══ TABLE ════════════════════════════════════════════ */
.table-wrap { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 12px 16px; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--border); background: var(--bg-soft); }
td { padding: 13px 16px; border-bottom: 1px solid var(--border-soft); font-size: 14px; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--card-hover); }

/* ═══ BADGES ═══════════════════════════════════════════ */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.active, .badge.confirmed { background: var(--green-soft); color: var(--green); }
.badge.pending { background: var(--yellow-soft); color: var(--yellow); }
.badge.expired, .badge.rejected { background: var(--red-soft); color: var(--red); }
.badge.cancelled { background: rgba(113,113,122,0.12); color: var(--text-muted); }
.badge.ok { background: var(--green-soft); color: var(--green); }

/* ═══ BUTTONS ══════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 14px; transition: all 0.15s;
  background: var(--card); color: var(--text); border: 1px solid var(--border);
  text-decoration: none;
}
.btn:hover { background: var(--card-hover); border-color: #3f3f46; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-outline { background: transparent; color: var(--text-dim); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--accent-soft); border-color: var(--accent-hover); color: var(--accent-hover); }
.btn-danger { background: transparent; color: var(--red); border-color: transparent; }
.btn-danger:hover { background: var(--red-soft); }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-full { width: 100%; }
.btn-ghost { background: none; color: var(--text-dim); border: none; padding: 0.5rem; }
.btn-ghost:hover { color: var(--accent); }

/* ═══ FORMS ════════════════════════════════════════════ */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 500; color: var(--text-dim); margin-bottom: 7px; }
.input, select {
  width: 100%; padding: 10px 13px; border-radius: var(--radius-sm);
  background: var(--bg-soft); border: 1px solid var(--border); color: var(--text); font-size: 14px; transition: border 0.15s;
}
.input:focus, select:focus { outline: none; border-color: var(--accent); }
.input::placeholder { color: var(--text-muted); }
.input-group { display: flex; align-items: center; gap: 8px; }
.input-group .input { flex: 1; min-width: 120px; }
.domain-suffix { font-weight: 500; color: var(--accent); font-size: 14px; white-space: nowrap; }

/* ═══ MODAL ════════════════════════════════════════════ */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; width: 100%; max-width: 440px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.modal h3 { font-size: 18px; margin-bottom: 8px; }
.modal-note { color: var(--text-muted); font-size: 13px; margin-bottom: 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }

/* ═══ AUTH / LOGIN PAGE ════════════════════════════════ */
.login-shell { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(ellipse at top, #1a1106 0%, var(--bg) 55%); padding: 20px; }
.login-stack { width: 100%; max-width: 400px; display: grid; gap: 14px; }
.login-card { width: 100%; background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 36px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.login-logo { width: 52px; height: 52px; border-radius: 13px; margin: 0 auto 18px; background: linear-gradient(135deg, var(--accent), var(--accent-hover)); display: grid; place-items: center; font-weight: 800; font-size: 26px; color: #fff; box-shadow: 0 4px 16px var(--accent-soft); }
.login-card h2 { text-align: center; font-size: 22px; margin-bottom: 6px; }
.login-card .subtitle { text-align: center; color: var(--text-muted); font-size: 14px; margin-bottom: 16px; }
.auth-switch { text-align: center; margin-top: 18px; color: var(--text-muted); font-size: 13px; }
.auth-switch a { color: var(--accent); text-decoration: none; font-weight: 500; }
.auth-switch a:hover { text-decoration: underline; }

/* ═══ LANDING PAGE ═════════════════════════════════════ */
.container { max-width: 860px; margin: 0 auto; padding: 40px 24px 80px; }
.hero { text-align: center; padding: 60px 0 48px; }
.hero .badge-top { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft); color: var(--accent-hover); border: 1px solid rgba(234,88,12,0.25); border-radius: 20px; padding: 4px 14px; font-size: 13px; font-weight: 500; margin-bottom: 20px; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 700; line-height: 1.15; margin: 0 0 18px; letter-spacing: -0.02em; }
.hero h1 .accent { color: var(--accent); }
.hero .sub { font-size: 1.1rem; color: var(--text-muted); max-width: 520px; margin: 0 auto 32px; line-height: 1.6; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.check-section { max-width: 540px; margin: 0 auto 72px; }

/* ═══ DASHBOARD ════════════════════════════════════════ */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px; flex-wrap: wrap; gap: 12px;
}
.page-title { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }
.page-desc { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-title { font-size: 13px; font-weight: 600; color: var(--text-dim); }
.subdomain-item { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; border-bottom: 1px solid var(--border-soft); gap: 16px; flex-wrap: wrap; }
.subdomain-item:last-child { border-bottom: none; }
.subdomain-name { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.subdomain-meta { display: flex; gap: 12px; flex-wrap: wrap; color: var(--text-muted); font-size: 12px; align-items: center; }
.subdomain-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ═══ PRICING / PLANS ══════════════════════════════════ */
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.plan { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 28px 22px; text-align: center; position: relative; transition: border-color .2s; }
.plan:hover { border-color: rgba(234,88,12,.4); }
.plan.popular { border-color: var(--accent); background: rgba(234,88,12,.04); }
.plan-badge { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; padding: 3px 12px; border-radius: 20px; white-space: nowrap; }
.plan-name { font-size: 14px; color: var(--text-muted); margin-bottom: 10px; }
.plan-price { font-size: 2rem; font-weight: 700; color: var(--text); }
.plan-price span { font-size: 14px; font-weight: 400; color: var(--text-muted); }
.plan-note { font-size: 12px; color: var(--text-muted); margin-top: 8px; }
.plan-cta { margin-top: 18px; }
.plans-radio { display: flex; gap: 12px; flex-wrap: wrap; }
.plan-option { flex: 1; min-width: 120px; cursor: pointer; }
.plan-option input { display: none; }
.plan-option span { display: block; background: var(--bg-soft); border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 14px 12px; text-align: center; transition: all 0.15s; font-size: 14px; }
.plan-option input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.plan-option small { color: var(--green); font-weight: 600; font-size: 12px; }

/* ═══ FEATURES ═════════════════════════════════════════ */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 72px; }
.feat { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 22px; }
.feat-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); border: 1px solid rgba(234,88,12,.2); display: flex; align-items: center; justify-content: center; color: var(--accent-hover); margin-bottom: 14px; }
.feat h3 { font-size: 15px; font-weight: 600; margin: 0 0 6px; }
.feat p { font-size: 13px; color: var(--text-muted); margin: 0; line-height: 1.5; }

/* ═══ RECORD LIST ══════════════════════════════════════ */
.record-list { list-style: none; padding: 0; }
.record-list li { padding: 10px 0; border-bottom: 1px solid var(--border-soft); color: var(--text-dim); font-size: 14px; }
.record-list li:last-child { border-bottom: none; }
.record-list li strong { color: var(--text); }
.code-pill { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 13px; background: var(--bg-soft); padding: 3px 8px; border-radius: 6px; color: var(--accent-hover); }

/* ═══ PAYMENT ══════════════════════════════════════════ */
.payment-layout { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.qr-wrapper { text-align: center; flex-shrink: 0; }
.qr-wrapper img { max-width: 220px; border-radius: var(--radius); background: white; padding: 10px; box-shadow: 0 24px 64px -12px rgba(0,0,0,0.5); }
.payment-details p { margin-bottom: 8px; font-size: 14px; }
.ref-code { font-size: 16px; color: var(--yellow); font-weight: 600; background: var(--yellow-soft); padding: 4px 8px; border-radius: 6px; font-family: ui-monospace, monospace; }
.note { margin-top: 20px; padding: 12px 14px; background: var(--yellow-soft); border: 1px solid rgba(234,179,8,.2); border-radius: var(--radius-sm); font-size: 13px; color: var(--yellow); line-height: 1.5; }
.info-row { padding: 10px 0; border-bottom: 1px solid var(--border-soft); display: flex; justify-content: space-between; }
.info-row:last-child { border-bottom: none; }
.info-row span:first-child { color: var(--text-dim); }
.info-row span:last-child { font-weight: 600; }

/* ═══ HÉ LỘTIẾP / HERO CARD ═══════════════════════════ */
.hero-card {
  background: linear-gradient(135deg, rgba(249,115,22,.18), rgba(24,24,27,.98));
  border: 1px solid rgba(249,115,22,.3);
  border-radius: 18px;
  padding: 24px;
  display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; flex-wrap: wrap;
}

/* ═══ GUIDE PAGE ═══════════════════════════════════════ */
.guide-page-wrap { padding: 32px 32px 80px; max-width: 860px; }
.guide-layout { display: grid; grid-template-columns: 220px 1fr; gap: 32px; align-items: start; }
.guide-toc { position: sticky; top: 76px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.guide-toc h4 { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 12px; }
.toc-link { display: block; font-size: 13px; color: var(--text-dim); padding: 5px 8px; border-radius: 6px; text-decoration: none; transition: all .15s; }
.toc-link:hover, .toc-link.active { color: var(--accent-hover); background: var(--accent-soft); }
.guide-content h2 { font-size: 1.3rem; margin: 40px 0 14px; padding-top: 8px; border-top: 1px solid var(--border); }
.guide-content h2:first-child { margin-top: 0; border-top: none; }
.guide-content h3 { font-size: 1rem; font-weight: 600; margin: 20px 0 8px; color: var(--accent-hover); }
.guide-content p { color: var(--text-dim); line-height: 1.7; margin: 0 0 12px; }
.guide-content ul, .guide-content ol { padding-left: 20px; color: var(--text-dim); line-height: 1.8; margin: 0 0 12px; }
.guide-content a { color: var(--accent-hover); }
.step-block { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 14px; }
.step-title { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; margin-bottom: 8px; }
.step-num { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-hover); font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.code-block { background: #0d0f10; border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 13px; color: #a3e635; margin: 10px 0 14px; overflow-x: auto; white-space: pre; }
.alert { background: rgba(251,191,36,.06); border: 1px solid rgba(251,191,36,.25); border-radius: 8px; padding: 12px 16px; font-size: 13px; color: #fbbf24; margin-bottom: 14px; display: flex; gap: 10px; align-items: flex-start; }

/* ═══ TOAST ════════════════════════════════════════════ */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast-notification { background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--accent); padding: 14px 18px; border-radius: var(--radius-sm); box-shadow: var(--shadow); min-width: 280px; animation: slideIn 0.2s; font-size: 14px; }
.toast-notification.ok { border-left-color: var(--green); }
.toast-notification.err { border-left-color: var(--red); }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ═══ MISC ═════════════════════════════════════════════ */
.result { margin-top: 10px; padding: 6px; border-radius: 6px; font-size: 14px; min-height: 22px; }
.result.success, .result.available { color: var(--green); }
.result.error, .result.taken { color: var(--red); }
.empty { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty .btn { margin-top: 14px; }
.loading { color: var(--text-muted); padding: 24px 0; text-align: center; }
.text-muted { color: var(--text-muted); font-size: 13px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.row { display: flex; align-items: center; gap: 12px; }
.spread { display: flex; align-items: center; justify-content: space-between; }
.footer { text-align: center; margin-top: 48px; padding: 24px 0; color: var(--text-muted); font-size: 12px; border-top: 1px solid var(--border); }
.footer a { color: var(--accent-hover); }

/* ═══ RESPONSIVE ═══════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.2s; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; width: 100vw; }
  .content { padding: 18px; }
  .topbar { padding: 0 18px; }
  .guide-layout { grid-template-columns: 1fr; }
  .guide-toc { position: static; }
  .payment-layout { flex-direction: column; }
}
@media (max-width: 640px) {
  .container { padding: 24px 16px 60px; }
  .hero { padding: 40px 0 32px; }
  .hero h1 { font-size: 1.8rem; }
  .plans-radio { flex-direction: column; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .subdomain-item { flex-direction: column; align-items: flex-start; }
  table { display: block; overflow-x: auto; }
}

::selection { background: var(--accent-soft); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
