/* ==========================================================================
   KontorBuch Pro 0.2.1 — Authentic Windows Desktop UI Stylesheet
   Supports 6 Color Schemes via "Ansicht -> Theme":
   - win10:    Windows 10 Desktop (Standard Hell)
   - win7:     Windows 7 Aero / Klassik
   - win11:    Windows 11 Fluent / Mica
   - dimmed:   Reduzierte Helligkeit (Augenschonend / Gedämpft)
   - dark:     Dunkelmodus Anthrazit (Windows Dark)
   - midnight: Dunkelmodus Mitternachtsblau (Navy Dark)
   ========================================================================== */

:root,
body[data-theme="win10"] {
  --win-font: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  --win-mono: "Consolas", "Courier New", monospace;
  --text-main: #111827;
  --text-muted: #4b5563;
  --titlebar-bg: linear-gradient(90deg, #004e98 0%, #0078d7 60%, #1084e0 100%);
  --titlebar-text: #ffffff;
  --menubar-bg: #f5f6f7;
  --menubar-border: #d9d9d9;
  --toolbar-bg: linear-gradient(180deg, #f9fafb 0%, #ebedf0 100%);
  --toolbar-border: #c6c9ce;
  --workspace-bg: #dce0e6;
  --panel-bg: #ebeef2;
  --mask-bg: #f4f6f9;
  --surface-bg: #ffffff;
  --section-header-bg: linear-gradient(90deg, #0055b3 0%, #0078d7 100%);
  --section-header-text: #ffffff;
  --border-outer: #8b9097;
  --border-inner: #bfc4cc;
  --input-bg: #ffffff;
  --input-border: #7a7a7a;
  --input-focus: #0078d7;
  --input-readonly-bg: #e8ecf1;
  --amount-bg: #fffef5;
  --btn-bg: linear-gradient(180deg, #f7f8fa 0%, #e1e4e8 100%);
  --btn-border: #8c9196;
  --btn-hover-bg: linear-gradient(180deg, #e5f1fb 0%, #cce4f7 100%);
  --btn-hover-border: #0078d7;
  --mode-box-expert: linear-gradient(180deg, #1b6ec2 0%, #004599 100%);
  --mode-box-easy: linear-gradient(180deg, #1e824c 0%, #0f5c30 100%);
  --grid-header-bg: linear-gradient(180deg, #f3f4f6 0%, #dfe3e8 100%);
  --grid-row-even: #ffffff;
  --grid-row-odd: #f4f7fa;
  --grid-row-hover: #e5f3ff;
  --grid-row-selected: #cce8ff;
  --grid-border: #d0d5dd;
  --statusbar-bg: #e4e7ec;
  --status-cell-bg: rgba(255, 255, 255, 0.5);
  --pos-color: #15803d;
  --neg-color: #b91c1c;
  --mask-inset-highlight: rgba(255, 255, 255, 0.8);
  --radius-sm: 0px;
  --radius-md: 0px;
  --window-shadow: 0 6px 22px rgba(0, 0, 0, 0.35);
}

/* Windows 7 Classic / Aero Theme */
body[data-theme="win7"] {
  --win-font: Tahoma, "Segoe UI", Arial, sans-serif;
  --text-main: #111827;
  --text-muted: #4b5563;
  --titlebar-bg: linear-gradient(180deg, #3b77bc 0%, #144e94 48%, #0a3c7c 52%, #1e62b5 100%);
  --titlebar-text: #ffffff;
  --menubar-bg: #d8dfe8;
  --menubar-border: #9da8b6;
  --toolbar-bg: linear-gradient(180deg, #ece9d8 0%, #d6d3c4 100%);
  --toolbar-border: #999688;
  --workspace-bg: #c7c5b8;
  --panel-bg: #d9d7c9;
  --mask-bg: #e6e4d8;
  --surface-bg: #ffffff;
  --section-header-bg: linear-gradient(90deg, #0a4291 0%, #2a6bc2 100%);
  --section-header-text: #ffffff;
  --border-outer: #7f7d70;
  --border-inner: #aca899;
  --input-bg: #ffffff;
  --input-border: #7f9db9;
  --input-focus: #003c74;
  --input-readonly-bg: #dcdad0;
  --amount-bg: #fffef2;
  --btn-bg: linear-gradient(180deg, #fcfcfe 0%, #e4e3dc 85%, #d4d1c8 100%);
  --btn-border: #706e64;
  --btn-hover-bg: linear-gradient(180deg, #eef6fd 0%, #c8e0f7 100%);
  --btn-hover-border: #3c7fb1;
  --mode-box-expert: linear-gradient(180deg, #2d73d2 0%, #0544a8 100%);
  --mode-box-easy: linear-gradient(180deg, #2b8a3e 0%, #145c23 100%);
  --grid-header-bg: linear-gradient(180deg, #ebeadb 0%, #d5d2c3 100%);
  --grid-row-even: #ffffff;
  --grid-row-odd: #f0efe8;
  --grid-row-hover: #dcebfc;
  --grid-row-selected: #b9d7fc;
  --grid-border: #c5c2b4;
  --statusbar-bg: #dcd9cc;
  --status-cell-bg: rgba(255, 255, 255, 0.45);
  --pos-color: #15803d;
  --neg-color: #b91c1c;
  --mask-inset-highlight: rgba(255, 255, 255, 0.7);
  --radius-sm: 2px;
  --radius-md: 3px;
  --window-shadow: 2px 3px 12px rgba(0, 0, 0, 0.45);
}

/* Windows 11 Modern Fluent / Mica Theme */
body[data-theme="win11"] {
  --win-font: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  --text-main: #0f172a;
  --text-muted: #475569;
  --titlebar-bg: linear-gradient(90deg, #1f2937 0%, #0f172a 100%);
  --titlebar-text: #f8fafc;
  --menubar-bg: #f8fafc;
  --menubar-border: #e2e8f0;
  --toolbar-bg: #f1f5f9;
  --toolbar-border: #cbd5e1;
  --workspace-bg: #e2e8f0;
  --panel-bg: #f8fafc;
  --mask-bg: #ffffff;
  --surface-bg: #ffffff;
  --section-header-bg: linear-gradient(90deg, #0258b8 0%, #0067c0 100%);
  --section-header-text: #ffffff;
  --border-outer: #cbd5e1;
  --border-inner: #e2e8f0;
  --input-bg: #ffffff;
  --input-border: #94a3b8;
  --input-focus: #0067c0;
  --input-readonly-bg: #f1f5f9;
  --amount-bg: #fefce8;
  --btn-bg: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
  --btn-border: #cbd5e1;
  --btn-hover-bg: #e0f2fe;
  --btn-hover-border: #0284c7;
  --mode-box-expert: linear-gradient(135deg, #0067c0 0%, #004c8c 100%);
  --mode-box-easy: linear-gradient(135deg, #107c41 0%, #0b532b 100%);
  --grid-header-bg: #f1f5f9;
  --grid-row-even: #ffffff;
  --grid-row-odd: #f8fafc;
  --grid-row-hover: #e0f2fe;
  --grid-row-selected: #bae6fd;
  --grid-border: #e2e8f0;
  --statusbar-bg: #f1f5f9;
  --status-cell-bg: #ffffff;
  --pos-color: #15803d;
  --neg-color: #b91c1c;
  --mask-inset-highlight: rgba(255, 255, 255, 0.9);
  --radius-sm: 4px;
  --radius-md: 6px;
  --window-shadow: 0 10px 30px rgba(15, 23, 42, 0.25);
}

/* Reduced Brightness / Eye-Care Theme (Reduzierte Helligkeit / Gedämpft) */
body[data-theme="dimmed"] {
  --win-font: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  --text-main: #1e242b;
  --text-muted: #4a5562;
  --titlebar-bg: linear-gradient(90deg, #2b4c6f 0%, #3a628c 100%);
  --titlebar-text: #eef2f6;
  --menubar-bg: #cfd6de;
  --menubar-border: #aeb8c4;
  --toolbar-bg: linear-gradient(180deg, #d5dce3 0%, #c5ced8 100%);
  --toolbar-border: #a3aebc;
  --workspace-bg: #b8c2cc;
  --panel-bg: #cad2dc;
  --mask-bg: #d4dce5;
  --surface-bg: #dee5ec;
  --section-header-bg: linear-gradient(90deg, #2c527a 0%, #3b6998 100%);
  --section-header-text: #f1f5f9;
  --border-outer: #828e9c;
  --border-inner: #a3afbd;
  --input-bg: #e6ecf2;
  --input-border: #788492;
  --input-focus: #2c527a;
  --input-readonly-bg: #c8d1dc;
  --amount-bg: #e9e7d8;
  --btn-bg: linear-gradient(180deg, #dfe5ec 0%, #c9d2dc 100%);
  --btn-border: #7c8896;
  --btn-hover-bg: linear-gradient(180deg, #cedff0 0%, #b8d0e8 100%);
  --btn-hover-border: #2c527a;
  --mode-box-expert: linear-gradient(180deg, #2d5a88 0%, #1e3f63 100%);
  --mode-box-easy: linear-gradient(180deg, #2b6e46 0%, #1d4d30 100%);
  --grid-header-bg: linear-gradient(180deg, #d3dbe4 0%, #c2ccd7 100%);
  --grid-row-even: #e2e8ef;
  --grid-row-odd: #d8e0e8;
  --grid-row-hover: #c6d9ec;
  --grid-row-selected: #b0cbe6;
  --grid-border: #b5c0cd;
  --statusbar-bg: #c4cdd7;
  --status-cell-bg: rgba(230, 236, 242, 0.65);
  --pos-color: #146c32;
  --neg-color: #9e1c1c;
  --mask-inset-highlight: rgba(255, 255, 255, 0.35);
  --radius-sm: 1px;
  --radius-md: 2px;
  --window-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

/* Windows Dark Mode (Dunkelmodus Anthrazit) */
body[data-theme="dark"] {
  --win-font: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --titlebar-bg: linear-gradient(90deg, #111318 0%, #1f242d 100%);
  --titlebar-text: #f3f4f6;
  --menubar-bg: #1e2229;
  --menubar-border: #2e3440;
  --toolbar-bg: linear-gradient(180deg, #252a34 0%, #1e222a 100%);
  --toolbar-border: #323846;
  --workspace-bg: #12151a;
  --panel-bg: #1b1f27;
  --mask-bg: #232832;
  --surface-bg: #1b1f27;
  --section-header-bg: linear-gradient(90deg, #1d4ed8 0%, #1e40af 100%);
  --section-header-text: #f8fafc;
  --border-outer: #384152;
  --border-inner: #2d3544;
  --input-bg: #15181f;
  --input-border: #4b5563;
  --input-focus: #3b82f6;
  --input-readonly-bg: #202530;
  --amount-bg: #26291e;
  --btn-bg: linear-gradient(180deg, #323947 0%, #262c38 100%);
  --btn-border: #4b5563;
  --btn-hover-bg: linear-gradient(180deg, #25426b 0%, #1d3557 100%);
  --btn-hover-border: #60a5fa;
  --mode-box-expert: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  --mode-box-easy: linear-gradient(180deg, #16a34a 0%, #15803d 100%);
  --grid-header-bg: linear-gradient(180deg, #2a303c 0%, #222731 100%);
  --grid-row-even: #1b1f27;
  --grid-row-odd: #212630;
  --grid-row-hover: #28364d;
  --grid-row-selected: #1e3a6d;
  --grid-border: #2c3340;
  --statusbar-bg: #181c23;
  --status-cell-bg: #222731;
  --pos-color: #4ade80;
  --neg-color: #f87171;
  --mask-inset-highlight: rgba(255, 255, 255, 0.06);
  --radius-sm: 2px;
  --radius-md: 3px;
  --window-shadow: 0 8px 28px rgba(0, 0, 0, 0.65);
}

/* Midnight Blue Dark Mode (Dunkelmodus Mitternachtsblau) */
body[data-theme="midnight"] {
  --win-font: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --titlebar-bg: linear-gradient(90deg, #090d16 0%, #172554 100%);
  --titlebar-text: #f8fafc;
  --menubar-bg: #0f172a;
  --menubar-border: #1e293b;
  --toolbar-bg: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  --toolbar-border: #334155;
  --workspace-bg: #090d16;
  --panel-bg: #0f172a;
  --mask-bg: #172136;
  --surface-bg: #111827;
  --section-header-bg: linear-gradient(90deg, #0369a1 0%, #0284c7 100%);
  --section-header-text: #ffffff;
  --border-outer: #334155;
  --border-inner: #1e293b;
  --input-bg: #0b1120;
  --input-border: #475569;
  --input-focus: #38bdf8;
  --input-readonly-bg: #162033;
  --amount-bg: #1c2726;
  --btn-bg: linear-gradient(180deg, #26354d 0%, #1b263b 100%);
  --btn-border: #475569;
  --btn-hover-bg: linear-gradient(180deg, #075985 0%, #0c4a6e 100%);
  --btn-hover-border: #38bdf8;
  --mode-box-expert: linear-gradient(180deg, #0284c7 0%, #0369a1 100%);
  --mode-box-easy: linear-gradient(180deg, #059669 0%, #047857 100%);
  --grid-header-bg: linear-gradient(180deg, #1e293b 0%, #151f30 100%);
  --grid-row-even: #0f172a;
  --grid-row-odd: #152033;
  --grid-row-hover: #1e3a5f;
  --grid-row-selected: #0369a1;
  --grid-border: #1e293b;
  --statusbar-bg: #0b1120;
  --status-cell-bg: #152033;
  --pos-color: #34d399;
  --neg-color: #fb7185;
  --mask-inset-highlight: rgba(255, 255, 255, 0.07);
  --radius-sm: 2px;
  --radius-md: 4px;
  --window-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
}

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

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  font-family: var(--win-font);
  font-size: 12px;
  color: var(--text-main);
  background: var(--workspace-bg);
  user-select: none;
}

/* ==========================================================================
   1. WINDOWS APPLICATION FRAME & TITLE BAR
   ========================================================================== */
.win-app-window {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  border: 1px solid var(--border-outer);
  background: var(--panel-bg);
}

.win-titlebar {
  height: 28px;
  background: var(--titlebar-bg);
  color: var(--titlebar-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1px;
  flex-shrink: 0;
}

.win-titlebar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  white-space: nowrap;
}

.app-logo-badge {
  width: 18px;
  height: 18px;
  background: #ffffff;
  color: #004e98;
  font-weight: 800;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px #003b73;
}

.win-titlebar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.win-caption-controls {
  display: flex;
  align-items: center;
  gap: 2px;
}

.win-caption-btn {
  width: 26px;
  height: 20px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 11px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.win-caption-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

.win-caption-btn.close:hover,
body[data-theme="win7"] .win-caption-btn.close {
  background: linear-gradient(180deg, #e86b5a 0%, #c62b17 100%);
  border-color: #9e1c0b;
}

/* ==========================================================================
   2. CLASSIC WINDOWS MENU BAR & DROPDOWNS
   ========================================================================== */
.win-menubar {
  height: 24px;
  background: var(--menubar-bg);
  border-bottom: 1px solid var(--menubar-border);
  display: flex;
  align-items: center;
  padding: 0 4px;
  gap: 2px;
  flex-shrink: 0;
  position: relative;
  z-index: 200;
}

.menu-item {
  position: relative;
  padding: 2px 8px;
  font-size: 12px;
  color: var(--text-main);
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
}

.menu-item u {
  text-decoration: underline;
}

.menu-item:hover,
.menu-item.open {
  background: var(--btn-hover-bg);
  border-color: var(--btn-hover-border);
}

.menu-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 250px;
  background: var(--surface-bg);
  border: 1px solid var(--border-outer);
  box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.35);
  padding: 2px;
  z-index: 500;
}

.menu-item.open .menu-dropdown {
  display: block;
}

.menu-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px 4px 24px;
  font-size: 12px;
  color: var(--text-main);
  cursor: pointer;
  position: relative;
  white-space: nowrap;
}

.menu-entry:hover {
  background: var(--grid-row-hover);
}

.menu-entry .shortcut {
  color: var(--text-muted);
  font-size: 11px;
  margin-left: 18px;
}

.menu-entry .check-icon {
  position: absolute;
  left: 6px;
  font-weight: bold;
  color: var(--input-focus);
}

/* Nested Submenu for "Ansicht -> Theme" */
.menu-has-sub {
  position: relative;
}

.menu-submenu {
  display: none;
  position: absolute;
  top: -2px;
  left: 100%;
  min-width: 265px;
  background: var(--surface-bg);
  border: 1px solid var(--border-outer);
  box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.35);
  padding: 2px;
  z-index: 550;
}

.menu-has-sub:hover .menu-submenu {
  display: block;
}

.menu-sep {
  height: 1px;
  background: var(--border-inner);
  margin: 3px 2px;
}

/* ==========================================================================
   3. TOOLBAR & BERICHTSZEITRAUM BAR
   ========================================================================== */
.win-toolbar {
  min-height: 34px;
  background: var(--toolbar-bg);
  border-bottom: 1px solid var(--toolbar-border);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  padding: 2px 6px;
  gap: 4px;
  flex-shrink: 0;
}

.toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 7px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--win-font);
  font-size: 11.5px;
  color: var(--text-main);
  cursor: pointer;
}

.toolbar-btn:hover {
  background: var(--btn-hover-bg);
  border-color: var(--btn-hover-border);
}

.toolbar-btn.active {
  background: var(--grid-row-selected);
  border-color: var(--input-focus);
  font-weight: 600;
}

.toolbar-btn .tb-icon {
  font-size: 14px;
  line-height: 1;
}

.toolbar-divider {
  width: 1px;
  height: 22px;
  background: var(--border-outer);
  margin: 0 4px;
}

.period-filter-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
  font-size: 11.5px;
  color: var(--text-main);
}

.win-input,
.win-select {
  height: 22px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  padding: 1px 5px;
  font-family: var(--win-font);
  font-size: 12px;
  color: var(--text-main);
}

.win-input:focus,
.win-select:focus {
  outline: none;
  border-color: var(--input-focus);
  box-shadow: 0 0 0 1px var(--input-focus);
}

.win-input[readonly] {
  background: var(--input-readonly-bg);
  color: var(--text-muted);
}

.win-btn {
  height: 24px;
  padding: 0 10px;
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-sm);
  font-family: var(--win-font);
  font-size: 12px;
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.win-btn:hover {
  background: var(--btn-hover-bg);
  border-color: var(--btn-hover-border);
}

.win-btn:active {
  transform: translateY(0.5px);
}

.win-btn.primary {
  font-weight: 600;
  border-color: var(--input-focus);
}

/* ==========================================================================
   4. MAIN WORKSPACE SPLIT LAYOUT
   ========================================================================== */
.win-workspace {
  flex: 1;
  display: flex;
  overflow: hidden;
  padding: 4px;
  gap: 4px;
  background: var(--workspace-bg);
}

.main-left-column {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

.right-dock-sidebar {
  width: 340px;
  min-width: 280px;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

/* ==========================================================================
   5. BUCHUNGSMASKE (TOP PANEL — EXACT DESKTOP LAYOUT)
   ========================================================================== */
.booking-mask-panel {
  background: var(--mask-bg);
  border: 1px solid var(--border-outer);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 1fr 126px 215px;
  gap: 10px;
  align-items: start;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 var(--mask-inset-highlight);
}

.mask-fields-col {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.mask-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mask-label {
  width: 82px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  flex-shrink: 0;
}

.date-split-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.date-part-input {
  width: 28px;
  text-align: center;
  font-family: var(--win-mono);
  font-weight: 600;
}

.date-year-input {
  width: 46px;
  text-align: center;
  font-family: var(--win-mono);
  font-weight: 600;
}

.amount-input {
  width: 105px;
  text-align: right;
  font-family: var(--win-mono);
  font-weight: 700;
  font-size: 13px;
  background: var(--amount-bg);
}

.account-no-input {
  width: 78px;
  font-family: var(--win-mono);
  font-weight: 700;
}

.account-name-select {
  flex: 1;
  min-width: 180px;
}

.account-saldo-box {
  width: 105px;
  text-align: right;
  font-family: var(--win-mono);
  font-size: 11.5px;
}

.mask-actions-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mask-actions-col .win-btn {
  width: 100%;
  height: 24px;
  justify-content: center;
}

.mask-right-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mode-banner-btn {
  width: 100%;
  height: 54px;
  border: 1px solid #003370;
  border-radius: var(--radius-sm);
  background: var(--mode-box-expert);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: filter 0.12s;
}

.mode-banner-btn.easy-mode {
  background: var(--mode-box-easy);
  border-color: #0b4a24;
}

.mode-banner-btn:hover {
  filter: brightness(1.08);
}

.mode-banner-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.mode-banner-sub {
  font-size: 10.5px;
  opacity: 0.9;
  margin-top: 2px;
}

.kost-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  font-size: 11.5px;
}

.kost-row select {
  width: 130px;
}

.easy-direction-toggle {
  display: inline-flex;
  border: 1px solid var(--border-outer);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.easy-dir-btn {
  border: none;
  padding: 2px 10px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  background: var(--input-readonly-bg);
  color: var(--text-main);
}

.easy-dir-btn.active-in {
  background: #15803d;
  color: #ffffff;
}

.easy-dir-btn.active-out {
  background: #b91c1c;
  color: #ffffff;
}

/* ==========================================================================
   6. STAPEL & JOURNAL DATA GRIDS
   ========================================================================== */
.grid-section-panel {
  background: var(--surface-bg);
  border: 1px solid var(--border-outer);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.stapel-panel {
  height: 175px;
  min-height: 120px;
  flex-shrink: 0;
}

.journal-panel {
  flex: 1;
  min-height: 160px;
}

.win-section-bar {
  height: 23px;
  background: var(--section-header-bg);
  color: var(--section-header-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px 0 8px;
  font-size: 11.5px;
  font-weight: 600;
  flex-shrink: 0;
}

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

.section-bar-btn {
  height: 18px;
  padding: 0 7px;
  font-size: 11px;
  font-family: var(--win-font);
  background: rgba(255, 255, 255, 0.92);
  color: #003b73;
  border: 1px solid #002752;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
}

.section-bar-btn:hover {
  background: #ffffff;
  color: #0055b3;
}

.grid-scroll-container {
  flex: 1;
  overflow: auto;
  background: var(--surface-bg);
}

.win-datagrid {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  table-layout: fixed;
  color: var(--text-main);
}

.win-datagrid thead th {
  position: sticky;
  top: 0;
  background: var(--grid-header-bg);
  border-right: 1px solid var(--border-inner);
  border-bottom: 1px solid var(--border-outer);
  padding: 3px 5px;
  text-align: left;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 5;
}

.win-datagrid tbody tr {
  border-bottom: 1px solid var(--grid-border);
  background: var(--grid-row-even);
  cursor: pointer;
}

.win-datagrid tbody tr:nth-child(even) {
  background: var(--grid-row-odd);
}

.win-datagrid tbody tr:hover {
  background: var(--grid-row-hover);
}

.win-datagrid tbody tr.selected {
  background: var(--grid-row-selected);
}

.win-datagrid tbody tr.storno-row {
  color: var(--neg-color);
  text-decoration: line-through;
}

.win-datagrid td {
  padding: 2.5px 5px;
  border-right: 1px solid var(--grid-border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.win-datagrid tfoot td {
  position: sticky;
  bottom: 0;
  background: var(--grid-header-bg);
  border-top: 1px solid var(--border-outer);
  border-right: 1px solid var(--border-inner);
  padding: 3px 5px;
  font-weight: 700;
  color: var(--text-main);
  z-index: 5;
}

.num-col {
  text-align: right !important;
  font-family: var(--win-mono);
}

.code-col {
  text-align: center !important;
  font-family: var(--win-mono);
  font-weight: 600;
}

.mini-row-btn {
  padding: 0 5px;
  height: 17px;
  font-size: 10.5px;
  border: 1px solid var(--border-outer);
  background: var(--btn-bg);
  color: var(--text-main);
  cursor: pointer;
  border-radius: 2px;
}

.mini-row-btn:hover {
  background: var(--btn-hover-bg);
  border-color: var(--btn-hover-border);
}

/* ==========================================================================
   7. RIGHT SIDEBAR: EÜR TREEVIEW & KONTENRAHMEN PICKER
   ========================================================================== */
.sidebar-tree-panel {
  flex: 1;
  min-height: 150px;
  background: var(--surface-bg);
  border: 1px solid var(--border-outer);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-accounts-panel {
  flex: 1.25;
  min-height: 150px;
  background: var(--surface-bg);
  border: 1px solid var(--border-outer);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.treeview-container {
  flex: 1;
  overflow: auto;
  padding: 4px 6px;
  font-size: 11.5px;
  color: var(--text-main);
}

.tree-node {
  padding: 2px 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  border: 1px solid transparent;
  border-radius: 2px;
  white-space: nowrap;
}

.tree-node:hover {
  background: var(--grid-row-hover);
}

.tree-node.active {
  background: var(--grid-row-selected);
  border-color: var(--input-focus);
  font-weight: 600;
}

.tree-children {
  padding-left: 16px;
  border-left: 1px dotted var(--border-outer);
  margin-left: 7px;
}

.sidebar-filter-bar {
  padding: 4px 6px;
  background: var(--panel-bg);
  border-bottom: 1px solid var(--border-inner);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ==========================================================================
   8. WINDOWS STATUS BAR (BOTTOM)
   ========================================================================== */
.win-statusbar {
  height: 24px;
  background: var(--statusbar-bg);
  border-top: 1px solid var(--border-outer);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px;
  gap: 4px;
  font-size: 11.5px;
  color: var(--text-main);
  flex-shrink: 0;
}

.status-sunken-cell {
  height: 19px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border-inner);
  box-shadow: inset 1px 1px 1px rgba(0, 0, 0, 0.08);
  background: var(--status-cell-bg);
  white-space: nowrap;
}

.status-sunken-cell.flex-grow {
  flex: 1;
}

.val-pos {
  color: var(--pos-color);
  font-weight: 700;
  font-family: var(--win-mono);
}

.val-neg {
  color: var(--neg-color);
  font-weight: 700;
  font-family: var(--win-mono);
}

/* ==========================================================================
   9. FLOATING WINDOWS / DIALOGS (Graphik, UStVA, EÜR, BWA, SuSa, OPOS, Theme)
   ========================================================================== */
.win-floating-dialog {
  position: fixed;
  top: 72px;
  left: 140px;
  width: 780px;
  max-width: 94vw;
  max-height: 84vh;
  background: var(--panel-bg);
  border: 2px solid var(--input-focus);
  border-radius: var(--radius-md);
  box-shadow: var(--window-shadow);
  display: none;
  flex-direction: column;
  z-index: 400;
  color: var(--text-main);
}

.win-floating-dialog.visible {
  display: flex;
}

.dialog-titlebar {
  height: 26px;
  background: var(--titlebar-bg);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 0 8px;
  font-weight: 600;
  cursor: move;
  flex-shrink: 0;
}

.dialog-body {
  flex: 1;
  padding: 10px;
  overflow: auto;
  background: var(--mask-bg);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dialog-footer {
  padding: 6px 10px;
  background: var(--panel-bg);
  border-top: 1px solid var(--border-inner);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

/* Official Tax Form (UStVA / EÜR) Styling */
.tax-form-sheet {
  background: var(--surface-bg);
  border: 1px solid var(--border-outer);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tax-form-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid var(--border-outer);
  padding-bottom: 8px;
}

.kz-badge {
  display: inline-block;
  min-width: 28px;
  padding: 1px 5px;
  background: #1e3a8a;
  color: #ffffff;
  font-family: var(--win-mono);
  font-weight: 700;
  font-size: 11px;
  text-align: center;
  border-radius: 2px;
}

/* Bar chart inside Graphik floating window */
.chart-canvas-box {
  background: var(--surface-bg);
  border: 1px solid var(--border-outer);
  padding: 16px 14px 8px 14px;
  height: 310px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.chart-bars-area {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 8px;
  border-left: 1px solid var(--border-outer);
  border-bottom: 1px solid var(--border-outer);
  padding: 16px 10px 0 10px;
  position: relative;
}

.chart-bar-col {
  flex: 1;
  max-width: 58px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
}

.chart-bar-val {
  font-size: 10px;
  font-family: var(--win-mono);
  font-weight: 700;
  margin-bottom: 3px;
  white-space: nowrap;
}

.chart-bar-rect {
  width: 100%;
  min-height: 3px;
  border: 1px solid rgba(0, 0, 0, 0.35);
  transition: height 0.25s ease;
}

.chart-bar-label {
  margin-top: 5px;
  font-size: 10px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

/* Theme Picker Cards inside "Ansicht -> Theme" Dialog */
.theme-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.theme-card {
  background: var(--surface-bg);
  border: 2px solid var(--border-outer);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-card:hover {
  border-color: var(--input-focus);
  background: var(--grid-row-hover);
}

.theme-card.active {
  border-color: var(--input-focus);
  background: var(--grid-row-selected);
  font-weight: 600;
}

.theme-swatch {
  width: 44px;
  height: 32px;
  border-radius: 3px;
  border: 1px solid #6b7280;
  flex-shrink: 0;
}

/* ==========================================================================
   10. ANDROID STUDIO-ORIENTED AI AGENT TOOL WINDOW & RIGHT TOOL STRIP
   ========================================================================== */
.ide-toolwindow-strip {
  width: 28px;
  background: var(--toolbar-bg);
  border: 1px solid var(--border-outer);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 0;
  gap: 6px;
  flex-shrink: 0;
}

.ide-strip-btn {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  padding: 8px 3px;
  font-family: var(--win-font);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-main);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.ide-strip-btn:hover {
  background: var(--btn-hover-bg);
  border-color: var(--btn-hover-border);
}

.ide-strip-btn.active {
  background: var(--grid-row-selected);
  border-color: var(--input-focus);
  color: var(--text-main);
  font-weight: 700;
}

.ide-strip-btn .strip-icon {
  writing-mode: horizontal-tb;
  transform: rotate(180deg);
  font-size: 12px;
}

/* AI Agent Tool Window (Docked right or Floating) */
.ai-agent-toolwindow {
  width: 360px;
  min-width: 310px;
  max-width: 440px;
  background: var(--surface-bg);
  border: 1px solid var(--border-outer);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}

.ai-agent-toolwindow.floating {
  position: fixed;
  top: 76px;
  right: 48px;
  height: 76vh;
  width: 410px;
  z-index: 450;
  border: 2px solid var(--input-focus);
  box-shadow: var(--window-shadow);
}

.agent-header-bar {
  height: 28px;
  background: var(--section-header-bg);
  color: var(--section-header-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px 0 8px;
  font-size: 11.5px;
  font-weight: 600;
  flex-shrink: 0;
}

.agent-mode-switch {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  overflow: hidden;
}

.agent-mode-pill {
  border: none;
  background: transparent;
  color: #e2e8f0;
  padding: 1px 6px;
  font-size: 10.5px;
  font-family: var(--win-font);
  cursor: pointer;
}

.agent-mode-pill.active {
  background: #ffffff;
  color: #003b73;
  font-weight: 700;
}

/* Context Chips Bar (Android Studio @Context bar) */
.agent-context-bar {
  padding: 4px 6px;
  background: var(--panel-bg);
  border-bottom: 1px solid var(--border-inner);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 10.5px;
}

.context-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  background: var(--surface-bg);
  border: 1px solid var(--border-outer);
  border-radius: 10px;
  color: var(--text-main);
  cursor: pointer;
  font-family: var(--win-mono);
  font-size: 10px;
}

.context-chip.active {
  background: var(--grid-row-selected);
  border-color: var(--input-focus);
  font-weight: 600;
}

/* Agent Chat Stream */
.agent-chat-stream {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface-bg);
}

.chat-msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 96%;
  font-size: 11.5px;
  line-height: 1.42;
}

.chat-msg.user {
  align-self: flex-end;
  background: var(--grid-row-selected);
  border: 1px solid var(--input-focus);
  border-radius: 6px 6px 1px 6px;
  padding: 6px 8px;
  color: var(--text-main);
}

.chat-msg.agent {
  align-self: flex-start;
  background: var(--mask-bg);
  border: 1px solid var(--border-inner);
  border-radius: 6px 6px 6px 1px;
  padding: 7px 9px;
  color: var(--text-main);
  width: 100%;
}

.agent-msg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--input-focus);
  margin-bottom: 2px;
}

/* Collapsible Reasoning / Context Trace (Android Studio Agent steps) */
.agent-reasoning-box {
  background: var(--panel-bg);
  border: 1px solid var(--border-inner);
  border-radius: 3px;
  padding: 3px 6px;
  font-size: 10.5px;
  color: var(--text-muted);
}

.agent-reasoning-box summary {
  cursor: pointer;
  font-weight: 600;
  user-select: none;
}

.agent-reasoning-list {
  margin-top: 3px;
  padding-left: 14px;
  font-size: 10px;
}

/* Proposed Booking Action Card (Android Studio Diff / Action Card) */
.agent-action-card {
  margin-top: 4px;
  background: var(--surface-bg);
  border: 1px solid var(--input-focus);
  border-radius: 4px;
  overflow: hidden;
}

.agent-action-card-header {
  background: var(--grid-header-bg);
  border-bottom: 1px solid var(--border-inner);
  padding: 3px 7px;
  font-size: 10.5px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.agent-action-card-body {
  padding: 6px 7px;
  font-size: 11px;
  display: grid;
  grid-template-columns: 74px 1fr;
  row-gap: 2px;
  column-gap: 6px;
}

.agent-action-card-footer {
  padding: 5px 7px;
  background: var(--panel-bg);
  border-top: 1px solid var(--border-inner);
  display: flex;
  gap: 5px;
  justify-content: flex-end;
}

/* Document Drag & Drop Area above Chat Input */
.agent-dropzone {
  margin: 0 6px;
  padding: 7px 8px;
  background: var(--panel-bg);
  border: 1px dashed var(--border-outer);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-align: center;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  flex-shrink: 0;
}

.agent-dropzone:hover,
.agent-dropzone.dragover {
  background: var(--grid-row-hover);
  border-color: var(--input-focus);
  border-style: solid;
}

.agent-dropzone-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 5px;
}

.agent-dropzone-sub {
  font-size: 10px;
  color: var(--text-muted);
}

.agent-attached-files {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  width: 100%;
  margin-top: 2px;
}

.agent-file-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 6px;
  background: var(--grid-row-selected);
  border: 1px solid var(--input-focus);
  border-radius: 3px;
  font-size: 10px;
  font-family: var(--win-mono);
  color: var(--text-main);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-input-composer {
  padding: 6px;
  background: var(--mask-bg);
  border-top: 1px solid var(--border-outer);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.agent-textarea {
  width: 100%;
  height: 46px;
  resize: none;
  background: var(--input-bg);
  color: var(--text-main);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  padding: 4px 6px;
  font-family: var(--win-font);
  font-size: 11.5px;
}

.agent-textarea:focus {
  outline: none;
  border-color: var(--input-focus);
}

.agent-composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--text-muted);
}

/* Toast notification */
.win-toast {
  position: fixed;
  bottom: 32px;
  right: 14px;
  background: #1e293b;
  color: #ffffff;
  border: 1px solid #0078d7;
  padding: 8px 14px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 999;
  display: none;
}
