﻿:root {
  --bg: #eef1f7;
  --panel: #ffffff;
  --brand: #1651d8;
  --text: #12213f;
  --muted: #5f6f8c;
  --border: #d3dced;
  --ok: #0f9154;
  --warn: #a15d00;
  --danger: #b0432f;

  /* UI density tokens */
  --ui-density-profile: compact;
  --ui-modal-font-size: 10px;
  --ui-modal-field-height: 22px;
  --ui-modal-field-padding-y: 1px;
  --ui-modal-field-padding-x: 6px;
  --ui-modal-button-height: 22px;
  --ui-modal-button-padding-x: 7px;
  --ui-article-trigger-height: 24px;
  --ui-article-font-size: 10px;
  --ui-article-option-height: 16px;
  --ui-article-list-height: 132px;
  --ui-article-indent-base: 4px;
}

/* Dense profile for admin preference switching */
[data-ui-density="dense"] {
  --ui-density-profile: dense;
  --ui-modal-font-size: 9px;
  --ui-modal-field-height: 18px;
  --ui-modal-field-padding-y: 0px;
  --ui-modal-field-padding-x: 4px;
  --ui-modal-button-height: 18px;
  --ui-modal-button-padding-x: 5px;
  --ui-article-trigger-height: 22px;
  --ui-article-font-size: 9px;
  --ui-article-option-height: 14px;
  --ui-article-list-height: 118px;
  --ui-article-indent-base: 3px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  font-family: "Segoe UI", "Noto Sans", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #edf2fb 0%, #e8edf7 100%);
  line-height: 1.35;
}

.shell {
  width: min(1720px, 100%);
  margin: 0 auto;
  padding: clamp(6px, 0.9vw, 10px);
}

.hero {
  background:
    radial-gradient(circle at 12% 18%, rgba(126, 176, 255, 0.24), transparent 48%),
    linear-gradient(132deg, #0f2f84 0%, #1e57dd 62%, #3277ff 100%);
  color: #ffffff;
  border-radius: 12px;
  padding: clamp(8px, 1.1vw, 12px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, auto);
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 24px rgba(14, 39, 95, 0.16);
}

.hero h1 {
  margin: 0;
  font-size: clamp(18px, 1.9vw, 24px);
  line-height: 1.2;
}

.hero p {
  margin: 2px 0 0;
  max-width: 55ch;
}

.hero > .row {
  justify-content: flex-end;
  align-items: center;
  row-gap: 6px;
  column-gap: 6px;
}

.hero-main {
  min-width: 0;
}

.hero-subline {
  font-size: var(--ui-article-font-size);
  opacity: 0.88;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero .badge {
  border-color: rgba(255, 255, 255, 0.46);
  background: rgba(255, 255, 255, 0.1);
}

.hero .plain-select {
  min-width: 110px;
  border-radius: 999px;
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.hero .plain-select option {
  color: #0f2458;
}

.hero button.ghost {
  border-color: rgba(255, 255, 255, 0.52);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.hero button.ghost:hover {
  background: rgba(255, 255, 255, 0.18);
}

.brand {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.78;
  margin: 0;
  font-size: var(--ui-article-font-size);
}

.hero-controls .badge,
.hero-controls button,
.hero-controls select {
  min-height: 20px;
  font-size: var(--ui-article-font-size);
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.client-sidebar {
  display: none;
}

.client-shell .side-nav {
  position: static;
  top: auto;
  max-height: none;
}

.side-kpis {
  display: grid;
  gap: 6px;
}

.side-kpi .value {
  font-size: 14px;
}

.client-shell .content-host {
  margin-top: 0;
}

.side-nav {
  grid-column: 1;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  position: sticky;
  top: 10px;
  max-height: calc(100vh - 20px);
  overflow: auto;
  z-index: 4;
}

.topnav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-item.has-submenu {
  position: relative;
  display: inline-flex;
}

.nav-submenu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 190px;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(16, 35, 83, 0.98);
  box-shadow: 0 12px 30px rgba(5, 16, 40, 0.35);
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
  z-index: 80;
}

.nav-item.has-submenu:hover .nav-submenu,
.nav-item.has-submenu:focus-within .nav-submenu,
.nav-item.has-submenu.open .nav-submenu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-submenu a {
  display: block;
  text-decoration: none;
}

.side-nav a,
.topnav a {
  color: #103a98;
  text-decoration: none;
  border: 1px solid var(--border);
  background: #ffffff;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 14px;
  font-weight: 600;
}

.side-nav a.active,
.topnav a.active {
  background: #e8f0ff;
  border-color: #95b5ef;
}

.kpi-grid,
.content-host {
  min-width: 0;
}

.content-host {
  min-height: 360px;
  overflow: visible;
}

.hero-topnav {
  margin-top: 8px;
}

.hero-topnav a {
  border-color: rgba(255, 255, 255, 0.34);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  font-size: 11px;
  padding: 5px 9px;
  border-radius: 999px;
}

.hero-topnav a.active {
  background: #ffffff;
  color: #103a98;
  border-color: #ffffff;
}

.hero-kpis {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.kpi-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.12);
}

.kpi-chip .label {
  color: rgba(255, 255, 255, 0.82);
  font-size: 10px;
}

.kpi-chip .value {
  color: #ffffff;
  font-size: 12px;
}

.kpi-chip .status {
  color: rgba(255, 255, 255, 0.92);
  font-size: 10px;
  white-space: nowrap;
}

h2 {
  margin: 0 0 6px;
  font-size: 24px;
  line-height: 1.2;
}

h3 {
  margin: 0 0 6px;
  font-size: 18px;
  line-height: 1.2;
}

.grid {
  display: grid;
  gap: 10px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
}

.kpi .label {
  font-size: var(--ui-article-font-size);
  color: var(--muted);
}

.kpi .value,
.kpi .value-sm {
  font-size: 18px;
  font-weight: 700;
  margin-top: 4px;
}

.dash-v2 {
  display: grid;
  gap: 10px;
}

.dash-head {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 10px 12px;
}

.dash-head h2 {
  margin: 0;
}

.dash-head .status {
  margin: 2px 0 0;
}

.dash-head-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.dashboard-primary-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-secondary-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dash-kpi {
  min-height: 104px;
}

.dash-kpi .ghost {
  color: #0f2d72;
  display: grid;
  gap: 4px;
  text-align: left;
  width: 100%;
}

.dash-kpi .label {
  align-items: center;
  display: flex;
  gap: 6px;
}

.dash-kpi .status {
  font-size: 11px;
}

.dash-kpi-ok {
  background: linear-gradient(180deg, #ffffff 0%, #f5fcf8 100%);
}

.dash-kpi-warn {
  background: linear-gradient(180deg, #ffffff 0%, #fff9ef 100%);
}

.dash-kpi-bad {
  background: linear-gradient(180deg, #ffffff 0%, #fff4f5 100%);
}

.kpi-spark {
  height: 24px;
  width: 100%;
}

.dash-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 10px;
}

.dash-panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
}

.dash-panel h3 {
  align-items: center;
  display: flex;
  font-size: 13px;
  gap: 6px;
  margin: 0 0 6px;
}

.dash-trend,
.dash-bars,
.dash-bullet,
.dash-waterfall {
  display: block;
  height: 140px;
  width: 100%;
}

.dash-bullet { height: 76px; }
.dash-bullet-bg { fill: #edf2f8; }
.dash-bullet-actual { fill: #2364aa; }
.dash-bullet-plan { stroke: #111827; stroke-width: 3; }
.dash-bullet text,
.dash-waterfall text {
  fill: #5f708a;
  font-size: 10px;
}

.dash-waterfall-zero { stroke: #cbd7e8; stroke-width: 1; }
.dash-waterfall-plan { fill: #8fb5e8; }
.dash-waterfall-actual { fill: #2364aa; }
.dash-waterfall-good { fill: #3fa36f; }
.dash-waterfall-bad { fill: #cb4d62; }

.dash-trend .axis {
  stroke: #dbe5f5;
  stroke-width: 1;
}

.dash-trend .line-in,
.dash-trend .dot-in {
  fill: none;
  stroke: #2e86de;
  stroke-width: 2;
}

.dash-trend .line-out,
.dash-trend .dot-out {
  fill: none;
  stroke: #e7902f;
  stroke-width: 2;
}

.dash-trend .line-net,
.dash-trend .dot-net {
  fill: none;
  stroke: #1f9d61;
  stroke-width: 2;
}

.dash-trend text,
.dash-bars text {
  fill: #6b7d97;
  font-size: 10px;
}

.dash-bars .bar-ok {
  fill: #3fa36f;
  opacity: 0.8;
}

.dash-bars .bar-warn {
  fill: #d9a441;
  opacity: 0.82;
}

.dash-bars .bar-bad {
  fill: #cb4d62;
  opacity: 0.82;
}

.dash-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.dash-legend .legend {
  border-radius: 999px;
  font-size: 11px;
  padding: 2px 8px;
}

.dash-legend .legend.in {
  background: #edf4ff;
  color: #1e4f92;
}

.dash-legend .legend.out {
  background: #fff4e8;
  color: #a65e1a;
}

.dash-legend .legend.net {
  background: #ecf9f1;
  color: #1e7e4d;
}

.dash-empty {
  border-style: dashed;
  padding: 12px;
}

.dash-empty h4 {
  margin: 0 0 6px;
}

.row {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
}

label {
  display: grid;
  gap: 4px;
}

input,
select,
button,
textarea {
  font: inherit;
}

input,
select,
textarea {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 9px;
  min-height: 34px;
}

button {
  border: 1px solid transparent;
  border-radius: 6px;
  min-height: 34px;
  padding: 0 12px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
}

button.secondary {
  background: #dce6f8;
  color: #0f2d72;
}

button.ghost {
  border-color: #7ca1ee;
  background: transparent;
}

.badge {
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: var(--ui-article-font-size);
}

.plain-select {
  min-width: 82px;
}

.status {
  color: var(--muted);
  margin: 4px 0;
  font-size: var(--ui-article-font-size);
}

.status.ok {
  color: var(--ok);
}

.status.warn {
  color: var(--warn);
}
.module-context {
  border: 1px solid #d5e0ef;
  border-radius: 8px;
  background: #f8fbff;
  padding: 8px;
  margin-bottom: 8px;
}
.module-context-chip {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
}
.module-context-workspace .module-context-chip {
  border: 1px solid #b6c9ec;
  background: #eaf1ff;
  color: #1a407d;
}
.module-context-accounting .module-context-chip {
  border: 1px solid #b9dbc9;
  background: #ecf8f1;
  color: #14533a;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--ui-article-font-size);
}

th,
td {
  border-bottom: 1px solid var(--border);
  text-align: left;
  padding: 7px 5px;
  white-space: nowrap;
  vertical-align: top;
}

.mt {
  margin-top: 10px;
}

.mb12 {
  margin-bottom: 10px;
}

.ops-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.ops-filters {
  position: sticky;
  top: 10px;
  align-self: start;
  max-height: calc(100vh - 10px);
  overflow: auto;
}

.ops-main {
  min-width: 0;
  width: 100%;
  overflow-x: clip;
}

.ops-footer {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.ops-footer span {
  min-width: 0;
  white-space: normal;
}

.link-btn {
  border: none;
  background: transparent;
  color: #103a98;
  font: inherit;
  cursor: pointer;
  padding: 0;
}

.amount-cell.pos {
  color: var(--ok);
  font-weight: 600;
}

.amount-cell.neg {
  color: var(--danger);
  font-weight: 600;
}

.ops-modal[hidden] {
  display: none !important;
}

.ops-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
}

.ops-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 20, 46, 0.45);
}

.ops-modal-card {
  position: relative;
  width: min(680px, calc(100vw - 14px));
  max-height: calc(100vh - 8px);
  overflow: auto;
}

.modal-head {
  justify-content: space-between;
  align-items: center;
}

.ops-tabs {
  display: flex;
  gap: 4px;
  margin: 2px 0 4px;
  flex-wrap: wrap;
}

.ops-tab-btn {
  border-radius: 6px;
  background: #dce6f8;
  color: #0f2d72;
}

.ops-tab-btn.active {
  background: var(--brand);
  color: #fff;
}

.ops-modal-card h4 {
  margin: 3px 0 2px;
  color: #0f2d72;
}

.ops-modal-hint {
  margin: 0 0 3px;
  font-size: var(--ui-article-font-size);
}

.ops-modal-card .card {
  padding: 4px 5px;
}

.ops-modal-card label {
  display: block;
  gap: 4px;
  font-size: var(--ui-article-font-size);
  margin: 0;
}

.ops-modal-card [hidden] {
  display: none !important;
}

.ops-modal-card label:not(.inline-check) > input,
.ops-modal-card label:not(.inline-check) > select,
.ops-modal-card label:not(.inline-check) > textarea {
  display: block;
  width: 100%;
  margin-top: 2px;
}

.ops-modal-card label .ops-help {
  vertical-align: middle;
  margin-left: 3px;
}

.ops-modal-card input,
.ops-modal-card select,
.ops-modal-card textarea {
  min-height: var(--ui-modal-field-height);
  padding: var(--ui-modal-field-padding-y) var(--ui-modal-field-padding-x);
  font-size: var(--ui-modal-font-size);
}

.ops-modal-card textarea {
  line-height: 1.25;
}

.ops-modal-card input[type="date"] {
  min-width: 120px;
  padding-right: 20px;
}

.ops-modal-card input[type="date"]::-webkit-clear-button,
.ops-modal-card input[type="date"]::-webkit-inner-spin-button {
  display: none;
}

.ops-modal-card input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
}

.ops-modal-card button {
  min-height: var(--ui-modal-button-height);
  padding: 0 var(--ui-modal-button-padding-x);
  border-radius: 6px;
  font-size: var(--ui-modal-font-size);
}

.ops-modal-card .ops-advanced {
  padding: 3px;
}

.ops-form-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #8f97a8;
  font-size: 10px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.ops-form-section-title::before,
.ops-form-section-title::after {
  content: "";
  flex: 1 1 auto;
  border-top: 1px solid #e2e7ef;
}

.ops-form-section-title.mt {
  margin-top: 6px;
}

.ops-linkline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 16px;
  white-space: nowrap;
}

.ops-linkline .link-btn {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: #1291b4;
  font-size: var(--ui-article-font-size);
}

.ops-linkline .link-btn:hover {
  text-decoration: underline;
}

.ops-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid #cbd5e1;
  color: #8a96ad;
  font-size: 9px;
  cursor: help;
  background: #fff;
  flex: 0 0 auto;
}

.ops-help-tooltip {
  position: fixed;
  z-index: 1600;
  max-width: min(280px, calc(100vw - 20px));
  background: #fff;
  border: 1px solid #d7e1ef;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(10, 30, 60, 0.2);
  padding: 6px 8px;
  font-size: 11px;
  line-height: 1.25;
  color: #334155;
  pointer-events: none;
}

.ops-form-grid {
  row-gap: 2px;
  column-gap: 8px;
  align-items: end;
}

.ops-grid-wide {
  grid-column: 1 / -1;
}

.ops-modal-actions {
  align-items: center;
  gap: 4px;
  padding-top: 1px;
}

.ops-modal-card .table-wrap .ops-table th,
.ops-modal-card .table-wrap .ops-table td {
  padding: 2px 4px;
}

.ops-modal-card .table-wrap .ops-table input,
.ops-modal-card .table-wrap .ops-table select {
  min-height: 20px;
}

.ops-modal-actions .status {
  margin-right: auto;
}

.ops-repeat-block[hidden] {
  display: none !important;
}

.ops-repeat-block {
  margin-top: 1px;
}

.sidebar-overlay {
  display: none;
}

.sidebar-toggle {
  display: none;
}

@media (max-width: 1260px) {
  .grid.two,
  .grid.three {
    grid-template-columns: 1fr;
  }

  .ops-layout {
    grid-template-columns: 1fr;
  }

  .ops-filters {
    position: static;
    max-height: 70vh;
  }

  .ops-layout.filters-open .ops-filters-panel {
    width: min(360px, calc(100vw - 24px));
  }
}

@media (max-width: 1100px) {
  .shell {
    width: calc(100vw - 8px);
    padding: 6px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .hero > .row {
    justify-content: flex-start;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .kpi-grid,
  .content-host {
    grid-column: 1;
  }

  .dashboard-primary-grid,
  .dashboard-secondary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dash-grid {
    grid-template-columns: 1fr;
  }

  .side-nav {
    position: fixed;
    left: -280px;
    top: 0;
    bottom: 8px;
    width: 260px;
    max-height: 100vh;
    border-radius: 0;
    border-left: none;
    transition: left 0.2s ease;
  }

  body.sidebar-open .side-nav {
    left: 0;
  }

  .sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 74px;
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(7, 20, 46, 0.45);
    z-index: 3;
  }

  body.sidebar-open .sidebar-overlay {
    display: block;
  }
}

/* Dense operations grid (PlanFact-like): sticky header + compact rows + stable column geometry */
.ops-table-wrap {
  max-height: 74vh;
  overflow-y: auto;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.ops-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: separate;
}

.ops-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f6f9ff;
  font-size: var(--ui-article-font-size);
  font-weight: 700;
  color: #243a6d;
}

.ops-table td,
.ops-table th {
  padding: 3px 6px;
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
}

.ops-table td {
  font-size: var(--ui-article-font-size);
}

.ops-table td.ops-col-account,
.ops-table td.ops-col-type,
.ops-table td.ops-col-nature,
.ops-table td.ops-col-counterparty,
.ops-table td.ops-col-article,
.ops-table td.ops-col-project,
.ops-table td.ops-col-deal {
  overflow: hidden;
  text-overflow: ellipsis;
}

.ops-table .ops-col-date { width: 10%; }
.ops-table .ops-col-account { width: 11%; }
.ops-table .ops-col-type { width: 10%; }
.ops-table .ops-col-nature { width: 8%; }
.ops-table .ops-col-counterparty { width: 13%; }
.ops-table .ops-col-article { width: 18%; }
.ops-table .ops-col-project { width: 11%; }
.ops-table .ops-col-deal { width: 9%; }
.ops-table .ops-col-amount { width: 10%; text-align: right; }
.ops-table .ops-col-date,
.ops-table .ops-col-amount {
  white-space: nowrap;
}

.ops-table .ops-col-amount.amount-cell {
  font-weight: 700;
}

.ops-nature-badge {
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 5px 8px;
  white-space: nowrap;
}

.ops-nature-badge.actual {
  background: #e8f7ef;
  color: #17613c;
}

.ops-nature-badge.plan {
  background: #eef4ff;
  color: #1e4f92;
}

.ops-nature-switch {
  border: 1px solid #d7e2f2;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(160px, 240px) 1fr;
  margin: 8px 0 12px;
  padding: 10px;
}


.ops-main .mb12 {
  margin-bottom: 4px;
}

/* W24 compact pass for Operations top zone */
.ops-main > h2 {
  margin: 0 0 2px;
  font-size: 36px;
  line-height: 1;
}

.ops-main > .status {
  margin: 0 0 4px;
  font-size: 10px;
}

.ops-main .card {
  padding: 5px 6px;
}


.ops-cell-main { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.ops-cell-sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 10px; margin-top: 0; }

.row.compact {
  gap: 4px;
}

.row.compact button {
  min-height: 28px;
  padding: 4px 8px;
}

.reports-breakdown-table th:last-child,
.reports-breakdown-table td:last-child {
  width: 160px;
}

.reports-breakdown-table .row.compact {
  align-items: stretch;
  flex-wrap: wrap;
}

.reports-breakdown-table .row.compact button {
  flex: 1 1 72px;
  min-width: 0;
}


.ops-footer {
  position: sticky;
  bottom: 8px;
  z-index: 3;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  box-shadow: 0 -2px 8px rgba(12, 28, 64, 0.06);
}


.ops-segment td {
  background: #f2f6ff;
  color: #2f467b;
  font-weight: 700;
  font-size: var(--ui-article-font-size);
  padding: 3px 6px;
}

.ops-alert {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #f08a00;
  color: #fff;
  font-weight: 700;
  font-size: var(--ui-article-font-size);
  margin-right: 8px;
}

.ops-setoff-box {
  border-style: dashed;
  border-color: #aac2f2;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 6px;
}


.ops-layout.filters-open .ops-filters-panel {
  position: absolute;
  left: 0;
  top: 0;
  width: min(340px, calc(100vw - 40px));
  z-index: 12;
  box-shadow: 0 8px 24px rgba(10, 24, 56, 0.2);
  max-height: 72vh;
}

.ops-layout.filters-hidden .ops-filters-panel {
  display: none !important;
}

.ops-filter-backdrop {
  position: absolute;
  inset: 0;
  z-index: 11;
  background: rgba(8, 20, 48, 0.2);
  border-radius: 10px;
}

.ops-quickbar {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 3px;
  align-items: end;
  min-width: 0;
  position: static;
  top: auto;
  z-index: 1;
  background: #ffffff;
  padding: 1px 0;
}

.ops-quickbar label {
  font-size: 10px;
  line-height: 1.05;
  gap: 1px;
  margin: 0;
}

.ops-quickbar input,
.ops-quickbar select {
  min-height: 23px;
  padding-top: 1px;
  padding-bottom: 1px;
  padding-left: 5px;
  padding-right: 5px;
  font-size: 10px;
}

.ops-quick-actions {
  display: flex;
  gap: 4px;
  align-items: end;
  grid-column: 1 / -1;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.ops-quick-actions button {
  min-height: 24px;
  padding: 2px 7px;
  font-size: 10px;
}

@media (max-width: 1360px) {
  .ops-quickbar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 980px) {
  .ops-quickbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.ops-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
}

.ops-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #9db8ef;
  background: #edf3ff;
  color: #173b86;
  border-radius: 999px;
  min-height: 22px;
  padding: 0 5px;
  font-size: 10px;
}

.ops-chip .ops-chip-label {
  white-space: nowrap;
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ops-chip .ops-chip-x {
  display: inline-flex;
  width: 16px;
  height: 16px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #d7e5ff;
  font-weight: 700;
  line-height: 1;
}

.ops-chip:hover {
  background: #e3eeff;
}

.ops-row {
  cursor: pointer;
}

.ops-row:hover {
  background: #f8fbff;
}

.ops-amount-line {
  display: block;
  font-weight: 700;
  white-space: nowrap;
}

.ops-amount-line.pos {
  color: #0f8a3c;
}

.ops-amount-line.neg {
  color: #cf2f45;
}



.ops-validation-summary,
.ops-source-note,
.ops-repeat-summary,
.ops-split-summary,
.subscription-policy-banner {
  border: 1px solid #f3c878;
  background: #fff7e6;
  color: #5f3f00;
  border-radius: 6px;
  padding: 8px 10px;
  margin: 8px 0;
}

.ops-source-note,
.ops-repeat-summary,
.ops-split-summary {
  border-color: #b9d8ff;
  background: #eef6ff;
  color: #14335f;
}

.subscription-policy-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.subscription-policy-banner a {
  color: #0f4fb8;
  font-weight: 700;
  text-decoration: none;
}

.subscription-policy-banner a:hover {
  text-decoration: underline;
}

label.field-invalid { color: #b42318; }
label.field-invalid input,
label.field-invalid select,
input.field-invalid,
select.field-invalid {
  border-color: #d92d20 !important;
  box-shadow: 0 0 0 2px rgba(217, 45, 32, 0.12);
}
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}


.dir-article-root-drop {
  border: 1px dashed #8aa9e8;
  border-radius: 6px;
  padding: 8px 10px;
  color: #27457f;
  background: #f7faff;
}

.dir-article-root-drop.drag-over {
  border-color: var(--brand);
  background: #e8f0ff;
}

.dir-article-row {
  cursor: grab;
}

.dir-article-row.dragging {
  opacity: 0.55;
}

.dir-article-row.drag-over td {
  background: #e8f0ff;
}

@media (max-width: 760px) {
  .hero h1 {
    font-size: clamp(17px, 5.2vw, 20px);
  }

  .hero > .row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .hero > .row > * {
    min-width: 0;
  }

  .hero .plain-select {
    width: 100%;
  }

  .ops-footer {
    position: static;
  }
}


.projects-layout {
  display: grid;
  grid-template-columns: minmax(480px, 1.2fr) minmax(360px, 0.8fr);
  gap: 10px;
  align-items: start;
}
.projects-table {
  min-width: 1120px;
}
.projects-table th,
.projects-table td {
  white-space: nowrap;
}
.projects-table .project-table-row.active td {
  background: #ebf2ff;
}
.projects-table .project-table-row.child td:first-child {
  padding-left: 18px;
}
.projects-table .project-group-row td {
  background: #f7f9ff;
  font-weight: 700;
}
.project-open-btn {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  color: #0f3f93;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.project-open-btn:hover {
  text-decoration: underline;
}
.project-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border: 1px solid #bdd0f3;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 11px;
  background: #f4f8ff;
}
.project-status-planned {
  border-color: #c8d3e2;
  background: #f7f9fc;
  color: #465366;
}
.project-status-in_work {
  border-color: #9ec7ff;
  background: #edf6ff;
  color: #0f4a8a;
}
.project-status-completed {
  border-color: #95d2b7;
  background: #eefaf4;
  color: #14633f;
}
.projects-metric-table td:nth-child(2),
.projects-metric-table td:nth-child(3) {
  min-width: 170px;
}
.project-bar {
  height: 8px;
  border-radius: 999px;
}
.project-bar-in {
  background: #39a575;
}
.project-bar-out {
  background: #d95555;
}
@media (max-width: 1200px) {
  .projects-layout { grid-template-columns: 1fr; }
}


.projects-toolbar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}
.projects-toolbar .actions {
  justify-content: flex-end;
}
.row.between {
  justify-content: space-between;
  align-items: center;
}
button.danger {
  background: #fbe9e9;
  color: #8f1f1f;
  border: 1px solid #efb5b5;
}
.projects-archive-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
}
.project-list-card {
  max-height: 68vh;
  overflow: auto;
}
.amount-pos { color: var(--ok); font-weight: 700; }
.amount-neg { color: var(--danger); font-weight: 700; }
@media (max-width: 1200px) {
  .projects-toolbar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .projects-toolbar .actions { justify-content: flex-start; }
}
@media (max-width: 760px) {
  .projects-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-list-card { max-height: 42vh; }
}


.ops-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
  margin-top: 6px;
}
.ops-row-actions .ghost {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  padding: 1px 5px;
  font-size: var(--ui-article-font-size);
  line-height: 1.2;
  color: var(--text);
}
.ops-row-actions .ghost.danger {
  color: #b42318;
  border-color: #f1b6b6;
}
.ops-advanced {
  border: 1px dashed var(--border);
  background: #fafcff;
}
.ops-advanced .grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 980px) {
  .ops-advanced .grid.three { grid-template-columns: 1fr; }
}


.ops-split-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #9eb9ef;
  background: #edf4ff;
  color: #183d89;
  border-radius: 999px;
  min-height: var(--ui-article-trigger-height);
  padding: 0 6px;
  margin-right: 8px;
}

.ops-split-toggle:hover {
  background: #e0ecff;
}

.ops-split-toggle-icon {
  font-weight: 700;
}

.ops-split-toggle-text {
  font-size: var(--ui-article-font-size);
  font-weight: 600;
}
.ops-row.split-parent {
  background: #f8fbff;
}
.ops-row.split-child td {
  background: #fcfdff;
}
.ops-row.split-child .ops-col-date {
  color: var(--muted);
}


.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 6px;
  min-height: 32px;
  border-radius: 10px;
  font-weight: 600;
}

.icon-btn .icon-btn-text {
  font-size: var(--ui-article-font-size);
}

.split-remove-btn {
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  justify-content: center;
  padding: 0;
  border-color: #f0b8b8;
  color: #9e2330;
  background: #fff5f5;
  font-weight: 700;
  line-height: 1;
}

.ops-split-remove-col {
  width: 40px;
  text-align: center;
  vertical-align: middle;
}

.split-remove-btn:hover {
  background: #ffe9e9;
}

@media (max-width: 760px) {
  .icon-btn .icon-btn-text {
    display: none;
  }
}


.ops-modal-card .icon-btn {
  color: #103a98;
  border-color: #8fb0ea;
  background: #f4f8ff;
}

.ops-modal-card .icon-btn:hover {
  background: #e7efff;
}

.ops-modal-card .split-remove-btn {
  color: #9e2330;
  border-color: #f0b8b8;
  background: #fff5f5;
}

.ops-modal-card .split-remove-btn:hover {
  background: #ffe9e9;
}


.article-map-card h5 {
  margin: 0 0 6px;
  font-size: 12px;
  color: #1d3f8e;
}

.article-map-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.article-map-grid section {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  background: #f8fbff;
}

.article-map-grid ul {
  margin: 0;
  padding-left: 18px;
  font-size: 11px;
  color: #294170;
}

@media (max-width: 1100px) {
  .article-map-grid {
    grid-template-columns: 1fr;
  }
}


.article-picker-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.article-picker {
  position: relative;
  width: 100%;
}

.article-picker-trigger {
  width: 100%;
  min-height: var(--ui-article-trigger-height);
  border: 1px solid #ced8ea;
  border-radius: 6px;
  background: #fff;
  color: #213756;
  padding: 0 18px 0 6px;
  text-align: left;
  position: relative;
  font-size: var(--ui-article-font-size);
  line-height: 1.05;
  transition: border-color .14s ease, box-shadow .14s ease;
}

.article-picker-trigger:hover {
  border-color: #b7c6df;
}

.article-picker.is-open .article-picker-trigger,
.article-picker-trigger:focus-visible {
  border-color: #28a3d8;
  box-shadow: 0 0 0 2px rgba(40, 163, 216, 0.12);
  outline: none;
}

.article-picker-trigger::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 50%;
  width: 5px;
  height: 5px;
  border-right: 1.2px solid #5a6f95;
  border-bottom: 1.2px solid #5a6f95;
  transform: translateY(-60%) rotate(45deg);
  transition: transform .12s ease;
}

.article-picker.is-open .article-picker-trigger::after {
  transform: translateY(-40%) rotate(-135deg);
}

.article-picker-trigger.is-placeholder {
  color: #7a8ba8;
}

.article-picker-panel {
  position: absolute;
  z-index: 1200;
  top: calc(100% + 3px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #c8d5ea;
  border-radius: 7px;
  box-shadow: 0 8px 16px rgba(11, 37, 76, 0.14);
  padding: 3px;
}

.article-picker-search {
  width: 100%;
  min-height: 20px;
  font-size: var(--ui-article-font-size);
  border: 1px solid #ccd8eb;
  border-radius: 6px;
  padding: 0 6px;
  margin-bottom: 3px;
}

.article-picker-search:focus {
  border-color: #28a3d8;
  outline: none;
  box-shadow: 0 0 0 2px rgba(40, 163, 216, 0.10);
}

.article-picker-list {
  max-height: var(--ui-article-list-height);
  overflow: auto;
  display: grid;
  gap: 0;
}

.article-picker-list::-webkit-scrollbar {
  width: 6px;
}

.article-picker-list::-webkit-scrollbar-thumb {
  background: #b6c8e2;
  border-radius: 6px;
}

.article-picker-option {
  min-height: var(--ui-article-option-height);
  width: 100%;
  border: 1px solid transparent;
  border-radius: 4px;
  background: #fff;
  color: #233b5f;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  padding: 0 4px;
  padding-left: calc(var(--ui-article-indent-base) + var(--article-indent, 0px));
  transition: background-color .12s ease, border-color .12s ease;
  font-size: calc(var(--ui-article-font-size) - 1px);
  line-height: 1.0;
  position: relative;
  text-align: left;
}

.article-picker-option:hover {
  background: #f3f7fd;
}

.article-picker-option.is-group {
  font-weight: 700;
  color: #2c476d;
  background: #f4f7fc;
  border-color: #e3eaf6;
}

.article-picker-option.is-group[data-value^="__group__"] {
  text-transform: none;
  letter-spacing: 0;
  font-size: 8px;
}

.article-picker-option.is-group:disabled {
  opacity: 1;
  cursor: default;
}

.article-picker-option.is-selected {
  border-color: #bcd9ea;
  background: #eef7fb;
}

.article-picker-option-check {
  color: #17a9c8;
  font-weight: 700;
  font-size: calc(var(--ui-article-font-size) - 1px);
}

.article-picker-empty {
  font-size: calc(var(--ui-article-font-size) - 1px);
  color: var(--muted);
  padding: 4px;
}

.article-picker-option.is-nested::before {
  content: "";
  position: absolute;
  left: calc(var(--ui-article-indent-base) + var(--article-indent, 0px) - 4px);
  top: 2px;
  bottom: 2px;
  width: 1px;
  background: #d4dfef;
}

.article-picker-option.is-nested .article-picker-option-label::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 1px;
  background: #c5d5eb;
  margin-right: 2px;
  vertical-align: middle;
}

.article-picker-option-label {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-modal-card .article-picker-option {
  padding-right: 4px !important;
  padding-left: calc(var(--ui-article-indent-base) + 2px + var(--article-indent, 0px)) !important;
  min-height: var(--ui-article-option-height);
}

.ops-modal-card .article-picker-option.is-nested {
  padding-left: calc(var(--ui-article-indent-base) + var(--article-indent, 0px)) !important;
}

.ops-modal-card .article-picker-option.is-group {
  font-weight: 700;
}


.billing-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.billing-tabs button {
  min-height: 28px;
}

.billing-timeline {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  font-size: var(--ui-article-font-size);
}

.value.ok { color: var(--ok); }
.value.warn { color: var(--warn); }
.value.block { color: var(--danger); }

@media (max-width: 900px) {
  .billing-summary-grid { grid-template-columns: 1fr 1fr; }
}



.dir-articles-page {
  padding: 10px;
}
.dir-unified-shell {
  border-color: #d7e2f2;
}
.dir-unified-shell h3 {
  margin: 0 0 6px;
}
.dir-mobile-list {
  display: none;
  gap: 8px;
}
.dir-mobile-row {
  border: 1px solid #d8e2f0;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  display: grid;
  gap: 6px;
}
.dir-mobile-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.dir-mobile-main strong {
  overflow-wrap: anywhere;
}
.dir-mobile-main span {
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}
.dir-mobile-sheet[hidden] { display: none !important; }
.dir-mobile-sheet {
  position: fixed;
  inset: 0;
  z-index: 1300;
}
.dir-mobile-sheet-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(7, 20, 46, 0.45);
}
.dir-mobile-sheet-card {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: max(10px, env(safe-area-inset-bottom));
  background: #fff;
  border-radius: 12px;
  border: 1px solid #d8e2f0;
  padding: 10px;
  box-shadow: 0 -8px 24px rgba(8, 20, 48, 0.22);
}
.dir-mobile-sheet-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.dir-mobile-sheet-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.dir-articles-head h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.dir-articles-tabs {
  margin-bottom: 8px;
}


.directories-articles-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 10px;
  align-items: start;
}

.article-directory-shell {
  padding: 8px !important;
}

.article-directory-shell .ops-tabs-wrap {
  margin-top: 4px !important;
}

.article-directory-shell .ops-tab-btn {
  min-height: 22px;
  height: 22px;
  padding: 0 8px;
  font-size: 11px;
}

.article-directory-shell .grid {
  margin-top: 4px !important;
  gap: 3px !important;
}

.article-directory-shell .grid label {
  font-size: 9px !important;
  line-height: 1.05 !important;
  margin-bottom: 0 !important;
}

.article-directory-shell .grid input,
.article-directory-shell .grid select {
  min-height: 20px !important;
  height: 20px !important;
  padding: 1px 6px !important;
  font-size: 10px !important;
  border-radius: 4px !important;
}

.dir-articles-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 6px;
}

.dir-article-create-panel {
  border: 1px solid #d7e2f2;
  border-radius: 8px;
  background: #f8fbff;
  margin-bottom: 6px;
  padding: 4px;
}

.dir-article-create-title {
  margin: 0 0 4px;
  font-size: 11px;
  color: #123f90;
  font-weight: 700;
}

.dir-article-create-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  padding: 0;
}

.dir-article-create-grid label {
  font-size: 9px;
  line-height: 1.15;
}

.dir-article-create-grid input,
.dir-article-create-grid select {
  min-height: 20px;
  height: 20px;
  font-size: 10px;
  border-radius: 4px;
  padding: 1px 6px;
}

.dir-parent-select,
.dir-parent-select option {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.dir-article-create-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-start;
  margin-top: 4px;
}

.dir-article-create-actions button {
  min-height: 24px;
  padding: 0 10px;
  font-size: 11px;
}

.dir-article-tree-wrap {
  max-height: 60vh;
  overflow: auto;
  border: 1px solid #d7e2f2;
  border-radius: 8px;
  padding: 6px;
  background: #fff;
  display: grid;
  gap: 4px;
}

.dir-article-row {
  border: 1px solid #dfe7f5;
  border-radius: 6px;
  background: #fff;
  min-height: 30px;
  padding: 4px 7px;
  padding-left: calc(8px + (var(--article-depth, 0) * 10px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  cursor: grab;
}

.dir-article-row:hover {
  background: #f7fbff;
  border-color: #cddaf0;
}

.dir-article-row.is-group .dir-article-title {
  font-weight: 700;
}

.dir-article-row.is-system {
  background: #fbfdff;
}

.dir-article-main {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dir-article-title {
  font-size: 11px;
  color: #173765;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 340px;
}

.dir-article-meta-inline {
  font-size: 10px;
  color: #5f7395;
  background: #eef4ff;
  border-radius: 999px;
  padding: 1px 6px;
}

.dir-article-meta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}

.dir-article-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  min-height: 18px;
  border: 1px solid #bcd0ec;
  border-radius: 999px;
  font-size: 10px;
  color: #1f4d97;
  padding: 0 6px;
  background: #f4f8ff;
}

.dir-article-pill-balance {
  color: #335272;
}

.dir-article-lock {
  font-size: 11px;
  color: #7f8fa8;
}

.dir-article-action {
  min-height: 22px;
  border: 1px solid #c8d8ef;
  border-radius: 6px;
  background: #fff;
  color: #154394;
  padding: 0 6px;
  font-size: 10px;
  cursor: pointer;
}

.dir-article-action:hover {
  background: #edf4ff;
}

.dir-article-action.danger {
  color: #9b1f34;
  border-color: #edc3cb;
  background: #fff5f7;
}

.dir-article-action.danger:hover {
  background: #ffecef;
}

.dir-articles-right .article-map-card {
  margin-top: 0;
  position: sticky;
  top: 8px;
}

.article-map-compact .status {
  margin-bottom: 5px;
  font-size: 10px;
}

.article-map-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.article-map-columns section {
  border: 1px solid #cfe0ef;
  border-radius: 8px;
  padding: 5px 6px;
  background: #fafeff;
}

.article-map-columns h5 {
  margin: 0 0 4px;
  font-size: 11px;
  color: #173f86;
}

.article-map-columns ul {
  margin: 0;
  padding-left: 14px;
  display: grid;
  gap: 2px;
  font-size: 10px;
  color: #243d62;
}

@media (max-width: 1180px) {
  .directories-articles-layout {
    grid-template-columns: 1fr;
  }

  .dir-articles-right .article-map-card {
    position: static;
  }
}

@media (max-width: 860px) {
  .dir-articles-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .dir-article-create-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dir-articles-scroll {
    max-height: 48vh;
  }

  .dir-article-title {
    max-width: 180px;
  }

  .dir-article-meta {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .dir-unified-shell:not(.counterparty-detail-card) .table-wrap {
    display: none;
  }
  .dir-mobile-list {
    display: grid;
  }
  .module-context {
    padding: 7px;
  }
}


.article-map-columns-rich section {
  box-shadow: inset 0 0 0 1px rgba(146, 186, 220, 0.25);
}

.article-map-samples {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.article-map-chip {
  display: inline-flex;
  align-items: center;
  min-height: 16px;
  border: 1px solid #c8dcf4;
  border-radius: 999px;
  padding: 0 6px;
  font-size: 9px;
  color: #1f4a86;
  background: #f3f8ff;
}

.article-map-empty {
  font-size: 10px;
  color: #7588a6;
}

.article-map-kpi {
  margin-top: 5px;
  font-size: 10px;
  color: #1e3f72;
}


.dir-articles-toolbar {
  grid-template-columns: minmax(0, 1fr) auto;
}
.dir-articles-toolbar .status {
  font-size: 10px;
}

/* Counterparty bank accounts table polish */
.dir-cp-accounts-table {
  table-layout: fixed;
}

.dir-cp-accounts-table th,
.dir-cp-accounts-table td {
  padding: 6px 8px;
  vertical-align: middle;
}

.dir-cp-accounts-table th:nth-child(1),
.dir-cp-accounts-table td:nth-child(1) { width: 34%; }
.dir-cp-accounts-table th:nth-child(2),
.dir-cp-accounts-table td:nth-child(2) { width: 24%; }
.dir-cp-accounts-table th:nth-child(3),
.dir-cp-accounts-table td:nth-child(3) { width: 30%; }
.dir-cp-accounts-table th:nth-child(4),
.dir-cp-accounts-table td:nth-child(4) { width: 12%; text-align: right; }

.dir-cp-accounts-table input {
  min-height: 30px;
  font-size: 12px;
  padding: 5px 8px;
}

.dir-cp-accounts-table button {
  min-height: 30px;
  padding: 5px 10px;
}

@media (max-width: 860px) {
  .dir-unified-shell .dir-cp-accounts-wrap {
    display: block;
    overflow-x: auto;
  }

  .dir-cp-accounts-table {
    min-width: 620px;
  }
}
@media (max-width: 1180px) {
  .dir-article-create-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 860px) {
  .dir-article-create-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* W18-01 operations list UX baseline */
.ops-main,
.ops-layout,
.ops-quickbar,
.ops-chips-row,
.ops-footer,
.ops-table-wrap,
.ops-mobile-list,
.ops-mobile-row {
  max-width: 100%;
  min-width: 0;
}

.ops-list-status {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fbff;
  padding: 5px;
  overflow-wrap: anywhere;
  font-size: 10px;
}

.ops-desktop-table {
  display: block;
}

.ops-mobile-list {
  display: none;
  gap: 8px;
}

.ops-mobile-row {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: inherit;
  cursor: pointer;
  display: grid;
  gap: 4px;
  padding: 8px;
  text-align: left;
  overflow-wrap: anywhere;
}

.ops-mobile-row:hover {
  background: #f8fbff;
}

.ops-mobile-sheet[hidden] {
  display: none !important;
}

.ops-mobile-sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.ops-mobile-sheet-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(7, 20, 46, 0.45);
}

.ops-mobile-sheet-card {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  background: #fff;
  border-radius: 14px 14px 0 0;
  border-top: 1px solid var(--border);
  padding: 12px;
  box-shadow: 0 -8px 24px rgba(8, 20, 48, 0.22);
}

.ops-mobile-sheet-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.ops-mobile-sheet-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.ops-mobile-primary {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  font-size: var(--ui-article-font-size);
  font-weight: 700;
  line-height: 1.2;
  min-width: 0;
}

.ops-mobile-secondary,
.ops-mobile-status {
  color: var(--muted);
  font-size: var(--ui-article-font-size);
  line-height: 1.3;
  min-width: 0;
  overflow-wrap: anywhere;
}

.ops-mobile-amount {
  text-align: right;
  white-space: nowrap;
}


/* W19-01 reports core trust baseline */
.report-shell,
.report-breakdown-section {
  max-width: 100%;
  min-width: 0;
  width: 100%;
}

.planning-shell .report-tabs {
  margin-bottom: 8px;
}

.planning-shell .report-controls-primary {
  align-items: end;
}

.planning-shell .report-controls-secondary {
  margin-top: 6px;
}
.report-sticky-head {
  position: static;
  top: auto;
  z-index: 1;
  background: #fff;
  border-bottom: 1px solid #e1e8f3;
  margin: -2px -2px 4px;
  padding: 1px 1px 4px;
}
.report-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-bottom: 4px;
}
.report-tab-btn {
  background: #eef4ff;
  border: 1px solid #c9d9f2;
  color: #244165;
  min-height: 26px;
  padding: 2px 8px;
  font-size: 11px;
}
.report-tab-btn.active,
.report-presets .active {
  background: #234d80;
  border-color: #234d80;
  color: #fff;
}
.report-controls {
  align-items: end;
  display: grid;
  gap: 3px;
  grid-template-columns: minmax(170px, 1.3fr) repeat(2, minmax(120px, 1fr)) minmax(180px, auto) minmax(120px, 1fr) minmax(130px, 1fr) auto auto;
  margin-bottom: 4px;
}
.report-controls-primary {
  grid-template-columns: minmax(150px, 1.1fr) minmax(120px, 1fr) minmax(120px, 1fr) auto auto auto auto;
  margin-bottom: 1px;
}
.report-controls-secondary {
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  margin-bottom: 1px;
}
.report-controls label,
.report-controls select,
.report-controls input {
  min-width: 0;
  width: 100%;
  font-size: 10px;
}
.report-controls label {
  display: grid;
  gap: 1px;
  line-height: 1.05;
}
.report-controls input,
.report-controls select,
.report-controls button {
  min-height: 22px;
  padding-top: 2px;
  padding-bottom: 2px;
  padding-left: 6px;
  padding-right: 6px;
}
.report-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.report-presets .secondary {
  min-height: 24px;
  padding: 1px 6px;
  font-size: 10px;
}
.report-export-menu {
  margin-bottom: 3px;
  border: 1px solid #d8e3f4;
  border-radius: 8px;
  background: #f8fbff;
  padding: 5px;
}
.report-export-menu-inner {
  display: grid;
  gap: 3px;
  grid-template-columns: minmax(120px, 180px) auto auto;
  align-items: end;
}
.report-trust {
  align-items: center;
  background: #f7fafc;
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 4px 0;
  padding: 5px;
  font-size: 11px;
}
.report-trust span:first-child {
  border-radius: 999px;
  font-weight: 700;
  padding: 2px 8px;
}
.report-trust span:nth-child(5) {
  display: none;
}
.report-trust-actual span:first-child { background: #e8f7ee; color: #14633f; }
.report-trust-incomplete span:first-child { background: #fff4db; color: #805100; }
.report-trust-stale span:first-child { background: #fdeaea; color: #8f1f1f; }
.report-totals {
  margin-top: 10px;
}
.planning-pf-chart-card { margin-top: 8px; padding: 8px 10px; }
.planning-pf-legend { display: flex; gap: 12px; align-items: center; margin: 4px 0 6px; font-size: 12px; color: #344054; }
.planning-pf-legend span { display: inline-flex; gap: 6px; align-items: center; }
.planning-pf-dot { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.planning-pf-dot.plan { background: #9dbcf1; }
.planning-pf-dot.actual { background: #2364aa; }
.planning-pf-chart-wrap { width: 100%; overflow-x: auto; border: 1px solid #d5dbe6; border-radius: 4px; background: #fff; }
.planning-pf-chart { width: 100%; min-width: 420px; height: 190px; display: block; }
.planning-pf-zero { stroke: #98a2b3; stroke-width: 1; stroke-dasharray: 3 3; }
.planning-pf-bar-plan { fill: #9dbcf1; }
.planning-pf-bar-actual { fill: #2364aa; }
.planning-pf-x { fill: #475467; font-size: 10px; letter-spacing: 0; }
.report-breakdown-mobile {
  display: none;
  gap: 8px;
}
.report-breakdown-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 8px;
}
.report-breakdown-card-head {
  align-items: start;
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(0, 1fr) auto;
}
.report-breakdown-card p {
  color: var(--muted);
  margin: 0;
  overflow-wrap: anywhere;
}
.report-card-values {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.report-card-values span {
  color: var(--muted);
  display: block;
  font-size: 11px;
}
.report-card-values strong {
  display: block;
  overflow-wrap: anywhere;
}
.report-mobile-sheet {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
}
.report-mobile-sheet.open {
  display: block;
}
.report-mobile-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 29, 45, 0.48);
  border: 0;
}
.report-mobile-sheet-panel {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: max(10px, env(safe-area-inset-bottom));
  background: #fff;
  border: 1px solid #d7e1ef;
  border-radius: 10px;
  padding: 10px;
  display: grid;
  gap: 8px;
  box-shadow: 0 18px 36px rgba(8, 26, 52, 0.26);
}
.report-mobile-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.report-mobile-sheet-head strong {
  min-width: 0;
  overflow-wrap: anywhere;
}
.report-mobile-sheet-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 1100px) {
  .report-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .dash-head {
    grid-template-columns: 1fr;
  }

  .dash-head-actions {
    justify-content: flex-start;
  }

  .dashboard-primary-grid,
  .dashboard-secondary-grid {
    grid-template-columns: 1fr;
  }

  .dash-panel {
    padding: 7px;
  }

  .dash-trend,
  .dash-bars {
    height: 132px;
  }

  .ops-modal-card {
    width: calc(100vw - 6px);
    max-height: calc(100vh - 4px);
  }

  .ops-modal-card .card {
    padding: 3px 4px;
  }

  .ops-form-grid {
    row-gap: 2px;
    column-gap: 6px;
  }

  .ops-linkline {
    min-height: 15px;
  }

  .ops-modal-actions {
    gap: 4px;
    padding-top: 0;
  }

  .ops-desktop-table,
  .reports-breakdown-desktop {
    display: none;
  }

  .ops-mobile-list,
  .report-breakdown-mobile {
    display: grid;
  }
  .report-sticky-head {
    top: 0;
    z-index: 9;
    padding-bottom: 3px;
  }

  .ops-quickbar,
  .report-controls,
  .report-card-values {
    grid-template-columns: 1fr;
  }

  .ops-chip .ops-chip-label {
    max-width: min(280px, calc(100vw - 96px));
  }

  .ops-footer {
    align-items: stretch;
    flex-direction: column;
    gap: 4px;
  }
}


.report-advanced-panel {
  border: 1px solid #d8e3f4;
  background: #f8fbff;
  border-radius: 8px;
  padding: 5px;
  margin-top: 3px;
}
.report-chips-row { margin-top: 3px; }
.report-problem-block,
.ops-report-source {
  border: 1px solid #f0c36d;
  background: #fff8e8;
  color: #503500;
  border-radius: 8px;
  padding: 10px;
  margin: 10px 0;
}
.report-problem-block,
.report-problem-actions,
.ops-report-source-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.report-problem-block p,
.ops-report-source p { margin: 2px 0 0; }
.ops-report-source {
  border-color: #9bc2f3;
  background: #f1f7ff;
  color: #16375f;
}
.ops-report-source-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.ops-report-source-grid div {
  min-width: 0;
  border: 1px solid #d7e5f7;
  background: #fff;
  border-radius: 6px;
  padding: 7px;
}
.ops-report-source-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.ops-report-source-grid strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}
@media (max-width: 760px) {
  .report-tabs {
    gap: 2px;
    margin-bottom: 3px;
  }
  .report-tab-btn {
    min-height: 24px;
    padding: 1px 6px;
    font-size: 10px;
  }
  .report-sticky-head {
    margin: -2px -2px 3px;
    padding: 1px 1px 3px;
  }
  .report-advanced-panel {
    padding: 4px;
    margin-top: 2px;
  }
  .report-chips-row {
    margin-top: 2px;
  }
  .report-controls,
  .report-presets,
  .report-export-menu-inner,
  .report-problem-block,
  .report-problem-actions,
  .ops-report-source-head {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .report-controls > *,
  .report-presets > *,
  .report-problem-actions > *,
  .ops-report-source-head > * {
    width: 100%;
    min-width: 0;
  }
  .ops-report-source-grid { grid-template-columns: 1fr; }
}

.report-statement-wrap {
  margin-bottom: 10px;
}

.report-statement-table th,
.report-statement-table td {
  vertical-align: middle;
}

.report-statement-label {
  display: inline-block;
}

.report-statement-label.level-1 {
  padding-left: 14px;
  font-weight: 600;
}

.report-statement-value {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.report-value-positive { color: #0f7b3a; font-weight: 600; }
.report-value-negative { color: #b42318; font-weight: 600; }
.report-value-neutral { color: #475467; }

.report-statement-total td {
  border-top: 2px solid #d6e3f5;
  font-weight: 700;
  background: #f7fbff;
}

/* W20 reports visual alignment (PlanFact-style table shell) */
.report-breakdown-section { padding: 6px 8px 8px; }
.report-breakdown-section > h3 { margin: 0 0 6px; font-size: 17px; font-weight: 700; letter-spacing: 0; }
.report-statement-wrap.planfact-grid { overflow: auto; border: 1px solid #d5dbe6; border-radius: 4px; background: #fff; }
.report-statement-table { width: max-content; min-width: 100%; border-collapse: collapse; table-layout: auto; }
.report-statement-table thead th {
  position: sticky; top: 0; z-index: 3;
  background: #f1f4f8; color: #243247;
  font-weight: 600; font-size: 12px; line-height: 1.2;
  padding: 5px 10px;
  border-bottom: 1px solid #d1d9e6;
}
.report-statement-table th,
.report-statement-table td {
  padding: 2px 8px;
  border-bottom: 1px solid #e2e8f1;
  font-size: 12px;
  line-height: 1.2;
}
.report-statement-first {
  background: #fff;
  min-width: 320px; max-width: 430px; width: 360px;
}
.report-statement-table thead .report-statement-first { background: #f1f4f8; }
.report-period-col { min-width: 132px; width: 132px; text-align: right; white-space: nowrap; }
.report-statement-value {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.report-statement-label { display: inline-flex; align-items: center; gap: 0; }
.report-statement-label.level-0 { font-weight: 600; }
.report-statement-label.level-1 { font-weight: 400; padding-left: 18px; }
.report-statement-label.level-2 { font-weight: 400; padding-left: 34px; }
.report-statement-label.level-3 { font-weight: 400; padding-left: 50px; }
.report-statement-label.level-4 { font-weight: 400; padding-left: 66px; }
.report-statement-label.level-5 { font-weight: 400; padding-left: 82px; }
.report-statement-group td { background: #f8fbff; }
.report-statement-total td { background: #f3f7fe; font-weight: 700; border-top: 1px solid #c8d3e4; }
.report-toggle{
  display:inline-flex;align-items:center;justify-content:center;
  width:14px;height:14px;margin-right:6px;
  border:1px solid #b9c4d8;border-radius:2px;
  background:#fff;color:#263a5e;font-weight:700;font-size:11px;line-height:1;cursor:pointer;
}
.report-toggle-spacer{display:inline-block;width:14px;height:14px;margin-right:6px;vertical-align:middle}
@media (max-width: 1100px) {
  .report-statement-first { min-width: 290px; width: 310px; }
}
@media (max-width: 900px) {
  .report-breakdown-section > h3 { font-size: 16px; }
  .report-statement-table th,
  .report-statement-table td { padding: 2px 8px; font-size: 12px; }
  .report-statement-first { min-width: 244px; width: 244px; }
  .report-period-col { min-width: 88px; width: 88px; }
  .report-shell,
  .planning-shell { min-width: 0; }
  .report-statement-wrap.planfact-grid {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
  }
}

.table-summary-footer {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  position: sticky;
  bottom: 8px;
  z-index: 3;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 -2px 8px rgba(12, 28, 64, 0.06);
  padding: 6px 8px;
}

.table-summary-footer span {
  white-space: nowrap;
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-kpis {
    grid-template-columns: 1fr;
  }
}

/* unified left filter drawer */
.filters-drawer-open .sidebar-overlay {
  display: none;
  opacity: 0;
  pointer-events: none;
}

#leftFiltersHost {
  display: none;
}

.ops-filters-panel {
  position: fixed;
  left: 8px;
  top: 74px;
  width: min(360px, calc(100vw - 20px));
  max-height: calc(100vh - 90px);
  z-index: 70;
  box-shadow: 0 18px 40px rgba(13, 27, 61, 0.22);
  border-radius: 10px;
}

.report-advanced-panel {
  position: fixed;
  left: 8px;
  top: 74px;
  width: min(360px, calc(100vw - 20px));
  max-height: calc(100vh - 90px);
  overflow: auto;
  z-index: 70;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 18px 40px rgba(13, 27, 61, 0.22);
}

.report-advanced-panel .grid.three {
  grid-template-columns: 1fr;
}

@media (max-width: 760px) {
  .ops-filters-panel,
  .report-advanced-panel {
    left: 6px;
    right: 6px;
    width: auto;
    top: 66px;
    max-height: calc(100vh - 78px);
  }
}

/* ultra-compact header pack */
.client-shell .hero {
  padding: 3px 8px;
  gap: 4px;
  border-radius: 9px;
}

.client-shell .hero-main .brand {
  font-size: 8px;
  line-height: 1;
  margin-bottom: 1px;
}

.client-shell .hero h1 {
  font-size: 14px;
  line-height: 1.05;
}

.client-shell .hero-subline {
  font-size: 9px;
  line-height: 1.05;
  margin-top: 0;
}

.client-shell .hero-topnav {
  margin-top: 3px;
  gap: 4px;
}

.client-shell .hero-topnav a {
  font-size: 9px;
  line-height: 1;
  padding: 2px 7px;
  min-height: 16px;
}

.client-shell .hero-controls {
  gap: 4px;
}

.client-shell .hero-controls .badge,
.client-shell .hero-controls button,
.client-shell .hero-controls select {
  min-height: 16px;
  font-size: 9px;
  line-height: 1;
  padding-top: 0;
  padding-bottom: 8px;
}

.client-shell .hero .plain-select {
  min-width: 86px;
}

.client-shell .hero-kpis {
  gap: 4px;
}

.client-shell .kpi-chip {
  min-height: 16px;
  border-radius: 6px;
  padding: 1px 6px;
  gap: 5px;
}

.client-shell .kpi-chip .label,
.client-shell .kpi-chip .status {
  font-size: 8px;
  line-height: 1;
}

.client-shell .kpi-chip .value {
  font-size: 10px;
  line-height: 1;
}

@media (max-width: 980px) {
  .client-shell .hero {
    padding: 4px 6px;
  }

  .client-shell .hero h1 {
    font-size: 13px;
  }
}

/* header layout: readable fullhd */
.client-shell .hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "main controls"
    "kpis kpis";
  align-items: start;
  gap: 8px 10px;
  padding: 8px 12px;
  border-radius: 12px;
}

.client-shell .hero-main {
  grid-area: main;
  min-width: 0;
}

.client-shell .hero-controls {
  grid-area: controls;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.client-shell .hero-main .brand {
  font-size: 10px;
  line-height: 1.1;
  margin-bottom: 2px;
}

.client-shell .hero h1 {
  font-size: 28px;
  line-height: 1.1;
  margin: 0;
}

.client-shell .hero-subline {
  font-size: 12px;
  line-height: 1.2;
  margin-top: 2px;
  opacity: 0.92;
}

.client-shell .hero-topnav {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.client-shell .hero-topnav a {
  font-size: 12px;
  line-height: 1.1;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
}

.client-shell .hero-controls .badge,
.client-shell .hero-controls button,
.client-shell .hero-controls select {
  min-height: 24px;
  font-size: 11px;
  line-height: 1.1;
  padding: 0 10px;
}

.client-shell .hero .plain-select {
  min-width: 98px;
}

.client-shell .hero-kpis {
  grid-area: kpis;
  display: grid;
  grid-template-columns: 1.4fr 1.2fr 0.9fr;
  gap: 8px;
}

.client-shell .kpi-chip {
  min-height: 30px;
  border-radius: 10px;
  padding: 5px 9px;
  gap: 8px;
}

.client-shell .kpi-chip .label {
  font-size: 10px;
}

.client-shell .kpi-chip .value {
  font-size: 13px;
}

.client-shell .kpi-chip .status {
  font-size: 10px;
}

/* filter drawers aligned under readable header */
.ops-filters-panel,
.report-advanced-panel {
  top: 106px;
  max-height: calc(100vh - 122px);
}

@media (max-width: 1200px) {
  .client-shell .hero h1 {
    font-size: 22px;
  }

  .client-shell .hero-kpis {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .client-shell .hero {
    grid-template-columns: 1fr;
    grid-template-areas:
      "main"
      "controls"
      "kpis";
    padding: 8px;
    gap: 7px;
  }

  .client-shell .hero-controls {
    justify-content: flex-start;
  }

  .client-shell .hero h1 {
    font-size: 18px;
  }

  .client-shell .hero-topnav a {
    min-height: 24px;
    font-size: 11px;
  }

  .ops-filters-panel,
  .report-advanced-panel {
    top: 76px;
    max-height: calc(100vh - 90px);
  }
}

/* header density switcher */
body[data-header-density="comfortable"] .client-shell .hero {
  padding: 8px 12px;
}

body[data-header-density="compact"] .client-shell .hero {
  padding: 5px 8px;
  gap: 5px 8px;
}

body[data-header-density="compact"] .client-shell .hero h1 {
  font-size: 20px;
}

body[data-header-density="compact"] .client-shell .hero-subline {
  font-size: 10px;
}

body[data-header-density="compact"] .client-shell .hero-topnav {
  margin-top: 4px;
  gap: 4px;
}

body[data-header-density="compact"] .client-shell .hero-topnav a {
  font-size: 10px;
  min-height: 20px;
  padding: 2px 8px;
}

body[data-header-density="compact"] .client-shell .hero-controls .badge,
body[data-header-density="compact"] .client-shell .hero-controls button,
body[data-header-density="compact"] .client-shell .hero-controls select {
  min-height: 20px;
  font-size: 10px;
  padding: 0 8px;
}

body[data-header-density="compact"] .client-shell .hero-kpis {
  gap: 5px;
}

body[data-header-density="compact"] .client-shell .kpi-chip {
  min-height: 22px;
  padding: 2px 7px;
  gap: 6px;
}

body[data-header-density="compact"] .client-shell .kpi-chip .label,
body[data-header-density="compact"] .client-shell .kpi-chip .status {
  font-size: 9px;
}

body[data-header-density="compact"] .client-shell .kpi-chip .value {
  font-size: 11px;
}

body[data-header-density="compact"] .ops-filters-panel,
body[data-header-density="compact"] .report-advanced-panel {
  top: 92px;
  max-height: calc(100vh - 106px);
}

/* directories submenu UX + project colors */
.nav-item.has-submenu {
  position: relative;
}

.nav-item.has-submenu .nav-submenu {
  top: 100%;
  margin-top: 0;
  padding: 6px;
  min-width: 210px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: 0 10px 22px rgba(12, 28, 64, 0.16);
}

/* hover bridge to prevent accidental close while moving cursor */
.nav-item.has-submenu .nav-submenu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -10px;
  height: 10px;
  background: transparent;
}

.nav-item.has-submenu .nav-submenu a {
  color: #103a98;
  border: 1px solid var(--border);
  background: #ffffff;
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.nav-item.has-submenu .nav-submenu a:hover,
.nav-item.has-submenu .nav-submenu a:focus,
.nav-item.has-submenu .nav-submenu a.active {
  background: #e8f0ff;
  border-color: #95b5ef;
  color: #0e2f7f;
  outline: none;
}

/* mobile menu drawer */
.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 18, 44, 0.42);
  z-index: 120;
  opacity: 0;
  transition: opacity .2s ease;
}

.mobile-menu-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 8px;
  width: min(88vw, 340px);
  background: linear-gradient(165deg, #163d9f 0%, #2d63db 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 24px 46px rgba(3, 12, 31, 0.36);
  z-index: 130;
  transform: translateX(-108%);
  transition: transform .24s ease;
  padding: 10px;
  overflow-y: auto;
}

.mobile-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  margin-bottom: 10px;
}

.mobile-menu-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mobile-menu-nav > a,
.mobile-menu-nav .nav-item.has-submenu > a {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 8px 10px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.mobile-menu-nav .nav-submenu {
  position: static;
  opacity: 1;
  transform: none;
  pointer-events: auto;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 2px 0 2px 10px;
  min-width: 0;
}

.mobile-menu-nav .nav-submenu a {
  color: #eaf1ff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 7px 9px;
}

body.mobile-menu-open .mobile-menu-overlay {
  opacity: 1;
}

body.mobile-menu-open .mobile-menu-drawer {
  transform: translateX(0);
}

@media (min-width: 981px) {
  .mobile-menu-overlay,
  .mobile-menu-drawer {
    display: none !important;
  }
}

.mobile-menu-quick {
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 8px;
  margin-bottom: 10px;
}

.mobile-menu-quick label {
  display: block;
  color: #eaf1ff;
  font-size: 11px;
  margin-bottom: 4px;
}

.mobile-menu-quick .plain-select {
  width: 100%;
  min-height: 30px;
  margin-bottom: 8px;
}

.mobile-menu-quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.mobile-menu-quick-actions .ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.12);
  min-height: 30px;
  font-size: 13px;
}

/* W25 OPU IFRS statement polish: keep P&L readable and resistant to old flat view regressions. */
.report-trend-col { width: 82px; min-width: 82px; text-align: center; }
.report-trend-spark { width: 66px; height: 22px; overflow: visible; }
.report-trend-spark polyline { fill: none; stroke: #2089a5; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.report-trend-spark.down polyline { stroke: #b42318; }
.report-trend-spark circle { fill: currentColor; color: #2089a5; }
.report-trend-spark.down circle { color: #b42318; }
.report-trend-empty { color: #98a2b3; }
.report-operator { display: inline-block; width: 34px; margin-right: 4px; font-size: 10px; font-weight: 500; line-height: 1; text-transform: lowercase; }
.report-operator.minus { color: #d92d20; }
.report-operator.plus { color: #07806b; }
.report-row-section td { background: #fbfcfe; }
.report-row-major td { background: #f0f7ff; font-weight: 700; border-top: 1px solid #bfd7f2; }
.report-row-final td { background: #eaf7ef; font-weight: 800; border-top: 2px solid #8fcfa8; }
.report-row-final_note td { background: #f6fbf7; font-weight: 700; }
.report-row-attention td { background: #fff7ed; }
.report-statement-ratio td { color: #475467; font-style: normal; }
.report-statement-ratio .report-statement-first { color: #667085; }
.report-statement-label { min-width: 0; }
.report-statement-first { white-space: normal; }
@media (max-width: 640px) {
  .report-trend-col { width: 58px; min-width: 58px; }
  .report-trend-spark { width: 52px; }
  .report-operator { width: 28px; font-size: 9px; }
}

/* W25 OPU visual pass (PlanFact-like readability) */
.report-shell-pnl .report-breakdown-section > h3 { font-size: 18px; font-weight: 700; }
.report-shell-pnl .report-statement-wrap.planfact-grid { border-color: #cfd6e3; border-radius: 3px; }
.report-shell-pnl .report-statement-table { min-width: 1120px; }
.report-shell-pnl .report-statement-table thead th { background: #f3f5f9; color: #2f3b52; font-weight: 600; border-bottom: 1px solid #d9e0ec; }
.report-shell-pnl .report-statement-table th,
.report-shell-pnl .report-statement-table td { padding: 3px 8px; font-size: 12px; line-height: 1.3; }
.report-shell-pnl .report-statement-first { min-width: 360px; width: 360px; }
.report-shell-pnl .report-period-col { min-width: 118px; width: 118px; }
.report-shell-pnl .report-statement-group td { background: #fbfcff; }
.report-shell-pnl .report-statement-total td { background: #f5f8fe; border-top: 1px solid #c8d5e8; }
.report-shell-pnl .report-row-major td { background: #eef5ff; font-weight: 700; }
.report-shell-pnl .report-row-final td { background: #edf8f1; border-top: 2px solid #92c9a8; }
.report-shell-pnl .report-row-final_note td { background: #f6fbf7; }
.report-shell-pnl .report-statement-ratio td { color: #5b6475; }
.report-shell-pnl .report-toggle { width: 14px; height: 14px; margin-right: 6px; border-radius: 2px; font-size: 11px; }
.report-shell-pnl .report-toggle-spacer { width: 14px; height: 14px; margin-right: 6px; }
.report-shell-pnl .report-operator { width: 36px; font-size: 10px; margin-right: 6px; }
.report-shell-pnl .report-trend-col { width: 78px; min-width: 78px; }
.report-shell-pnl .report-trend-spark { width: 62px; height: 20px; }
@media (max-width: 640px) {
  .report-shell-pnl .report-statement-table { min-width: 760px; }
  .report-shell-pnl .report-statement-first { min-width: 250px; width: 250px; }
  .report-shell-pnl .report-period-col { min-width: 86px; width: 86px; }
  .report-shell-pnl .report-trend-col { width: 56px; min-width: 56px; }
}

/* W25 OPU compact mobile + expand presets */
.report-density-pnl { display: inline-flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.report-density-pnl > button { padding: 4px 8px; font-size: 12px; }
@media (max-width: 640px) {
  .report-shell-pnl .report-statement-table th,
  .report-shell-pnl .report-statement-table td { padding: 2px 6px; font-size: 11px; line-height: 1.2; }
  .report-shell-pnl .report-statement-first { min-width: 224px; width: 224px; }
  .report-shell-pnl .report-statement-label.level-1 { padding-left: 14px; }
  .report-shell-pnl .report-statement-label.level-2 { padding-left: 24px; }
  .report-shell-pnl .report-statement-label.level-3 { padding-left: 34px; }
  .report-shell-pnl .report-statement-label.level-4 { padding-left: 44px; }
  .report-shell-pnl .report-toggle,
  .report-shell-pnl .report-toggle-spacer { width: 12px; height: 12px; margin-right: 4px; }
  .report-shell-pnl .report-operator { width: 30px; margin-right: 4px; font-size: 9px; }
}



/* W134 ultra-compact deals list head */
.deals-page-head{margin-bottom:2px !important}
.deals-page-head > h2{margin:0 0 2px !important;font-size:18px !important;line-height:1.1}
.deals-page-head > .status{margin:0 !important;font-size:11px !important;line-height:1.15}
.deals-kpis{display:none !important}
.deals-toolbar{padding:4px 6px !important;gap:4px !important;border-radius:8px !important;margin-top:2px !important}
.deals-toolbar label{font-size:11px !important;line-height:1.1}
.deals-toolbar input[type="search"],.deals-toolbar input[type="text"],.deals-toolbar select{height:24px !important;min-height:24px !important;padding:1px 6px !important;font-size:12px !important}
.deals-toolbar .actions{gap:4px !important}
#dealsSearchApplyBtn,#dealsSearchClearBtn,#dealsResetFiltersBtn{display:none !important}
.deals-toolbar .actions button,#dealsCreateBtn,#dealsRefreshBtn{height:24px !important;min-height:24px !important;padding:1px 7px !important;font-size:11px !important}
.deals-quick-presets{display:none !important}
.deals-pager{margin-top:4px !important;gap:4px !important}
.deals-pager button{height:22px !important;min-height:22px !important;padding:0 6px !important;font-size:11px !important}
.deals-pager .status{font-size:11px !important}
.projects-layout{margin-top:2px !important}

/* W147 UX: operations table usability lock (option 1)
   - sticky table header inside scroll container
   - sticky totals footer at bottom of operations card */
.ops-main .ops-table-wrap {
  position: relative;
  max-height: min(56vh, 620px);
}

.ops-main .ops-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #f6f9ff;
  box-shadow: inset 0 -1px 0 var(--border);
}

.ops-main > .ops-footer {
  position: sticky;
  bottom: 8px;
  z-index: 5;
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: 0 -8px 16px rgba(16, 42, 93, 0.08);
}

@media (max-width: 860px) {
  .ops-main > .ops-footer {
    position: static;
  }
}



/* Hide Project column in operations table */
.ops-table col.ops-col-project,
.ops-table th.ops-col-project,
.ops-table td.ops-col-project {
  display: none !important;
}
