﻿/* ====================================================
   HVN Group - Mua chung tài khoản AI
   Shared design tokens & utility components
   ==================================================== */

@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@500;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Brand */
  --brand-red: #EA4445;
  --brand-dark-red: #C93939;
  --brand-light-red: #FDECEC;
  --brand-graphite: #6E6E6E; /* secondary in logo */

  /* Neutrals */
  --charcoal: #1F1F1F;
  --ink: #333333;
  --medium-gray: #808080;
  --soft-gray: #B5B5B5;
  --light-gray: #F5F5F5;
  --hairline: #E6E6E6;
  --white: #FFFFFF;

  /* Utility */
  --success: #28A745;
  --success-bg: #E7F6EC;
  --info: #17A2B8;
  --info-bg: #E5F4F7;
  --warning: #FFC107;
  --warning-bg: #FFF7DC;
  --danger-bg: #FDECEC;

  /* Type */
  --font-display: 'Google Sans', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', 'Roboto', system-ui, sans-serif;

  /* Radii & Shadows */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(15, 15, 15, 0.04), 0 1px 3px rgba(15, 15, 15, 0.06);
  --shadow-md: 0 4px 14px rgba(15, 15, 15, 0.06), 0 2px 6px rgba(15, 15, 15, 0.04);
  --shadow-lg: 0 18px 40px rgba(15, 15, 15, 0.08), 0 6px 14px rgba(15, 15, 15, 0.05);
  --shadow-red: 0 12px 28px rgba(234, 68, 69, 0.22);

  /* Spacing scale */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 32px;
  --s-8: 40px;
  --s-9: 56px;
  --s-10: 80px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body { font-size: 16px; line-height: 1.55; }

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  color: var(--charcoal);
  margin: 0;
  letter-spacing: -0.01em;
}
h1 { font-size: 48px; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
h2 { font-size: 36px; font-weight: 700; line-height: 1.15; letter-spacing: -0.015em; }
h3 { font-size: 24px; font-weight: 500; line-height: 1.25; }
h4 { font-size: 20px; font-weight: 500; line-height: 1.3; }

p { margin: 0; }
a { color: inherit; text-decoration: none; }

button { font-family: inherit; cursor: pointer; border: 0; background: none; }
input, select, textarea { font-family: inherit; font-size: 16px; color: var(--ink); }

/* ============= Layout ============= */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============= Buttons ============= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 16px;
  padding: 12px 22px;
  border-radius: var(--r-sm);
  transition: all 0.2s ease;
  white-space: nowrap;
  line-height: 1;
}
.btn-primary {
  background: var(--brand-red);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(234, 68, 69, 0.25);
}
.btn-primary:hover { background: var(--brand-dark-red); transform: translateY(-1px); box-shadow: var(--shadow-red); }
.btn-primary:active { transform: translateY(0); }
.btn-outline {
  background: transparent;
  color: var(--charcoal);
  border: 1.5px solid var(--hairline);
}
.btn-outline:hover { border-color: var(--brand-red); color: var(--brand-red); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  padding: 10px 14px;
}
.btn-ghost:hover { background: var(--light-gray); }
.btn-lg { padding: 16px 28px; font-size: 17px; border-radius: 12px; }
.btn-sm { padding: 8px 14px; font-size: 14px; }
.btn-block { width: 100%; }

/* ============= Logo lockup ============= */
.logo-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.logo-lockup img {
  height: 40px;
  width: auto;
  display: block;
}
.logo-lockup .lockup-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.logo-lockup .lockup-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--charcoal);
  letter-spacing: -0.01em;
}
.logo-lockup .lockup-sub {
  font-size: 11px;
  color: var(--medium-gray);
  margin-top: 3px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ============= Header ============= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.site-nav {
  display: flex;
  gap: 32px;
}
.site-nav a {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  position: relative;
  padding: 6px 0;
}
.site-nav a:hover { color: var(--brand-red); }
.site-nav a.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--brand-red);
  border-radius: 2px;
}

/* ============= Footer ============= */
.site-footer {
  background: var(--charcoal);
  color: #C9C9C9;
  padding: 56px 0 32px;
  font-size: 14px;
  margin-top: 80px;
}
.site-footer h5 {
  color: var(--white);
  font-family: var(--font-display);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}
.site-footer a:hover { color: var(--brand-red); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  font-size: 13px;
  color: #888;
}

/* ============= Card ============= */
.card {
  background: var(--white);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  transition: all 0.2s ease;
}
.card-hover:hover {
  border-color: rgba(234, 68, 69, 0.3);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* ============= Badge ============= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  letter-spacing: 0.01em;
  font-family: var(--font-body);
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-warning { color: #B07700; background: var(--warning-bg); }
.badge-success { color: #1B7A33; background: var(--success-bg); }
.badge-danger  { color: var(--brand-dark-red); background: var(--danger-bg); }
.badge-info    { color: #126B7B; background: var(--info-bg); }
.badge-gray    { color: var(--medium-gray); background: var(--light-gray); }

/* ============= Progress ============= */
.progress {
  width: 100%;
  height: 8px;
  background: var(--light-gray);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.progress > .progress-bar {
  height: 100%;
  background: var(--brand-red);
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(.2,.7,.2,1);
  position: relative;
}
.progress > .progress-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
  animation: progressShine 2.2s linear infinite;
}
@keyframes progressShine {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ============= Form controls ============= */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 14px;
  font-weight: 500;
  color: var(--charcoal);
}
.input, .select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--hairline);
  border-radius: var(--r-sm);
  background: var(--white);
  transition: all 0.18s ease;
  font-size: 15px;
}
.input:focus, .select:focus {
  outline: none;
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px rgba(234, 68, 69, 0.12);
}
.input::placeholder { color: var(--soft-gray); }

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.5;
}
.checkbox input { margin-top: 3px; accent-color: var(--brand-red); width: 16px; height: 16px; }

/* Radio card (for chu kỳ) */
.radio-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1.5px solid var(--hairline);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all 0.18s ease;
  background: var(--white);
}
.radio-card:hover { border-color: var(--soft-gray); }
.radio-card input { display: none; }
.radio-card .radio-dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--soft-gray);
  flex-shrink: 0;
  position: relative;
  transition: all 0.18s ease;
}
.radio-card.is-checked {
  border-color: var(--brand-red);
  background: var(--brand-light-red);
}
.radio-card.is-checked .radio-dot {
  border-color: var(--brand-red);
}
.radio-card.is-checked .radio-dot::after {
  content: '';
  position: absolute;
  inset: 3px;
  background: var(--brand-red);
  border-radius: 50%;
}
.radio-card .radio-body { flex: 1; }
.radio-card .radio-title { font-weight: 600; font-size: 15px; color: var(--charcoal); }
.radio-card .radio-sub { font-size: 13px; color: var(--medium-gray); margin-top: 3px; }
.radio-card .radio-price { font-family: var(--font-display); font-weight: 700; font-size: 20px; color: var(--charcoal); }

/* ============= Toast ============= */
.toast-region {
  position: fixed;
  top: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
  pointer-events: none;
}
.toast {
  background: var(--charcoal);
  color: var(--white);
  padding: 12px 18px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.32s cubic-bezier(.2,.8,.2,1);
}
.toast .toast-ico {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--success);
  color: var(--white);
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(-8px); }
}

/* ============= Utility ============= */
.eyebrow {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brand-red);
}
.muted { color: var(--medium-gray); }
.mono  { font-family: 'JetBrains Mono', 'SF Mono', ui-monospace, monospace; }
.divider { height: 1px; background: var(--hairline); width: 100%; }
.text-strike { text-decoration: line-through; color: var(--soft-gray); }

/* ============= Section spacing ============= */
.section { padding: 88px 0; }
.section-tight { padding: 56px 0; }
.section-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  margin-bottom: 56px;
}

/* ============= Responsive ============= */
@media (max-width: 1024px) {
  h1 { font-size: 38px; }
  h2 { font-size: 30px; }
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; }
  .footer-grid > div:last-child { grid-column: 1 / -1; }
}
@media (max-width: 768px) {
  .container { padding: 0 20px; }
  h1 { font-size: 32px; }
  h2 { font-size: 26px; }
  .site-nav { display: none; }
  .section { padding: 64px 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
}
/* ============= Admin Shell ============= */
.admin-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
  background: #FAFAFB;
}

.sidebar {
  background: var(--charcoal);
  color: var(--white);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}
.sidebar-brand img { height: 40px; filter: brightness(0) invert(1) sepia(1) saturate(8) hue-rotate(330deg); }
.sidebar-brand .name { font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--white); }
.sidebar-brand .sub { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: 0.05em; }

.sidebar-section-label {
  font-size: 11px;
  font-weight: 700;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 24px 0 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  color: #B0B0B0;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  margin-bottom: 4px;
  position: relative;
}
.nav-item svg { width: 18px; height: 18px; opacity: 0.7; }
.nav-item:hover { background: rgba(255,255,255,0.05); color: var(--white); }
.nav-item.active { background: var(--brand-red); color: var(--white); box-shadow: 0 4px 12px rgba(234,68,69,0.3); }
.nav-item.active svg { opacity: 1; }

.nav-badge {
  margin-left: auto;
  background: var(--brand-red);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 99px;
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-foot .avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--brand-red);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}
.sidebar-foot .nm { font-size: 13px; font-weight: 600; color: white; }
.sidebar-foot .role { font-size: 11px; color: #888; }
.sidebar-foot .icon-btn { color: #888; transition: color 0.2s; padding: 4px; }
.sidebar-foot .icon-btn:hover { color: var(--white); }

/* ============= Admin Content ============= */
.main {
  padding: 40px;
  max-width: 1400px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}
.page-head h1 { font-size: 28px; margin-bottom: 4px; }
.page-head p { color: var(--medium-gray); font-size: 14px; }
.page-actions { display: flex; gap: 12px; align-items: center; }

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}
.search-box svg { position: absolute; left: 14px; color: var(--soft-gray); }
.search-box input {
  height: 38px;
  padding: 0 14px 0 40px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  font-size: 14px;
  width: 280px;
}

/* Metrics */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}
.metric {
  background: var(--white);
  padding: 24px;
  border-radius: var(--r-md);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-sm);
}
.metric-head { font-size: 13px; font-weight: 600; color: var(--medium-gray); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.metric-num { font-family: var(--font-display); font-size: 28px; font-weight: 700; color: var(--charcoal); }
.metric-num .unit { font-size: 16px; color: var(--medium-gray); margin-left: 2px; }

.metric.is-red { border-top: 4px solid var(--brand-red); }
.metric.is-green { border-top: 4px solid var(--success); }
.metric.is-amber { border-top: 4px solid var(--warning); }
.metric.is-blue { border-top: 4px solid var(--info); }

/* Panels */
.alert-panel {
  background: var(--white);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  margin-bottom: 24px;
  overflow: hidden;
}
.alert-panel-head {
  padding: 16px 24px;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.alert-panel-head h3 { font-size: 17px; font-weight: 600; }

/* Table */
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table th {
  text-align: left;
  padding: 12px 24px;
  background: #F9FAFB;
  font-weight: 600;
  color: var(--medium-gray);
  border-bottom: 1px solid var(--hairline);
}
.data-table td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: 0; }
.data-table .nm { font-weight: 600; color: var(--charcoal); }
.data-table .gp { font-size: 12px; color: var(--medium-gray); margin-top: 2px; }
.row-actions { display: flex; gap: 8px; }

/* Slot info */
.slot-mini { display: flex; align-items: center; gap: 12px; }
.slot-mini .progress { width: 80px; }
.slot-mini .txt { font-size: 13px; font-weight: 600; color: var(--charcoal); }

/* Settings form */
.settings-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
  padding: 32px 0;
  border-bottom: 1px solid var(--hairline);
}
.settings-grid:last-child { border-bottom: 0; }
.settings-info h4 { margin-bottom: 8px; }
.settings-info p { font-size: 14px; color: var(--medium-gray); line-height: 1.5; }
.settings-form { display: flex; flex-direction: column; gap: 20px; max-width: 500px; }

.save-bar {
  position: sticky;
  bottom: 0;
  left: 0; right: 0;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  padding: 16px 40px;
  border-top: 1px solid var(--hairline);
  display: flex;
  justify-content: flex-end;
  z-index: 40;
}

/* Responsive */
@media (max-width: 1200px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1024px) {
  .admin-shell { grid-template-columns: 80px 1fr; }
  .sidebar .sidebar-brand .name, .sidebar .sidebar-brand .sub, .sidebar .nav-item span, .sidebar .sidebar-section-label, .sidebar .sidebar-foot div { display: none; }
  .sidebar .nav-item { justify-content: center; padding: 12px; }
  .sidebar .nav-item svg { margin: 0; width: 22px; height: 22px; }
  .sidebar-brand { justify-content: center; }
  .sidebar-foot { justify-content: center; }
}
@media (max-width: 768px) {
  .main { padding: 24px; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 16px; }
  .metrics { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; gap: 20px; }
}
