body.admin-mode,
body.client-mode {
  background: #f5f6f8;
  color: #152235;
}

body.client-mode .bg-grid,
body.client-mode .site-header,
body.client-mode .site-footer,
body.client-mode main > section:not(#client-panel-section) {
  display: none !important;
}

body.admin-mode #admin-panel-section,
body.client-mode #client-panel-section {
  min-height: 100vh;
  padding: 0;
  --line: #e4e8ee;
  --ink: #152235;
}

body.admin-mode #admin-panel-section > .container,
body.client-mode #client-panel-section > .container {
  width: min(1760px, calc(100% - 48px));
  max-width: none;
}

body.admin-mode .panel-section#admin-panel-section .backoffice-shell,
body.client-mode .panel-section#client-panel-section .backoffice-shell {
  grid-template-columns: 232px minmax(0, 1fr);
  min-width: 0;
  gap: 28px;
  padding: 24px 0;
}

body.client-mode #client-panel-section > .container > .section-head {
  padding-top: 28px;
  margin-bottom: 0;
  max-width: none;
}

.panel-section .backoffice-content,
.panel-section .backoffice-pane,
.panel-section .panel-card,
.panel-section .panel-grid > *,
.panel-section .fleet-module-shell,
.panel-section .admin-form-grid > *,
.panel-section .module-head > * {
  min-width: 0;
}

.panel-section .backoffice-pane,
.panel-section .fleet-module-shell {
  grid-template-columns: minmax(0, 1fr);
}

.panel-section .table-wrap {
  min-width: 0;
  width: 100%;
}

body.admin-mode .panel-section#admin-panel-section .backoffice-sidebar,
body.client-mode .panel-section#client-panel-section .backoffice-sidebar {
  position: sticky;
  top: 24px;
  max-height: calc(100dvh - 48px);
  overflow: auto;
  border: 1px solid #e4e8ee;
  background: #fff;
  border-radius: 16px;
  padding: 18px 14px;
  box-shadow: 0 2px 7px #07111f04;
  scrollbar-width: thin;
}

.panel-section .backoffice-brand {
  padding: 8px 6px 22px;
  margin-bottom: 16px;
  border-bottom: 1px solid #edf0f4;
}

.panel-section .backoffice-brand img {
  display: block;
  width: 100%;
  max-width: 175px;
  height: 48px;
  object-fit: contain;
  object-position: left center;
}

.panel-section .backoffice-title {
  color: #7a8596;
  font-size: 10px;
  letter-spacing: .12em;
  padding: 0 10px;
}

.panel-section .backoffice-tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  border-color: transparent;
  border-radius: 9px;
  color: #566479;
  background: transparent;
  box-shadow: none;
  font-size: 13px;
  padding: 11px 12px;
  line-height: 1.4;
}

.panel-section .backoffice-tab:hover,
.panel-section .backoffice-submenu button:hover {
  background: #f6f7f9;
  border-color: transparent;
  color: #07111f;
}

.panel-section .backoffice-tab.active {
  background: #07111f;
  border-color: #07111f;
  color: #f2d292;
  box-shadow: none;
}

.panel-section .backoffice-submenu {
  margin: 6px 0 6px 12px;
  padding: 0 0 0 8px;
  border-left: 1px solid #e4e8ee;
}

.panel-section .backoffice-submenu button {
  font-size: 12px;
  min-height: 36px;
  line-height: 1.45;
  color: #65728a;
  font-weight: 500;
}

.panel-section .backoffice-submenu button.active {
  color: #62460e;
  background: #f9f1e1;
  border-color: transparent;
  box-shadow: inset 2px 0 0 #c49b4b;
}

.panel-workspace-toolbar,
.catalog-pagination,
.catalog-spec-footer,
.client-welcome,
.client-overview-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.panel-workspace-toolbar {
  padding: 0 0 22px;
  margin-bottom: 20px;
  border-bottom: 1px solid #e4e8ee;
}

.panel-workspace-toolbar .admin-breadcrumb {
  margin: 0;
  color: #65728a;
  font-size: 12px;
}

.panel-load-status:empty { display: none; }
.panel-load-status:not(:empty) {
  border: 1px solid #dfd5bd;
  border-radius: 10px;
  background: #fffaf0;
  padding: 12px 16px;
  font-size: 13px;
}

.panel-section .panel-card {
  background: #fff;
  border: 1px solid #e4e8ee;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 2px 5px #07111f03;
}

.panel-section .panel-card .panel-card {
  box-shadow: none;
}

.panel-section h2 { font-size: clamp(22px, 2vw, 30px); line-height: 1.35; }
.panel-section h3 { font-size: 17px; line-height: 1.45; }
.panel-section h4 { font-size: 14px; line-height: 1.45; }
.panel-section .panel-muted { color: #718096; font-size: 13px; line-height: 1.6; }
.panel-section .eyebrow { color: #947133; font-size: 10px; letter-spacing: .13em; }

.panel-section :is(.btn, .auth-tab),
.catalog-spec-dialog .btn {
  box-shadow: none;
  font-size: 12px;
  min-height: 38px;
  border-radius: 8px;
  padding: 9px 14px;
  line-height: 1.4;
}

.panel-section .btn-gold,
.catalog-spec-dialog .btn-gold {
  color: #07111f;
  background: #dfb765;
  border-color: #dfb765;
}

.panel-section .btn-outline-dark,
.catalog-spec-dialog .btn-outline-dark {
  color: #38475e;
  border-color: #dce2e9;
  background: #fff;
}

.panel-section :is(button, a, input, select, textarea):focus-visible,
.catalog-spec-dialog :is(button, a, summary):focus-visible {
  outline: 3px solid #c99e51;
  outline-offset: 3px;
}

.panel-section :is(button, input, select):disabled {
  opacity: .5;
  cursor: not-allowed;
}

.panel-section :is(.fleet-tab-bar, .client-detail-tabs, .finance-tab-bar, .analytics-tab-bar) {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: thin;
  padding: 5px;
  margin-bottom: 20px;
  border: 1px solid #e4e8ee;
  border-radius: 11px;
  background: #eef0f3;
}

.panel-section :is(.fleet-tab-bar, .client-detail-tabs, .finance-tab-bar, .analytics-tab-bar) > button {
  width: auto;
  flex: 0 0 auto;
  white-space: nowrap;
  background: transparent;
  color: #65728a;
  border: 0;
  box-shadow: none;
}

.panel-section :is(.fleet-tab-bar, .client-detail-tabs, .finance-tab-bar, .analytics-tab-bar) > button.active {
  background: #fff;
  color: #07111f;
  box-shadow: 0 1px 4px #07111f0d;
}

.panel-section .table-wrap,
.catalog-spec-dialog .table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid #edf0f4;
  border-radius: 10px;
  scrollbar-width: thin;
}

.panel-section :is(.data-table, table),
.catalog-spec-dialog table {
  font-size: 12px;
  width: 100%;
  border-collapse: collapse;
}

.panel-section :is(.data-table, table) th,
.catalog-spec-dialog th {
  padding: 13px 14px;
  background: #f8f9fb;
  color: #69768b;
  font-size: 11px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.panel-section :is(.data-table, table) td,
.catalog-spec-dialog td {
  padding: 14px;
  vertical-align: middle;
  border-bottom: 1px solid #edf0f4;
  overflow-wrap: anywhere;
}

.panel-section .data-table tbody tr:hover { background: #fafbfd; }
.panel-section .data-table tbody tr:last-child td { border-bottom: 0; }
.panel-section .table-wrap td .btn { white-space: nowrap; }

.panel-section :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea) {
  min-width: 0;
  max-width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  background: #fff;
  color: #152235;
  border: 1px solid #dce2e9;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  box-shadow: none;
}

.panel-section .admin-form label,
.catalog-reference-filters label {
  color: #566479;
  font-size: 12px;
  font-weight: 500;
}

.panel-section .fleet-product-form-card {
  background: #fff;
  border: 1px solid #e4e8ee;
  border-radius: 12px;
  padding: 22px;
}

.panel-section .invoice-line-row:has(#item-battery-rental-enabled),
.panel-section .invoice-line-row:has(#item-cleaning-chemicals-enabled),
.panel-section .invoice-line-row:has(#item-online-training-enabled),
.panel-section .invoice-line-row:has(#item-onsite-training-enabled) {
  display: none;
}

.panel-section .fleet-product-form-card .admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.panel-section .fleet-product-form-card .admin-form-grid-compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel-section :is(.cockpit-kpi-card, .client-summary-card, .clients-report-card) {
  box-shadow: 0 2px 5px #07111f03;
  border-color: #e4e8ee;
  border-radius: 12px;
}

.workspace-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 22px 0;
}

.workspace-kpi {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 22px;
  border: 1px solid #e4e8ee;
  border-radius: 12px;
  color: #152235;
  background: #fff;
  text-align: left;
  font: inherit;
}

button.workspace-kpi { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
button.workspace-kpi:hover { border-color: #cba456; box-shadow: 0 4px 14px #07111f08; }
.workspace-kpi > span { display: flex; justify-content: space-between; gap: 10px; color: #68778d; font-size: 12px; }
.workspace-kpi > span > span { color: #b08942; }
.workspace-kpi > strong { font-family: "Sora", sans-serif; font-size: clamp(23px, 2vw, 31px); font-weight: 600; letter-spacing: -.045em; line-height: 1.45; }
.workspace-kpi > small { color: #7a8596; font-size: 11px; line-height: 1.5; }

.client-welcome { padding: 5px 0; }
.client-welcome .panel-muted { margin: 0; }
.client-overview-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 20px; }
.client-overview-row { padding: 18px 0; border-bottom: 1px solid #edf0f4; font-size: 13px; }
.client-overview-row small,
.client-shortcuts small { display: block; color: #7a8596; margin-top: 5px; font-size: 12px; }
.client-shortcuts { display: grid; margin-top: 16px; }
.client-shortcuts button { display: flex; justify-content: space-between; align-items: center; gap: 16px; border: 0; border-top: 1px solid #edf0f4; background: transparent; text-align: left; padding: 19px 0; font: inherit; font-size: 13px; color: #152235; cursor: pointer; }
.client-shortcuts button:hover { color: #947133; }

.workspace-empty { padding: 36px 16px; text-align: center; color: #718096; }
.workspace-empty > span { display: block; margin-bottom: 14px; color: #cba456; font-size: 28px; }
.workspace-empty h4 { margin-bottom: 8px; color: #38475e; }
.workspace-empty p { font-size: 13px; max-width: 390px; margin: 0 auto 18px; }

.catalog-directory-intro { display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; gap: 16px; }
.catalog-directory-intro > div:first-child { max-width: 650px; }
.panel-section .fleet-module-shell:has(#admin-fleet-catalog-view:not(.hidden)) > .fleet-module-hero { display: none; }
.catalog-directory-intro h3 { font-size: 24px; }
.catalog-upload { position: relative; cursor: pointer; overflow: hidden; }
.catalog-upload input { position: absolute; opacity: 0; inset: 0; width: 100%; cursor: pointer; }
.catalog-reference-filters { display: grid; grid-template-columns: minmax(180px, 1.6fr) repeat(2, minmax(110px, 1fr)) minmax(100px, .7fr) minmax(150px, 1.2fr) auto; align-items: end; gap: 12px; margin-bottom: 22px; }
.catalog-reference-filters label { display: grid; gap: 7px; }
.catalog-reference-filters :is(input, select) { width: 100%; }
.catalog-market { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; min-width: 36px; width: fit-content; padding: 4px 9px; color: #796029; background: #faf3e6; border: 1px solid #f0e1c4; border-radius: 6px; font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.catalog-variant-name { max-width: 360px; color: #65728a; }
.catalog-source-note { display: flex; align-items: flex-start; gap: 14px; padding: 18px 0; border-bottom: 1px solid #e4e8ee; font-size: 13px; }
.catalog-source-note p { margin: 6px 0; color: #718096; font-size: 12px; line-height: 1.6; }
.catalog-source-note small { color: #718096; font-size: 11px; }
.catalog-source-note a { color: #796029; }
.catalog-pagination { padding-top: 18px; color: #718096; font-size: 12px; }
.catalog-pagination { flex-wrap: wrap; }
.catalog-match:empty { display: none; }
.catalog-match:not(:empty) { margin-top: 18px; padding: 14px 18px; background: #f8f9fb; border: 1px solid #e4e8ee; border-radius: 10px; font-size: 12px; }
.catalog-match .catalog-source-note { padding: 0 0 12px; margin-bottom: 12px; }
[aria-busy="true"] > table { opacity: .5; }

.catalog-spec-dialog {
  width: min(900px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  margin: auto;
  padding: 30px;
  border: 1px solid #e4e8ee;
  border-radius: 18px;
  color: #152235;
  background: #fff;
  font-family: "IBM Plex Sans", sans-serif;
  box-shadow: 0 24px 100px #07111f33;
}

.catalog-spec-dialog::backdrop { background: #07111f88; backdrop-filter: blur(3px); }
.catalog-spec-header { display: flex; justify-content: space-between; align-items: start; gap: 20px; }
.catalog-spec-header h2 { font-size: 24px; }
.catalog-spec-header p { color: #718096; font-size: 12px; }
.catalog-spec-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 20px; margin: 20px 0 26px; }
.catalog-spec-grid > div { padding: 15px 0; border-bottom: 1px solid #e4e8ee; min-width: 0; }
.catalog-spec-grid dt { font-size: 11px; color: #718096; margin-bottom: 5px; }
.catalog-spec-grid dd { margin: 0; font-size: 13px; overflow-wrap: anywhere; font-weight: 500; }
.catalog-spec-dialog h3 { font-size: 15px; }
.catalog-spec-dialog > p { font-size: 12px; color: #718096; }
.catalog-raw { margin: 24px 0; border: 1px solid #e4e8ee; border-radius: 10px; padding: 14px; }
.catalog-raw summary { cursor: pointer; font-size: 12px; color: #38475e; }
.catalog-raw .table-wrap { margin-top: 16px; }
.catalog-spec-footer { padding-top: 18px; border-top: 1px solid #e4e8ee; font-size: 11px; color: #718096; }
.catalog-spec-footer,
.catalog-spec-footer .admin-actions { flex-wrap: wrap; }

@media (max-width: 1200px) {
  .catalog-reference-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .workspace-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.admin-mode .panel-section#admin-panel-section .backoffice-shell,
  body.client-mode .panel-section#client-panel-section .backoffice-shell { grid-template-columns: 205px minmax(0, 1fr); gap: 20px; }
}

@media (max-width: 860px) {
  body.admin-mode #admin-panel-section > .container,
  body.client-mode #client-panel-section > .container { width: calc(100% - 28px); }
  body.admin-mode .panel-section#admin-panel-section .backoffice-shell,
  body.client-mode .panel-section#client-panel-section .backoffice-shell { grid-template-columns: minmax(0, 1fr); padding-top: 14px; gap: 20px; }
  body.admin-mode .panel-section#admin-panel-section .backoffice-sidebar,
  body.client-mode .panel-section#client-panel-section .backoffice-sidebar { position: static; max-height: 260px; padding: 10px; }
  .panel-section .backoffice-brand,
  .panel-section .backoffice-title { display: none; }
  .panel-section .backoffice-nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .panel-section .backoffice-nav > * { flex: 1 1 140px; }
  .panel-section .backoffice-submenu { margin-left: 5px; }
  .panel-section .backoffice-tab { width: 100%; min-height: 38px; font-size: 12px; }
  .panel-section .backoffice-sidebar > .btn { margin-top: 8px; }
  .client-overview-grid { grid-template-columns: minmax(0, 1fr); }
  .panel-workspace-toolbar { flex-wrap: wrap; padding-bottom: 14px; }
  .panel-section .panel-card { padding: 18px; }
  .client-welcome { flex-wrap: wrap; }
}

@media (max-width: 560px) {
  .catalog-reference-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-reference-filters label:first-child { grid-column: 1 / -1; }
  .workspace-kpis { gap: 10px; }
  .workspace-kpi { padding: 16px; }
  .workspace-kpi > strong { font-size: 23px; }
  .workspace-kpi > small { font-size: 10px; }
  .catalog-pagination,
  .catalog-spec-footer { flex-wrap: wrap; }
  .catalog-spec-dialog { padding: 20px; }
  .catalog-spec-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-section .fleet-product-form-card .admin-form-grid,
  .panel-section .fleet-product-form-card .admin-form-grid-compact { grid-template-columns: minmax(0, 1fr); }
}

.reconciliation-workspace { margin-block: 20px; padding: 22px; border: 1px solid #dce2ea; border-inline-start: 4px solid #dcb562; border-radius: 12px; min-width: 0; }
.reconciliation-workspace header { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.reconciliation-workspace h5 { margin-block: 4px 8px; font-size: 18px; }
.reconciliation-workspace pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; overflow: auto; font-size: 12px; }
.reconciliation-form { display: grid; gap: 18px; margin-block: 18px; }
.reconciliation-form label { display: grid; align-content: start; gap: 7px; min-width: 0; font-size: 13px; }
.reconciliation-form input:not([type="checkbox"]), .reconciliation-form select, .reconciliation-form textarea { width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid #dce2ea; border-radius: 8px; background: #fff; color: #101d32; font: inherit; }
.reconciliation-form fieldset { min-width: 0; padding: 18px; border: 1px solid #dce2ea; border-radius: 10px; display: grid; gap: 16px; }
.reconciliation-form legend { font-weight: 700; padding-inline: 6px; }
.reconciliation-editor { border: 1px solid #dce2ea; border-radius: 10px; min-width: 0; }
.reconciliation-editor > summary { padding: 16px; cursor: pointer; font-weight: 600; }
.reconciliation-editor > fieldset { border: 0; padding-top: 4px; }
.reconciliation-editor > fieldset > legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.reconciliation-amounts { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.reconciliation-form .reconciliation-check { display: flex; align-items: start; gap: 10px; line-height: 1.6; }
.reconciliation-check input { flex: 0 0 auto; margin-top: 5px; }
.reconciliation-validation { padding: 12px; border-radius: 8px; background: #f6f8fb; font-size: 13px; }
.reconciliation-workspace [role="alert"] { color: #a32232; font-weight: 600; }
.reconciliation-form > button { justify-self: start; }
@media (max-width: 760px) { .reconciliation-amounts { grid-template-columns: repeat(2,minmax(0,1fr)); } .reconciliation-workspace { padding: 14px; } }
.invoice-reconciliation {
  border-inline-start: 4px solid var(--brand-gold, #dcb562);
  margin-block: 20px;
  min-width: 0;
}
.invoice-evidence-chain {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-block: 16px;
}
.invoice-evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
}
.invoice-evidence-grid details {
  min-width: 0;
  padding: 14px;
  background: #f6f8fb;
  border: 1px solid #e0e5ec;
  border-radius: 10px;
}
.invoice-evidence-grid summary { cursor: pointer; font-weight: 600; }
.invoice-evidence-grid pre {
  font: inherit;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.invoice-evidence-hash { display: block; overflow-wrap: anywhere; }
.invoice-reconciliation li { margin-block: 8px; }
@media (max-width: 760px) {
  .invoice-evidence-grid { grid-template-columns: minmax(0, 1fr); }
}

@media print {
  body:has(#vehicle-technical-dialog[open]) > :not(#vehicle-technical-dialog) { display: none !important; }
  #vehicle-technical-dialog[open] { position: static; width: auto; max-height: none; margin: 0; padding: 0; border: 0; box-shadow: none; overflow: visible; }
  #vehicle-technical-dialog .catalog-spec-header > button,
  #vehicle-technical-dialog .catalog-spec-footer .admin-actions,
  #vehicle-technical-dialog .catalog-raw { display: none; }
  #vehicle-technical-dialog::backdrop { display: none; }
  .catalog-spec-grid > div { break-inside: avoid; }
}
