/* ============================================
   LINE Business Automation — Design System
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Noto+Sans+Thai:wght@300;400;500;600;700&display=swap');

/* === CSS Custom Properties === */
:root {
  /* LINE Brand Colors */
  --line-green: #06C755;
  --line-green-dark: #05a648;
  --line-green-light: #e8f9ef;
  --line-green-glow: rgba(6, 199, 85, 0.15);

  /* Neutrals */
  --bg-primary: #0f1117;
  --bg-secondary: #1a1d27;
  --bg-tertiary: #242833;
  --bg-card: #1e2230;
  --bg-card-hover: #252a3a;
  --bg-sidebar: #141620;
  --bg-input: #1a1d27;

  /* Text */
  --text-primary: #f0f2f5;
  --text-secondary: #9ca3b4;
  --text-tertiary: #7c8494;
  --text-inverse: #0f1117;

  /* Borders */
  --border-color: rgba(255, 255, 255, 0.06);
  --border-color-hover: rgba(255, 255, 255, 0.12);
  --border-color-focus: var(--line-green);

  /* Status Colors */
  --status-pending: #f59e0b;
  --status-pending-bg: rgba(245, 158, 11, 0.12);
  --status-confirmed: #06C755;
  --status-confirmed-bg: rgba(6, 199, 85, 0.12);
  --status-completed: #6366f1;
  --status-completed-bg: rgba(99, 102, 241, 0.12);
  --status-cancelled: #ef4444;
  --status-cancelled-bg: rgba(239, 68, 68, 0.12);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px var(--line-green-glow);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Layout */
  --sidebar-width: 260px;
  --header-height: 64px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Light Theme === */
[data-theme="light"] {
  --bg-primary: #f5f7fa;
  --bg-secondary: #ffffff;
  --bg-tertiary: #eef1f6;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f3f8;
  --bg-sidebar: #ffffff;
  --bg-input: #f5f7fa;

  --text-primary: #1a1d27;
  --text-secondary: #4b5563;
  --text-tertiary: #6b7280;
  --text-inverse: #f0f2f5;

  --border-color: rgba(0, 0, 0, 0.08);
  --border-color-hover: rgba(0, 0, 0, 0.15);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .sidebar {
  border-right-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .simulator-messages {
  background: #7EB0D4;
}

[data-theme="light"] .sim-msg.incoming {
  background: white;
  color: #333;
}

[data-theme="light"] .thread-msg.incoming {
  background: #e8ecf2;
}

[data-theme="light"] .modal-content {
  background: #ffffff;
}

[data-theme="light"] .toast {
  background: #1a1d27;
  color: #f0f2f5;
}

[data-theme="light"] .status-dot.offline {
  background: var(--status-pending);
}

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

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow: hidden;
  height: 100vh;
}

a {
  color: var(--line-green);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--line-green-dark);
}

/* === Layout === */
.app-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* === Sidebar === */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 100;
  transition: transform var(--transition-normal);
}

.sidebar-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  background: var(--line-green);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow-glow);
}

.sidebar-logo-text {
  flex: 1;
}

.sidebar-logo-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.sidebar-logo-subtitle {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-md) var(--space-sm);
  overflow-y: auto;
}

.nav-section {
  margin-bottom: var(--space-lg);
}

.nav-section-title {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  padding: 0 var(--space-md);
  margin-bottom: var(--space-sm);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.9rem;
  font-weight: 500;
  user-select: none;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--line-green-glow);
  color: var(--line-green);
}

.nav-item.active .nav-icon {
  color: var(--line-green);
}

.nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-color);
}

.sidebar-credit {
  display: block;
  margin-top: var(--space-md);
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.25);
  text-decoration: none;
  text-align: center;
  transition: color var(--transition-fast);
}

.sidebar-credit:hover {
  color: var(--line-green);
}

[data-theme="light"] .sidebar-credit {
  color: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .sidebar-credit:hover {
  color: var(--line-green);
}

/* Sidebar CTA */
.sidebar-cta {
  margin-top: var(--space-md);
  padding: var(--space-md);
  background: rgba(6, 199, 85, 0.04);
  border: 1px solid rgba(6, 199, 85, 0.1);
  border-radius: var(--radius-md);
}

.sidebar-cta-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: var(--space-sm);
}

.sidebar-cta-link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
  margin-bottom: 4px;
}

.sidebar-cta-link:last-child {
  margin-bottom: 0;
}

.sidebar-cta-link:hover {
  background: rgba(6, 199, 85, 0.08);
  color: var(--line-green);
}

.sidebar-cta-line:hover {
  background: rgba(6, 199, 85, 0.12);
  color: var(--line-green);
}

[data-theme="light"] .sidebar-cta {
  background: rgba(6, 199, 85, 0.04);
  border-color: rgba(6, 199, 85, 0.12);
}

[data-theme="light"] .sidebar-cta-link:hover {
  background: rgba(6, 199, 85, 0.08);
}

.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 4px 10px;
  background: var(--status-pending-bg);
  color: var(--status-pending);
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  animation: demoBreathe 2.5s ease-in-out infinite;
}

@keyframes demoBreathe {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.04); }
}

[data-theme="light"] .demo-badge {
  background: rgba(245, 158, 11, 0.2);
  color: #b45309;
}

[data-theme="light"] .demo-badge {
  background: rgba(245, 158, 11, 0.2);
  color: #b45309;
}

.toggle-group {
  display: flex;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  padding: 3px;
  margin-top: var(--space-sm);
  border: 1px solid var(--border-color);
}

.toggle-pill {
  flex: 1;
  padding: 5px 14px;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  white-space: nowrap;
  text-align: center;
}

.toggle-pill:hover {
  color: rgba(255, 255, 255, 0.8);
}

.toggle-pill.active {
  background: var(--line-green);
  color: white;
  box-shadow: 0 2px 6px rgba(6, 199, 85, 0.25);
}

[data-theme="light"] .toggle-group {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .toggle-pill {
  color: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .toggle-pill:hover {
  color: rgba(0, 0, 0, 0.7);
}

/* === Main Content Area === */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* === Header === */
.main-header {
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-xl);
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.menu-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: 1.3rem;
  align-items: center;
  justify-content: center;
}

.menu-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
}

.page-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 6px 14px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-green);
  animation: pulse 2s infinite;
}

.status-dot.offline {
  background: var(--status-pending);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* === Content Area === */
.content-area {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-xl);
}

.content-area::-webkit-scrollbar {
  width: 6px;
}

.content-area::-webkit-scrollbar-track {
  background: transparent;
}

.content-area::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.content-area::-webkit-scrollbar-thumb:hover {
  background: var(--border-color-hover);
}

/* === Demo Banner === */
.demo-banner {
  background: linear-gradient(135deg, rgba(6, 199, 85, 0.08), rgba(245, 158, 11, 0.08));
  border: 1px solid rgba(6, 199, 85, 0.2);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-xl);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.demo-banner > span {
  flex: 1;
  min-width: 0;
}

.demo-banner-actions {
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .demo-banner {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: var(--space-sm);
  }
  .demo-banner-actions {
    text-align: center;
  }
}

.demo-reset-btn {
  background: rgba(245, 158, 11, 0.15) !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
  color: var(--status-pending) !important;
  font-size: 0.75rem !important;
  white-space: nowrap;
}

.demo-reset-btn:hover {
  background: rgba(245, 158, 11, 0.25) !important;
}

[data-theme="light"] .demo-reset-btn {
  background: rgba(245, 158, 11, 0.15) !important;
  border-color: rgba(180, 83, 9, 0.3) !important;
  color: #b45309 !important;
}

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--line-green), transparent);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.stat-card:hover {
  border-color: var(--border-color-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-sm);
}

.stat-card-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1;
}

.stat-card-icon {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  font-size: 1.5rem;
  opacity: 0.5;
}

/* === Cards & Panels === */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card-body {
  padding: var(--space-lg);
}

.card-body.no-padding {
  padding: 0;
}

/* === Content Grids === */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
}

.content-grid-wide {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

/* === Tables === */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  padding: var(--space-md) var(--space-lg);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-secondary);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: rgba(6, 199, 85, 0.05);
}

.data-table tr:last-child td {
  border-bottom: none;
}

/* === Status Badges === */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.status-badge.pending {
  background: var(--status-pending-bg);
  color: var(--status-pending);
}

.status-badge.confirmed {
  background: var(--status-confirmed-bg);
  color: var(--status-confirmed);
}

.status-badge.completed {
  background: var(--status-completed-bg);
  color: var(--status-completed);
}

.status-badge.cancelled {
  background: var(--status-cancelled-bg);
  color: var(--status-cancelled);
}

.status-badge.draft {
  background: var(--status-pending-bg);
  color: var(--status-pending);
}

.status-badge.sending {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  animation: pulse 1.5s infinite;
}

.status-badge.sent {
  background: var(--status-completed-bg);
  color: var(--status-completed);
}

/* === Tag Badges === */
.tag-badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 500;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  margin-right: 4px;
  margin-bottom: 4px;
}

.tag-badge.new_customer {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
}

.tag-badge.has_booking {
  background: var(--status-confirmed-bg);
  color: var(--status-confirmed);
}

.tag-badge.vip {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  user-select: none;
}

.btn-primary {
  background: var(--line-green);
  color: white;
  border-color: var(--line-green);
}

.btn-primary:hover {
  background: var(--line-green-dark);
  color: white;
  box-shadow: var(--shadow-glow);
}

a.btn-primary,
a.btn-primary:hover,
a.btn-primary:visited {
  color: white;
}

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

.btn-secondary:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-color-hover);
}

.btn-danger {
  background: transparent;
  color: var(--status-cancelled);
  border-color: transparent;
}

.btn-danger:hover {
  background: var(--status-cancelled-bg);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 0.75rem;
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

/* === Search / Inputs === */
.search-input-wrapper {
  position: relative;
  margin-bottom: var(--space-lg);
}

.search-input-icon {
  position: absolute;
  left: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: 0.9rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--line-green);
  box-shadow: 0 0 0 3px var(--line-green-glow);
}

.search-input::placeholder {
  color: var(--text-tertiary);
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--line-green);
  box-shadow: 0 0 0 3px var(--line-green-glow);
}

.form-input::placeholder {
  color: var(--text-tertiary);
}

.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  resize: vertical;
  min-height: 80px;
  transition: all var(--transition-fast);
}

.form-textarea:focus {
  outline: none;
  border-color: var(--line-green);
  box-shadow: 0 0 0 3px var(--line-green-glow);
}

.form-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239ca3b4' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.form-select:focus {
  outline: none;
  border-color: var(--line-green);
  box-shadow: 0 0 0 3px var(--line-green-glow);
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
  accent-color: var(--line-green);
  width: 16px;
  height: 16px;
}

/* === Filter Tabs === */
.filter-tabs {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
  padding: 3px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  width: fit-content;
}

.filter-tab {
  padding: 6px 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-tab:hover {
  color: var(--text-primary);
}

.filter-tab.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* === LINE Chat Simulator === */
.simulator-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: calc(100vh - var(--header-height) - var(--space-xl) * 2);
  padding: var(--space-lg);
}

.simulator-phone {
  width: 375px;
  max-width: 90vw;
  height: 100%;
  max-height: 780px;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border-radius: 40px;
  overflow: hidden;
  box-shadow:
    0 0 0 3px #1a1a2e,
    0 0 0 6px #2d2d44,
    0 0 0 8px #1a1a2e,
    0 25px 60px rgba(0, 0, 0, 0.5);
  position: relative;
}

.simulator-phone::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 22px;
  background: #1a1a2e;
  border-radius: 14px;
  z-index: 10;
}

[data-theme="light"] .simulator-phone {
  box-shadow:
    0 0 0 3px #2c2c2e,
    0 0 0 6px #3a3a3c,
    0 0 0 8px #2c2c2e,
    0 25px 60px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .simulator-phone::before {
  background: #2c2c2e;
}

.simulator-header {
  background: #2C2C2E;
  padding: 32px var(--space-lg) var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-shrink: 0;
}

[data-theme="light"] .simulator-header {
  background: #6E93B6;
}

.simulator-avatar {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.simulator-chat-name {
  font-weight: 600;
  color: white;
  font-size: 0.95rem;
}

.simulator-chat-status {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.7);
}

.simulator-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  background: #1B1B1B;
}

.simulator-messages .empty-state-icon {
  opacity: 0.6;
}

.simulator-messages .empty-state-text {
  color: rgba(255, 255, 255, 0.5);
}

[data-theme="light"] .simulator-messages {
  background: #7EB0D4;
}

[data-theme="light"] .simulator-messages .empty-state-text {
  color: rgba(255, 255, 255, 0.75);
}

.simulator-messages::-webkit-scrollbar {
  width: 4px;
}

.simulator-messages::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

.sim-msg {
  max-width: 85%;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-lg);
  font-size: 0.85rem;
  line-height: 1.5;
  animation: msgAppear 0.3s ease;
  word-wrap: break-word;
  white-space: pre-wrap;
}

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

.sim-msg.incoming {
  align-self: flex-start;
  background: #303030;
  color: #e8e8e8;
  border-bottom-left-radius: var(--radius-sm);
}

[data-theme="light"] .sim-msg.incoming {
  background: white;
  color: #333;
}

.sim-typing {
  display: flex;
  gap: 4px;
  padding: 12px 16px !important;
  min-height: 0;
}

.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #888;
  animation: typingBounce 1.2s infinite ease-in-out;
}

.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

.sim-msg.outgoing {
  align-self: flex-end;
  background: var(--line-green);
  color: white;
  border-bottom-right-radius: var(--radius-sm);
}

.sim-msg-time {
  font-size: 0.65rem;
  color: var(--text-tertiary);
  margin-top: var(--space-xs);
}

.sim-msg.outgoing .sim-msg-time {
  color: rgba(255, 255, 255, 0.6);
}

.sim-quick-replies {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
}

.sim-quick-reply-btn {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-full);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.78rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.sim-quick-reply-btn:hover {
  background: var(--line-green);
  color: white;
  border-color: var(--line-green);
}

[data-theme="light"] .sim-quick-reply-btn {
  background: white;
  border-color: var(--line-green);
  color: var(--line-green);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.simulator-input-area {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: #2C2C2E;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

[data-theme="light"] .simulator-input-area {
  background: #6E93B6;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

[data-theme="light"] .simulator-input {
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
}

[data-theme="light"] .simulator-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

[data-theme="light"] .simulator-input:focus {
  border-color: rgba(255, 255, 255, 0.5);
}

.simulator-input {
  flex: 1;
  padding: 10px 16px;
  background: #3A3A3C;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  color: #f0f0f0;
  font-family: inherit;
  font-size: 0.85rem;
}

.simulator-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.simulator-input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.3);
}

.simulator-send-btn {
  width: 40px;
  height: 40px;
  background: var(--line-green);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.simulator-send-btn:hover {
  background: var(--line-green-dark);
  box-shadow: var(--shadow-glow);
}

.simulator-demo-banner {
  padding: var(--space-sm) var(--space-md);
  background: rgba(245, 158, 11, 0.1);
  border-top: 1px solid rgba(245, 158, 11, 0.2);
  font-size: 0.72rem;
  color: var(--status-pending);
  text-align: center;
  flex-shrink: 0;
}

[data-theme="light"] .simulator-demo-banner {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
}

[data-theme="light"] .rich-menu-toggle {
  color: rgba(255, 255, 255, 0.85);
}

[data-theme="light"] .rich-menu-label {
  color: #fff;
}

[data-theme="light"] .rich-menu-toggle {
  background: #6E93B6;
  border-top-color: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.8);
}

/* === Rich Menu === */
.rich-menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 8px var(--space-md);
  background: #2C2C2E;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition-fast);
  user-select: none;
}

.rich-menu-toggle:hover {
  color: rgba(255,255,255,0.85);
}

.rich-menu-toggle.open {
  color: rgba(255,255,255,0.85);
}

.rich-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  flex-shrink: 0;
}

.rich-menu.open {
  max-height: 200px;
}

.rich-menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: #2C2C2E;
}

[data-theme="light"] .rich-menu-grid {
  background: #6E93B6;
}

[data-theme="light"] .rich-menu-item {
  border-color: rgba(255, 255, 255, 0.15);
}

.rich-menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 0.5px solid rgba(255, 255, 255, 0.08);
}

.rich-menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.rich-menu-item:active {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(0.97);
}

.rich-menu-icon {
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.rich-menu-label {
  font-size: 0.68rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  letter-spacing: 0.02em;
}

/* === Conversations View === */
.conversations-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: calc(100vh - var(--header-height) - var(--space-xl) * 2);
  gap: 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.thread-list {
  background: var(--bg-card);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
}

.thread-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  cursor: pointer;
  transition: background var(--transition-fast);
  border-bottom: 1px solid var(--border-color);
}

.thread-item:hover {
  background: var(--bg-card-hover);
}

.thread-item.active {
  background: var(--line-green-glow);
  border-left: 3px solid var(--line-green);
}

.thread-avatar {
  width: 40px;
  height: 40px;
  background: var(--bg-tertiary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  color: var(--text-secondary);
}

.thread-info {
  flex: 1;
  min-width: 0;
}

.thread-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread-preview {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread-time {
  font-size: 0.65rem;
  color: var(--text-tertiary);
  white-space: nowrap;
  flex-shrink: 0;
}

.thread-messages-area {
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  min-height: 0;
}

.thread-back-btn {
  display: none;
  align-items: center;
  gap: var(--space-sm);
  background: none;
  border: none;
  color: var(--line-green);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  margin-right: var(--space-md);
}

.thread-messages-header {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  font-size: 0.9rem;
}

.thread-messages-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.thread-reply-bar {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.thread-reply-bar .form-input {
  flex: 1;
  margin: 0;
}

.thread-reply-bar .btn {
  flex-shrink: 0;
  padding: 8px 16px;
}

.thread-msg {
  max-width: 75%;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  line-height: 1.4;
  white-space: pre-wrap;
}

.thread-msg.incoming {
  align-self: flex-start;
  background: var(--bg-card);
  color: var(--text-primary);
}

.thread-msg.outgoing {
  align-self: flex-end;
  background: var(--line-green);
  color: white;
}

.thread-msg-time {
  font-size: 0.6rem;
  color: var(--text-tertiary);
  margin-top: 1px;
  text-align: right;
}

.thread-msg.outgoing .thread-msg-time {
  color: rgba(255, 255, 255, 0.7);
}

.thread-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-tertiary);
  font-size: 0.85rem;
}

/* === Modal === */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 520px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform var(--transition-normal);
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.modal-body {
  padding: var(--space-lg);
}

.modal-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
}

/* === Toast Notifications === */
.toast-container {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.82rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  transform: translateX(120%);
  transition: transform var(--transition-normal);
  min-width: 280px;
}

.toast.show {
  transform: translateX(0);
}

.toast.success {
  border-left: 3px solid var(--line-green);
}

.toast.error {
  border-left: 3px solid var(--status-cancelled);
}

.toast.info {
  border-left: 3px solid #6366f1;
}

/* === Loading Spinner === */
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-color);
  border-top-color: var(--line-green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.page-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  gap: var(--space-md);
  color: var(--text-tertiary);
}

/* === Empty State === */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  color: var(--text-tertiary);
  text-align: center;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.4;
}

.empty-state-text {
  font-size: 0.9rem;
  max-width: 300px;
}

/* === Schedule List === */
.schedule-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border-color);
}

.schedule-item:last-child {
  border-bottom: none;
}

.schedule-time {
  font-weight: 600;
  color: var(--line-green);
  font-size: 0.85rem;
  min-width: 55px;
}

.schedule-info {
  flex: 1;
}

.schedule-customer {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
}

.schedule-service {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

/* === Activity Item === */
.activity-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-avatar {
  width: 32px;
  height: 32px;
  background: var(--bg-tertiary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.activity-info {
  flex: 1;
  min-width: 0;
}

.activity-name {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
}

.activity-message {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-time {
  font-size: 0.65rem;
  color: var(--text-tertiary);
  white-space: nowrap;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 3px;
}

/* === Responsive === */
@media (max-width: 1024px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .conversations-layout {
    grid-template-columns: 1fr;
  }

  .thread-list.thread-hidden {
    display: none;
  }

  .thread-messages-area {
    display: none;
  }

  .thread-messages-area.active {
    display: flex;
  }

  .thread-back-btn {
    display: inline-flex;
  }

  .data-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .data-table {
    min-width: 600px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
    z-index: 200;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
  }

  .sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  .menu-toggle {
    display: flex;
  }

  .content-area {
    padding: var(--space-md);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-card-value {
    font-size: 1.5rem;
  }

  .simulator-container {
    max-width: 100%;
    height: calc(100vh - var(--header-height) - var(--space-md) * 2);
  }

  .modal-content {
    max-height: 90vh;
    overflow-y: auto;
    margin: var(--space-md);
    width: calc(100% - var(--space-md) * 2) !important;
  }

  .sidebar-footer {
    padding: var(--space-sm) var(--space-md);
  }

  /* Booking filter tabs — scrollable */
  .filter-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
  }

  .filter-tabs::-webkit-scrollbar {
    display: none;
  }

  .filter-tab {
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Analytics summary cards */
  .analytics-summary {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Settings — stack all 2-col grids */
  #page-settings [style*="grid-template-columns: 1fr 1fr"],
  #page-settings [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Thread reply bar tighter */
  .thread-reply-bar {
    padding: 8px 12px;
  }
}

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

  .content-area {
    padding: var(--space-sm);
  }

  .page-header h1 {
    font-size: 1.1rem;
  }

  /* Analytics single column */
  .analytics-summary {
    grid-template-columns: 1fr !important;
  }

  /* Flex-between stack on tiny screens */
  .flex-between {
    flex-wrap: wrap;
    gap: var(--space-sm);
  }
}

/* === Page Transition === */
.page-view {
  display: none;
  animation: fadeIn 0.3s ease;
}

.page-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* === Utility === */
.text-green { color: var(--line-green); }
.text-muted { color: var(--text-tertiary); }
.text-center { text-align: center; }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.hidden { display: none !important; }

/* === Theme Toggle === */

/* === Toggle Switch === */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch .toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg-tertiary);
  border: 1.5px solid var(--border-color);
  border-radius: 24px;
  transition: all 0.25s ease;
}

.toggle-switch .toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  background: white;
  border-radius: 50%;
  transition: all 0.25s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--line-green);
  border-color: var(--line-green);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateY(-50%) translateX(20px);
}

.toggle-switch.toggle-amber input:checked + .toggle-slider {
  background: #f59e0b;
  border-color: #f59e0b;
}

/* === Guided Tour === */
.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.tour-overlay.active {
  pointer-events: auto;
}

.tour-overlay-bg {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 9998;
  transition: opacity 0.3s ease;
  opacity: 0;
}

.tour-overlay.active .tour-overlay-bg {
  opacity: 0;
}

.tour-spotlight {
  position: fixed;
  z-index: 9999;
  border-radius: var(--radius-md);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.7), inset 0 0 0 2px rgba(6, 199, 85, 0.5);
  background: transparent;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.tour-tooltip {
  position: fixed;
  z-index: 10000;
  width: 320px;
  max-width: calc(100vw - 32px);
  background: var(--bg-card);
  border: 1px solid var(--line-green);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), 0 0 20px rgba(6, 199, 85, 0.15);
  padding: 20px;
  animation: tourTooltipIn 0.35s ease;
}

@keyframes tourTooltipIn {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.tour-tooltip-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tour-tooltip-body {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 16px;
}

.tour-tooltip-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tour-step-counter {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

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

.tour-btn {
  padding: 7px 16px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
}

.tour-btn-skip {
  background: transparent;
  color: var(--text-tertiary);
}

.tour-btn-skip:hover {
  color: var(--text-secondary);
}

.tour-btn-back {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.tour-btn-back:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.tour-btn-next {
  background: var(--line-green);
  color: white;
}

.tour-btn-next:hover {
  background: var(--line-green-dark);
  box-shadow: var(--shadow-glow);
}

/* Tour Welcome Modal */
.tour-welcome {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.tour-welcome.active {
  opacity: 1;
  pointer-events: auto;
}

.tour-welcome-card {
  width: 400px;
  max-width: calc(100vw - 32px);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 32px;
  text-align: center;
  animation: tourTooltipIn 0.4s ease;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

.tour-welcome-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.tour-welcome-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.tour-welcome-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

.tour-welcome-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tour-welcome-actions .tour-btn {
  width: 100%;
  padding: 12px;
  font-size: 0.88rem;
}

@media (max-width: 768px) {
  .tour-tooltip {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
  }
  .tour-tooltip.tour-tooltip-targeted {
    left: 12px !important;
  }
}
