:root {
  /* Luxury Command Center Palette */
  --bg: #F8F6F2;
  --surface: rgba(255, 255, 255, 0.7);
  --surface-strong: #ffffff;
  --onyx: #121212;
  --gold: #C5A059;
  --gold-muted: rgba(197, 160, 89, 0.1);
  --line: rgba(18, 18, 18, 0.05);
  --glass-border: rgba(255, 255, 255, 0.5);
  --text-main: #1C1C1E;
  --text-muted: #8E8E93;
  
  --radius-sm: 12px;
  --radius-md: 24px;
  --radius-lg: 40px;
  
  --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.03);
  --shadow-glass: 0 20px 60px rgba(197, 160, 89, 0.08);
  
  --serif: "Playfair Display", "Source Han Serif CN", serif;
  --sans: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; -webkit-font-smoothing: antialiased; }

body {
  margin: 0;
  min-height: 100vh;
  background: 
    radial-gradient(circle at 10% 10%, rgba(197, 160, 89, 0.05) 0%, transparent 30%),
    radial-gradient(circle at 90% 90%, rgba(197, 160, 89, 0.05) 0%, transparent 30%),
    var(--bg);
  color: var(--text-main);
  font-family: var(--sans);
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, .brand-name { font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; }

.eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--gold);
  margin-bottom: 8px;
}

/* Navigation */
.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 60px;
  background: rgba(248, 246, 242, 0.8);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--line);
}

.topbar-brand {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 20px;
  color: var(--onyx);
  letter-spacing: 0.1em;
}

.topbar-nav {
  display: flex;
  gap: 8px;
}

.topbar-nav a {
  padding: 10px 24px;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.topbar-nav a:hover, .topbar-nav a.active {
  background: var(--gold-muted);
  color: var(--gold);
  transform: translateY(-1px);
}

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

.user-chip {
  text-align: right;
}

.user-name { display: block; font-size: 14px; font-weight: 700; color: var(--onyx); }
.user-sub { display: block; font-size: 11px; color: var(--gold); font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; }

/* Layout Shell */
.page-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 60px;
  animation: fadeInSlideUp 0.8s ease-out;
}

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

/* UI Elements */
.panel {
  background: var(--surface);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 48px;
  margin-bottom: 48px;
  box-shadow: var(--shadow-glass);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.panel-title h2 { font-size: 32px; margin: 0; }

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 32px;
  margin-bottom: 48px;
}

.stat-card {
  padding: 32px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  transition: all 0.5s ease;
}

.stat-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-glass);
  border-color: var(--gold);
}

.stat-card .label { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.15em; }
.stat-card .value { display: block; font-family: var(--serif); font-size: 48px; color: var(--onyx); margin-top: 16px; line-height: 1; }

.stat-card-accent {
  background: var(--onyx);
  color: #FFF;
}
.stat-card-accent .value { color: var(--gold); }

/* Data Tables */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #FFF;
}

.data-table th {
  text-align: left;
  padding: 16px 24px;
  background: #FAFAFA;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--line);
}

.data-table td {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--gold-muted); }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }
.form-full { grid-column: span 2; }

.field { margin-bottom: 24px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 10px; color: var(--onyx); }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 14px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.8);
  font-size: 15px;
  transition: all 0.3s;
}

.field input:focus {
  outline: none;
  border-color: var(--gold);
  background: #FFF;
  box-shadow: 0 0 0 4px var(--gold-muted);
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 32px;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  letter-spacing: 0.05em;
}

.button-primary { background: var(--onyx); color: #FFF; }
.button-primary:hover { background: #000; transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0,0,0,0.15); }

.button-gold { background: var(--gold); color: #FFF; }
.button-gold:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(197,160,89,0.3); }

.button-ghost { background: transparent; border: 1px solid var(--line); color: var(--text-main); }
.button-ghost:hover { background: var(--line); }

.button-small { height: 36px; padding: 0 20px; font-size: 12px; }

/* Badges */
.badge {
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-gold { background: var(--gold-muted); color: var(--gold); }
.badge-onyx { background: var(--onyx); color: #FFF; }

/* Auth Layout */
.page-shell-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px;
}

.auth-card {
  width: 100%;
  max-width: 1100px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  background: #FFF;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 40px 120px rgba(0,0,0,0.1);
}

.auth-hero {
  position: relative;
  background: url('https://images.unsplash.com/photo-1594553500230-08027aa4466b?auto=format&fit=crop&q=80') center/cover;
  padding: 80px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: #FFF;
}

.auth-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(18,18,18,0.8), transparent);
}

.auth-hero-content { position: relative; z-index: 2; }
.auth-hero h1 { font-size: 64px; margin-bottom: 24px; color: #FFF; }
.auth-hero p { font-size: 18px; opacity: 0.8; max-width: 400px; }

.auth-form-container {
  padding: 80px 60px;
}

/* Chat Backend */
.chat-window {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: 700px;
  background: #FFF;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  overflow: hidden;
}

.chat-sidebar { border-right: 1px solid var(--line); background: #FAFAFA; display: flex; flex-direction: column; }
.chat-list-item { padding: 20px; border-bottom: 1px solid var(--line); cursor: pointer; transition: all 0.3s; }
.chat-list-item:hover, .chat-list-item.active { background: #FFF; border-left: 4px solid var(--gold); }

.chat-main { display: flex; flex-direction: column; }
.chat-messages { flex: 1; padding: 32px; overflow-y: auto; background: var(--bg); display: flex; flex-direction: column; gap: 20px; }
.chat-bubble { max-width: 70%; padding: 16px 24px; border-radius: 20px; font-size: 14px; line-height: 1.6; }
.chat-bubble-merchant { align-self: flex-end; background: var(--onyx); color: #FFF; border-bottom-right-radius: 4px; }
.chat-bubble-user { align-self: flex-start; background: #FFF; border: 1px solid var(--line); border-bottom-left-radius: 4px; }

.chat-input-area { padding: 24px; border-top: 1px solid var(--line); background: #FFF; display: flex; gap: 16px; }

/* Flash Messages */
.flash-stack {
  position: fixed;
  top: 100px;
  right: 40px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.flash {
  padding: 16px 32px;
  border-radius: 12px;
  background: #FFF;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  border-left: 4px solid var(--gold);
  font-size: 14px;
  font-weight: 600;
  animation: slideInRight 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
