:root {
  --bg-deep: #050d18;
  --bg-main: #071222;
  --bg-panel: #0b192d;
  --bg-panel-elev: #0f213b;
  --bg-input: #06101e;
  --border: #1a3354;
  --border-bright: #254c7c;
  --accent: #0ea5e9;
  --accent-bright: #38bdf8;
  --accent-glow: rgba(14, 165, 233, 0.28);
  --emerald: #10b981;
  --emerald-bg: rgba(16, 185, 129, 0.14);
  --emerald-border: rgba(16, 185, 129, 0.4);
  --amber: #f59e0b;
  --amber-bg: rgba(245, 158, 11, 0.14);
  --rose: #f43f5e;
  --rose-bg: rgba(244, 63, 94, 0.14);
  --rose-border: rgba(244, 63, 94, 0.4);
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 12px 32px rgba(0, 0, 0, 0.35);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at 18% 0%, #0d213d 0%, var(--bg-deep) 55%);
  color: var(--text);
  font-family: var(--font-sans);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-bright);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.hidden {
  display: none !important;
}

/* Simulator Banner */
.sim-banner {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.18), rgba(14, 165, 233, 0.18));
  border-bottom: 1px solid rgba(245, 158, 11, 0.35);
  color: #fde68a;
  font-size: 12px;
  padding: 7px 16px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Top Navigation Bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(6, 15, 29, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 12px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none !important;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  flex-shrink: 0;
}

.brand-title {
  font-weight: 800;
  font-size: 17px;
  color: #f8fafc;
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 12px;
  color: var(--accent-bright);
  font-weight: 500;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
  text-decoration: none !important;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: #ffffff;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-panel-elev);
  border-color: var(--border-bright);
  color: var(--text);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--accent);
  color: #ffffff;
}

.btn-emerald {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
}

.btn-emerald:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn-danger {
  background: var(--rose-bg);
  border-color: var(--rose-border);
  color: #fda4af;
}

.btn-danger:hover:not(:disabled) {
  background: rgba(244, 63, 94, 0.25);
  color: #ffffff;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-muted);
}

.btn-ghost:hover:not(:disabled) {
  color: #ffffff;
  border-color: var(--border-bright);
}

.btn-sm {
  padding: 6px 11px;
  font-size: 12px;
}

.btn-lg {
  padding: 13px 24px;
  font-size: 15px;
  border-radius: 10px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-cyan {
  background: rgba(14, 165, 233, 0.16);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.badge-emerald {
  background: var(--emerald-bg);
  color: #6ee7b7;
  border: 1px solid var(--emerald-border);
}

.badge-amber {
  background: var(--amber-bg);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.badge-rose {
  background: var(--rose-bg);
  color: #fda4af;
  border: 1px solid var(--rose-border);
}

/* Cards & Inputs */
.card {
  background: linear-gradient(180deg, rgba(14, 29, 52, 0.92), rgba(9, 20, 37, 0.96));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-card);
}

.card-title {
  margin: 0 0 12px;
  font-size: 14.5px;
  font-weight: 700;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.input, .select, .textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: #f8fafc;
  font-family: inherit;
  font-size: 13.5px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.textarea {
  resize: vertical;
  line-height: 1.65;
}

.mono {
  font-family: var(--font-mono);
}

/* Container for Landing / Checkout / Dashboard / Admin */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

.container-narrow {
  max-width: 820px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

/* Landing Hero */
.hero {
  text-align: center;
  padding: 36px 12px 26px;
  max-width: 860px;
  margin: 0 auto;
}

.hero h1 {
  margin: 14px 0 14px;
  font-size: clamp(28px, 4.4vw, 48px);
  line-height: 1.12;
  font-weight: 850;
  letter-spacing: -0.03em;
  background: linear-gradient(180deg, #ffffff 30%, #7dd3fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-muted);
  margin: 0 auto 24px;
  max-width: 680px;
}

.hero-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.trust-strip {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 24px;
  color: var(--text-muted);
  font-size: 13px;
}

.section-head {
  text-align: center;
  margin: 44px 0 22px;
}

.section-head h2 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 800;
}

.section-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14.5px;
}

/* Grids */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

/* Pricing Card */
.pkg-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.pkg-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.pkg-card.popular {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35), 0 16px 36px rgba(14, 165, 233, 0.18);
}

.pkg-card.out-of-stock {
  opacity: 0.72;
  border-color: rgba(244, 63, 94, 0.35);
}

.pkg-price {
  font-size: 28px;
  font-weight: 850;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.pkg-credits {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-bright);
}

.pkg-meta {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* Model Showcase Grid */
.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

/* ========================================================
   AINEMO VOICE STUDIO (Full-Screen Dark App Layout)
   Inspired by Wijaya11Labs reference — cleaner & PWA ready
   ======================================================== */
.studio-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px 18px 28px;
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.studio-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.studio-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.license-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--emerald-bg);
  border: 1px solid var(--emerald-border);
  color: #6ee7b7;
  font-weight: 800;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  flex: 1;
}

.credit-readout {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  font-size: 13px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.credit-value {
  font-weight: 800;
  font-size: 16px;
  color: #34d399;
  font-family: var(--font-mono);
}

.model-picker {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.model-opt {
  text-align: left;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 11px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: all 0.14s ease;
  font-family: inherit;
}

.model-opt:hover {
  border-color: var(--border-bright);
  background: #0a1a30;
}

.model-opt.active {
  background: rgba(14, 165, 233, 0.16);
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35);
}

.model-opt-name {
  font-weight: 700;
  font-size: 13px;
  color: #f8fafc;
}

.model-opt-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* Quote / Credit Calculator Bar */
.quote-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 9px;
  background: rgba(6, 16, 30, 0.9);
  border: 1px solid var(--border);
  font-size: 13px;
}

.quote-bar.danger {
  border-color: var(--rose-border);
  background: rgba(244, 63, 94, 0.1);
}

.studio-action-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: rgba(8, 19, 36, 0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.btn-generate {
  min-width: 210px;
  padding: 13px 22px;
  font-size: 15px;
  letter-spacing: 0.03em;
}

.status-indicator {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--emerald);
  display: inline-block;
}

.dot.busy {
  background: var(--amber);
  box-shadow: 0 0 10px var(--amber);
  animation: pulse 1s infinite;
}

.dot.error {
  background: var(--rose);
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* Data Tables (History, Orders, Licenses) */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  text-align: left;
  padding: 10px 10px;
  color: var(--accent-bright);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 10px 10px;
  border-bottom: 1px solid rgba(26, 51, 84, 0.55);
  vertical-align: middle;
}

tr:hover td {
  background: rgba(14, 165, 233, 0.05);
}

.audio-mini {
  height: 32px;
  width: 210px;
  max-width: 100%;
}

/* QRIS Checkout Box */
.qris-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}

.qris-img-frame {
  background: #ffffff;
  padding: 14px;
  border-radius: 14px;
  display: inline-block;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.qris-img-frame img {
  display: block;
  width: 240px;
  height: 240px;
}

.amount-highlight {
  font-size: 30px;
  font-weight: 850;
  font-family: var(--font-mono);
  color: #38bdf8;
  letter-spacing: -0.02em;
}

.license-reveal-box {
  background: rgba(6, 37, 31, 0.9);
  border: 1.5px solid var(--emerald);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  width: 100%;
}

.license-key-big {
  font-family: var(--font-mono);
  font-size: clamp(18px, 3vw, 26px);
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #ffffff;
  margin: 10px 0 14px;
  word-break: break-all;
}

/* KPI Stat Cards (Admin & Dashboard) */
.stat-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-value {
  font-size: 22px;
  font-weight: 850;
  color: #f8fafc;
  font-family: var(--font-mono);
}

.stat-sub {
  font-size: 11.5px;
  color: var(--text-dim);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.tab-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.tab-btn.active {
  background: var(--accent);
  border-color: var(--accent-bright);
  color: #ffffff;
}

/* Toast Notifications */
#toast-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
}

.toast {
  background: #0e2038;
  border: 1px solid var(--border-bright);
  color: #f8fafc;
  padding: 12px 15px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
  animation: fadeUp 0.18s ease;
}

.toast.success { border-color: var(--emerald); }
.toast.error { border-color: var(--rose); }
.toast.warn { border-color: var(--amber); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.footer {
  border-top: 1px solid var(--border);
  padding: 24px 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 12.5px;
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .studio-shell { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .topbar { padding: 10px 14px; }
  .studio-shell { padding: 12px 12px 24px; }
  .btn-generate { width: 100%; }
  .status-indicator { margin-left: 0; }
}
