/* Popolamus night theme. Loaded after every Figma frame stylesheet so that
   theme colors never change the geometry exported from the light layouts. */
body.dark {
  --bg: #0b1220;
  --bg-soft: #0f192a;
  --surface: #111c2e;
  --surface-soft: #18263c;
  --line: rgba(148, 163, 184, 0.18);
  --text: #f1f5f9;
  --muted: #a5b4c7;
  --muted-2: #7f91aa;
  --primary: #3b82f6;
  --primary-strong: #2b7fff;
  --figma-bg: #0b1220;
  --figma-surface: #111c2e;
  --figma-surface-blue: #18263c;
  --figma-text: #f1f5f9;
  --figma-muted: #a5b4c7;
  --figma-muted-light: #7f91aa;
  --figma-line: rgba(148, 163, 184, 0.18);
  color-scheme: dark;
  background: #0b1220 !important;
  color: #f1f5f9 !important;
}

body.dark #app,
body.dark #view-auth,
body.dark #view-event-detail,
body.dark #view-event-split,
body.dark #view-faq {
  background: #0b1220 !important;
  color: #f1f5f9 !important;
}

body.dark .app-loading-screen {
  background: #0b1220 !important;
}

body.dark .app-loading-logo {
  background: #111c2e !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.34) !important;
}

body.dark .app-loading-wordmark {
  color: #f1f5f9 !important;
}

body.dark .card,
body.dark dialog.modal:not(.create-event-v2):not(.create-receipt-sheet):not(.recognition-result-sheet) {
  border-color: rgba(148, 163, 184, 0.18) !important;
  background: #111c2e !important;
  color: #f1f5f9 !important;
  box-shadow: none !important;
}

body.dark h1,
body.dark h2,
body.dark h3,
body.dark h4,
body.dark strong,
body.dark b,
body.dark label {
  color: #f1f5f9;
}

body.dark .muted,
body.dark .section-label,
body.dark .settings-section-label,
body.dark .overview-section-label,
body.dark .split-list-head {
  color: #a5b4c7 !important;
}

body.dark input,
body.dark textarea,
body.dark select,
body.dark .qty-stepper,
body.dark .segmented {
  border-color: rgba(148, 163, 184, 0.18) !important;
  background-color: #18263c !important;
  color: #f1f5f9 !important;
}

body.dark input::placeholder,
body.dark textarea::placeholder {
  color: #7f91aa !important;
  opacity: 1 !important;
}

body.dark .btn.secondary,
body.dark .btn.ghost,
body.dark .icon-btn {
  border-color: rgba(148, 163, 184, 0.18) !important;
  background: #18263c !important;
  color: #d8e2f0 !important;
  box-shadow: none !important;
}

body.dark .backdrop {
  background: rgba(2, 6, 23, 0.72) !important;
}

/* Persistent bottom navigation */
html body.dark .tabbar {
  border-top-color: rgba(148, 163, 184, 0.16) !important;
  background: rgba(15, 25, 42, 0.94) !important;
}

html body.dark .tabbar .tab {
  color: #8091aa !important;
}

html body.dark .tabbar .tab.active {
  color: #60a5fa !important;
}

html body.dark .tabbar .tab.active::after {
  background: #60a5fa !important;
}

/* Frame 1 — events */
body.dark #view-events.events-v2 {
  background: #0b1220 !important;
  color: #f1f5f9 !important;
}

body.dark #view-events.events-v2 .events-brand,
body.dark #view-events.events-v2 .event-card p,
body.dark #view-events.events-v2 .event-card-bottom,
body.dark #view-events.events-v2 .event-participants,
body.dark #view-events.events-v2 .event-empty-card p {
  color: #a5b4c7 !important;
}

body.dark #view-events.events-v2 .events-header h1,
body.dark #view-events.events-v2 .event-card h3,
body.dark #view-events.events-v2 .event-total,
body.dark #view-events.events-v2 #search-input {
  color: #f1f5f9 !important;
}

body.dark #view-events.events-v2 .events-notifications,
body.dark #view-events.events-v2 .search-row.card,
body.dark #view-events.events-v2 .event-card-v2,
body.dark #view-events.events-v2 .event-empty-card {
  border-color: rgba(148, 163, 184, 0.18) !important;
  background: #111c2e !important;
  color: #f1f5f9 !important;
  box-shadow: none !important;
}

body.dark #view-events.events-v2 .events-notifications img[src$="events-notification.svg"] {
  filter: brightness(0) invert(1);
  opacity: 0.84;
}

body.dark #view-events.events-v2 .events-status-tabs,
body.dark #view-events.events-v2 .event-progress {
  background: #18263c !important;
}

body.dark #view-events.events-v2 .events-status-tabs button {
  color: #9aacbf !important;
}

body.dark #view-events.events-v2 .events-status-tabs button.active {
  background: #263750 !important;
  color: #f1f5f9 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

body.dark #view-events.events-v2 .event-cat-emoji {
  background: #18263c !important;
  color: #f1f5f9 !important;
}

body.dark #view-events.events-v2 .event-my-amount,
body.dark #view-events.events-v2 .event-payment-state {
  background: rgba(249, 115, 22, 0.14) !important;
  color: #fb923c !important;
}

body.dark #view-events.events-v2 .event-my-amount-closed,
body.dark #view-events.events-v2 .event-closed-label,
body.dark #view-events.events-v2 .event-payment-state.is-paid {
  background: rgba(16, 185, 129, 0.14) !important;
  color: #34d399 !important;
}

/* Frame 2 — create/edit event */
html body.dark #create-event-modal.create-event-v2,
html body.dark #create-event-modal.create-event-v2 .create-event-footer {
  background: #0b1220 !important;
  color: #f1f5f9 !important;
}

body.dark #create-event-modal.create-event-v2 .create-event-header .modal-close,
body.dark #create-event-modal.create-event-v2 .create-event-emoji,
body.dark #create-event-modal.create-event-v2 .create-event-title-row input,
body.dark #create-event-modal.create-event-v2 .create-event-field > input,
body.dark #create-event-modal.create-event-v2 .create-event-field > textarea,
body.dark #create-event-modal.create-event-v2 .create-event-field > select,
body.dark #create-event-modal.create-event-v2 .create-event-date-control,
body.dark #create-event-modal.create-event-v2 .create-event-fee-row label {
  border-color: rgba(148, 163, 184, 0.18) !important;
  background: #111c2e !important;
  color: #f1f5f9 !important;
}

body.dark #create-event-modal.create-event-v2 .create-event-header h2,
body.dark #create-event-modal.create-event-v2 .create-event-date-display {
  color: #f1f5f9 !important;
}

body.dark #create-event-modal.create-event-v2 .create-event-label,
body.dark #create-event-modal.create-event-v2 .create-event-fee-row label,
body.dark #create-event-modal.create-event-v2 .create-event-fee-row input,
body.dark #create-event-modal.create-event-v2 input::placeholder,
body.dark #create-event-modal.create-event-v2 textarea::placeholder {
  color: #9aacbf !important;
  -webkit-text-fill-color: currentColor !important;
}

body.dark #create-event-modal.create-event-v2 .create-receipt-type-row {
  border-color: rgba(96, 165, 250, 0.24) !important;
  background: rgba(59, 130, 246, 0.12) !important;
  color: #93c5fd !important;
}

body.dark #create-event-modal.create-event-v2 .create-receipt-type-row > span:last-child {
  color: #9aacbf !important;
}

body.dark #create-event-modal.create-event-v2 .create-receipt-type-icon,
body.dark #create-event-modal.create-event-v2 .create-category-picker {
  background: rgba(59, 130, 246, 0.18) !important;
}

body.dark #create-event-modal.create-event-v2 .create-category-picker .category-btn {
  border-color: rgba(148, 163, 184, 0.16) !important;
  background: #18263c !important;
}

body.dark #create-event-modal.create-event-v2 .create-category-picker .category-btn.active {
  border-color: #3b82f6 !important;
  background: rgba(59, 130, 246, 0.24) !important;
}

body.dark #create-event-modal.create-event-v2.is-editing #new-event-currency:disabled {
  background: #18263c !important;
  color: #7f91aa !important;
  -webkit-text-fill-color: #7f91aa !important;
}

body.dark #create-event-modal.create-event-v2 .create-event-header img[src$="create-back.svg"],
body.dark #view-event-overview img[src$="event-back.svg"],
body.dark #view-event-overview img[src$="event-menu.svg"] {
  filter: brightness(0) invert(1);
  opacity: 0.84;
}

/* Frames 3–4 — receipt and recognition sheets */
html body.dark #create-receipt-sheet.create-receipt-sheet,
html body.dark #recognition-result-sheet.recognition-result-sheet {
  background: #111c2e !important;
  color: #f1f5f9 !important;
}

html body.dark #create-receipt-sheet.create-receipt-sheet .sheet-handle {
  background: rgba(148, 163, 184, 0.3) !important;
}

html body.dark #create-receipt-sheet.create-receipt-sheet .modal-close,
html body.dark #create-receipt-sheet.create-receipt-sheet .receipt-source-card {
  background: #18263c !important;
  color: #f1f5f9 !important;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.18) !important;
}

html body.dark #create-receipt-sheet.create-receipt-sheet .receipt-source-card-photo {
  background: rgba(59, 130, 246, 0.16) !important;
  box-shadow: inset 0 0 0 2px rgba(96, 165, 250, 0.32) !important;
}

html body.dark #create-receipt-sheet.create-receipt-sheet h2,
html body.dark #create-receipt-sheet.create-receipt-sheet .receipt-source-copy strong,
html body.dark #recognition-result-sheet.recognition-result-sheet h2,
html body.dark #recognition-result-sheet.recognition-result-sheet #recognition-result-message strong {
  color: #f1f5f9 !important;
}

html body.dark #create-receipt-sheet.create-receipt-sheet > p,
html body.dark #create-receipt-sheet.create-receipt-sheet .receipt-source-copy small,
html body.dark #recognition-result-sheet.recognition-result-sheet #recognition-result-message,
html body.dark #recognition-result-sheet.recognition-result-sheet .recognition-result-more {
  color: #a5b4c7 !important;
}

html body.dark #create-receipt-sheet.create-receipt-sheet .receipt-sheet-info-surface {
  background: rgba(59, 130, 246, 0.13) !important;
  color: #93c5fd !important;
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.22) !important;
}

html body.dark #create-receipt-sheet.create-receipt-sheet .receipt-source-card-pdf .receipt-source-icon {
  background: rgba(96, 165, 250, 0.14) !important;
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.2) !important;
}

html body.dark #create-receipt-sheet.create-receipt-sheet img[src$="receipt-sheet-pdf.svg"] {
  filter: brightness(0) invert(1);
  opacity: 0.88;
}

html body.dark #recognition-result-sheet.recognition-result-sheet .recognition-result-item {
  background: rgba(16, 185, 129, 0.13) !important;
  color: #e7fff6 !important;
}

/* Frames 5–6 — event summary and positions */
body.dark #view-event-overview.event-overview-v2 {
  background: #0b1220 !important;
  color: #f1f5f9 !important;
}

body.dark #view-event-overview .overview-live-header .back-btn,
body.dark #view-event-overview .overview-live-header .overview-edit-btn,
body.dark #view-event-overview.event-overview-v2.active > .overview-segmented button.active,
body.dark #view-event-overview .overview-participant-card,
body.dark #view-event-overview .participant-selection-details,
body.dark #view-event-overview .overview-actions .btn.secondary,
body.dark #view-event-overview #overview-positions-pane .overview-position-summary,
body.dark #view-event-overview #overview-positions-pane .overview-position-card,
body.dark #view-event-overview #overview-positions-pane .overview-position-empty {
  border-color: rgba(148, 163, 184, 0.18) !important;
  background: #111c2e !important;
  color: #f1f5f9 !important;
  box-shadow: none !important;
}

body.dark #view-event-overview .overview-live-header h1,
body.dark #view-event-overview .overview-live-title > div > span,
body.dark #view-event-overview .overview-live-title strong,
body.dark #view-event-overview .overview-participant-name h4,
body.dark #view-event-overview #overview-positions-pane .overview-position-summary b,
body.dark #view-event-overview #overview-positions-pane .overview-position-copy h4,
body.dark #view-event-overview #overview-positions-pane .overview-position-quantity,
body.dark #view-event-overview #overview-positions-pane .overview-position-side > b {
  color: #f1f5f9 !important;
}

body.dark #view-event-overview .overview-live-header .muted,
body.dark #view-event-overview .overview-live-title p,
body.dark #view-event-overview .overview-section-label,
body.dark #view-event-overview #overview-positions-pane .overview-position-section-label,
body.dark #view-event-overview #overview-positions-pane .overview-position-selected,
body.dark #view-event-overview #overview-positions-pane .overview-position-empty p {
  color: #9aacbf !important;
}

body.dark #view-event-overview.event-overview-v2.active > .overview-segmented,
body.dark #view-event-overview #overview-positions-pane .overview-position-stepper {
  background: #18263c !important;
}

body.dark #view-event-overview.event-overview-v2.active > .overview-segmented button {
  color: #9aacbf !important;
}

body.dark #view-event-overview.event-overview-v2.active > .overview-segmented button.active {
  color: #f1f5f9 !important;
}

body.dark #view-event-overview .overview-you-badge {
  background: rgba(59, 130, 246, 0.18) !important;
  color: #93c5fd !important;
}

body.dark #view-event-overview .overview-payment-toggle {
  background: rgba(249, 115, 22, 0.14) !important;
  color: #fb923c !important;
}

body.dark #view-event-overview .overview-payment-toggle.is-paid,
body.dark #view-event-overview #overview-positions-pane .overview-position-badge {
  background: rgba(16, 185, 129, 0.14) !important;
  color: #34d399 !important;
}

body.dark #view-event-overview #overview-positions-pane .overview-position-warning,
body.dark #view-event-overview #overview-positions-pane .overview-position-card.is-unallocated {
  border-color: rgba(251, 146, 60, 0.38) !important;
}

body.dark #view-event-overview #overview-positions-pane .overview-position-warning {
  background: rgba(249, 115, 22, 0.12) !important;
}

body.dark #view-event-overview #overview-positions-pane .overview-position-warning p,
body.dark #view-event-overview #overview-positions-pane .overview-position-card.is-unallocated .overview-position-side > b,
body.dark #view-event-overview #overview-positions-pane .overview-position-card.is-unallocated .overview-position-badge {
  color: #fb923c !important;
}

body.dark #view-event-overview #overview-positions-pane .overview-position-card.is-unallocated .overview-position-badge {
  background: rgba(249, 115, 22, 0.16) !important;
}

body.dark #view-event-overview #overview-positions-pane .overview-position-add {
  border-color: rgba(148, 163, 184, 0.22) !important;
  color: #a5b4c7 !important;
}

/* Legacy detail and split screens */
body.dark .event-split-v2 .back-btn,
body.dark .event-split-v2 .checks-mini-card,
body.dark .event-split-v2 .split-position-card,
body.dark .event-split-v2 .split-extra-card,
body.dark #view-event-detail .summary-block,
body.dark #view-event-detail .receipts-card,
body.dark #view-event-detail .fee-editor,
body.dark #view-event-detail .participant-row,
body.dark #view-event-detail .position-row,
body.dark #view-faq .faq-item {
  border-color: rgba(148, 163, 184, 0.18) !important;
  background: #111c2e !important;
  color: #f1f5f9 !important;
  box-shadow: none !important;
}

body.dark .event-split-v2 .split-pay-card {
  border-color: rgba(96, 165, 250, 0.26) !important;
  background: rgba(59, 130, 246, 0.14) !important;
}

body.dark .event-split-v2 .split-coeff-stepper {
  background: #18263c !important;
}

body.dark .event-split-v2 > .actions {
  background: linear-gradient(to bottom, rgba(11, 18, 32, 0), #0b1220 22%) !important;
}

/* Frame 7 — bots */
body.dark #view-bots.bots-v2 {
  background: #0b1220 !important;
  color: #f1f5f9 !important;
}

body.dark #view-bots.bots-v2 .bots-header h1,
body.dark #view-bots.bots-v2 .bot-card-title {
  color: #f1f5f9 !important;
}

body.dark #view-bots.bots-v2 .bots-brand,
body.dark #view-bots.bots-v2 .bots-description,
body.dark #view-bots.bots-v2 #bots-description,
body.dark #view-bots.bots-v2 .bot-card-description {
  color: #a5b4c7 !important;
}

body.dark #view-bots.bots-v2 .bot-card {
  border-color: rgba(148, 163, 184, 0.18) !important;
  background: #111c2e !important;
}

body.dark #view-bots.bots-v2 .bot-card-icon,
body.dark #view-bots.bots-v2 .bot-card-open,
body.dark #view-bots.bots-v2 .bot-card-edit-icon {
  background: #18263c !important;
  color: #93c5fd !important;
}

/* Frame 8 — settings */
body.dark #view-settings.settings-v2 {
  background: #0b1220 !important;
  color: #f1f5f9 !important;
}

body.dark #view-settings.settings-v2 > .page-header h1,
body.dark #view-settings.settings-v2 .profile-main h3,
body.dark #view-settings.settings-v2 .settings-limit-top,
body.dark #view-settings.settings-v2 .settings-limit-value-row,
body.dark #view-settings.settings-v2 .settings-limit-value-row span,
body.dark #view-settings.settings-v2 .settings-limit-value-row b,
body.dark #view-settings.settings-v2 .settings-events-total b,
body.dark #view-settings.settings-v2 .setting-main {
  color: #f1f5f9 !important;
}

body.dark #view-settings.settings-v2 .settings-section-label,
body.dark #view-settings.settings-v2 .settings-account-top > span,
body.dark #view-settings.settings-v2 .profile-main > p,
body.dark #view-settings.settings-v2 .profile-id-row > .muted,
body.dark #view-settings.settings-v2 .settings-events-total {
  color: #a5b4c7 !important;
}

body.dark #view-settings.settings-v2 .settings-profile-card,
body.dark #view-settings.settings-v2 .settings-limit-card,
body.dark #view-settings.settings-v2 .settings-appearance,
body.dark #view-settings.settings-v2 .settings-notifications,
body.dark #view-settings.settings-v2 .settings-links,
body.dark #view-settings.settings-v2 .settings-appearance .setting-row,
body.dark #view-settings.settings-v2 .settings-notifications .setting-row,
body.dark #view-settings.settings-v2 .settings-link-row {
  border-color: rgba(148, 163, 184, 0.18) !important;
  background: #111c2e !important;
  color: #f1f5f9 !important;
  box-shadow: none !important;
}

body.dark #view-settings.settings-v2 .settings-appearance .setting-row:first-child,
body.dark #view-settings.settings-v2 .settings-link-row:first-child {
  border-bottom-color: rgba(148, 163, 184, 0.18) !important;
}

body.dark #view-settings.settings-v2 .setting-ico,
body.dark #view-settings.settings-v2 .profile-id-copy-btn,
body.dark #view-settings.settings-v2 .settings-edit-profile-btn,
body.dark #view-settings.settings-v2 .settings-currency-button {
  border-color: rgba(96, 165, 250, 0.16) !important;
  background: #18263c !important;
  color: #dbeafe !important;
}

body.dark #view-settings.settings-v2 .profile-id-copy-btn code,
body.dark #view-settings.settings-v2 .settings-currency-button {
  color: #f1f5f9 !important;
}

body.dark #view-settings.settings-v2 .settings-limit-progress,
body.dark #view-settings.settings-v2 .switch {
  background: #263750 !important;
}

body.dark #view-settings.settings-v2 .settings-appearance .switch:has(input:checked) {
  background: #2563eb !important;
}

body.dark #view-settings.settings-v2 .settings-notification-switch:has(input:checked) {
  background: #00bc7d !important;
}

body.dark #view-settings.settings-v2 .switch span {
  background: #ffffff !important;
}

body.dark #view-settings.settings-v2 .settings-currency-menu {
  border-color: rgba(148, 163, 184, 0.2) !important;
  background: #18263c !important;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.36) !important;
}

body.dark #view-settings.settings-v2 .settings-currency-menu button {
  color: #d8e2f0 !important;
}

body.dark #view-settings.settings-v2 .settings-currency-menu button.active {
  background: rgba(59, 130, 246, 0.18) !important;
  color: #93c5fd !important;
}

body.dark #view-settings.settings-v2 .setting-ico img[src$="settings-theme.svg"],
body.dark #view-settings.settings-v2 .setting-ico img[src$="settings-currency.svg"],
body.dark #view-settings.settings-v2 .setting-ico img[src$="settings-notification.svg"],
body.dark #view-settings.settings-v2 .setting-ico img[src$="settings-faq.svg"],
body.dark #view-settings.settings-v2 .setting-ico img[src$="settings-support.svg"] {
  filter: brightness(0) invert(1);
  opacity: 0.84;
}

/* Standard dialogs and action sheet */
body.dark dialog.modal:not(.create-event-v2):not(.create-receipt-sheet):not(.recognition-result-sheet) input,
body.dark dialog.modal:not(.create-event-v2):not(.create-receipt-sheet):not(.recognition-result-sheet) textarea,
body.dark dialog.modal:not(.create-event-v2):not(.create-receipt-sheet):not(.recognition-result-sheet) select {
  border-color: rgba(148, 163, 184, 0.18) !important;
  background: #18263c !important;
  color: #f1f5f9 !important;
}

body.dark .event-actions-sheet .sheet-handle {
  background: rgba(148, 163, 184, 0.3) !important;
}

body.dark .event-actions-sheet h2,
body.dark .event-action-row strong {
  color: #f1f5f9 !important;
}

body.dark .event-action-row {
  border-color: rgba(148, 163, 184, 0.16) !important;
  background: transparent !important;
  color: #d8e2f0 !important;
}

body.dark .event-action-row small {
  color: #8fa1b9 !important;
}

body.dark .event-action-icon {
  background: #18263c !important;
  color: #93c5fd !important;
}

body.dark .event-action-danger,
body.dark .event-action-danger strong {
  color: #fda4af !important;
}

body.dark .receipt-preview-body,
body.dark .receipt-preview-file {
  border-color: rgba(148, 163, 184, 0.18) !important;
  background: #18263c !important;
  color: #a5b4c7 !important;
}
