/* ===================================================================
   Alice AI Portal — Design System
   =================================================================== */

/* ===================================================================
   1. DESIGN TOKENS
   =================================================================== */
:root {
  /* Brand — Orange */
  --al-orange-50: #fff3eb;
  --al-orange-100: #ffe0cc;
  --al-orange-200: #ffc299;
  --al-orange-300: #ffa366;
  --al-orange-400: #ff8c3f;
  --al-orange-500: #ff7a2f;
  --al-orange-600: #e66a20;
  --al-orange-700: #cc5a11;
  --al-orange-800: #b34a02;

  /* Neutral */
  --al-neutral-50: #f8fafc;
  --al-neutral-100: #e2e8f0;
  --al-neutral-200: #cbd5e1;
  --al-neutral-300: #a8b5b2;
  --al-neutral-400: #64748b;
  --al-neutral-500: #475569;
  --al-neutral-600: #1e293b;
  --al-neutral-700: #0f1a19;
  --al-neutral-800: #081211;
  --al-neutral-900: #050f0e;

  /* Semantic */
  --al-cyan: #55d6c2;
  --al-green: #8fd46b;
  --al-danger: #ff6d6d;
  --al-warning: #fbbf24;

  /* Surfaces */
  --al-bg-primary: #07100f;
  --al-bg-surface: rgba(8, 18, 17, 0.82);
  --al-bg-surface-hover: rgba(255, 255, 255, 0.08);
  --al-bg-elevated: rgba(15, 28, 26, 0.95);
  --al-bg-glass: rgba(7, 16, 15, 0.78);
  --al-border: rgba(255, 255, 255, 0.13);
  --al-border-light: rgba(255, 255, 255, 0.06);
  --al-border-focus: rgba(255, 177, 93, 0.8);

  /* Typography */
  --al-font-sans: "Inter", "Noto Sans", "Segoe UI", Arial, sans-serif;
  --al-font-display: "Space Grotesk", "Noto Sans", "Segoe UI", Arial, sans-serif;
  --al-text-primary: #f8fafc;
  --al-text-secondary: #a8b5b2;
  --al-text-accent: #ffb15d;

  /* Spacing (4px base) */
  --al-space-1: 4px;
  --al-space-2: 8px;
  --al-space-3: 12px;
  --al-space-4: 16px;
  --al-space-5: 20px;
  --al-space-6: 24px;
  --al-space-8: 32px;
  --al-space-10: 40px;
  --al-space-12: 48px;

  /* Radius */
  --al-radius-sm: 6px;
  --al-radius-md: 8px;
  --al-radius-lg: 12px;
  --al-radius-xl: 16px;
  --al-radius-full: 9999px;

  /* Shadows */
  --al-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.24);
  --al-shadow-md: 0 8px 32px rgba(0, 0, 0, 0.32);
  --al-shadow-lg: 0 24px 80px rgba(0, 0, 0, 0.42);
  --al-shadow-glow: 0 0 34px rgba(255, 122, 47, 0.34);

  /* Animation */
  --al-transition-fast: 0.15s ease;
  --al-transition: 0.25s ease;

  /* Z-index */
  --al-z-dropdown: 100;
  --al-z-sticky: 20;
  --al-z-overlay: 200;
}

/* ===================================================================
   2. RESET / BASE
   =================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(7, 16, 15, 0.92), rgba(7, 16, 15, 1) 54%),
    radial-gradient(circle at 10% 10%, rgba(255, 122, 47, 0.12), transparent 30%),
    var(--al-bg-primary);
  color: var(--al-text-primary);
  font-family: var(--al-font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button, textarea, select, input { font: inherit; }
img { max-width: 100%; height: auto; }
.hidden { display: none !important; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ===================================================================
   3. TYPOGRAPHY
   =================================================================== */
h1, h2, h3 { font-family: var(--al-font-display); margin: 0; }

.al-eyebrow {
  margin: 0 0 var(--al-space-3);
  color: var(--al-cyan);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.al-text--muted { color: var(--al-text-secondary); }
.al-text--accent { color: var(--al-text-accent); }
.al-text--positive { color: var(--al-green); font-weight: 700; }
.al-text--negative { color: var(--al-danger); font-weight: 700; }

/* ===================================================================
   4. BUTTONS
   =================================================================== */
.al-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--al-space-2);
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(255, 122, 47, 0.45);
  border-radius: var(--al-radius-md);
  background: linear-gradient(135deg, var(--al-orange-500), var(--al-orange-200));
  color: #1b0f09;
  font-weight: 800;
  cursor: pointer;
  transition: all var(--al-transition-fast);
  white-space: nowrap;
}
.al-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(255, 122, 47, 0.25); }
.al-btn:active { transform: translateY(0); }

.al-btn--secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--al-text-primary);
  border-color: var(--al-border);
}
.al-btn--secondary:hover { background: rgba(255, 255, 255, 0.1); box-shadow: none; }

.al-btn--ghost {
  background: transparent;
  color: var(--al-text-secondary);
  border-color: transparent;
}
.al-btn--ghost:hover { background: rgba(255, 255, 255, 0.06); color: var(--al-text-primary); box-shadow: none; }

.al-btn--danger {
  background: rgba(255, 109, 109, 0.12);
  color: var(--al-danger);
  border-color: rgba(255, 109, 109, 0.3);
}
.al-btn--danger:hover { background: rgba(255, 109, 109, 0.2); box-shadow: none; }

.al-btn--link {
  background: transparent;
  color: var(--al-cyan);
  border: none;
  padding: 0;
  min-height: auto;
  font-weight: 700;
  font-size: 14px;
}
.al-btn--link:hover { color: var(--al-orange-200); transform: none; box-shadow: none; }

.al-btn--sm {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
}

/* ===================================================================
   5. FORMS
   =================================================================== */
.al-input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--al-border);
  border-radius: var(--al-radius-md);
  background: rgba(0, 0, 0, 0.28);
  color: var(--al-text-primary);
  outline: none;
  transition: border-color var(--al-transition-fast), box-shadow var(--al-transition-fast);
}
.al-input:focus {
  border-color: var(--al-border-focus);
  box-shadow: 0 0 0 3px rgba(255, 122, 47, 0.12);
}
.al-input::placeholder { color: var(--al-text-secondary); }

.al-input--textarea {
  min-height: 112px;
  padding: var(--al-space-3) 14px;
  resize: vertical;
}

select.al-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a8b5b2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.al-field {
  display: grid;
  gap: var(--al-space-2);
  color: var(--al-text-secondary);
  font-weight: 600;
  font-size: 13px;
  min-width: 160px;
}

/* ===================================================================
   6. CARDS
   =================================================================== */
.al-card {
  display: flex;
  align-items: center;
  gap: var(--al-space-4);
  padding: var(--al-space-5);
  border: 1px solid var(--al-border);
  border-radius: var(--al-radius-lg);
  background: rgba(8, 18, 17, 0.68);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--al-shadow-sm);
  transition: transform var(--al-transition-fast), border-color var(--al-transition-fast);
}
.al-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 122, 47, 0.25);
}

.al-card-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: var(--al-radius-md);
  background: rgba(255, 122, 47, 0.15);
  color: var(--al-orange-200);
  font-weight: 900;
  font-size: 18px;
}

.al-card strong { display: block; margin: 4px 0; font-size: 24px; }
.al-card small { display: block; color: var(--al-text-secondary); font-size: 13px; }
.al-card > div { min-width: 0; }

.al-card--green .al-card-icon { background: rgba(143, 212, 107, 0.15); color: var(--al-green); }
.al-card--orange .al-card-icon { background: rgba(255, 122, 47, 0.15); color: var(--al-orange-200); }
.al-card--purple .al-card-icon { background: rgba(85, 214, 194, 0.12); color: var(--al-cyan); }

/* ===================================================================
   7. PANELS
   =================================================================== */
.al-panel {
  padding: var(--al-space-6);
  border: 1px solid var(--al-border);
  border-radius: var(--al-radius-lg);
  background: rgba(8, 18, 17, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--al-shadow-md);
}

.al-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--al-space-4);
  margin-bottom: var(--al-space-5);
  flex-wrap: wrap;
}
.al-panel-header h2 { margin: 0; }

.al-panel--strong {
  background: var(--al-bg-elevated);
  backdrop-filter: blur(12px);
}

.al-panel--gradient {
  background: linear-gradient(135deg, rgba(255, 122, 47, 0.08), rgba(85, 214, 194, 0.04));
  backdrop-filter: blur(16px);
}

/* ===================================================================
   8. TABLES
   =================================================================== */
.al-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--al-border);
  border-radius: var(--al-radius-lg);
}

.al-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.al-table th {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--al-cyan);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: left;
  border-bottom: 1px solid var(--al-border);
}

.al-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--al-border);
  color: #eaf1ee;
}

.al-table tr:last-child td { border-bottom: none; }
.al-table tr:hover td { background: rgba(255, 255, 255, 0.03); }

/* ===================================================================
   9. BADGES / TAGS
   =================================================================== */
.al-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: var(--al-radius-full);
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--al-border);
  color: var(--al-text-secondary);
}

.al-badge--orange {
  background: rgba(255, 122, 47, 0.12);
  border-color: rgba(255, 122, 47, 0.3);
  color: var(--al-orange-200);
}

.al-badge--green {
  background: rgba(143, 212, 107, 0.12);
  border-color: rgba(143, 212, 107, 0.3);
  color: var(--al-green);
}

.al-badge--cyan {
  background: rgba(85, 214, 194, 0.12);
  border-color: rgba(85, 214, 194, 0.3);
  color: var(--al-cyan);
}

.al-badge--danger {
  background: rgba(255, 109, 109, 0.12);
  border-color: rgba(255, 109, 109, 0.3);
  color: var(--al-danger);
}

.al-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: var(--al-radius-full);
  background: var(--al-cyan);
  color: #10211f;
  font-weight: 700;
  font-size: 12px;
}
.al-card.complete .al-pill,
.al-pill--green { background: var(--al-green); }

/* ===================================================================
   10. LAYOUT
   =================================================================== */

/* App Layout */
.al-app {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

/* Sidebar */
.al-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: var(--al-space-5);
  padding: var(--al-space-6) var(--al-space-4);
  border-right: 1px solid var(--al-border);
  background: linear-gradient(180deg, rgba(6, 15, 14, 0.98), rgba(8, 18, 17, 0.94));
  overflow-y: auto;
}

.al-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--al-space-3);
  min-width: max-content;
}

.al-logo {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
}

.al-nav {
  display: flex;
  flex-direction: column;
  gap: var(--al-space-2);
}

.al-nav-section {
  margin: var(--al-space-3) var(--al-space-2) var(--al-space-1);
  color: var(--al-text-secondary);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.al-nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--al-space-3);
  min-height: 40px;
  padding: 0 var(--al-space-3);
  border-radius: var(--al-radius-md);
  color: #dbe8e4;
  font-weight: 600;
  font-size: 14px;
  transition: background var(--al-transition-fast), color var(--al-transition-fast);
}
.al-nav-link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }

.al-nav-link--active {
  background: rgba(255, 122, 47, 0.1);
  color: var(--al-orange-200);
}
.al-nav-link--active::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  border-radius: 3px;
  background: var(--al-orange-500);
}

.al-nav-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: var(--al-radius-sm);
  background: rgba(255, 122, 47, 0.12);
  color: var(--al-orange-200);
  font-weight: 900;
  font-size: 12px;
}

.al-sidebar-footer { margin-top: auto; display: grid; gap: var(--al-space-2); }

/* Main */
.al-main { min-width: 0; padding: 28px clamp(18px, 4vw, 44px) 44px; }

.al-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--al-space-5);
  margin-bottom: var(--al-space-6);
  flex-wrap: wrap;
}

.al-page-title h1 { margin: 0; font-size: clamp(24px, 3vw, 32px); }
.al-page-title p { margin: var(--al-space-1) 0 0; color: var(--al-text-secondary); }

.al-top-actions {
  display: flex;
  align-items: center;
  gap: var(--al-space-3);
  flex-wrap: wrap;
}

.al-userbox {
  display: inline-flex;
  align-items: center;
  gap: var(--al-space-3);
  min-height: 44px;
  padding: 0 var(--al-space-3);
  border: 1px solid var(--al-border);
  border-radius: var(--al-radius-md);
  transition: border-color var(--al-transition-fast);
}
.al-userbox:hover { border-color: rgba(255, 255, 255, 0.25); }

.al-userbox small { display: block; color: var(--al-text-secondary); font-size: 12px; line-height: 1.2; }

/* Grid */
.al-grid { display: grid; gap: var(--al-space-5); }
.al-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.al-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.al-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Controls */
.al-control-row {
  display: flex;
  align-items: center;
  gap: var(--al-space-3);
  flex-wrap: wrap;
}

.al-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--al-space-4);
  flex-wrap: wrap;
}

/* ===================================================================
   11. AVATAR / BALANCE PILL
   =================================================================== */
.al-avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: var(--al-radius-md);
  background: linear-gradient(135deg, var(--al-orange-500), var(--al-orange-200));
  color: #1b0f09;
  font-weight: 800;
  font-size: 14px;
}

.al-balance-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--al-border);
  border-radius: var(--al-radius-md);
  background: rgba(255, 255, 255, 0.06);
  color: #dff7f1;
  font-size: 14px;
  font-weight: 700;
  gap: var(--al-space-2);
}

/* ===================================================================
   12. AI CHAT / CONSOLE
   =================================================================== */
.al-chat-wrap {
  display: grid;
  gap: var(--al-space-4);
}

.al-chat-messages {
  display: grid;
  gap: var(--al-space-3);
  min-height: 200px;
  max-height: 440px;
  overflow-y: auto;
  padding: var(--al-space-5);
  border: 1px solid var(--al-border);
  border-radius: var(--al-radius-lg);
  background:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px),
    rgba(0,0,0,0.25);
  background-size: 32px 32px;
}

.al-chat-message {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: var(--al-space-3);
  align-items: start;
  max-width: 82%;
}

.al-chat-message--user {
  justify-self: end;
  grid-template-columns: minmax(0, 1fr) 34px;
}

.al-chat-message__avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--al-radius-md);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
  background: linear-gradient(135deg, var(--al-orange-500), var(--al-orange-200));
  color: #1b0f09;
}

.al-chat-message--user .al-chat-message__avatar { order: 1; }

.al-chat-message__bubble {
  padding: var(--al-space-3) var(--al-space-4);
  border: 1px solid var(--al-border);
  border-radius: var(--al-radius-lg);
  background: rgba(255, 255, 255, 0.075);
  color: #e8efed;
  line-height: 1.6;
}

.al-chat-message--user .al-chat-message__bubble {
  background: rgba(255, 122, 47, 0.14);
  border-color: rgba(255, 122, 47, 0.25);
}

/* ===================================================================
   13. LISTS
   =================================================================== */
.al-list { display: grid; gap: var(--al-space-3); }

.al-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--al-space-3);
  padding: var(--al-space-3) 0;
  border-bottom: 1px solid var(--al-border);
}
.al-list-item:last-child { border-bottom: none; }
.al-list-item strong { display: block; }
.al-list-item small { display: block; margin-top: 2px; color: var(--al-text-secondary); font-size: 12px; }

.al-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--al-space-4);
  padding: var(--al-space-4);
  border: 1px solid var(--al-border);
  border-radius: var(--al-radius-md);
  background: rgba(255, 255, 255, 0.04);
  transition: border-color var(--al-transition-fast);
}
.al-list-row:hover { border-color: rgba(255, 255, 255, 0.2); }
.al-list-row h3, .al-list-row p { margin: 4px 0; }

/* ===================================================================
   14. HOME / LANDING PAGE
   =================================================================== */
.al-page--home { min-height: 100vh; }

.al-topbar--home {
  position: sticky;
  top: 0;
  z-index: var(--al-z-sticky);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--al-space-4);
  padding: var(--al-space-4) clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--al-border);
  background: var(--al-bg-glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.al-nav--horizontal {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.8vw, 22px);
  color: var(--al-text-secondary);
  font-size: 13px;
}
.al-nav--horizontal a:hover { color: var(--al-text-primary); }

.al-hero {
  position: relative;
  min-height: 640px;
  display: grid;
  align-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--al-border);
  background-image: linear-gradient(90deg, rgba(7,16,15,0.94), rgba(7,16,15,0.5)), url("assets/alice-portal-hero.png");
  background-size: cover;
  background-position: center;
}

.al-hero__content {
  width: min(800px, calc(100% - 36px));
  margin: 0 auto;
  padding: 100px 0 140px;
}

.al-hero__content h1 {
  font-size: clamp(38px, 5.5vw, 70px);
  line-height: 1.04;
  max-width: 720px;
  margin-bottom: var(--al-space-5);
}

.al-hero__copy {
  max-width: 600px;
  color: #dce7e4;
  font-size: 18px;
  line-height: 1.7;
  margin: 0;
}

.al-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--al-space-3);
  margin-top: var(--al-space-8);
}

.al-hero__stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--al-border);
  border-radius: var(--al-radius-lg);
  background: var(--al-bg-glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  overflow: hidden;
}

.al-hero__stat {
  padding: var(--al-space-5);
  border-right: 1px solid var(--al-border);
}
.al-hero__stat:last-child { border-right: none; }
.al-hero__stat span { display: block; color: var(--al-text-secondary); font-size: 13px; }
.al-hero__stat strong { display: block; margin-top: var(--al-space-1); font-family: var(--al-font-display); font-size: 22px; }

.al-section {
  padding: clamp(50px, 6vw, 80px) clamp(18px, 5vw, 72px);
  border-top: 1px solid var(--al-border);
}

.al-section--compact { padding-top: 48px; padding-bottom: 48px; }

.al-section__head {
  max-width: 800px;
  margin-bottom: var(--al-space-6);
}
.al-section__head h2 { margin: 0; font-size: clamp(28px, 3.6vw, 44px); }
.al-section__head p { color: var(--al-text-secondary); line-height: 1.65; }

.al-feature-grid,
.al-step-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--al-space-5);
}

.al-feature-card {
  padding: var(--al-space-6);
  border: 1px solid var(--al-border);
  border-radius: var(--al-radius-lg);
  background: rgba(8, 18, 17, 0.68);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--al-shadow-sm);
}

.al-feature-card span {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--al-radius-md);
  background: rgba(255, 122, 47, 0.12);
  color: var(--al-orange-200);
  font-weight: 900;
}

.al-feature-card h3 { margin: var(--al-space-4) 0 var(--al-space-2); font-size: 20px; }
.al-feature-card p { color: var(--al-text-secondary); line-height: 1.65; margin: 0; }

.al-step-card { min-height: 200px; background: linear-gradient(180deg, rgba(255, 177, 93, 0.07), rgba(255, 255, 255, 0.03)); }
.al-step-card strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 30px;
  border: 1px solid rgba(85, 214, 194, 0.4);
  border-radius: var(--al-radius-md);
  color: var(--al-cyan);
  font-family: var(--al-font-display);
  font-weight: 700;
}

.al-database-card {
  background: var(--al-bg-elevated);
}
.al-database-card .al-btn--link { width: fit-content; }

/* ===================================================================
   15. LOGIN PAGE
   =================================================================== */
.al-login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.al-login-page > div {
  width: min(900px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: var(--al-space-6);
  align-items: center;
}

.al-login-brand img { width: 60px; height: 60px; border-radius: var(--al-radius-lg); }
.al-login-brand h1 { font-size: clamp(32px, 4vw, 52px); margin: var(--al-space-3) 0; }

.al-login-card { padding: var(--al-space-8); }
.al-login-card form { display: grid; gap: var(--al-space-4); }

.al-auth-switch {
  display: grid;
  gap: var(--al-space-3);
  margin-top: var(--al-space-4);
  text-align: center;
}
.al-auth-switch button {
  border: 0;
  background: transparent;
  color: var(--al-orange-200);
  font-weight: 800;
  cursor: pointer;
}

/* ===================================================================
   16. ADMIN PANEL
   =================================================================== */
.al-admin-shell {
  min-height: 100vh;
  padding: clamp(24px, 5vw, 72px);
}

.al-admin-login {
  min-height: calc(100vh - 144px);
  display: grid;
  place-items: center;
}

.al-admin-login-card {
  width: min(480px, 100%);
  display: grid;
  gap: var(--al-space-4);
}

.al-admin-logo {
  width: 68px;
  height: 68px;
  border-radius: var(--al-radius-lg);
  object-fit: contain;
  background: var(--al-orange-500);
  box-shadow: var(--al-shadow-glow);
}
.al-admin-logo--sm { width: 48px; height: 48px; }

.al-admin-header {
  display: flex;
  justify-content: space-between;
  gap: var(--al-space-5);
  align-items: end;
  margin-bottom: var(--al-space-6);
  flex-wrap: wrap;
}
.al-admin-header h1 { font-size: clamp(38px, 5vw, 64px); }

.al-admin-dashboard { max-width: 1400px; margin: 0 auto; }

.al-stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--al-space-3);
  margin-bottom: var(--al-space-5);
}

.al-stat {
  padding: var(--al-space-5);
  border: 1px solid var(--al-border);
  border-radius: var(--al-radius-lg);
  background: rgba(8, 18, 17, 0.68);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.al-stat span {
  display: block;
  font-size: 13px;
  color: var(--al-text-secondary);
  margin-bottom: var(--al-space-1);
}
.al-stat strong {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: var(--al-text-primary);
}

.al-actions {
  display: flex;
  gap: var(--al-space-2);
  align-items: center;
  flex-wrap: wrap;
}

.al-form { display: grid; gap: var(--al-space-3); }

.al-admin-item {
  padding: var(--al-space-5);
  border: 1px solid var(--al-border);
  border-radius: var(--al-radius-lg);
  background: rgba(8, 18, 17, 0.72);
  backdrop-filter: blur(12px);
}

.al-admin-item--cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.5fr);
  gap: var(--al-space-5);
}

.al-admin-item--row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--al-space-5);
}

.al-admin-actions {
  display: grid;
  gap: var(--al-space-2);
  align-content: start;
}

.al-deposit-address {
  padding: var(--al-space-4);
  border: 1px solid rgba(255, 122, 47, 0.3);
  border-radius: var(--al-radius-md);
  background: rgba(255, 122, 47, 0.06);
  word-break: break-all;
  color: #ffe3c5;
  font-size: 13px;
  font-family: monospace;
}

.al-code-block {
  margin: 0;
  min-height: 180px;
  padding: var(--al-space-4);
  border: 1px solid rgba(85, 214, 194, 0.22);
  border-radius: var(--al-radius-md);
  background: rgba(3, 9, 12, 0.76);
  color: #dffaf4;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font: 13px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.al-client-tabs {
  display: flex;
  gap: var(--al-space-2);
  margin-bottom: var(--al-space-4);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.al-client-tab {
  flex: 0 0 auto;
  padding: 8px 14px;
  border: 1px solid var(--al-border);
  border-radius: var(--al-radius-md);
  background: rgba(255, 255, 255, 0.03);
  color: var(--al-text-secondary);
  font-weight: 700;
  cursor: pointer;
}

.al-client-tab--active {
  border-color: rgba(85, 214, 194, 0.6);
  background: rgba(85, 214, 194, 0.12);
  color: var(--al-cyan);
}

.al-quick-panel h2 {
  margin: var(--al-space-1) 0 var(--al-space-2);
  font-size: 20px;
  overflow-wrap: anywhere;
}

.al-gateway-panel {
  max-width: 1280px;
  margin: 0 auto var(--al-space-5);
}

.al-gateway-panel h3 {
  margin: 0 0 var(--al-space-3);
  font-size: 18px;
}

/* ── Admin Tab Navigation ── */
.al-admin-tabs {
  display: flex;
  gap: 0;
  margin-bottom: var(--al-space-6);
  border-bottom: 1px solid var(--al-border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.al-admin-tab {
  padding: var(--al-space-3) var(--al-space-5);
  font-size: 14px;
  font-weight: 600;
  color: var(--al-text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.al-admin-tab:hover { color: var(--al-text-primary); }
.al-admin-tab--active {
  color: var(--al-orange-500);
  border-bottom-color: var(--al-orange-500);
}

/* ── Admin Section ── */
.al-admin-section { animation: al-fade-in 0.2s ease-out; }

/* ── Banned user row ── */
.al-row--banned { opacity: 0.55; }
.al-row--banned td { text-decoration: line-through; text-decoration-color: var(--al-text-secondary); }

/* ── Badge variants ── */
.al-badge--positive { background: rgba(143, 212, 107, 0.15); color: #8fd46b; }
.al-badge--danger { background: rgba(255, 82, 82, 0.15); color: #ff5252; }
.al-badge--warning { background: rgba(255, 193, 7, 0.15); color: #ffc107; }

/* ── Dimmed admin item ── */
.al-admin-item--dim { opacity: 0.6; }

/* ── Stats grid 4-col ── */
.al-stats-grid--4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--al-space-3);
  margin-bottom: var(--al-space-5);
}

/* ── Button group ── */
.al-btn-group {
  display: flex;
  gap: 0;
  border: 1px solid var(--al-border);
  border-radius: var(--al-radius-md);
  overflow: hidden;
}
.al-btn-group .al-btn,
.al-btn-group .al-btn--sm {
  border: none;
  border-radius: 0;
  background: none;
  color: var(--al-text-secondary);
}
.al-btn-group .al-btn--active {
  background: var(--al-orange-500);
  color: #fff;
}

/* ── Button xs ── */
.al-btn--xs {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--al-border);
  border-radius: var(--al-radius-md);
  background: none;
  color: var(--al-text-secondary);
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.al-btn--xs:hover { color: var(--al-text-primary); border-color: var(--al-orange-500); }
.al-btn--xs.al-btn--active {
  background: var(--al-orange-500);
  color: #fff;
  border-color: var(--al-orange-500);
}

/* ── Modal ── */
.al-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 1000;
  padding: var(--al-space-4);
  animation: al-fade-in 0.15s ease-out;
}
.al-modal {
  width: min(800px, 100%);
  max-height: 80vh;
  display: grid;
  grid-template-rows: auto auto 1fr;
  background: var(--al-bg-elevated);
  border: 1px solid var(--al-border);
  border-radius: var(--al-radius-xl);
  overflow: hidden;
  animation: al-slide-up 0.2s ease-out;
}
.al-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--al-space-5);
  border-bottom: 1px solid var(--al-border);
}
.al-modal-header h2 { margin: 0; font-size: 20px; }
.al-modal-header .al-btn--ghost { font-size: 28px; padding: 0 8px; line-height: 1; }
.al-modal-body {
  overflow-y: auto;
  padding: var(--al-space-5);
}
.al-modal-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--al-border);
  margin-bottom: var(--al-space-4);
  overflow-x: auto;
}
.al-modal-tab {
  padding: var(--al-space-2) var(--al-space-4);
  font-size: 13px;
  font-weight: 600;
  color: var(--al-text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.al-modal-tab:hover { color: var(--al-text-primary); }
.al-modal-tab--active {
  color: var(--al-orange-500);
  border-bottom-color: var(--al-orange-500);
}
.al-modal-content { min-height: 100px; }

.al-model-select-list {
  display: grid;
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--al-border);
  border-radius: var(--al-radius-md);
  background: rgba(0, 0, 0, 0.16);
}
.al-model-select-row {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: var(--al-space-3);
  align-items: center;
  padding: var(--al-space-3) var(--al-space-4);
  border-bottom: 1px solid var(--al-border);
  cursor: pointer;
}
.al-model-select-row:last-child { border-bottom: 0; }
.al-model-select-row:hover { background: rgba(255, 255, 255, 0.04); }
.al-model-select-row strong,
.al-model-select-row small {
  display: block;
}
.al-model-select-row small {
  margin-top: 3px;
  color: var(--al-text-secondary);
}

/* ── Detail grid ── */
.al-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--al-space-3);
}
.al-detail-grid div {
  padding: var(--al-space-2) 0;
}
.al-detail-grid strong {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--al-text-secondary);
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}
.al-detail-grid p { margin: 0; }

/* ── Ledger list ── */
.al-ledger-list {
  display: grid;
  gap: 1px;
  background: var(--al-border);
  border: 1px solid var(--al-border);
  border-radius: var(--al-radius-md);
  overflow: hidden;
}
.al-ledger-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: var(--al-space-3);
  align-items: center;
  padding: var(--al-space-3) var(--al-space-4);
  background: var(--al-bg);
  font-size: 13px;
}
.al-ledger-row small { color: var(--al-text-secondary); font-size: 11px; }

/* ── Text colors ── */
.al-text--danger { color: #ff5252; }

/* ===================================================================
   17. UTILITY / MISC
   =================================================================== */
.al-question-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--al-space-5);
}

.al-quest-card {
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: var(--al-space-4);
  padding: var(--al-space-5);
  border: 1px solid var(--al-border);
  border-radius: var(--al-radius-lg);
  background: var(--al-bg-elevated);
}

.al-quest-card.complete { border-color: rgba(143, 212, 107, 0.3); }

.al-quest-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--al-space-2);
}

.al-field--proof {
  display: grid;
  gap: var(--al-space-1);
  color: var(--al-text-secondary);
  font-size: 13px;
  font-weight: 700;
}

.al-inline-adjust {
  display: flex;
  gap: var(--al-space-2);
  align-items: center;
  flex-wrap: wrap;
}

.al-qty-table { width: 100%; min-width: 600px; border-collapse: collapse; }
.al-qty-table th,
.al-qty-table td { padding: 12px; border-bottom: 1px solid var(--al-border); text-align: left; }
.al-qty-table th { color: var(--al-cyan); font-size: 12px; text-transform: uppercase; }

/* ===================================================================
   18. ANIMATIONS
   =================================================================== */
@keyframes al-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes al-slide-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===================================================================
   19. RESPONSIVE
   =================================================================== */

/* Tablet landscape */
@media (max-width: 1100px) {
  .al-grid--4,
  .al-feature-grid,
  .al-step-grid,
  .al-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .al-question-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .al-hero__stats { grid-template-columns: repeat(2, 1fr); }
  .al-hero__stat:nth-child(2) { border-right: none; }
  .al-hero__stat:nth-child(3),
  .al-hero__stat:nth-child(4) { border-top: 1px solid var(--al-border); }
}

/* Tablet portrait */
@media (max-width: 860px) {
  .al-app { grid-template-columns: 1fr; }
  .al-sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    padding: var(--al-space-3) var(--al-space-4);
    gap: var(--al-space-2);
    border-right: none;
    border-bottom: 1px solid var(--al-border);
  }
  .al-nav { flex-direction: row; flex-wrap: wrap; gap: var(--al-space-1); }
  .al-nav-section { display: none; }
  .al-sidebar-footer { margin-top: 0; flex-direction: row; margin-left: auto; }
  .al-topbar,
  .al-login-page > div,
  .al-admin-item--cols,
  .al-admin-item--row {
    flex-direction: column;
    align-items: stretch;
  }
  .al-login-page > div { grid-template-columns: 1fr; }
  .al-grid--2 { grid-template-columns: 1fr; }
  .al-grid--3 { grid-template-columns: 1fr; }
  .al-stats-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Mobile */
@media (max-width: 640px) {
  /* Grids */
  .al-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .al-grid--4,
  .al-feature-grid,
  .al-step-grid,
  .al-question-grid {
    grid-template-columns: 1fr;
  }

  /* Top actions */
  .al-top-actions { width: 100%; justify-content: stretch; }
  .al-top-actions .al-btn,
  .al-top-actions .al-btn--ghost { flex: 1; text-align: center; }

  /* Hero */
  .al-hero {
    min-height: 360px;
  }
  .al-hero__content {
    padding: 40px 0 50px;
  }
  .al-hero__content h1 { font-size: 32px; }
  .al-hero__actions {
    flex-direction: column;
  }
  .al-hero__actions .al-btn,
  .al-hero__actions .al-btn--secondary { width: 100%; text-align: center; }
  .al-hero__stats { grid-template-columns: 1fr; }
  .al-hero__stat { border-right: none; border-bottom: 1px solid var(--al-border); }
  .al-hero__stat:last-child { border-bottom: none; }

  /* Sections */
  .al-section {
    padding-top: 36px;
    padding-bottom: 36px;
  }

  /* Feature cards */
  .al-feature-card {
    padding: 16px;
  }
  .al-feature-card h3 {
    font-size: 18px;
  }

  /* Sidebar — hide brand text, keep logo */
  .al-brand span,
  .al-brand small {
    display: none;
  }
  .al-sidebar {
    gap: var(--al-space-3);
    padding: var(--al-space-3);
  }
  .al-nav-link {
    min-height: 36px;
    padding: 0 var(--al-space-2);
    font-size: 13px;
  }
  .al-nav-section {
    font-size: 10px;
    margin: var(--al-space-2) var(--al-space-1) 0;
  }

  /* Login */
  .al-login-card {
    padding: 20px;
  }

  /* Admin header */
  .al-admin-header h1 {
    font-size: clamp(28px, 8vw, 42px);
  }

  /* Admin stats */
  .al-stat {
    padding: 14px;
  }
  .al-stat strong {
    font-size: 22px;
  }

  /* Admin review cards */
  .al-admin-item {
    padding: 16px;
  }
  .al-admin-item--cols {
    grid-template-columns: 1fr;
  }
  .al-admin-item--cols .al-actions {
    display: grid;
    gap: var(--al-space-2);
  }
  .al-admin-item--cols .al-actions input {
    width: 100%;
  }
  .al-admin-item--cols .al-actions .al-btn,
  .al-admin-item--cols .al-actions .al-btn--secondary {
    width: 100%;
    justify-content: center;
  }

  /* Table */
  .al-table th,
  .al-table td {
    padding: 10px 10px;
  }

  /* User adjust row */
  .al-inline-adjust {
    flex-direction: column;
    align-items: stretch;
  }
  .al-inline-adjust select,
  .al-inline-adjust input,
  .al-inline-adjust .al-btn--secondary {
    width: 100%;
  }

  /* Chat */
  .al-chat-message { max-width: 100%; }
  .al-chat-messages { padding: var(--al-space-3); }

  /* Topbar — home page */
  .al-topbar--home { flex-direction: column; align-items: flex-start; }

  /* Home nav — compact */
  .al-nav--horizontal {
    gap: 8px;
    font-size: 12px;
  }
}

/* ===================================================================
   20. LANGUAGE SWITCHER
   =================================================================== */
.alice-lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: var(--al-space-2);
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--al-border);
  border-radius: var(--al-radius-md);
  background: rgba(0, 0, 0, 0.28);
  color: var(--al-text-primary);
  font-weight: 700;
  font-size: 13px;
  font-family: var(--al-font-sans);
  white-space: nowrap;
}
.alice-lang-switcher select {
  min-height: 28px;
  border-radius: var(--al-radius-sm);
  border: 1px solid var(--al-border);
  background: rgba(0, 0, 0, 0.4);
  color: var(--al-text-primary);
  padding: 0 6px;
  font-size: 13px;
  font-family: var(--al-font-sans);
  outline: none;
  cursor: pointer;
}

/* ===================================================================
   (end)
   =================================================================== */
