:root {
  --bg-dark: #0b0f19;
  --bg-card: #161f30;
  --bg-card-hover: #1e293b;
  --border-color: #26334d;
  --accent-primary: #6366f1;
  --accent-secondary: #a855f7;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
.app-header {
  height: 60px;
  background-color: #111827;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.5px;
}

.brand-title {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-icon {
  width: 34px;
  height: 34px;
  background: var(--accent-gradient);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Buttons */
.btn {
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

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

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #ffffff;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

/* Main Layout */
.app-container {
  display: flex;
  flex: 1;
  height: calc(100vh - 60px);
  overflow: hidden;
}

/* Sidebar Navigation */
.sidebar {
  width: 210px;
  background: #0d1322;
  border-right: 1px solid var(--border-color);
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

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

.nav-item.active {
  color: #ffffff;
  background: var(--bg-card);
  border-left: 3px solid var(--accent-primary);
}

/* Workspace Split Layout */
.workspace {
  flex: 1;
  display: flex;
  height: 100%;
  overflow: hidden;
}

.panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* Left Panel: Inputs & Controls */
.panel-editor {
  width: 480px;
  min-width: 420px;
  border-right: 1px solid var(--border-color);
  background: var(--bg-dark);
  flex-shrink: 0;
}

/* Right Panel: Expanded Live Canvas */
.panel-preview {
  flex: 1;
  background: #060913;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.panel-header {
  height: 48px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #111827;
  flex-shrink: 0;
}

.panel-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Custom Scrollbars */
.panel-body::-webkit-scrollbar,
.preview-container::-webkit-scrollbar {
  width: 6px;
}
.panel-body::-webkit-scrollbar-track,
.preview-container::-webkit-scrollbar-track {
  background: transparent;
}
.panel-body::-webkit-scrollbar-thumb,
.preview-container::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
}

/* Form Controls */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input, .form-textarea, .form-select {
  font-family: var(--font-family);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-main);
  font-size: 13.5px;
  outline: none;
  transition: all 0.2s ease;
  width: 100%;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.5;
}

/* Subject Cards */
.subject-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.subject-card:hover {
  border-color: var(--accent-primary);
  background: var(--bg-card-hover);
}

.subject-card.selected {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.15);
  box-shadow: 0 0 0 1px var(--accent-primary);
}

/* Drag & Drop Accordion Section Cards */
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.section-card.collapsed {
  gap: 0;
}

.section-card.dragging {
  opacity: 0.4;
  border-style: dashed;
  border-color: var(--accent-primary);
}

.section-card.drag-over {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--accent-primary);
  transform: scale(1.01);
}

.drag-handle {
  cursor: grab;
  color: var(--text-dim);
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 4px;
  user-select: none;
}
.drag-handle:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.1);
}
.drag-handle:active {
  cursor: grabbing;
}

.section-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  padding: 4px 0;
}

.section-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  flex: 1;
}

.section-title-preview {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.section-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.accordion-arrow {
  font-size: 11px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
  margin-left: 4px;
}

.section-card.expanded .accordion-arrow {
  transform: rotate(180deg);
}

.section-card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Color Theme Pill Selector */
.theme-picker {
  display: flex;
  gap: 6px;
  align-items: center;
}

.theme-pill {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.theme-pill:hover {
  transform: scale(1.15);
}

.theme-pill.selected {
  border-color: #ffffff;
  box-shadow: 0 0 0 2px var(--accent-primary);
  transform: scale(1.15);
}

.badge {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 9999px;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Preview Canvas Area */
.preview-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.device-toggle {
  background: #1e293b;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 3px;
  display: flex;
  gap: 2px;
}

.device-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.device-btn.active {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.preview-container {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 24px;
  overflow-y: auto;
  height: 100%;
}

.preview-frame-wrapper {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  margin: 0 auto;
}

.preview-frame-wrapper.desktop {
  width: 720px;
  min-height: 800px;
  height: 100%;
}

.preview-frame-wrapper.mobile {
  width: 385px;
  height: 720px;
  border: 12px solid #1e293b;
  border-radius: 38px;
}

iframe#email-iframe {
  width: 100%;
  height: 100%;
  min-height: 750px;
  border: none;
  background: #ffffff;
}

/* Modals Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.modal {
  background: #161f30;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 520px;
  max-width: 92%;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  transform: translateY(10px);
  transition: transform 0.2s ease;
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

.modal-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

/* Utility Spinner */
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

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

/* ==========================================================================
   Analytics & Performance Dashboard Styles
   ========================================================================== */

.analytics-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

.analytics-filter-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.filter-group-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 5px 10px;
}

.filter-pill label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-select {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 12.5px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  padding-right: 4px;
}

.filter-select option {
  background: #1e293b;
  color: #ffffff;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.4);
}

.kpi-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-icon {
  font-size: 18px;
}

.kpi-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
  line-height: 1.1;
  font-family: var(--font-family);
}

.kpi-subtext {
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

.kpi-badge-positive {
  color: #34d399;
  font-weight: 700;
}

.kpi-badge-neutral {
  color: #94a3b8;
  font-weight: 600;
}

.analytics-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 1080px) {
  .analytics-two-col {
    grid-template-columns: 1fr;
  }
}

.analytics-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.analytics-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Geo Leaderboard Table */
.geo-table-wrap {
  overflow-x: auto;
}

.geo-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.geo-table th {
  padding: 10px 12px;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-color);
}

.geo-table td {
  padding: 12px 12px;
  border-bottom: 1px solid rgba(38, 51, 77, 0.5);
  color: var(--text-main);
}

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

.geo-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.geo-country-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.geo-bar-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}

.geo-bar-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 4px;
}

/* Section Click Heatmap */
.heatmap-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.heatmap-item {
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.heatmap-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.heatmap-item-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.heatmap-item-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  flex: 1;
}

.heatmap-item-stats {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-secondary);
}

.heatmap-bar-track {
  width: 100%;
  height: 7px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
}

.heatmap-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* Donut & Client Breakdown */
.client-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.client-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.client-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
  font-weight: 600;
}

.client-pct {
  font-weight: 800;
  color: var(--text-main);
}

/* ==========================================================================
   Issues Library & Draft Manager Styles
   ========================================================================== */

.library-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

.library-filter-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.library-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 280px;
}

.library-search-input {
  flex: 1;
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text-main);
  outline: none;
  font-family: var(--font-family);
}

.library-search-input:focus {
  border-color: var(--accent-primary);
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

.issue-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 20px;
  gap: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.issue-card:hover {
  transform: translateY(-3px);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

.issue-card-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.issue-tag {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 6px;
  background: #0f172a;
  border: 1px solid var(--border-color);
  color: #a5b4fc;
  letter-spacing: 0.5px;
}

.issue-status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.status-published {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.status-draft {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.status-scheduled {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.issue-card-body {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.issue-card-pub {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  height: 16px;
  line-height: 16px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.issue-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  height: 44px;
  letter-spacing: -0.3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

.issue-card-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.45;
  height: 38px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

.issue-metrics-bar {
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  height: 38px;
  box-sizing: border-box;
  margin-top: auto;
  margin-bottom: 4px;
}

.issue-metrics-bar strong {
  color: var(--text-main);
}

.issue-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(38, 51, 77, 0.5);
  margin-top: 0;
}

/* Sidebar Layout with Bottom Profile */
.sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}
.sidebar-nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-user-profile {
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-top: auto;
}
.profile-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #ffffff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.15);
}

/* Auth Screens */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 25, 0.96);
  backdrop-filter: blur(16px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-card {
  background: #161f30;
  border: 1px solid #26334d;
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}
.google-signin-btn {
  background: #ffffff;
  color: #1f2937;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 20px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.google-signin-btn:hover {
  background: #f8fafc;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transform: translateY(-1px);
}

/* Nested FAQ Accordion Styles */
.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.faq-item {
  background: #161f30;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.2s;
}
.faq-item:hover {
  border-color: rgba(99, 102, 241, 0.4);
}
.faq-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  background: #161f30;
  font-weight: 700;
  font-size: 14.5px;
  user-select: none;
}
.faq-header:hover {
  background: #1a2538;
}
.faq-chevron {
  transition: transform 0.25s ease;
  font-size: 13px;
  color: var(--text-dim);
}
.faq-item.active > .faq-header .faq-chevron {
  transform: rotate(90deg);
  color: #818cf8;
}
.faq-content {
  display: none;
  padding: 0 20px 20px;
  border-top: 1px solid rgba(38, 51, 77, 0.5);
  color: #cbd5e1;
  font-size: 13.5px;
  line-height: 1.65;
  background: #111927;
}
.faq-item.active > .faq-content {
  display: block;
}

/* Sub-accordion / Nested Guide */
.faq-nested-item {
  background: #161f30;
  border: 1px solid #232f44;
  border-radius: 8px;
  margin-top: 12px;
  overflow: hidden;
}
.faq-nested-header {
  padding: 12px 16px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #161f30;
  color: #e2e8f0;
}
.faq-nested-header:hover {
  background: #1c283c;
}
.faq-nested-content {
  display: none;
  padding: 14px 16px;
  border-top: 1px solid #232f44;
  font-size: 13px;
  background: #0f172a;
}
.faq-nested-item.active > .faq-nested-header .faq-chevron {
  transform: rotate(90deg);
  color: #38bdf8;
}
.faq-nested-item.active > .faq-nested-content {
  display: block;
}

.faq-step {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}
.faq-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  font-weight: 700;
  font-size: 11.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.faq-step-text {
  flex: 1;
}
.faq-step-text strong {
  color: #f8fafc;
}

/* Admin Permissions Table */
.admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.admin-table th {
  background: #111827;
  color: var(--text-dim);
  font-weight: 600;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(38, 51, 77, 0.5);
  background: #161f30;
  color: var(--text-main);
  vertical-align: middle;
}
.admin-table tr:hover td {
  background: #1b263b;
}

/* =========================================================================
   Toast Notification System
   ========================================================================= */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 420px;
  width: calc(100vw - 48px);
}

.toast-item {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 1px rgba(255, 255, 255, 0.2);
  color: var(--text-main);
  font-size: 13px;
  line-height: 1.5;
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast-item.toast-exit {
  animation: toastSlideOut 0.25s ease forwards;
}

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

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

.toast-icon {
  font-size: 18px;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 1px;
}

.toast-content {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.toast-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 0 0 8px;
  transition: color 0.15s ease;
  flex-shrink: 0;
}

.toast-close:hover {
  color: var(--text-main);
}

.toast-success {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(16, 185, 129, 0.15);
}
.toast-success .toast-icon { color: #34d399; }

.toast-error {
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(239, 68, 68, 0.15);
}
.toast-error .toast-icon { color: #f87171; }

.toast-warning {
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(245, 158, 11, 0.15);
}
.toast-warning .toast-icon { color: #fbbf24; }

.toast-info {
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(99, 102, 241, 0.15);
}
.toast-info .toast-icon { color: #a5b4fc; }


