/*
  ╔══════════════════════════════════════════════════════════════╗
  ║  twabot.css — TwaBot Design System v1.0                     ║
  ║  Common stylesheet for all TwaBot app pages                 ║
  ║  twabot.com                                                  ║
  ╚══════════════════════════════════════════════════════════════╝
*/

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@300;400;500;600;700;800&family=DM+Mono:wght@400;500&display=swap');

/* ═══════════════════════════════════════════
   1. CSS VARIABLES — Light Mode (default)
═══════════════════════════════════════════ */
:root {
  /* Brand */
  --brand:          #25c060;
  --brand-dark:     #1a9e4d;
  --brand-light:    #e8f9ef;
  --brand-mid:      #c2f0d6;
  --brand-shadow:   rgba(37,192,96,.28);

  /* Backgrounds */
  --bg:             #f5f7f5;
  --bg-1:           #ffffff;
  --bg-2:           #ffffff;
  --bg-3:           #eef2ee;
  --bg-elevated:    #ffffff;
  --bg-overlay:     rgba(26,33,24,.55);

  /* Text */
  --text:           #1a2118;
  --text-2:         #3d5040;
  --text-3:         #7a917e;

  /* Borders */
  --border:         #dce8de;
  --border-focus:   #25c060;

  /* Semantic colours */
  --success:        #16a34a;
  --success-soft:   #dcfce7;
  --success-border: #86efac;
  --error:          #dc2626;
  --error-soft:     #fee2e2;
  --error-border:   #fca5a5;
  --warning:        #d97706;
  --warning-soft:   #fef3c7;
  --warning-border: #fcd34d;
  --info:           #2563eb;
  --info-soft:      #dbeafe;
  --info-border:    #93c5fd;

  /* Shadows */
  --shadow-xs:   0 1px 3px rgba(30,60,30,.07);
  --shadow-sm:   0 2px 8px  rgba(30,60,30,.09);
  --shadow-md:   0 4px 20px rgba(30,60,30,.11);
  --shadow-lg:   0 12px 48px rgba(30,60,30,.13);
  --shadow-xl:   0 24px 72px rgba(30,60,30,.16);

  /* Radii */
  --radius-xs:  5px;
  --radius-sm:  8px;
  --radius:     12px;
  --radius-lg:  18px;
  --radius-xl:  24px;
  --radius-full: 9999px;

  /* Typography */
  --font:         'Figtree', sans-serif;
  --font-display: 'Figtree', sans-serif;
  --font-mono:    'DM Mono', monospace;

  /* Transitions */
  --transition: all .18s ease;

  /* Z-index layers */
  --z-nav:    100;
  --z-modal:  300;
  --z-toast:  400;
}

/* ═══════════════════════════════════════════
   2. DARK MODE
═══════════════════════════════════════════ */
[data-theme="dark"] {
  --brand:          #2dd870;
  --brand-dark:     #25c060;
  --brand-light:    rgba(37,192,96,.12);
  --brand-mid:      rgba(37,192,96,.25);

  --bg:             #0f1410;
  --bg-1:           #1a221a;
  --bg-2:           #161d16;
  --bg-3:           #1c251c;
  --bg-elevated:    #1e281e;
  --bg-overlay:     rgba(0,0,0,.7);

  --text:           #e8f0e8;
  --text-2:         #a3b8a5;
  --text-3:         #637864;

  --border:         #2a3b2a;
  --border-focus:   #2dd870;

  --success:        #4ade80;
  --success-soft:   rgba(74,222,128,.12);
  --success-border: rgba(74,222,128,.3);
  --error:          #f87171;
  --error-soft:     rgba(248,113,113,.12);
  --error-border:   rgba(248,113,113,.3);
  --warning:        #fbbf24;
  --warning-soft:   rgba(251,191,36,.12);
  --warning-border: rgba(251,191,36,.3);
  --info:           #60a5fa;
  --info-soft:      rgba(96,165,250,.12);
  --info-border:    rgba(96,165,250,.3);

  --shadow-xs:  0 1px 3px rgba(0,0,0,.25);
  --shadow-sm:  0 2px 8px  rgba(0,0,0,.3);
  --shadow-md:  0 4px 20px rgba(0,0,0,.35);
  --shadow-lg:  0 12px 48px rgba(0,0,0,.4);
  --shadow-xl:  0 24px 72px rgba(0,0,0,.45);
}

/* ═══════════════════════════════════════════
   3. RESET & BASE
═══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background .25s, color .25s;
}
a { color: var(--brand-dark); text-decoration: none; transition: color .18s; }
a:hover { color: var(--brand); }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--font); }
input, select, textarea { font-family: var(--font); }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--brand-mid); border-radius: var(--radius-full); }

/* ═══════════════════════════════════════════
   4. TYPOGRAPHY
═══════════════════════════════════════════ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--text);
}
h1 { font-size: clamp(1.9rem, 3.5vw, 2.8rem); }
h2 { font-size: clamp(1.5rem, 2.8vw, 2.2rem); }
h3 { font-size: 1.15rem; font-weight: 700; }
h4 { font-size: 0.95rem; font-weight: 700; letter-spacing: 0; }
p  { color: var(--text-2); line-height: 1.75; }
small { font-size: 0.8rem; color: var(--text-3); }
.mono { font-family: var(--font-mono); }
.text-brand { color: var(--brand-dark); }
.text-muted { color: var(--text-3); }
.text-center { text-align: center; }

/* ═══════════════════════════════════════════
   5. LAYOUT UTILITIES
═══════════════════════════════════════════ */
.container  { max-width: 1200px; margin: 0 auto; padding: 0 6%; }
.container-sm { max-width: 720px;  margin: 0 auto; padding: 0 5%; }
.container-xs { max-width: 460px;  margin: 0 auto; padding: 0 5%; }

.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col    { display: flex; flex-direction: column; }
.gap-4  { gap: 4px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }

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

.w-full   { width: 100%; }
.h-full   { height: 100%; }
.min-h-screen { min-height: 100vh; }

.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

/* ═══════════════════════════════════════════
   6. BUTTONS
═══════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: var(--font); font-weight: 600; font-size: 0.875rem; line-height: 1;
  border-radius: var(--radius-sm); border: 1.5px solid transparent;
  padding: 10px 20px; cursor: pointer; transition: var(--transition);
  white-space: nowrap; text-decoration: none; position: relative; overflow: hidden;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; pointer-events: none; }
.btn:active:not(:disabled) { transform: scale(0.98); }

/* Sizes */
.btn-sm  { padding: 7px 14px; font-size: 0.8rem; border-radius: var(--radius-xs); }
.btn-lg  { padding: 13px 28px; font-size: 1rem; border-radius: 10px; }
.btn-xl  { padding: 15px 36px; font-size: 1.05rem; border-radius: 12px; }
.btn-full { width: 100%; }
.btn-icon { padding: 9px; aspect-ratio: 1; }

/* Variants */
.btn-primary {
  background: var(--brand); color: #fff;
  border-color: var(--brand);
  box-shadow: 0 3px 12px var(--brand-shadow);
}
.btn-primary:hover:not(:disabled) {
  background: var(--brand-dark); border-color: var(--brand-dark);
  box-shadow: 0 5px 20px var(--brand-shadow);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent; color: var(--text);
  border-color: var(--border);
}
.btn-outline:hover:not(:disabled) {
  border-color: var(--brand); color: var(--brand-dark);
  background: var(--brand-light);
}

.btn-ghost {
  background: transparent; color: var(--text-2);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-3); color: var(--text);
}

.btn-danger {
  background: var(--error); color: #fff;
  border-color: var(--error);
}
.btn-danger:hover:not(:disabled) {
  background: #b91c1c; border-color: #b91c1c;
  transform: translateY(-1px);
}

.btn-dark {
  background: var(--text); color: var(--bg-2);
  border-color: var(--text);
}
.btn-dark:hover:not(:disabled) {
  background: var(--text-2); border-color: var(--text-2);
}

/* Loading state */
.btn.loading { pointer-events: none; }
.btn.loading .btn-text-label { opacity: 0; }
.btn.loading::after {
  content: ''; position: absolute;
  width: 16px; height: 16px;
  border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
.btn-outline.loading::after,
.btn-ghost.loading::after {
  border-color: var(--border);
  border-top-color: var(--brand);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════
   7. FORM ELEMENTS
═══════════════════════════════════════════ */
.form-group  { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-group:last-child { margin-bottom: 0; }
.form-label  { font-size: 0.82rem; font-weight: 600; color: var(--text-2); }
.form-label .required { color: var(--error); margin-left: 2px; }
.form-hint   { font-size: 0.75rem; color: var(--text-3); margin-top: 4px; line-height: 1.5; }
.form-error  { font-size: 0.75rem; color: var(--error); margin-top: 4px; display: flex; align-items: center; gap: 4px; }

.form-input {
  width: 100%; padding: 10px 14px;
  background: var(--bg-2); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: 0.875rem; font-family: var(--font);
  transition: border-color .18s, box-shadow .18s, background .18s;
  outline: none; line-height: 1.5;
}
.form-input::placeholder { color: var(--text-3); }
.form-input:hover  { border-color: var(--brand-mid); }
.form-input:focus  {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37,192,96,.15);
  background: var(--bg-elevated);
}
.form-input:disabled { opacity: 0.55; cursor: not-allowed; background: var(--bg-3); }
.form-input.error { border-color: var(--error); }
.form-input.error:focus { box-shadow: 0 0 0 3px rgba(220,38,38,.12); }

select.form-input { cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%237a917e' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
  padding-right: 36px;
}
textarea.form-input { resize: vertical; min-height: 100px; line-height: 1.65; }

/* Input with icon */
.input-icon-wrap { position: relative; }
.input-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 0.9rem; pointer-events: none; line-height: 1;
}
.input-icon-wrap .form-input { padding-left: 38px; }
.input-icon-right { left: auto; right: 12px; cursor: pointer; pointer-events: all; }
.input-icon-wrap .form-input.has-right-icon { padding-right: 38px; }

/* Checkbox & Radio */
.checkbox-wrap, .radio-wrap {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
}
.checkbox-wrap input[type="checkbox"],
.radio-wrap input[type="radio"] {
  width: 17px; height: 17px; accent-color: var(--brand); cursor: pointer; flex-shrink: 0; margin-top: 1px;
}
.checkbox-label, .radio-label {
  font-size: 0.85rem; color: var(--text-2); line-height: 1.55; user-select: none;
}

/* Form section divider */
.form-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; }
.form-divider::before, .form-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.form-divider span { font-size: 0.75rem; color: var(--text-3); white-space: nowrap; font-weight: 500; }

/* ═══════════════════════════════════════════
   8. ALERTS / NOTIFICATIONS
═══════════════════════════════════════════ */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 15px; border-radius: var(--radius-sm);
  font-size: 0.855rem; line-height: 1.55; font-weight: 500;
  border: 1.5px solid; margin-bottom: 14px;
  animation: slideDown .22s ease;
}
.alert.hidden { display: none; }
.hidden { display: none !important; }
.alert-icon { font-size: 1rem; line-height: 1; flex-shrink: 0; margin-top: 1px; }
.alert-text { flex: 1; }
.alert-close { background: none; border: none; padding: 0; cursor: pointer; font-size: 1rem; opacity: .6; transition: opacity .18s; margin-left: auto; color: inherit; }
.alert-close:hover { opacity: 1; }

.alert-success { background: var(--success-soft); border-color: var(--success-border); color: var(--success); }
.alert-error   { background: var(--error-soft);   border-color: var(--error-border);   color: var(--error); }
.alert-warning { background: var(--warning-soft); border-color: var(--warning-border); color: var(--warning); }
.alert-info    { background: var(--info-soft);    border-color: var(--info-border);    color: var(--info); }

@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ═══════════════════════════════════════════
   9. TOAST NOTIFICATIONS
═══════════════════════════════════════════ */
.toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: var(--z-toast);
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius);
  font-size: 0.855rem; font-weight: 500; line-height: 1.45;
  background: var(--bg-elevated); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); pointer-events: all;
  min-width: 260px; max-width: 380px;
  animation: toastIn .28s cubic-bezier(.34,1.56,.64,1);
}
.toast.out { animation: toastOut .22s ease forwards; }
.toast-success { border-left: 3px solid var(--brand); }
.toast-error   { border-left: 3px solid var(--error); }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-info    { border-left: 3px solid var(--info); }
@keyframes toastIn  { from { opacity: 0; transform: translateX(20px) scale(.95); } to { opacity: 1; transform: translateX(0) scale(1); } }
@keyframes toastOut { to   { opacity: 0; transform: translateX(20px) scale(.95); } }

/* ═══════════════════════════════════════════
   10. CARDS
═══════════════════════════════════════════ */
.card {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow-xs); transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-sm { padding: 16px; border-radius: var(--radius-sm); }
.card-lg { padding: 32px; border-radius: var(--radius-lg); }
.card-header { padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.card-footer { padding-top: 16px; border-top: 1px solid var(--border); margin-top: 20px; }

/* ═══════════════════════════════════════════
   11. BADGES & TAGS
═══════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: var(--radius-full);
  font-size: 0.72rem; font-weight: 700; letter-spacing: .04em;
  white-space: nowrap;
}
.badge-green   { background: var(--brand-light);  color: var(--brand-dark); border: 1px solid var(--brand-mid); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-error   { background: var(--error-soft);   color: var(--error); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-info    { background: var(--info-soft);    color: var(--info); }
.badge-neutral { background: var(--bg-3);         color: var(--text-3); border: 1px solid var(--border); }

/* ═══════════════════════════════════════════
   12. DIVIDERS
═══════════════════════════════════════════ */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.divider-dashed { border-style: dashed; }

/* ═══════════════════════════════════════════
   13. SPINNER / LOADER
═══════════════════════════════════════════ */
.spinner {
  display: inline-block; width: 22px; height: 22px;
  border: 2.5px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%; animation: spin .65s linear infinite;
}
.spinner-sm { width: 16px; height: 16px; border-width: 2px; }
.spinner-lg { width: 36px; height: 36px; border-width: 3px; }

/* Page loader overlay */
.page-loader {
  position: fixed; inset: 0; z-index: 999;
  background: var(--bg); display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 14px;
  transition: opacity .3s; pointer-events: none;
}
.page-loader.hidden { opacity: 0; pointer-events: none; }

/* ═══════════════════════════════════════════
   14. THEME TOGGLE BUTTON
═══════════════════════════════════════════ */
.theme-toggle {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: var(--bg-3); border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem; transition: var(--transition); cursor: pointer;
}
.theme-toggle:hover { border-color: var(--brand); background: var(--brand-light); }
[data-theme="dark"]  .theme-icon-light { display: none; }
[data-theme="light"] .theme-icon-dark  { display: none; }
[data-theme="dark"]  .theme-icon-dark  { display: block; }
[data-theme="light"] .theme-icon-light { display: block; }

/* ═══════════════════════════════════════════
   15. MODAL
═══════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: var(--z-modal);
  background: var(--bg-overlay); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; pointer-events: none; transition: opacity .22s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 32px; width: 100%; max-width: 480px;
  box-shadow: var(--shadow-xl); transform: scale(.95);
  transition: transform .22s cubic-bezier(.34,1.56,.64,1);
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; gap: 12px; }
.modal-close { background: none; border: none; font-size: 1.1rem; color: var(--text-3); cursor: pointer; padding: 2px; transition: color .18s; }
.modal-close:hover { color: var(--text); }
.modal-footer { margin-top: 24px; display: flex; gap: 10px; justify-content: flex-end; }

/* ═══════════════════════════════════════════
   16. AUTH LAYOUT (register, login, etc.)
═══════════════════════════════════════════ */
.auth-page {
  min-height: 100vh; display: grid;
  grid-template-columns: 1fr 520px;
}
.auth-left {
  background: linear-gradient(145deg, #0d2b16 0%, #1a4a28 40%, #0f3320 100%);
  padding: 56px 60px; display: flex; flex-direction: column;
  justify-content: space-between; position: relative; overflow: hidden;
}
.auth-left::before {
  content: ''; position: absolute;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(37,192,96,.18) 0%, transparent 70%);
  top: -120px; right: -120px; pointer-events: none;
}
.auth-left::after {
  content: ''; position: absolute;
  width: 340px; height: 340px;
  background: radial-gradient(circle, rgba(37,192,96,.12) 0%, transparent 70%);
  bottom: -80px; left: -80px; pointer-events: none;
}
/* Decorative grid overlay */
.auth-left-grid {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 48px 48px;
}
.auth-left-content { position: relative; z-index: 1; }
.auth-logo {
  display: flex; align-items: center; gap: 10px; margin-bottom: 48px;
}
.auth-logo img { width: 40px; height: 40px; border-radius: 10px; object-fit: contain; }
.auth-logo-name { font-size: 1.1rem; font-weight: 800; color: #fff; letter-spacing: -.02em; }
.auth-logo-name span { opacity: 0.6; font-weight: 500; }
.auth-headline {
  font-size: clamp(2rem, 3.2vw, 2.8rem); font-weight: 800;
  color: #fff; line-height: 1.12; letter-spacing: -0.035em; margin-bottom: 16px;
}
.auth-tagline { font-size: 0.95rem; color: rgba(255,255,255,.68); line-height: 1.75; max-width: 360px; margin-bottom: 40px; }
.auth-steps { display: flex; flex-direction: column; gap: 16px; }
.auth-step { display: flex; align-items: flex-start; gap: 14px; }
.auth-step-num {
  width: 30px; height: 30px; flex-shrink: 0;
  background: rgba(37,192,96,.25); border: 1.5px solid rgba(37,192,96,.5);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 800; color: #7effa8; font-family: var(--font-mono);
}
.auth-step-text { font-size: 0.88rem; color: rgba(255,255,255,.82); line-height: 1.55; padding-top: 5px; font-weight: 500; }
.auth-left-footer { position: relative; z-index: 1; }
.auth-quote {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-lg); padding: 22px 24px;
}
.auth-quote-text { font-size: 0.95rem; font-weight: 600; color: rgba(255,255,255,.9); line-height: 1.6; font-style: italic; }
.auth-quote-author { font-size: 0.78rem; color: rgba(255,255,255,.5); margin-top: 8px; font-weight: 500; }

/* Auth right panel */
.auth-right {
  background: var(--bg-2); display: flex; align-items: center;
  justify-content: center; padding: 40px 48px;
  border-left: 1px solid var(--border); position: relative;
  overflow-y: auto;
}
.auth-right-top {
  position: absolute; top: 20px; right: 20px;
  display: flex; align-items: center; gap: 8px;
}
.auth-form-wrap { width: 100%; max-width: 380px; }
.auth-trial-badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--brand-light); color: var(--brand-dark);
  border: 1px solid var(--brand-mid); border-radius: var(--radius-full);
  padding: 5px 14px; font-size: 0.78rem; font-weight: 700; margin-bottom: 18px;
}
.auth-form-header { margin-bottom: 24px; }
.auth-form-header h2 { margin-bottom: 6px; }
.auth-form-header p { font-size: 0.875rem; color: var(--text-3); }
.auth-terms {
  font-size: 0.75rem; color: var(--text-3); text-align: center;
  margin-top: 14px; line-height: 1.65;
}
.auth-terms a { color: var(--brand-dark); font-weight: 600; }
.auth-form-footer {
  text-align: center; margin-top: 18px; font-size: 0.855rem; color: var(--text-3);
  padding-top: 18px; border-top: 1px solid var(--border);
}
.auth-form-footer a { font-weight: 700; color: var(--brand-dark); }

/* ═══════════════════════════════════════════
   17. DASHBOARD SHELL (shared nav/sidebar)
═══════════════════════════════════════════ */
.app-shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.app-sidebar {
  background: var(--bg-2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-logo { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 9px; }
.sidebar-logo img { width: 32px; height: 32px; border-radius: 8px; object-fit: contain; }
.sidebar-logo-name { font-weight: 800; font-size: 1rem; letter-spacing: -.02em; color: var(--text); }
.sidebar-logo-name span { color: var(--text-3); font-weight: 400; }
.sidebar-nav { padding: 12px 10px; flex: 1; }
.sidebar-section { font-size: 0.65rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); padding: 10px 10px 6px; margin-top: 6px; }
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  font-size: 0.85rem; font-weight: 500; color: var(--text-2);
  transition: var(--transition); cursor: pointer; text-decoration: none;
  margin-bottom: 2px;
}
.sidebar-link:hover  { background: var(--bg-3); color: var(--text); }
.sidebar-link.active { background: var(--brand-light); color: var(--brand-dark); font-weight: 700; }
.sidebar-link-icon { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-badge { margin-left: auto; font-size: .6rem; background: var(--brand); color: #fff; padding: 2px 7px; border-radius: var(--radius-full); font-weight: 700; }
.sidebar-footer { padding: 14px 10px; border-top: 1px solid var(--border); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius-sm); transition: var(--transition); cursor: pointer; }
.sidebar-user:hover { background: var(--bg-3); }
.sidebar-user-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-light); border: 1.5px solid var(--brand-mid); display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 700; color: var(--brand-dark); flex-shrink: 0; }
.sidebar-user-name  { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.sidebar-user-email { font-size: 0.72rem; color: var(--text-3); }

.app-main { display: flex; flex-direction: column; min-height: 100vh; }
.app-topbar {
  height: 58px; background: var(--bg-2); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; position: sticky; top: 0; z-index: 50;
}
.app-topbar-title { font-weight: 700; font-size: 0.95rem; color: var(--text); }
.app-content { padding: 28px; flex: 1; }

/* ═══════════════════════════════════════════
   18. TABLE
═══════════════════════════════════════════ */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 0.855rem; }
thead { background: var(--bg-3); }
th { padding: 11px 16px; text-align: left; font-size: 0.75rem; font-weight: 700; color: var(--text-3); letter-spacing: .06em; text-transform: uppercase; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px 16px; color: var(--text-2); border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: var(--bg-3); }

/* ═══════════════════════════════════════════
   19. EMPTY STATE
═══════════════════════════════════════════ */
.empty-state { padding: 60px 20px; text-align: center; }
.empty-state-icon { font-size: 3rem; margin-bottom: 14px; opacity: .55; }
.empty-state h3 { margin-bottom: 8px; }
.empty-state p { font-size: 0.875rem; color: var(--text-3); max-width: 320px; margin: 0 auto 20px; }

/* ═══════════════════════════════════════════
   20. ANIMATIONS & TRANSITIONS
═══════════════════════════════════════════ */
.fade-in { animation: fadeIn .4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.slide-up { animation: slideUp .35s cubic-bezier(.34,1.56,.64,1); }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.scale-in { animation: scaleIn .25s cubic-bezier(.34,1.56,.64,1); }
@keyframes scaleIn { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: scale(1); } }

.fade-out { animation: fadeOut .4s ease; }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }

.pulse { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.5} }

/* ═══════════════════════════════════════════
   21. INTERACTIVE GUIDE SYSTEM
═══════════════════════════════════════════ */
.guide-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.55);
  transition: opacity .3s;
}
.guide-overlay.guide-fade-out { opacity: 0; pointer-events: none; }

.guide-spotlight {
  position: fixed;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 0 9999px rgba(0,0,0,.55);
  z-index: 501;
  cursor: pointer;
  transition: top .35s cubic-bezier(.4,0,.2,1), left .35s cubic-bezier(.4,0,.2,1),
              width .35s cubic-bezier(.4,0,.2,1), height .35s cubic-bezier(.4,0,.2,1);
  animation: spotlightPulse 2s ease-in-out infinite;
}
@keyframes spotlightPulse {
  0%, 100% { box-shadow: 0 0 0 9999px rgba(0,0,0,.55), 0 0 0 0 rgba(37,192,96,.4); }
  50%      { box-shadow: 0 0 0 9999px rgba(0,0,0,.55), 0 0 0 6px rgba(37,192,96,.15); }
}

.guide-hand {
  position: fixed; z-index: 502;
  pointer-events: none;
  animation: handBounce 1s ease-in-out infinite;
  transition: top .35s cubic-bezier(.4,0,.2,1), left .35s cubic-bezier(.4,0,.2,1);
}
@keyframes handBounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

.guide-callout {
  position: fixed; z-index: 502;
  background: var(--bg-elevated);
  color: var(--text);
  font-size: .82rem; font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  border: 1.5px solid var(--brand-mid);
  white-space: nowrap;
  pointer-events: none;
  animation: calloutFadeIn .3s ease both;
  transition: top .35s cubic-bezier(.4,0,.2,1), left .35s cubic-bezier(.4,0,.2,1);
}
@keyframes calloutFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.guide-skip {
  position: fixed; bottom: 28px; right: 28px; z-index: 503;
  background: rgba(255,255,255,.15); color: #fff;
  border: 1.5px solid rgba(255,255,255,.3);
  border-radius: var(--radius-sm);
  padding: 7px 18px; font-size: .8rem; font-weight: 600;
  cursor: pointer; transition: background .18s;
  backdrop-filter: blur(4px);
}
.guide-skip:hover { background: rgba(255,255,255,.25); }

.guide-progress {
  position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%);
  z-index: 503;
  display: flex; gap: 8px;
}
.guide-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,.3);
  transition: background .2s, transform .2s;
}
.guide-dot.active { background: var(--brand); transform: scale(1.3); }
.guide-dot.done { background: rgba(255,255,255,.6); }

/* ═══════════════════════════════════════════
   22. RESPONSIVE HELPERS
═══════════════════════════════════════════ */
@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-left  { display: none; }
  .auth-right { min-height: 100vh; padding: 36px 24px; border-left: none; }

  .app-shell { grid-template-columns: 1fr; }
  .app-sidebar { display: none; }

  .grid-3, .grid-4 { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 560px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .auth-right { padding: 28px 20px; }
  .app-content { padding: 18px 16px; }
  .modal { padding: 24px 20px; }
  .toast-container { bottom: 16px; right: 16px; left: 16px; }
  .toast { min-width: unset; max-width: 100%; }
}