/* =========================================================================
   Tabula – .NET 10 könyvelő- és számlázóprogram
   Az eredeti React/BlueprintJS alkalmazás vizuális nyelvének átültetése.
   ========================================================================= */

:root {
  /* Sidebar */
  --color-sidebar-background: #01115e;
  --color-sidebar-text: #fff;
  --color-sidebar-toggle: #6b8193;
  --color-sidebar-menu-item-text: rgb(255, 255, 255);
  --color-sidebar-menu-item-hover-background: rgba(255, 255, 255, 0.2);
  --color-sidebar-menu-item-active-background: rgba(255, 255, 255, 0.2);
  --color-sidebar-menu-label-color: rgba(255, 255, 255, 0.5);
  --color-sidebar-popover-submenu-bg: rgb(1, 20, 62);

  /* App */
  --color-app-body: #f5f6fa;
  --color-dashboard-navbar-item-text: #32304a;
  --color-dashboard-navbar-item-hover-background: rgba(167, 182, 194, 0.12);
  --color-dashboard-navbar-item-active-background: #a7b6c21f;
  --color-dashboard-topbar-title-text: #48485c;
  --color-dashboard-actionsbar-border: #e1e2e8;

  /* Card */
  --color-card-background: #fff;
  --color-card-border: #d2dce2;
  --color-topbar-background: #fff;
  --color-subtle-background: #fbfbfd;
  --color-metric-value: #2c3a5d;
  --color-input-background: #fff;
  --color-hover-background: #e6effb;
  --color-table-entry-head: #fbfbfd;
  --color-card-header-border: #eef0f3;

  /* Datatable */
  --color-datatable-head-background: #f2f3fb;
  --color-datatable-head-text: #415060;
  --color-datatable-head-border: #d2dce2;
  --color-datatable-cell-hover-background: #f5f6f7;
  --color-datatable-cell-border: #d8d8d8;

  /* Blueprint-szintű vezérlők */
  --bp-intent-primary: #0069ff;
  --bp-intent-primary-hover: #338dff;
  --bp-text-color: #182026;
  --bp-text-muted: #5f7080;
  --bp-danger: #c23030;
  --bp-success: #0f9960;
  --bp-warning: #c87619;
  --bp-border-radius: 3px;
  --bp-font-family: "Noto Sans", -apple-system, "Segoe UI", Roboto, sans-serif;

  --sidebar-width: 240px;
  --topbar-height: 60px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--bp-font-family);
  font-size: 14px;
  line-height: 1.4;
  color: var(--bp-text-color);
  background-color: var(--color-app-body);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--bp-intent-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ======================= Alkalmazás váz ======================= */

.app-shell {
  display: flex;
  min-height: 100vh;
  min-width: 1100px;
}

.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--color-sidebar-background);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 20;
}

.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.25); }

.sidebar__head {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-decoration: none;
  opacity: 0.95;
}
.sidebar__logo:hover { text-decoration: none; opacity: 1; }
.sidebar__logo-mark {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bp-intent-primary);
  border-radius: 4px;
  font-size: 15px; font-weight: 800;
}

.sidebar__org {
  margin-top: 14px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar__org-sub {
  display: block;
  font-size: 12px;
  font-weight: 400;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.6);
}

.sidebar__menu {
  flex: 1;
  padding: 8px 0 32px;
}

.sidebar__label {
  padding: 14px 20px 6px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--color-sidebar-menu-label-color);
}

/* Összecsukható fő menücsoportok */
.sidebar__label--toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  font-family: inherit;
  line-height: inherit;
  text-align: left;
  user-select: none;
}
.sidebar__label--toggle:hover { color: rgba(255, 255, 255, 0.8); }
.sidebar__label--toggle:focus-visible {
  outline: 1px solid var(--color-sidebar-toggle);
  outline-offset: -1px;
}

.sidebar__chevron {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-right: 3px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.15s ease-in-out;
}
.sidebar__group--collapsed .sidebar__chevron { transform: rotate(-45deg); }
.sidebar__group--collapsed .sidebar__group-items { display: none; }

.sidebar__item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 20px;
  font-size: 15px;
  font-weight: 400;
  color: var(--color-sidebar-menu-item-text);
  border-left: 3px solid transparent;
  transition: background-color 0.12s ease-in-out;
}
.sidebar__item:hover {
  background: var(--color-sidebar-menu-item-hover-background);
  color: #fff;
  text-decoration: none;
}
.sidebar__item.active {
  background: var(--color-sidebar-menu-item-active-background);
  border-left-color: var(--bp-intent-primary);
  font-weight: 500;
}
.sidebar__item-icon {
  width: 18px;
  flex: 0 0 18px;
  opacity: 0.75;
  display: inline-flex;
}

.sidebar__version {
  padding: 0 20px 16px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
}

/* ======================= Tartalomterület ======================= */

.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-height);
  background: var(--color-topbar-background);
  border-bottom: 1px solid var(--color-dashboard-actionsbar-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar__title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-dashboard-topbar-title-text);
}
.topbar__actions { display: flex; align-items: center; gap: 10px; }

.topbar__user {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--bp-text-muted);
}

.page {
  padding: 24px;
  flex: 1;
}

/* ======================= Kártyák ======================= */

.card {
  background: var(--color-card-background);
  border: 1px solid var(--color-card-border);
  border-radius: 4px;
  margin-bottom: 20px;
}

.card__header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-card-header-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card__title {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  color: var(--color-metric-value);
}
.card__body { padding: 18px; }
.card__body--flush { padding: 0; }

/* ======================= űrlap elemek ======================= */

.form-group { margin-bottom: 14px; }

.label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--bp-text-muted);
}
.label--required::after { content: " *"; color: var(--bp-danger); }

.input, .select, .textarea {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  padding: 7px 10px;
  color: var(--bp-text-color);
  background: var(--color-input-background);
  border: 1px solid rgba(16, 22, 26, 0.2);
  border-radius: var(--bp-border-radius);
  box-shadow: inset 0 1px 1px rgba(16, 22, 26, 0.06);
  transition: border-color 0.1s, box-shadow 0.1s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--bp-intent-primary);
  box-shadow: 0 0 0 2px rgba(0, 105, 255, 0.2);
}
.input[readonly], .input[disabled], .select[disabled] {
  background: #f2f3f7;
  color: var(--bp-text-muted);
  cursor: not-allowed;
}
.textarea { min-height: 72px; resize: vertical; }

.field-hint { font-size: 12px; color: var(--bp-text-muted); margin-top: 4px; }
.field-error { font-size: 12px; color: var(--bp-danger); margin-top: 4px; }

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

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--bp-text-muted);
  cursor: pointer;
}
.checkbox input { width: 16px; height: 16px; accent-color: var(--bp-intent-primary); cursor: pointer; }

/* ======================= Gombok ======================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: var(--bp-border-radius);
  border: 1px solid rgba(16, 22, 26, 0.2);
  background: #e6effb;
  color: #182026;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.1s, box-shadow 0.1s;
}
.btn:hover { background: #cfdcee; text-decoration: none; }
.btn:active { background: #b8cde7; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn--primary {
  background: var(--bp-intent-primary);
  border-color: var(--bp-intent-primary);
  color: #fff;
}
.btn--primary:hover { background: var(--bp-intent-primary-hover); border-color: var(--bp-intent-primary-hover); }

.btn--success { background: var(--bp-success); border-color: var(--bp-success); color: #fff; }
.btn--success:hover { background: #0e8150; }

.btn--danger { background: var(--bp-danger); border-color: var(--bp-danger); color: #fff; }
.btn--danger:hover { background: #a12828; }

.btn--minimal {
  background: transparent;
  border-color: transparent;
  color: var(--bp-intent-primary);
}
.btn--minimal:hover { background: rgba(0, 105, 255, 0.1); }

.btn--sm { font-size: 13px; padding: 4px 9px; }

.btn-group { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ======================= Adattábla ======================= */

.table-wrap { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table th {
  background: var(--color-datatable-head-background);
  color: var(--color-datatable-head-text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-datatable-head-border);
  white-space: nowrap;
}
.table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--color-datatable-cell-border);
  vertical-align: middle;
}
.table tbody tr:hover { background: var(--color-datatable-cell-hover-background); }
.table tbody tr:last-child td { border-bottom: none; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions a { margin-left: 8px; }

.table--entries th { background: var(--color-table-entry-head); text-transform: none; font-size: 12px; }
.table--entries input, .table--entries select {
  font-size: 13px; padding: 5px 7px;
}
.table--entries td { padding: 6px 8px; }

.empty-state {
  padding: 56px 20px;
  text-align: center;
  color: var(--bp-text-muted);
}
.empty-state__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-metric-value);
  margin-bottom: 6px;
}

/* ======================= Szűrő sáv ======================= */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  padding: 14px 18px;
  background: var(--color-subtle-background);
  border-bottom: 1px solid var(--color-card-header-border);
}
.filter-bar .form-group { margin-bottom: 0; }
.filter-bar .input, .filter-bar .select { min-width: 160px; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-top: 1px solid #eef0f3;
  font-size: 13px;
  color: var(--bp-text-muted);
}
.pagination__pages { display: flex; gap: 6px; }
.pagination a, .pagination span.current {
  padding: 4px 9px;
  border: 1px solid rgba(16, 22, 26, 0.15);
  border-radius: var(--bp-border-radius);
  color: var(--bp-text-color);
  text-decoration: none;
  background: var(--color-input-background);
}
.pagination span.current {
  background: var(--bp-intent-primary);
  border-color: var(--bp-intent-primary);
  color: #fff;
  font-weight: 600;
}
.pagination a:hover { background: var(--color-hover-background); text-decoration: none; }

/* ======================= Jelzések (badge) ======================= */

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  white-space: nowrap;
}
.badge--draft    { background: #eceff1; color: #546e7a; }
.badge--unpaid   { background: #fff3e0; color: #b26a00; }
.badge--paid     { background: #e6f4ea; color: #1e7e34; }
.badge--overdue  { background: #fdecea; color: #c62828; }
.badge--void     { background: #f3f3f3; color: #9e9e9e; }
.badge--delivered{ background: #e3f2fd; color: #1565c0; }
.badge--approved { background: #e6f4ea; color: #1e7e34; }
.badge--rejected { background: #fdecea; color: #c62828; }
.badge--closed   { background: #ede7f6; color: #5e35b1; }

/* ======================= Riasztások ======================= */

.alert {
  padding: 12px 14px;
  border-radius: var(--bp-border-radius);
  margin-bottom: 18px;
  font-size: 14px;
  border: 1px solid transparent;
}
.alert--danger  { background: #fdecea; border-color: #f5c6c2; color: #8b1f1f; }
.alert--success { background: #e6f4ea; border-color: #b7dfc3; color: #155724; }
.alert--warning { background: #fff8e5; border-color: #f5e0a8; color: #7a5b00; }
.alert--info    { background: #e3f2fd; border-color: #b3d7f5; color: #0d4d7a; }

/* ======================= Kezdőlap ======================= */

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.metric-card {
  background: var(--color-card-background);
  border: 1px solid var(--color-card-border);
  border-radius: 4px;
  padding: 16px 18px;
}
.metric-card__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--bp-text-muted);
  margin-bottom: 6px;
}
.metric-card__value {
  font-size: 24px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--color-metric-value);
}
.metric-card--receivable .metric-card__value { color: #1f6fb2; }
.metric-card--payable .metric-card__value { color: #b2543a; }
.metric-card--cash .metric-card__value { color: #1e7e34; }
.metric-card--profit .metric-card__value { color: #0f6d5a; }

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 1200px) { .dashboard-grid { grid-template-columns: 1fr; } }

.chart { width: 100%; height: 240px; display: block; }

.chart-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #eef0f3;
  font-size: 12px;
}
.chart-labels__item { color: var(--bp-text-muted); white-space: nowrap; }
.chart-labels__income { color: var(--bp-intent-primary); margin-left: 6px; font-variant-numeric: tabular-nums; }
.chart-labels__expense { color: #c06361; margin-left: 6px; font-variant-numeric: tabular-nums; }

/* ======================= Jelentések ======================= */

.report-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.report-table td, .report-table th {
  padding: 6px 10px;
  border-bottom: 1px solid #eef0f3;
}
.report-table td.num, .report-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.report-table .section-title {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 12px;
  color: var(--color-metric-value);
  padding-top: 14px;
  border-bottom: 1px solid var(--color-datatable-head-border);
}
.report-table .group-header { font-weight: 600; padding-left: 0; }
.report-table .subtotal { font-weight: 600; background: #fafbfe; }
.report-table .total {
  font-weight: 700;
  background: #eef2fb;
  border-top: 2px solid #c3cfe8;
}
.report-table td.depth-1 { padding-left: 20px; }
.report-table td.depth-2 { padding-left: 34px; }

/* ======================= Űrlaplap (bizonylat) ======================= */

.doc-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-top: 14px;
  padding: 14px;
  background: #f8f9fc;
  border: 1px solid #e4e8f0;
  border-radius: 4px;
}
.doc-summary__item { text-align: right; }
.doc-summary__item--total {
  text-align: right;
  font-weight: 700;
  font-size: 15px;
  color: var(--color-metric-value);
}
.doc-summary__label {
  font-size: 12px;
  color: var(--bp-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.doc-summary__value { font-size: 15px; font-variant-numeric: tabular-nums; }

.entry-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ======================= Számlatörvény ======================= */

.account-type-group { margin-bottom: 20px; }
.account-type-group__title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-metric-value);
  padding-bottom: 6px;
  margin-bottom: 8px;
  border-bottom: 1px solid #e4e8f0;
}

/* ======================= Bejelentkezés ======================= */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #01115e 0%, #0a2273 45%, #0b3ea8 100%);
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  padding: 32px;
}
.auth-card__logo {
  display: flex; align-items: center; gap: 10px;
  justify-content: center;
  font-size: 22px; font-weight: 700; color: #01115e;
  margin-bottom: 6px;
}
.auth-card__subtitle {
  text-align: center;
  color: var(--bp-text-muted);
  font-size: 14px;
  margin-bottom: 24px;
}
.auth-card__footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #eef0f3;
  font-size: 13px;
  color: var(--bp-text-muted);
  text-align: center;
}

.error-summary {
  background: #fdecea;
  border: 1px solid #f5c6c2;
  color: #8b1f1f;
  border-radius: var(--bp-border-radius);
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: 14px;
}
.error-summary ul { margin: 6px 0 0; padding-left: 20px; }

/* ======================= Segédosztályok ======================= */

.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--bp-text-muted); }
.text-success { color: var(--bp-success); }
.text-danger { color: var(--bp-danger); }
.text-warning { color: var(--bp-warning); }
.text-bold { font-weight: 600; }
.text-small { font-size: 12px; }
.mono { font-family: "Consolas", "Courier New", monospace; font-size: 13px; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gap-8 { gap: 8px; }
.wrap { flex-wrap: wrap; }

@media print {
  .sidebar, .topbar, .filter-bar, .pagination, .no-print, .ai-fab, .ai-panel { display: none !important; }
  .page { padding: 0; }
  .card { border: none; }
  body { background: #fff; }
}

/* =========================================================================
   15. fázis – AI-asszisztens
   ========================================================================= */

.ai-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.ai-conversations { position: sticky; top: 16px; }
.ai-conversation-list { display: flex; flex-direction: column; }
.ai-conversation {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-card-border);
  color: inherit;
  text-decoration: none;
}
.ai-conversation:hover { background: #f5f6f7; }
.ai-conversation--active { background: rgba(0, 105, 255, 0.08); border-left: 3px solid #0069ff; }
.ai-conversation__title { font-weight: 600; font-size: 13px; }
.ai-conversation__date { color: var(--bp-text-muted); font-size: 11px; }

.ai-chat__body {
  min-height: 280px;
  max-height: 55vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-message { display: flex; flex-direction: column; gap: 4px; max-width: 90%; }
.ai-message--user { align-self: flex-end; }
.ai-message--assistant { align-self: flex-start; }
.ai-message__meta { font-size: 11px; color: var(--bp-text-muted); }
.ai-message__content {
  padding: 10px 12px;
  border-radius: 10px;
  background: #f2f3fb;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
}
.ai-message--user .ai-message__content { background: #e3efff; }

.ai-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: #01115e;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(1, 17, 94, 0.35);
  cursor: pointer;
}
.ai-fab:hover { background: #0a2380; }
.ai-fab__icon { font-size: 18px; }

.ai-panel {
  position: fixed;
  right: 22px;
  bottom: 84px;
  z-index: 61;
  width: min(420px, calc(100vw - 44px));
  max-height: min(620px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--color-card-border);
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(1, 17, 94, 0.28);
  overflow: hidden;
}
.ai-panel[hidden] { display: none; }
.ai-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #01115e;
  color: #fff;
}
.ai-panel__budget { font-size: 11px; color: rgba(255, 255, 255, 0.75); margin-top: 2px; }
.ai-panel__close {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.ai-panel__messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8f9fc;
}
.ai-panel__form { padding: 10px 12px 12px; border-top: 1px solid var(--color-card-border); }
.ai-panel__input { resize: vertical; min-height: 58px; }
.ai-panel__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.ai-panel__model { flex: 1; min-width: 0; }
.ai-panel__status { margin-top: 6px; min-height: 16px; }

.ai-json {
  margin: 0;
  max-height: 420px;
  overflow: auto;
  font-size: 12px;
  background: #f8f9fc;
  border: 1px solid var(--color-card-border);
  border-radius: 8px;
  padding: 10px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ai-payload__summary {
  margin: 0 0 14px;
  line-height: 1.55;
}

.ai-payload__heading {
  margin: 16px 0 8px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-muted, #64748b);
}

.ai-payload__list {
  margin: 0 0 12px 18px;
  padding: 0;
}

.ai-payload__list li {
  margin-bottom: 4px;
  line-height: 1.45;
}

.ai-payload__field {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--color-card-border);
}

.ai-payload__field:last-of-type {
  border-bottom: none;
}

.ai-payload__label {
  font-weight: 600;
  color: var(--color-muted, #64748b);
}

.ai-payload__raw {
  margin-top: 16px;
}

.ai-payload__raw summary {
  cursor: pointer;
  color: var(--color-muted, #64748b);
  margin-bottom: 8px;
}

@media (max-width: 900px) {
  .ai-layout { grid-template-columns: 1fr; }
  .ai-conversations { position: static; }
  .ai-fab__label { display: none; }
}

/* =========================================================================
   Tenant-szintű színstílusok (Beállítások → Felületi stílus)
   A klasszikus az alapértelmezett; a login/induló oldal nem kap témát.
   ========================================================================= */

body.theme-midnight {
  --color-app-body: #0b1220;
  --color-sidebar-background: #07101c;
  --color-card-background: #121c2e;
  --color-card-border: #26364f;
  --color-datatable-head-background: #1a2940;
  --color-datatable-head-text: #cfe3f7;
  --color-datatable-cell-border: #22324a;
  --color-datatable-cell-hover-background: #17253b;
  --bp-text-color: #e6eef9;
  --bp-text-muted: #93a7bf;
  --bp-intent-primary: #42d3c8;
  --bp-intent-primary-hover: #2bb8ae;
  --color-topbar-background: #0f1a2b;
  --color-subtle-background: #101a2a;
  --color-metric-value: #e8f4ff;
  --color-input-background: #0c1625;
  --color-hover-background: #1a2c45;
  --color-table-entry-head: #152236;
  --color-card-header-border: #22324a;
}
body.theme-midnight .sidebar { background: linear-gradient(180deg, #07101c 0%, #0d1b2f 100%); }
body.theme-midnight .topbar { border-bottom-color: #22324a; box-shadow: 0 1px 0 rgba(66, 211, 200, 0.08); }
body.theme-midnight .card { border-radius: 10px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18); }
body.theme-midnight .btn { background: #1b2c44; color: #e6eef9; border-color: #2d4260; }
body.theme-midnight .btn:hover { background: #243a57; }
body.theme-midnight .btn--minimal:hover { background: rgba(66, 211, 200, 0.12); }
body.theme-midnight .badge--draft { background: #22324a; color: #cfe3f7; }
body.theme-midnight .sidebar__item.active { background: rgba(66, 211, 200, 0.16); }
body.theme-midnight .ai-panel,
body.theme-midnight .ai-panel__messages { background: #121c2e; }
body.theme-midnight .ai-message__content { background: #1a2940; color: #e6eef9; }
body.theme-midnight .ai-message--user .ai-message__content { background: #17394a; }

body.theme-sand {
  --color-app-body: #f3eadf;
  --color-sidebar-background: #4a3427;
  --color-card-background: #fffaf3;
  --color-card-border: #dfcbb7;
  --color-datatable-head-background: #efe2d3;
  --color-datatable-head-text: #5b4030;
  --color-datatable-cell-border: #e6d5c4;
  --color-datatable-cell-hover-background: #f7eadb;
  --bp-text-color: #3f3228;
  --bp-text-muted: #806b58;
  --bp-intent-primary: #b85c38;
  --bp-intent-primary-hover: #9d4a2c;
  --color-topbar-background: #fffaf3;
  --color-subtle-background: #f8efe4;
  --color-metric-value: #4a2f22;
  --color-input-background: #fffdf9;
  --color-hover-background: #f0dfcb;
  --color-table-entry-head: #f5e9dc;
  --color-card-header-border: #e6d5c4;
}
body.theme-sand .sidebar { background: linear-gradient(180deg, #4a3427 0%, #6b4a35 100%); }
body.theme-sand .topbar { border-bottom-color: #dfcbb7; box-shadow: 0 1px 0 rgba(184, 92, 56, 0.08); }
body.theme-sand .card { border-radius: 10px; box-shadow: 0 8px 24px rgba(90, 60, 40, 0.07); }
body.theme-sand .btn--minimal:hover { background: rgba(184, 92, 56, 0.10); }
body.theme-sand .metric-card--receivable .metric-card__value { color: #9a5a2a; }
body.theme-sand .sidebar__logo-mark { color: #4a3427; }

body.theme-forest {
  --color-app-body: #edf3ea;
  --color-sidebar-background: #173a2a;
  --color-card-background: #fbfdf8;
  --color-card-border: #c9dbc5;
  --color-datatable-head-background: #e3eee1;
  --color-datatable-head-text: #2f4d3c;
  --color-datatable-cell-border: #d7e5d3;
  --color-datatable-cell-hover-background: #f0f6ed;
  --bp-text-color: #26382e;
  --bp-text-muted: #627a69;
  --bp-intent-primary: #2f6b4f;
  --bp-intent-primary-hover: #24543e;
  --color-topbar-background: #fbfdf8;
  --color-subtle-background: #f3f8f1;
  --color-metric-value: #1d3b2b;
  --color-input-background: #ffffff;
  --color-hover-background: #e1eee0;
  --color-table-entry-head: #eff6ec;
  --color-card-header-border: #d7e5d3;
}
body.theme-forest .sidebar { background: linear-gradient(180deg, #173a2a 0%, #24513a 100%); }
body.theme-forest .topbar { border-bottom-color: #c9dbc5; box-shadow: 0 1px 0 rgba(181, 139, 42, 0.12); }
body.theme-forest .card { border-radius: 10px; box-shadow: 0 8px 24px rgba(26, 70, 45, 0.07); }
body.theme-forest .sidebar__item.active { border-left-color: #b58b2a; background: rgba(181, 139, 42, 0.18); }
body.theme-forest .sidebar__logo-mark { background: #b58b2a; color: #173a2a; }
body.theme-forest .btn--minimal:hover { background: rgba(47, 107, 79, 0.10); }
body.theme-forest .metric-card--profit .metric-card__value { color: #b58b2a; }

body.theme-ocean {
  --color-app-body: #e9f4f8;
  --color-sidebar-background: #073b4c;
  --color-card-background: #f9fdff;
  --color-card-border: #c2dce6;
  --color-datatable-head-background: #dceff5;
  --color-datatable-head-text: #235468;
  --color-datatable-cell-border: #d1e6ee;
  --color-datatable-cell-hover-background: #eef8fb;
  --bp-text-color: #1d3945;
  --bp-text-muted: #5e7f8d;
  --bp-intent-primary: #0e87a8;
  --bp-intent-primary-hover: #0b6f8a;
  --color-topbar-background: #f9fdff;
  --color-subtle-background: #f0f9fc;
  --color-metric-value: #0d3c4d;
  --color-input-background: #ffffff;
  --color-hover-background: #d9eef6;
  --color-table-entry-head: #eaf6fa;
  --color-card-header-border: #d1e6ee;
}
body.theme-ocean .sidebar { background: linear-gradient(180deg, #073b4c 0%, #0b556b 100%); }
body.theme-ocean .topbar { border-bottom-color: #c2dce6; box-shadow: 0 1px 0 rgba(6, 182, 164, 0.12); }
body.theme-ocean .card { border-radius: 10px; box-shadow: 0 8px 24px rgba(7, 59, 76, 0.07); }
body.theme-ocean .sidebar__item.active { border-left-color: #06d6a0; background: rgba(6, 214, 160, 0.16); }
body.theme-ocean .sidebar__logo-mark { background: #06d6a0; color: #073b4c; }
body.theme-ocean .btn--minimal:hover { background: rgba(14, 135, 168, 0.10); }
body.theme-ocean .metric-card--receivable .metric-card__value { color: #0e87a8; }

.theme-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.theme-preview__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--color-card-border);
  border-radius: 999px;
  background: var(--color-input-background);
  color: var(--bp-text-color);
  font-size: 12px;
}
.theme-preview__item.is-active {
  border-color: var(--bp-intent-primary);
  box-shadow: 0 0 0 2px rgba(0, 105, 255, 0.12);
}
.theme-preview__swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
}
.theme-preview__swatch--classic { background: linear-gradient(135deg, #01115e 0 50%, #f5f6fa 50%); }
.theme-preview__swatch--midnight { background: linear-gradient(135deg, #0b1220 0 50%, #42d3c8 50%); }
.theme-preview__swatch--sand { background: linear-gradient(135deg, #4a3427 0 50%, #b85c38 50%); }
.theme-preview__swatch--forest { background: linear-gradient(135deg, #173a2a 0 50%, #b58b2a 50%); }
.theme-preview__swatch--ocean { background: linear-gradient(135deg, #073b4c 0 50%, #06d6a0 50%); }

/* driver.js – a téma színeihez igazított bemutatóablak */
.driver-popover.tabula-tour-popover {
  background: var(--color-card-background);
  color: var(--bp-text-color);
  border: 1px solid var(--color-card-border);
  border-radius: 10px;
  box-shadow: 0 18px 48px rgba(1, 17, 94, 0.24);
  font-family: var(--bp-font-family);
}
.driver-popover.tabula-tour-popover .driver-popover-title {
  color: var(--color-metric-value);
  font-size: 16px;
}
.driver-popover.tabula-tour-popover .driver-popover-description {
  color: var(--bp-text-color);
  font-size: 13px;
  line-height: 1.5;
}
.driver-popover.tabula-tour-popover .driver-popover-progress-text {
  color: var(--bp-text-muted);
  font-size: 11px;
}
.driver-popover.tabula-tour-popover .driver-popover-next-btn,
.driver-popover.tabula-tour-popover .driver-popover-prev-btn {
  background: var(--bp-intent-primary);
  color: #fff;
  border: 0;
  text-shadow: none;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
}
.driver-popover.tabula-tour-popover .driver-popover-prev-btn {
  background: transparent;
  color: var(--bp-intent-primary);
  border: 1px solid var(--bp-intent-primary);
}



