/* public/assets/css/app.css - NeoVina "Neon Monolith" Design System */

@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;700;900&family=Inter:wght@300;400;500;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=swap');

/* ─── CSS Variables ─────────────────────────────────────────── */
:root {
  --bg:               #0b0e14;
  --surface:          #0b0e14;
  --surface-low:      #10131a;
  --surface-high:     #1c2028;
  --surface-highest:  #22262f;
  --surface-bright:   #282c36;
  --surface-black:    #000000;

  --primary:          #a3a6ff;
  --primary-dim:      #6063ee;
  --primary-fixed:    #9396ff;

  --tertiary:         #ec63ff;
  --tertiary-dim:     #de4bf4;

  --on-surface:       #ecedf6;
  --on-surface-var:   #a9abb3;
  --on-primary:       #0f00a4;

  --error:            #ff6e84;
  --error-dim:        #d73357;

  --secondary-container: #424655;
  --on-secondary:        #cbd0e2;

  --outline:          #73757d;
  --outline-var:      rgba(69,72,79,0.25);

  --radius:           0.375rem;
  --radius-sm:        0.25rem;
  --radius-lg:        0.5rem;

  --gradient-cta:     linear-gradient(135deg, var(--primary), var(--primary-dim));
  --gradient-accent:  linear-gradient(135deg, var(--primary), var(--tertiary));

  --font-head:  'Be Vietnam Pro', sans-serif;
  --font-body:  'Inter', sans-serif;
}

/* ─── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  color: var(--on-surface);
  font-family: var(--font-body);
  font-size: 0.875rem;
  line-height: 1.6;
  min-height: 100vh;
}

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

/* ─── Layout ────────────────────────────────────────────────── */
.app-wrapper { display: flex; min-height: 100vh; }

/* ─── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  width: 272px;
  min-height: 100vh;
  background: var(--surface-black);
  border-right: 1px solid rgba(255,255,255,0.04);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-inner { display: flex; flex-direction: column; height: 100%; padding: 1.5rem 1rem; gap: 1.5rem; overflow-y: auto; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 0.5rem;
}

.brand-icon {
  width: 40px; height: 40px;
  background: var(--gradient-accent);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 18px rgba(163,166,255,0.35);
  flex-shrink: 0;
}

.brand-icon .material-symbols-outlined { color: #fff; font-size: 1.25rem; }

.brand-name {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 900;
  font-style: italic;
  letter-spacing: -0.05em;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* User card in sidebar */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface-high);
  border-radius: var(--radius);
  padding: 0.75rem;
}
.sidebar-user-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--surface-highest);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
.sidebar-user-avatar .material-symbols-outlined { color: var(--on-surface-var); }
.sidebar-user-name { font-size: 0.8rem; font-weight: 600; color: var(--on-surface); }
.sidebar-user-balance { font-size: 0.7rem; color: var(--primary); font-weight: 500; }

/* Nav */
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--on-surface-var);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease;
}
.nav-link:hover { background: var(--surface-high); color: var(--on-surface); }
.nav-link.active {
  background: rgba(163,166,255,0.1);
  color: var(--primary);
  transform: translateX(2px);
}
.nav-link .material-symbols-outlined { font-size: 1.2rem; }

.sidebar-footer { margin-top: auto; padding-top: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }

.btn-topup {
  width: 100%;
  padding: 0.75rem;
  background: var(--gradient-cta);
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(96,99,238,0.25);
  transition: filter 0.15s;
  text-align: center;
  display: block;
}
.btn-topup:hover { filter: brightness(1.12); }

.nav-link-logout { color: var(--on-surface-var) !important; }
.nav-link-logout:hover { color: var(--error) !important; }

/* ─── Main Content ──────────────────────────────────────────── */
.main { flex: 1; margin-left: 272px; display: flex; flex-direction: column; min-height: 100vh; }

/* ─── Top Bar ───────────────────────────────────────────────── */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(11,14,20,0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--outline-var);
  box-shadow: 0 0 30px rgba(99,102,241,0.06);
}

.topbar-title {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.topbar-right { display: flex; align-items: center; gap: 1rem; }

.balance-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  background: var(--surface-high);
  border-radius: 99px;
  border: 1px solid var(--outline-var);
  font-size: 0.8rem;
  font-weight: 700;
}
.balance-chip .material-symbols-outlined { color: var(--primary); font-size: 1.1rem; }

.icon-btn {
  background: none;
  border: none;
  color: var(--on-surface-var);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 50%;
  transition: color 0.15s;
  display: flex;
}
.icon-btn:hover { color: var(--on-surface); }

/* ─── Page Content ──────────────────────────────────────────── */
.page-content { flex: 1; padding: 2rem; max-width: 1200px; width: 100%; margin: 0 auto; }

/* ─── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--surface-low);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}
.card-high { background: var(--surface-high); }
.card-glow::before {
  content: '';
  position: absolute; top: -80px; right: -80px;
  width: 200px; height: 200px;
  background: rgba(163,166,255,0.06);
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
}

.card-title {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.card-title-bar {
  width: 3px; height: 20px;
  background: var(--primary);
  border-radius: 99px;
  display: inline-block;
}

/* Stat Cards */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 1rem; margin-bottom: 2rem; }

.stat-card {
  background: var(--surface-low);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon-primary { background: rgba(163,166,255,0.12); }
.stat-icon-tertiary { background: rgba(236,99,255,0.12); }
.stat-icon-success { background: rgba(86,220,120,0.12); }
.stat-icon-warning { background: rgba(255,180,50,0.12); }

.stat-icon .material-symbols-outlined { font-size: 1.4rem; }
.stat-icon-primary .material-symbols-outlined { color: var(--primary); }
.stat-icon-tertiary .material-symbols-outlined { color: var(--tertiary); }
.stat-icon-success .material-symbols-outlined { color: #56dc78; }
.stat-icon-warning .material-symbols-outlined { color: #ffb432; }

.stat-label { font-size: 0.7rem; color: var(--on-surface-var); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.stat-value { font-family: var(--font-head); font-size: 1.4rem; font-weight: 900; color: var(--on-surface); line-height: 1; margin-top: 0.2rem; }

/* ─── Tables ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); background: var(--surface-low); }

table { width: 100%; border-collapse: collapse; }

thead tr {
  background: var(--surface-high);
}
thead th {
  padding: 0.85rem 1.25rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--on-surface-var);
  white-space: nowrap;
}

tbody tr { border-bottom: 1px solid var(--outline-var); transition: background 0.1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface-highest); }
tbody tr:nth-child(even) { background: rgba(28,32,40,0.3); }
tbody tr:nth-child(even):hover { background: var(--surface-highest); }

td { padding: 0.85rem 1.25rem; font-size: 0.8rem; color: var(--on-surface); }

.td-id { font-family: monospace; color: var(--primary); font-size: 0.8rem; }
.td-muted { color: var(--on-surface-var); }
.td-right { text-align: right; }
.td-center { text-align: center; }

/* ─── Status Badges ─────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.status-primary  { background: rgba(163,166,255,0.12); color: var(--primary); }
.status-success  { background: rgba(86,220,120,0.12);  color: #56dc78; }
.status-tertiary { background: rgba(236,99,255,0.12);  color: var(--tertiary); }
.status-error    { background: rgba(255,110,132,0.12); color: var(--error); }
.status-warning  { background: rgba(255,180,50,0.12);  color: #ffb432; }
.status-muted    { background: rgba(169,171,179,0.1);  color: var(--on-surface-var); }

/* ─── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.8rem;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  letter-spacing: 0.04em;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--gradient-cta);
  color: #fff;
  box-shadow: 0 0 20px rgba(96,99,238,0.2);
}
.btn-primary:hover { filter: brightness(1.1); }

.btn-lg { padding: 0.85rem 1.75rem; font-size: 0.875rem; }
.btn-full { width: 100%; }

.btn-secondary {
  background: var(--secondary-container);
  color: var(--on-secondary);
}
.btn-secondary:hover { filter: brightness(1.15); }

.btn-ghost {
  background: transparent;
  color: var(--on-surface-var);
  border: 1px solid var(--outline-var);
}
.btn-ghost:hover { color: var(--on-surface); background: var(--surface-high); }

.btn-danger { background: var(--error-dim); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); }

.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.72rem; }

/* ─── Forms ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }

.form-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--on-surface-var);
  margin-bottom: 0.4rem;
  padding: 0 0.1rem;
}

.form-control {
  width: 100%;
  background: var(--surface-highest);
  border: none;
  border-bottom: 1.5px solid var(--outline);
  color: var(--on-surface);
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-size: 0.875rem;
  transition: border-color 0.15s;
  outline: none;
}
.form-control:focus { border-bottom-color: var(--primary); }
.form-control::placeholder { color: var(--on-surface-var); opacity: 0.5; }

select.form-control { cursor: pointer; appearance: none; }
.select-wrap { position: relative; }
.select-wrap::after {
  content: 'expand_more';
  font-family: 'Material Symbols Outlined';
  position: absolute;
  right: 0.75rem; top: 50%; transform: translateY(-50%);
  color: var(--on-surface-var);
  pointer-events: none;
  font-size: 1.2rem;
}

textarea.form-control { resize: vertical; min-height: 100px; }

/* Quick chips */
.quantity-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.chip {
  padding: 0.3rem 0.75rem;
  background: var(--secondary-container);
  color: var(--on-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s;
}
.chip:hover { background: rgba(163,166,255,0.2); color: var(--primary); }

/* ─── Alerts ────────────────────────────────────────────────── */
.alert {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.alert-error   { background: rgba(255,110,132,0.1); color: var(--error); border-left: 3px solid var(--error); }
.alert-success { background: rgba(86,220,120,0.1);  color: #56dc78; border-left: 3px solid #56dc78; }
.alert-info    { background: rgba(163,166,255,0.1); color: var(--primary); border-left: 3px solid var(--primary); }

/* ─── Pricing widget ────────────────────────────────────────── */
.pricing-card {
  background: var(--surface-high);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid rgba(163,166,255,0.08);
}
.pricing-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.82rem; margin-bottom: 0.6rem; }
.pricing-row span:first-child { color: var(--on-surface-var); }
.pricing-divider { border: none; border-top: 1px solid var(--outline-var); margin: 0.85rem 0; }
.pricing-total { font-family: var(--font-head); font-size: 1.8rem; font-weight: 900; color: var(--primary); }

/* ─── Service Info Panel ────────────────────────────────────── */
.info-panel {
  background: var(--surface-low);
  border-radius: var(--radius);
  padding: 1.25rem;
  border-left: 3px solid var(--tertiary);
}
.info-panel-title { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--tertiary); margin-bottom: 1rem; display: flex; align-items: center; gap: 0.4rem; }
.info-row { display: flex; gap: 0.6rem; margin-bottom: 0.85rem; font-size: 0.78rem; color: var(--on-surface-var); line-height: 1.5; }
.info-row .material-symbols-outlined { color: var(--tertiary); font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.info-row b { color: var(--on-surface); }

/* ─── Order Form Grid ───────────────────────────────────────── */
.order-grid { display: grid; grid-template-columns: 1fr 320px; gap: 1.5rem; align-items: start; }
@media (max-width: 900px) { .order-grid { grid-template-columns: 1fr; } }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) {
  .form-grid-2 { grid-template-columns: 1fr; }
  .form-grid-3 { grid-template-columns: 1fr; }
}

/* ─── Section Headers ───────────────────────────────────────── */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.section-title { font-family: var(--font-head); font-size: 1.1rem; font-weight: 700; }
.section-link { font-size: 0.75rem; color: var(--primary); font-weight: 600; }
.section-link:hover { text-decoration: underline; }

/* ─── Service List ──────────────────────────────────────────── */
.service-category-header {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--on-surface-var);
  padding: 0.6rem 1.25rem;
  background: var(--surface-high);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ─── Auth Layout ───────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 1rem;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface-low);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
}
.auth-logo { display: flex; align-items: center; gap: 0.75rem; justify-content: center; margin-bottom: 2rem; }
.auth-title { font-family: var(--font-head); font-size: 1.4rem; font-weight: 800; text-align: center; margin-bottom: 0.4rem; }
.auth-subtitle { color: var(--on-surface-var); font-size: 0.82rem; text-align: center; margin-bottom: 2rem; }
.auth-footer { text-align: center; font-size: 0.78rem; color: var(--on-surface-var); margin-top: 1.25rem; }
.auth-footer a { color: var(--primary); font-weight: 600; }

/* ─── Page Footer ───────────────────────────────────────────── */
.page-footer {
  background: var(--surface-black);
  border-top: 1px solid rgba(255,255,255,0.04);
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: auto;
}
.footer-brand { font-family: var(--font-head); font-weight: 900; font-size: 1.1rem; }
.footer-copy { font-size: 0.7rem; color: var(--on-surface-var); }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { font-size: 0.72rem; color: var(--on-surface-var); transition: color 0.15s; }
.footer-links a:hover { color: var(--primary); }

/* ─── Paginator ─────────────────────────────────────────────── */
.paginator { display: flex; gap: 0.3rem; margin-top: 1.25rem; justify-content: center; }
.page-link {
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--surface-high);
  color: var(--on-surface-var);
  font-size: 0.8rem;
  transition: all 0.15s;
}
.page-link:hover { color: var(--on-surface); background: var(--surface-highest); }
.page-link.active { background: var(--gradient-cta); color: #fff; }

/* ─── Ambient BG decoration ─────────────────────────────────── */
.bg-glow {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}
.bg-glow-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.15;
}
.blob-1 { top: 20%; left: 30%; width: 400px; height: 400px; background: var(--primary); }
.blob-2 { bottom: 20%; right: 15%; width: 500px; height: 500px; background: var(--tertiary); opacity: 0.08; }

/* ─── Misc Utilities ────────────────────────────────────────── */
.text-primary  { color: var(--primary); }
.text-tertiary { color: var(--tertiary); }
.text-muted    { color: var(--on-surface-var); }
.text-error    { color: var(--error); }
.fw-bold       { font-weight: 700; }
.fw-black      { font-weight: 900; }
.font-mono     { font-family: monospace; }
.d-flex        { display: flex; }
.align-center  { align-items: center; }
.gap-1         { gap: 0.25rem; }
.gap-2         { gap: 0.5rem; }
.gap-3         { gap: 0.75rem; }
.mb-1          { margin-bottom: 0.25rem; }
.mb-2          { margin-bottom: 0.5rem; }
.mb-3          { margin-bottom: 0.75rem; }
.mb-4          { margin-bottom: 1rem; }
.mt-auto       { margin-top: auto; }
.w-full        { width: 100%; }
.text-right    { text-align: right; }
.text-center   { text-align: center; }

/* ─── API Key box ───────────────────────────────────────────── */
.api-key-box {
  background: var(--surface-highest);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--primary);
  word-break: break-all;
  border-left: 3px solid var(--primary);
}

/* ─── Ticket message bubbles ────────────────────────────────── */
.msg-bubble { margin-bottom: 1.25rem; }
.msg-bubble-admin { text-align: left; }
.msg-bubble-user  { text-align: right; }
.msg-meta { font-size: 0.7rem; color: var(--on-surface-var); margin-bottom: 0.3rem; }
.msg-content {
  display: inline-block;
  max-width: 80%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.82rem;
  line-height: 1.6;
  text-align: left;
}
.msg-bubble-admin .msg-content  { background: var(--surface-high); color: var(--on-surface); border-left: 3px solid var(--primary); }
.msg-bubble-user  .msg-content  { background: rgba(163,166,255,0.1); color: var(--on-surface); }

/* ─── Responsive ────────────────────────────────────────────── */
.sidebar-toggle { display: none; background: none; border: none; color: var(--on-surface); cursor: pointer; }

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .page-content { padding: 1rem; }
  .topbar { padding: 0.85rem 1rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}
