/* ===================================================
   QV MARKETING TOOL — GOOGLE MATERIAL DESIGN SYSTEM
   =================================================== */

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

:root {
  /* Colors - Material Light Theme */
  --bg-base:       #f8f9fa; /* Classic Google Drive background */
  --bg-surface:    #ffffff;
  --bg-card:       #ffffff;
  --bg-elevated:   #f1f3f4;
  --bg-hover:      #f8f9fa;
  --border:        #dadce0;
  --border-focus:  #1a73e8;

  --purple:        #1a73e8; /* Aliased to blue for compatibility */
  --purple-glow:   rgba(26,115,232,0.15);
  --blue:          #1a73e8;
  --blue-glow:     rgba(26,115,232,0.15);
  --teal:          #0f9d58; /* Google green */
  --teal-glow:     rgba(15,157,88,0.15);
  --orange:        #f4b400; /* Google yellow */
  --orange-glow:   rgba(244,180,0,0.15);
  --red:           #d93025;
  --green:         #188038;

  --text-primary:  #202124;
  --text-secondary:#5f6368;
  --text-muted:    #80868b;

  /* Sizes */
  --sidebar-w: 256px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Transitions */
  --tr: 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
}

html, body {
  height: 100%;
  font-family: 'Roboto', 'Google Sans', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  overflow: hidden;
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #dadce0; border-radius: 99px; border: 2px solid var(--bg-base); }
::-webkit-scrollbar-thumb:hover { background: #bdc1c6; }

/* ==================== LAYOUT ==================== */
body { display: flex; height: 100vh; width: 100vw; overflow: hidden; }

.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}
.app-layout.hidden { display: none !important; }

.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  z-index: 10;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-base);
}

/* ==================== SIDEBAR ==================== */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid transparent; /* No border for cleaner look */
}

.logo-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--blue);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.logo-icon svg { width: 20px; height: 20px; }

.logo-text {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.2px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0 12px 0; /* padding right removed for pill shape */
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px 10px 24px;
  margin-right: 12px; /* For pill effect */
  border-radius: 0 24px 24px 0;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--tr), color var(--tr);
  position: relative;
}

.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }

.nav-item.active {
  background: #e8f0fe;
  color: #1967d2;
  font-weight: 600;
}
.nav-item.active .nav-icon { color: #1967d2; }

.nav-icon {
  width: 20px; height: 20px; flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--bg-elevated);
  border-radius: 99px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}
.nav-item.active .nav-badge { background: #d2e3fc; color: #1967d2; }

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

.api-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}
.api-status.online .status-dot { background: var(--green); }
.api-status.offline .status-dot { background: var(--red); }
.api-status.online .status-text { color: var(--green); }
.api-status.offline .status-text { color: var(--red); }

/* ==================== TOPBAR ==================== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.page-title {
  font-size: 22px;
  font-weight: 400; /* Google typically uses lighter weights for larger headers */
  color: var(--text-primary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.api-base-input {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}
.api-base-input input {
  background: #f1f3f4;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  padding: 8px 12px;
  width: 220px;
  font-family: 'Roboto', monospace;
  outline: none;
  transition: all var(--tr);
}
.api-base-input input:focus { background: #fff; border-color: var(--blue); box-shadow: 0 1px 2px rgba(0,0,0,0.1); }

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 24px;
  border-radius: 20px; /* Pill shape for Google UI */
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--tr), box-shadow var(--tr), border-color var(--tr);
  white-space: nowrap;
  font-family: 'Roboto', sans-serif;
  letter-spacing: 0.25px;
}

.btn-primary {
  background: #1a73e8;
  color: #fff;
}
.btn-primary:hover { 
  background: #1b66c9; 
  box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15); 
}
.btn-primary:active { box-shadow: none; background: #185abc; }

.btn-ghost, .btn-secondary {
  background: #ffffff;
  color: #1a73e8;
  border: 1px solid #dadce0 !important;
}
.btn-ghost:hover, .btn-secondary:hover { 
  background: #f8f9fa; 
  color: #174ea6; 
}
.btn-ghost:active, .btn-secondary:active { background: #e8eaed; }

.btn-sm { padding: 6px 16px; font-size: 13px; border-radius: 16px; }
.btn-danger { background: #fff; color: var(--red); border-color: #dadce0; }
.btn-danger:hover { background: #fce8e6; color: #c5221f; border-color: transparent; }

/* ==================== PAGE CONTENT ==================== */
.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
}

.page { display: block; }
.hidden { display: none !important; }

/* ==================== DASHBOARD ==================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: box-shadow var(--tr);
}
.stat-card:hover { box-shadow: 0 1px 2px rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15); }

.stat-card-icon {
  width: 48px; height: 48px;
  border-radius: 50%; /* Circle icons for Google style */
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-card-icon svg { width: 24px; height: 24px; }
.stat-card-icon.purple { background: #e8f0fe; color: #1a73e8; }
.stat-card-icon.blue   { background: #e8f0fe; color: #1a73e8; }
.stat-card-icon.teal   { background: #e6f4ea; color: #137333; }
.stat-card-icon.orange { background: #fef7e0; color: #b06000; }

.stat-value { font-size: 32px; font-weight: 400; color: var(--text-primary); }
.stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 4px; font-weight: 500; }

.dash-lower {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 16px;
}

.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0;
}

.dash-card-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}
.dash-card-header h2 { font-size: 16px; font-weight: 500; color: var(--text-primary); }

.dash-list { padding: 0 24px 24px; }
.dash-campaign-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.dash-campaign-row:last-child { border-bottom: none; }
.dash-campaign-name { font-weight: 500; font-size: 14px; color: var(--text-primary); }
.dash-campaign-meta { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

.status-breakdown { display: flex; flex-direction: column; gap: 16px; padding: 24px; }
.status-row { display: flex; align-items: center; gap: 12px; }
.status-row-label { font-size: 13px; color: var(--text-secondary); width: 80px; font-weight: 500; }
.progress-bar-wrap { flex: 1; height: 8px; background: #f1f3f4; border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 99px; transition: width 0.6s ease; }
.progress-bar.draft     { background: #bdc1c6; }
.progress-bar.active    { background: #137333; }
.progress-bar.paused    { background: #f4b400; }
.progress-bar.completed { background: #1a73e8; }
.status-row-count { font-size: 13px; font-weight: 500; color: var(--text-secondary); width: 30px; text-align: right; }

/* ==================== PAGE TOOLBAR ==================== */
.page-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 250px;
}
.search-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--text-secondary);
  pointer-events: none;
}
.search-wrap input {
  width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 10px 16px 10px 42px;
  font-size: 14px;
  font-family: 'Roboto', sans-serif;
  outline: none;
  transition: box-shadow var(--tr);
}
.search-wrap input:focus { border-color: transparent; box-shadow: 0 1px 2px rgba(0,0,0,0.1), 0 0 0 2px var(--blue); }
.search-wrap input::placeholder { color: var(--text-muted); }

.filter-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  padding: 6px 16px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--tr);
  font-family: 'Roboto', sans-serif;
}
.pill:hover { background: #f8f9fa; }
.pill.active { background: #e8f0fe; border-color: #e8f0fe; color: #1967d2; }

/* ==================== TABLE ==================== */
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  overflow-x: auto;
}

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

.data-table th {
  background: #fff;
  padding: 12px 24px;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-primary);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background var(--tr); }
.data-table tbody tr:hover { background: var(--bg-hover); }

.td-primary { color: var(--text-primary); font-weight: 500; }
.td-mono { font-family: 'Roboto Mono', 'Courier New', monospace; font-size: 13px; color: var(--text-secondary); }

.loading-row { text-align: center; padding: 48px !important; color: var(--text-muted); }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 64px 24px; color: var(--text-secondary); font-size: 14px; }
.empty-state-icon { font-size: 40px; display: block; margin-bottom: 16px; opacity: 0.6; }

/* ==================== STATUS BADGE ==================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.badge-draft     { background: #f1f3f4; color: #5f6368; }
.badge-active    { background: #e6f4ea; color: #137333; }
.badge-paused    { background: #fef7e0; color: #b06000; }
.badge-completed { background: #e8f0fe; color: #1967d2; }
.badge-one-time  { background: #e8eaed; color: #202124; }
.badge-recurring { background: #ceead6; color: #137333; }
.badge-sent      { background: #e6f4ea; color: #137333; }
.badge-delivered { background: #e6f4ea; color: #137333; }
.badge-failed    { background: #fce8e6; color: #c5221f; }
.badge-bounced   { background: #fef7e0; color: #b06000; }

/* ==================== CARDS GRID ==================== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.item-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: box-shadow var(--tr);
  cursor: default;
}
.item-card:hover {
  box-shadow: 0 1px 2px rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
}

.item-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.item-card-title { font-size: 16px; font-weight: 500; color: var(--text-primary); }
.item-card-sub { font-size: 13px; color: var(--text-secondary); margin-top: 4px; min-height: 20px; }
.item-card-actions { display: flex; gap: 8px; flex-shrink: 0; }
.item-card-body { font-size: 14px; color: var(--text-secondary); }
.item-card-footer { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 16px; }
.item-card-date { font-size: 12px; color: var(--text-muted); margin-left: auto; }

.condition-chip {
  display: inline-flex;
  align-items: center;
  background: #f1f3f4;
  border-radius: 16px;
  padding: 4px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  font-family: 'Roboto Mono', monospace;
}

/* ==================== PAGINATION ==================== */
.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  padding-top: 20px;
}
.pagination .page-btn {
  padding: 6px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  font-family: 'Roboto', sans-serif;
  transition: all var(--tr);
}
.pagination .page-btn:hover { background: var(--bg-hover); }
.pagination .page-btn.active { background: #e8f0fe; border-color: #1a73e8; color: #1967d2; font-weight: 500; }
.pagination .page-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.page-info { font-size: 14px; color: var(--text-secondary); margin-right: 8px; }

/* ==================== MODAL ==================== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(32,33,36,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadein 0.2s ease;
}
.modal-overlay.hidden { display: none !important; }

@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes scale-up { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

.modal {
  background: #fff;
  border-radius: 8px;
  width: 560px;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: scale-up 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 24px 38px 3px rgba(0,0,0,0.14), 0 9px 46px 8px rgba(0,0,0,0.12), 0 11px 15px -7px rgba(0,0,0,0.2);
  transition: width var(--tr);
}
.modal.modal-xl {
  width: 840px;
  max-height: 92vh;
}
.modal.modal-xl .modal-body {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 16px;
  flex-shrink: 0;
}
.modal-header h2 { font-size: 20px; font-weight: 500; color: var(--text-primary); }

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  border-radius: 50%;
  transition: all var(--tr);
}
.modal-close:hover { background: rgba(60,64,67,0.08); color: var(--text-primary); }

.modal-body {
  padding: 8px 24px 24px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 0 0 8px 8px;
}

/* ==================== FORM ==================== */
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group label { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.form-control {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  padding: 10px 14px;
  font-size: 14px;
  font-family: 'Roboto', sans-serif;
  outline: none;
  transition: border-color var(--tr), box-shadow var(--tr);
  width: 100%;
}
.form-control:hover { border-color: #80868b; }
.form-control:focus { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 100px; line-height: 1.5; }
select.form-control { cursor: pointer; padding-right: 32px; }
.form-hint { font-size: 12.5px; color: var(--text-secondary); margin-top: -4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.code-editor {
  font-family: 'Roboto Mono', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.6;
  min-height: 140px;
  background: #f8f9fa;
  color: #c5221f; /* slightly different code color */
  border: 1px solid var(--border);
  padding: 12px;
}

.CodeMirror {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Roboto Mono', monospace;
  font-size: 13px;
  height: 260px !important;
  overflow-y: auto;
}

/* ==================== TEMPLATE EDITOR ==================== */
.template-editor-grid {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 24px;
  overflow-y: auto;
  flex: 1;
  padding-right: 4px;
}
@media (max-width: 768px) {
  .template-editor-grid { grid-template-columns: 1fr; }
}
.template-editor-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.template-editor-sidebar {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  height: max-content;
}
.template-editor-sidebar h4 { margin-bottom: 8px; font-weight: 500; font-size: 14px; color: var(--text-primary); }
.template-editor-sidebar p { font-size: 12px; color: var(--text-secondary); margin-bottom: 16px; line-height: 1.4; }
.token-list { display: flex; flex-direction: column; gap: 8px; }
.token-item {
  background: #fff;
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--tr);
  display: flex;
  flex-direction: column;
}
.token-item .tok { font-family: 'Roboto Mono', monospace; font-size: 12px; color: var(--blue); font-weight: 500; }
.token-item .desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.token-item:hover { border-color: var(--blue); box-shadow: 0 1px 2px rgba(0,0,0,0.05); }

/* ==================== DRAWER (CENTERED MODAL OVERLAY) ==================== */
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(32,33,36,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
  animation: fadein 0.2s ease;
}
.drawer-overlay.hidden { display: none !important; }

.drawer {
  width: 800px;
  max-width: 90vw;
  background: #fff;
  height: 650px;
  max-height: 85vh;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  animation: scale-up 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 24px 38px 3px rgba(0,0,0,0.14), 0 9px 46px 8px rgba(0,0,0,0.12), 0 11px 15px -7px rgba(0,0,0,0.2);
}
@keyframes slide-in-right { from { transform: translateX(100%); } to { transform: translateX(0); } }

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.drawer-progress {
  height: 4px;
  width: 100%;
  background: transparent;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}
.drawer-progress.active {
  background: #e8f0fe;
}
.drawer-progress-bar {
  height: 100%;
  background: transparent;
  width: 50%;
  position: absolute;
}
.drawer-progress.active .drawer-progress-bar {
  background: var(--blue);
  animation: indeterminate 1.5s infinite linear;
}
@keyframes indeterminate {
  0% { left: -50%; }
  100% { left: 100%; }
}
.drawer-header h2 { font-size: 20px; font-weight: 500; color: var(--text-primary); }
.drawer-body { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 24px; }

.detail-section { display: flex; flex-direction: column; gap: 12px; }
.detail-section h3 { font-size: 14px; font-weight: 500; color: var(--text-primary); padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.detail-row { display: flex; gap: 16px; }
.detail-label { font-size: 13px; color: var(--text-secondary); width: 120px; flex-shrink: 0; }
.detail-value { flex: 1; font-size: 14px; color: var(--text-primary); word-break: break-all; }
.detail-actions { display: flex; gap: 12px; padding-top: 16px; }

.preview-html {
  background: #f8f9fa;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  min-height: 200px;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  overflow: auto;
}

/* ==================== TOAST ==================== */
#toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px; /* Google toasts usually bottom-left */
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #323232; /* Classic dark toast / Snackbar for light theme */
  border-radius: 4px;
  padding: 14px 24px;
  font-size: 14px;
  color: #fff;
  box-shadow: 0 3px 5px -1px rgba(0,0,0,0.2), 0 6px 10px 0 rgba(0,0,0,0.14), 0 1px 18px 0 rgba(0,0,0,0.12);
  animation: slide-up-toast 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 288px;
  max-width: 568px;
}
@keyframes slide-up-toast { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.toast-icon { display: none; /* Google dark snackbars rarely use bold colored icons, text is enough */ }
.toast-success { border-left: 4px solid var(--green); }
.toast-error   { border-left: 4px solid var(--red); }
.toast-info    { border-left: 4px solid var(--blue); }
.toast-fade-out { animation: fadeout-toast 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
@keyframes fadeout-toast { to { opacity: 0; } }

/* ==================== ACTION BTNS ==================== */
.action-btn {
  background: transparent;
  border: none;
  border-radius: 50%; /* Circle icon buttons */
  cursor: pointer;
  padding: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background var(--tr), color var(--tr);
}
.action-btn:hover { background: rgba(60,64,67,0.08); color: var(--text-primary); }
.action-btn.danger:hover { background: #fce8e6; color: #c5221f; }
.action-btn svg { width: 18px; height: 18px; }
.actions-cell { display: flex; gap: 4px; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 800px) {
  .dash-lower { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  :root { --sidebar-w: 64px; }
  .logo-text, .nav-item span:not(.nav-badge), .nav-badge, .sidebar-footer .status-text { display: none; }
  .nav-item { justify-content: center; padding: 12px; margin-right: 0; border-radius: 0; }
  .sidebar-logo { justify-content: center; padding: 16px 12px; }
  .api-base-input label { display: none; }
  .api-base-input input { width: 140px; }
}

/* ==================== AUTH UI ==================== */
.auth-page {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  z-index: 9999;
  overflow: hidden;
}
.auth-page.hidden { display: none !important; }

/* Left hero panel */
.auth-hero {
  background: linear-gradient(145deg, #1a73e8 0%, #0d47a1 60%, #1565c0 100%);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 56px;
  overflow: hidden;
  color: #fff;
}
.auth-hero::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  top: -100px; right: -150px;
}
.auth-hero::after {
  content: '';
  position: absolute;
  width: 340px; height: 340px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  bottom: -60px; left: -60px;
}
.auth-hero-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 48px;
  position: relative;
  z-index: 1;
}
.auth-hero-logo-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.auth-hero-logo span {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: #fff;
}
.auth-hero-title {
  font-size: 34px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.5px;
  max-width: 320px;
  position: relative;
  z-index: 1;
  margin-bottom: 16px;
}
.auth-hero-sub {
  font-size: 15px;
  color: rgba(255,255,255,0.75);
  line-height: 1.6;
  max-width: 300px;
  position: relative;
  z-index: 1;
  margin-bottom: 40px;
}
.auth-hero-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  z-index: 1;
}
.auth-hero-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: rgba(255,255,255,0.85);
}
.auth-hero-feature-check {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.auth-hero-feature-check svg { width: 12px; height: 12px; }

/* Right form panel */
.auth-form-panel {
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 56px;
  overflow-y: auto;
}
.auth-container {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.auth-form-header {
  margin-bottom: 32px;
}
.auth-form-header h2 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.4px;
  margin-bottom: 6px;
}
.auth-form-header p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Tab switcher */
.auth-tabs {
  display: flex;
  gap: 0;
  background: var(--bg-elevated);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 28px;
}
.auth-tab {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 7px;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--tr);
  font-family: 'Roboto', sans-serif;
}
.auth-tab.active {
  background: #fff;
  color: var(--blue);
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.auth-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.auth-card.hidden { display: none !important; }

/* Icon input */
.input-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon-wrap .input-icon {
  position: absolute;
  left: 14px;
  width: 18px; height: 18px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color var(--tr);
}
.input-icon-wrap input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1.5px solid transparent;
  border-radius: 10px;
  color: var(--text-primary);
  padding: 12px 14px 12px 44px;
  font-size: 14px;
  font-family: 'Roboto', sans-serif;
  outline: none;
  transition: all var(--tr);
}
.input-icon-wrap input:hover {
  background: #eaecef;
}
.input-icon-wrap input:focus {
  background: #fff;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26,115,232,0.12);
}
.input-icon-wrap input:focus + .input-icon,
.input-icon-wrap:focus-within .input-icon {
  color: var(--blue);
}
.input-icon-wrap input::placeholder { color: var(--text-muted); }

/* Password toggle */
.input-icon-wrap .input-eye {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex; align-items: center;
  padding: 4px;
  border-radius: 6px;
  transition: color var(--tr);
}
.input-icon-wrap .input-eye:hover { color: var(--text-primary); }
.input-icon-wrap .input-eye svg { width: 18px; height: 18px; }
.input-icon-wrap input.has-eye { padding-right: 44px; }

/* Auth form label */
.auth-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.auth-form-group > label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.1px;
}

/* Auth submit button */
.btn-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px;
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.1px;
  font-family: 'Roboto', sans-serif;
  transition: background var(--tr), box-shadow var(--tr), transform var(--tr);
  margin-top: 4px;
}
.btn-auth:hover {
  background: #1565c0;
  box-shadow: 0 4px 12px rgba(26,115,232,0.35);
  transform: translateY(-1px);
}
.btn-auth:active { transform: translateY(0); box-shadow: none; background: #0d47a1; }

.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-secondary);
}
.auth-switch a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
}
.auth-switch a:hover { text-decoration: underline; }

.auth-error {
  background: #fce8e6;
  border: 1px solid #f4c7c3;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: #c5221f;
  display: none;
  align-items: center;
  gap: 8px;
}
.auth-error.visible { display: flex; }
.auth-error svg { width: 16px; height: 16px; flex-shrink: 0; }

@media (max-width: 860px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-form-panel { padding: 40px 24px; }
}

/* ==================== SETTINGS UI ==================== */
.settings-layout {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.settings-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.settings-section-header {
  padding: 20px 28px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
}
.settings-section-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: #e8f0fe;
  color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.settings-section-icon svg { width: 20px; height: 20px; }
.settings-section-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.settings-section-desc { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.settings-section-body {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.settings-input-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.settings-input-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.settings-input-group .input-hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.4;
}
.settings-input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1.5px solid transparent;
  border-radius: 10px;
  color: var(--text-primary);
  padding: 11px 14px;
  font-size: 14px;
  font-family: 'Roboto', sans-serif;
  outline: none;
  transition: all var(--tr);
}
.settings-input:hover { background: #eaecef; }
.settings-input:focus {
  background: #fff;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26,115,232,0.12);
}
.settings-input::placeholder { color: var(--text-muted); }
.settings-input[readonly] { cursor: pointer; background: #f1f3f4; color: var(--text-secondary); }
.settings-input-addon {
  position: relative;
}
.settings-input-addon .settings-input { padding-right: 46px; }
.settings-input-addon-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 6px;
  border-radius: 6px;
  display: flex; align-items: center;
  transition: color var(--tr), background var(--tr);
}
.settings-input-addon-btn:hover { color: var(--text-primary); background: rgba(60,64,67,0.08); }
.settings-input-addon-btn svg { width: 18px; height: 18px; }
.settings-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}
.settings-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 4px;
}
.settings-save-msg {
  font-size: 13px;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.settings-save-msg.visible { opacity: 1; }
.settings-save-msg svg { width: 16px; height: 16px; }

.settings-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 560px) {
  .settings-form-row { grid-template-columns: 1fr; }
}

/* Attributes & Rules Editor */
.attributes-list, .rules-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 4px;
  margin-bottom: 8px;
}

.attribute-row, .rule-condition-row {
  display: grid;
  gap: 12px;
  align-items: center;
  background: var(--bg-elevated);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  transition: border-color var(--tr), box-shadow var(--tr);
}

.attribute-row:hover, .rule-condition-row:hover {
  border-color: #bdc1c6;
  background: #eaecef;
}

.attribute-row {
  grid-template-columns: 1fr 1.2fr auto;
}

.rule-condition-row {
  grid-template-columns: 1fr 1fr 1fr auto;
}

.attribute-row .form-control, .rule-condition-row .form-control {
  padding: 8px 12px;
  font-size: 13.5px;
  background: #fff;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.attribute-row .form-control:focus, .rule-condition-row .form-control:focus {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue);
}

.btn-remove-attr, .btn-remove-rule {
  flex-shrink: 0;
}

/* Schedule Info Box */
.schedule-info-box {
  display: flex;
  align-items: center;
  background: var(--purple-glow);
  border: 1px solid rgba(26,115,232,0.2);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Disabled button styles */
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--bg-elevated) !important;
  color: var(--text-muted) !important;
  border-color: var(--border) !important;
  box-shadow: none !important;
}

/* Dashboard Premium Welcome Hero Banner */
.dash-hero {
  background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
  border-radius: var(--radius-lg);
  padding: 24px 32px;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.15);
  position: relative;
  overflow: hidden;
}
.dash-hero::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 240px; height: 240px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}
.dash-hero-content {
  z-index: 1;
  max-width: 70%;
}
.dash-hero-title {
  font-size: 24px;
  font-weight: 500;
  margin-bottom: 8px;
  letter-spacing: -0.2px;
}
.dash-hero-subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.5;
}
.dash-hero-illustration {
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Stats Trends Styling */
.stat-trend {
  font-size: 12px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.trend-up { color: var(--green); font-weight: 500; }
.trend-neutral { color: var(--text-secondary); font-weight: 500; }

/* Dashboard Lower Grid Layout */
.improved-layout {
  display: grid;
  grid-template-columns: 1.6fr 1.2fr 1fr;
  gap: 20px;
}

@media (max-width: 1200px) {
  .improved-layout {
    grid-template-columns: 1fr 1fr;
  }
  .quick-actions-wrapper {
    grid-column: span 2;
  }
}
@media (max-width: 800px) {
  .improved-layout {
    grid-template-columns: 1fr;
  }
  .quick-actions-wrapper {
    grid-column: span 1;
  }
  .dash-hero-illustration {
    display: none;
  }
}

/* Quick Actions List */
.quick-actions-list {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: border-color var(--tr), box-shadow var(--tr), transform var(--tr);
  outline: none;
}
.quick-action-btn:hover {
  border-color: var(--blue);
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}
.quick-action-btn:active {
  transform: translateY(0);
}
.quick-action-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.quick-action-info {
  display: flex;
  flex-direction: column;
}
.quick-action-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
}
.quick-action-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* ==================== DROPDOWN MENU ==================== */
.dropdown {
  position: relative;
  display: inline-block;
}
.dropdown-menu {
  position: absolute;
  right: 0;
  top: 100%;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(60,64,67,0.15), 0 2px 4px rgba(60,64,67,0.1);
  z-index: 1000;
  min-width: 125px;
  display: flex;
  flex-direction: column;
  padding: 4px 0;
}
.dropdown-menu.hidden {
  display: none !important;
}
.dropdown-menu button {
  background: none;
  border: none;
  padding: 10px 16px;
  text-align: left;
  font-size: 13.5px;
  color: var(--text-primary);
  cursor: pointer;
  width: 100%;
  transition: background var(--tr);
  font-family: 'Roboto', sans-serif;
}
.dropdown-menu button:hover {
  background: var(--bg-hover);
}
.dropdown-menu button.danger {
  color: var(--red);
}
.dropdown-menu button.danger:hover {
  background: #fce8e6;
}

/* ===================================================
   HELP PAGE & WALKTHROUGH STYLES
   =================================================== */

.help-container {
  max-width: 960px;
  margin: 0 auto;
  padding-bottom: 60px;
  animation: fadeIn 0.4s ease-out;
}

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

.help-hero {
  background: linear-gradient(135deg, #e8f0fe 0%, #d2e3fc 100%);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  border: 1px solid rgba(26,115,232,0.15);
  box-shadow: 0 4px 15px rgba(26,115,232,0.06);
}

.help-hero-content {
  flex: 1;
  max-width: 600px;
}

.help-hero-title {
  font-size: 28px;
  font-weight: 500;
  color: #1967d2;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.help-hero-desc {
  font-size: 15px;
  color: #3c4043;
  margin-bottom: 24px;
  line-height: 1.6;
}

.help-hero-illustration {
  margin-left: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
  100% { transform: translateY(0px); }
}

.help-section-title {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-primary);
  margin: 32px 0 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.help-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  cursor: pointer;
  transition: all var(--tr);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.help-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 20px rgba(60,64,67,0.1);
  border-color: rgba(26,115,232,0.3);
}

.help-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.help-card-icon.blue { background: #e8f0fe; color: #1a73e8; }
.help-card-icon.purple { background: #f3e8fd; color: #a142f4; }
.help-card-icon.teal { background: #e6f4ea; color: #137333; }
.help-card-icon.orange { background: #fef7e0; color: #b06000; }
.help-card-icon.red { background: #fce8e6; color: #c5221f; }
.help-card-icon.gray { background: #f1f3f4; color: #5f6368; }

.help-card h3 {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.help-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
  flex-grow: 1;
}

.help-card-link {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  transition: transform var(--tr);
}

.help-card:hover .help-card-link {
  transform: translateX(4px);
}

/* FAQ Styling */
.help-faq-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px 32px;
  margin-top: 40px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.faq-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.faq-item summary {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px 0;
  outline: none;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: color var(--tr);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 18px;
  color: var(--text-secondary);
  font-weight: 300;
  transition: transform 0.25s ease;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
  color: var(--blue);
}

.faq-item summary:hover {
  color: var(--blue);
}

.faq-answer {
  padding: 8px 0 16px;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  animation: slideDown 0.3s ease-out;
}

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

.faq-answer pre {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  overflow-x: auto;
  margin: 8px 0;
  font-family: monospace;
}

.faq-answer ul {
  padding-left: 20px;
  margin-top: 8px;
}

.faq-answer li {
  margin-bottom: 6px;
}

/* ==================== TOUR OVERLAY & BACKDROP ==================== */
.tour-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 9999;
  pointer-events: auto; /* block interactions behind overlay */
  transition: opacity 0.3s ease;
}

#tour-highlight-box {
  position: fixed;
  border-radius: var(--radius-md);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5); /* Spotlight shadow */
  border: 2px solid var(--blue);
  z-index: 10000;
  pointer-events: none; /* click events pass through */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}

.tour-tooltip {
  position: fixed;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2);
  width: 340px;
  z-index: 10001;
  padding: 20px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Roboto', sans-serif;
  box-sizing: border-box;
}

.tour-tooltip-arrow {
  position: absolute;
  width: 0;
  height: 0;
  border: 8px solid transparent;
  transition: all 0.3s ease;
}

/* Tooltip Arrow orientations */
.tour-tooltip-arrow.top {
  border-bottom-color: #ffffff;
  top: -16px;
  left: 30px;
}
.tour-tooltip-arrow.bottom {
  border-top-color: #ffffff;
  bottom: -16px;
  left: 30px;
}
.tour-tooltip-arrow.left {
  border-right-color: #ffffff;
  left: -16px;
  top: 30px;
}
.tour-tooltip-arrow.right {
  border-left-color: #ffffff;
  right: -16px;
  top: 30px;
}

.tour-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.tour-step-indicator {
  font-size: 11px;
  font-weight: 700;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.tour-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--tr);
}
.tour-close:hover {
  color: var(--text-primary);
}

.tour-body {
  font-size: 13.5px;
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.tour-body p {
  margin-bottom: 8px;
}

.tour-body strong {
  color: var(--blue);
}

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

.tour-buttons-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Feature specific illustration styling in Drawer */
.guide-drawer-body {
  padding: 12px 4px;
}

.guide-step {
  margin-bottom: 24px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.guide-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e8f0fe;
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 2px;
}

.guide-step-content h4 {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.guide-step-content p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.guide-visual-mock {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 16px 0;
  font-family: monospace;
  font-size: 12px;
  color: var(--text-secondary);
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.02);
}
