/* ============================================
   🌐 BASIS STIJLEN
   ============================================ */

body {
  font-family: var(--font-body, Arial, sans-serif);
  margin: 20px;
  background-color: var(--bg-app, #f9f9f9);
  color: var(--text, #333);
}

.container {
  max-width: 1200px;
  margin: auto;
  padding: 15px;
}

.hidden {
  display: none;
}

/* ============================================
   📌 SIDEBAR STIJLEN (aangepast voor .hidden toggle)
   ============================================ */

.financien-sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  /* Blokkeert klikken als verborgen */
  transition: opacity 0.3s ease;
}

.financien-sidebar-overlay:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
}

.financien-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: white;
  z-index: 1000;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

.financien-sidebar:not(.hidden) {
  transform: translateX(0);
}

.financien-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid #ddd;
}

.financien-sidebar-content {
  padding: 16px;
  overflow-y: auto;
  height: calc(100vh - 60px);
}

.sidebar-section {
  margin-bottom: 10px;
}

.sidebar-subtitle {
  font-weight: bold;
  margin-bottom: 4px;
  font-size: 0.85em;
  color: #555;
}

.sidebar-toggle {
  background: #eee;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 700;
}

.sidebar-close {
  background: none;
  border: none;
  font-size: 1.5em;
  cursor: pointer;
  padding: 4px 8px;
}

/* ============================================
   📥 INPUT & BUTTONS
   ============================================ */

input {
  padding: 8px;
  margin: 10px 0;
  border: 1px solid #ddd;
  border-radius: 4px;
  width: 300px;
}

button {
  padding: 10px 15px;
  background: var(--btn-primary-bg, #4CAF50);
  color: var(--btn-primary-text, #000);
  border: none;
  cursor: pointer;
  margin-right: 10px;
  margin-bottom: 10px;
  border-radius: 4px;
  font-size: 14px;
  transition: background 0.2s;
}

button:hover {
  background: var(--btn-primary-hover, #45a049);
}

#clearData {
  background: var(--btn-danger-bg, #f44336);
}

#clearData:hover {
  background: var(--danger, #d32f2f);
}

.btn-back {
  background: #ddd;
}

.btn-primary {
  background: var(--btn-primary-bg, #4CAF50);
  color: var(--btn-primary-text, #000);
}

.btn-secondary {
  background: var(--info, #2196F3);
  color: #000;
}

/* ============================================
   ℹ️ INFORMATIE BLOKKEN
   ============================================ */

.info-box {
  background-color: var(--accent-light-bg, #e7f3ff);
  padding: 10px;
  border-left: 4px solid var(--primary, #2196F3);
  margin: 15px 0;
  border-radius: 0 4px 4px 0;
}

.status {
  margin-top: 10px;
  padding: 8px;
  background-color: var(--accent-light-bg, #e8f5e9);
  border-radius: 4px;
  font-size: 14px;
}

/* ============================================
   📊 LAYOUT & STRUCTUUR
   ============================================ */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 0 5px;
  border-bottom: 1px solid #e5e5e5;
  margin-bottom: 0;
}

.app-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-header-center {
  display: flex;
  align-items: center;
  gap: 4px;
}

.app-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.app-logo {
  font-weight: 900;
  font-size: 0.95em;
  color: var(--logo-color, #333);
  white-space: nowrap;
  font-family: var(--font-heading, inherit);
}

.app-nav-link {
  padding: 3px 10px;
  border: 1px solid var(--border, #ddd);
  border-radius: 4px;
  background: var(--nav-inactive-bg, #fff);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8em;
  color: var(--nav-inactive-text, #333);
  text-decoration: none;
  transition: background 0.15s;
}

.app-nav-link:hover {
  background: var(--nav-hover-bg, #eee);
}

.app-nav-link.active {
  background: var(--nav-active-bg, #333);
  color: var(--nav-active-text, #fff);
  border-color: var(--nav-active-bg, #333);
}

.page-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 4px 0;
  margin-bottom: 0;
  border-bottom: 1px solid #e5e5e5;
}

.page-toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-toolbar-label {
  font-size: 0.8em;
  font-weight: 600;
  color: #666;
  white-space: nowrap;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 0 10px;
  border-bottom: 1px solid #e5e5e5;
  margin-bottom: 14px;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar-right {
  flex: 1;
  justify-content: center;
}


.topbar button {
  margin-bottom: 0;
}

.topbar-filter {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  min-width: 170px;
}


.sort-select,
#transactionMonthFilterButton {
  width: 210px;
  height: 35px;
  padding: 6px 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-sizing: border-box;
}

.topbar-filter span {
  font-size: 0.82em;
  color: #555;
}

.sort-control-label {
  font-size: 13px;
  font-weight: 600;
}


.account-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 0;
  align-items: center;
}

.account-filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* ============================================
   📁 ACCOUNT & TRANSACTIES
   ============================================ */

.account-dropzone-topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}


.account-dropzone-topbar .drop-zone {
  flex: 1;
  min-width: 200px;
  max-width: 33.33%;
  min-height: auto;
  padding: 6px 8px;
  border: 1px dashed #ccc;
  border-radius: 6px;
}

/* Compacte topbar dropzone */
.stee-themed .account-dropzone-topbar {
  padding: 0;
}

.stee-themed .account-dropzone-topbar .drop-zone {
  flex: 1;
  min-width: 0;
  max-width: none;
  min-height: 48px;
  padding: var(--sp-1);
  border: 1px dashed var(--border-hover);
  border-radius: var(--radius-md);
}

.account-checkbox {
  display: inline-flex;

  align-items: flex-start;
  gap: 8px;
  padding: 6px 10px;
  min-width: 140px;
  max-width: 220px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: 0.92em;
  box-sizing: border-box;
}

input[type="checkbox"] {
  width: auto;
  margin: 0;
  padding: 0;
}

.file-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  font-weight: 600;
}

.file-label input {
  display: none;
}

#accountSelect {
  width: 100%;
  min-height: 120px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: white;
  font-size: 14px;
}

.tranction-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.transaction-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.transaction-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 4px 6px;
  margin-bottom: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  background: white;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  pointer-events: auto;
  gap: 6px;
  min-height: 22px;
}


.transaction-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}

.card-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.card-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

/* ============================================
   🔍 VOORSPELLING (prediction) HEADER ALIGN
   ============================================ */
/* Compact prediction uses stacked left-lines; ensure consistent column/row spacing */
.compact-prediction {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}

.compact-prediction .card-header-left {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.compact-prediction .card-header-right {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.card-category-detail {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 0.85em;
  font-weight: 600;
  white-space: nowrap;
}

.card-name {
  display: inline-block;
  font-size: 0.85em;
  color: rgba(0, 0, 0, 0.65);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

.card-amount {
  font-weight: bold;
  font-size: 1.05em;
}

.card-balance {
  font-size: 0.85em;
  color: inherit;
}

.transaction-card.left {
  width: 75%;
  margin-right: auto;
  margin-left: 0;
}

.transaction-card.center {
  width: 75%;
  margin-left: 12.5%;
  margin-right: auto;
}

.transaction-card.right {
  width: 75%;
  margin-left: auto;
  margin-right: 0;
}

/* ============================================
   ⚙️ ACCOUNT SECTIES & DROP ZONES
   ============================================ */

.account-section-container {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  justify-content: space-between;
  position: relative;
  max-height: 48px;
  overflow-y: auto;
}


.account-section-container.timeline {
  display: block;
  max-width: 980px;
  margin: 0 auto;
}

.account-section {
  flex: 1;
  min-width: 200px;
  max-width: 33.33%;
}

.account-section.two {
  flex: 1;
  min-width: 200px;
  max-width: 33.33%;
}

.account-section.dragging {
  opacity: 0.6;
}

.account-section.drag-over {
  outline: 2px dashed var(--btn-primary-bg, #4CAF50);
}

.account-section h3 {
  margin: 0 0 4px;
  font-size: 0.85em;
}

.account-section-header {
  font-weight: bold;
  margin-bottom: 4px;
  font-size: 0.9em;
  text-align: center;
}

.account-section.left {
  text-align: left;
}

.account-section.center {
  text-align: center;
}

.account-section.right {
  text-align: right;
}

.drop-zone {
  flex: 1;
  min-width: 200px;
  max-width: 33.33%;
  min-height: 0;
  border: 1px dashed #ccc;
  border-radius: 4px;
  text-align: center;
  line-height: 1;
  color: #999;
  background-color: transparent;
  font-size: 0.75em;
  padding: 2px 4px;
}


.drop-zone.left {
  text-align: left;
  padding-left: 10px;
}

.drop-zone.center {
  text-align: center;
}

.drop-zone.right {
  text-align: right;
  padding-right: 10px;
}

.drop-zone.has-section {
  border: none;
  background-color: transparent;
  padding: 0;
}

.unified-transaction-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 10px;
}


/* Timeline */
.timeline-headers {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
}

.timeline-headers span {
  font-weight: 700;
  width: 50%;
}

.timeline-headers span.right {
  text-align: right;
}

/* ============================================
   🔧 INSTELLINGEN
   ============================================ */

.settings-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.settings-row label {
  flex: 0 0 280px;
  font-weight: 600;
  font-size: 0.95em;
}

.settings-row input {
  flex: 1;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
}

.settings-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 15px;
}

.settings-tablist {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.settings-tab {
  padding: 8px 14px;
  background: #eee;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

.settings-tab.active {
  background: #fff;
  border-color: #bbb;
}

.settings-panel {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 15px;
}

.settings-section-title {
  font-size: 1em;
  font-weight: 700;
  margin: 15px 0 8px;
}

.settings-list-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 1fr) minmax(200px, 1fr) 120px 140px auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.settings-list-row input[type="text"],
.settings-list-row select {
  width: 100%;
}

.settings-list-row .color-input {
  width: 100%;
  padding: 6px;
}

.settings-list-row .remove-button {
  padding: 6px 10px;
  background: var(--btn-danger-bg, #f44336);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.settings-list-row .remove-button:hover {
  background: var(--danger, #d32f2f);
}

.settings-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.settings-page h2 {
  margin: 0;
  font-size: 1.35em;
}

.account-message {
  font-size: 0.95em;
  color: #444;
  margin-bottom: 5px;
}

/* ============================================
   🪟 MODAL & INSTELLINGEN PAGINA
   ============================================ */

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
}

.settings-page {
  display: none;
  position: fixed;
  inset: 0;
  background: #f9f9f9;
  overflow-y: auto;
  z-index: 1000;
  padding: 20px;
  box-sizing: border-box;
}

.settings-page.visible {
  display: block;
}

.settings-page-content {
  max-width: 1200px;
  margin: 0 auto;
}

.modal-content {
  background-color: #fefefe;
  margin: 5% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border-radius: 5px;
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  line-height: 20px;
}

.close:hover {
  color: black;
}

.back-button {
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  background: #ddd;
  cursor: pointer;
  font-size: 1em;
}

.modal-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

/* ============================================
   🎨 TRANSACTIE DETAILS & FORMS
   ============================================ */

.tx-details-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  column-gap: 20px;
  row-gap: 8px;
  align-items: start;
}

.tx-details-label {
  font-weight: 700;
}

.modal-form-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.modal-form-col {
  font-weight: 700;
  width: 130px;
}

.modal-form-col-small {
  font-weight: 700;
  width: 120px;
}

/* ============================================
   📱 RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 720px) {
  .account-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .account-section-container {
    flex-direction: column;
  }

  .account-section.two {
    width: 100%;
    margin: 0;
  }
}
/* ============================================
   🔔 PREDICTION MATCHING BADGES
   ============================================ */

.prediction-badge.matched {
  background: var(--success, #4CAF50);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75em;
  font-weight: 700;
  margin-left: 6px;
}

.prediction-badge.deviation {
  background: var(--warning, #FF9800);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75em;
  font-weight: 700;
  margin-left: 6px;
}

.transaction-badge.deviation {
  background: var(--warning, #FF9800);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75em;
  font-weight: 700;
  margin-left: 6px;
}

.card-name {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}


/* ============================================
   📎 ATTACHMENT ICON
   ============================================ */
.attachment-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 16px;
  cursor: default;
  flex-shrink: 0;
  opacity: 0.8;
}

/* ============================================
   ☑ SELECT MODE & BULK ACTIONS
   ============================================ */
.transaction-card.select-mode {
  cursor: pointer;
  position: relative;
}

.transaction-card.select-mode .select-checkbox {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  flex-shrink: 0;
}

.transaction-card .select-checkbox {
  display: none;
}

.transaction-card.select-mode.selected {
  outline: 3px solid var(--primary, #9C27B0);
  outline-offset: -3px;
  box-shadow: 0 0 8px rgba(156, 39, 176, 0.3);
}

/* ============================================
   🔗 LINKED TRANSACTIONS INDICATOR
   ============================================ */
.linked-indicator {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.75em;
  color: #2196F3;
  font-weight: 600;
  margin-left: 6px;
  white-space: nowrap;
}

/* ============================================
   ℹ️ INFO-ICOON (ⓘ) & CUSTOM TOOLTIP (2026-07-28)
   Conventie: uitleg achter een ⓘ naast de veldnaam (data-tip).
   Native title-tooltips waren onbetrouwbaar/traag; #finTooltip is
   één gedeelde tooltip die door utils.js (initFinTooltip) gepositioneerd wordt.
   ============================================ */
.fin-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  min-width: 16px;
  border: 1px solid #999;
  border-radius: 50%;
  font-size: 11px;
  line-height: 1;
  color: #555;
  cursor: help;
  margin-left: 6px;
  user-select: none;
  font-style: normal;
  box-sizing: border-box;
}

.fin-info:hover,
.fin-info:focus {
  background: #eef2ff;
  border-color: #667;
  color: #1a1a1a;
  outline: none;
}

#finTooltip {
  display: none;
  position: fixed;
  z-index: 3000; /* boven modal (1000) én dropdowns (2000) */
  background: #1f2937;
  color: #fff;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.45;
  max-width: 340px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  white-space: normal;
}

/* ============================================
   📝 MODAL-FORMULIEREN — compacte veldrijen (2026-07-28)
   De globale regel `input { margin: 10px 0; width: 300px }` gaf iedere
   invulveld-flexrij in de modal 10px marge boven én onder: rijen mét een
   tekst/date/select-veld stonden daardoor 20px verder uit elkaar dan rijen
   zonder. Binnen de modal gelden compacte rijen; inline styles
   (width/flex/padding) blijven leidend (hogere specificiteit dan inline is
   hier niet nodig: inline wint altijd).
   ============================================ */
#transactionModal .modal-content input,
#transactionModal .modal-content select,
#transactionModal .modal-content textarea {
  margin: 0;
  width: auto;
}

/* ===== Bedrag-kleuren rood/groen (2026-08-01, todo-1785583173853-z12lv) =====
   Conventie: negatief = rood, positief = groen, nul = neutraal.
   ALLEEN op bedragen (transacties/voorspellingen/sommen) — NOOIT op saldo's. */
.fin-amt-neg { color: var(--amount-negative, #f44336); }
.fin-amt-pos { color: var(--amount-positive, #4CAF50); }
/* Transactie-/voorspellingskaarten gebruiken dezelfde conventie (classes stonden
   al op de bedragen, maar er was geen CSS — daarom leken bedragen zwart). */
.card-amount.negative { color: var(--amount-negative, #f44336); }
.card-amount.positive { color: var(--amount-positive, #4CAF50); }
