﻿:root {
  --panel: rgba(255, 249, 242, 0.98);
  --line: rgba(95, 68, 54, 0.18);
  --text: #3e302a;
  --muted: #927a6c;
  --accent: #f58220;
  --accent-deep: #46352f;
  --accent-soft: #fff1e3;
  --danger: #b55d49;
  --shadow: 0 18px 36px rgba(52, 34, 23, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Montserrat", "Segoe UI", Tahoma, sans-serif;
  color: var(--text);
  background:
    linear-gradient(180deg, #46352f 0, #46352f 118px, #f7f1ea 118px, #f7f1ea 100%);
}

.page-shell {
  width: 100%;
  padding: 14px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 10px;
}

.topbar-single {
  grid-template-columns: minmax(0, 1fr);
}

.brand-block,
.upload-card,
.panel,
.toolbar,
.meta-strip {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.brand-block {
  min-height: 52px;
  padding: 8px 14px;
  background: linear-gradient(135deg, rgba(255,252,248,0.99) 0%, rgba(249,240,229,0.97) 100%);
  display: flex;
  align-items: center;
}

.brand-shell {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  width: 100%;
}

.brand-logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 16px;
  border: 1px solid rgba(95, 68, 54, 0.14);
  background: rgba(255, 252, 248, 0.94);
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.brand-logo-link:hover {
  background: rgba(255, 248, 240, 0.98);
}

.brand-logo-image {
  display: block;
  width: 203px;
  max-width: min(100%, 203px);
  height: auto;
}

.page-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 0;
  align-items: center;
  flex-wrap: wrap;
}

.page-nav-link {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 245, 0.92);
  color: var(--accent-deep);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}

.page-nav-link.active {
  background: linear-gradient(135deg, #f07d18 0%, #f59a36 100%);
  color: #fff;
  border-color: transparent;
}

h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: 0.01em;
  color: #29405a;
}

.upload-card {
  padding: 5px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: stretch;
  align-self: stretch;
  min-height: 52px;
  height: 100%;
  min-width: 198px;
}

.upload-dropzone {
  flex: 1 1 88px;
  border: 1px dashed rgba(245, 130, 32, 0.45);
  border-radius: 10px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  min-height: 40px;
  cursor: pointer;
}

.upload-dropzone input {
  display: none;
}

.upload-title {
  font-size: 12px;
  font-weight: 700;
}

.upload-status,
label,
.panel-head p,
.meta-pill span {
  color: var(--muted);
}

.upload-status {
  margin: 0;
  flex-basis: 100%;
  min-height: 0;
  line-height: 1.1;
  font-size: 11px;
}

.upload-status:empty {
  display: none;
}

.primary-button,
.ghost-button {
  border: none;
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.primary-button {
  background: linear-gradient(135deg, #f07d18 0%, #f59a36 100%);
  color: white;
  align-self: stretch;
  min-height: 40px;
  padding: 8px 12px;
}

.ghost-button {
  background: rgba(245, 130, 32, 0.12);
  color: var(--accent-deep);
}

.ghost-button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.ghost-button.danger-button {
  background: rgba(181, 93, 73, 0.12);
  color: var(--danger);
}

#delete-snapshot-button,
#dashboards-delete-snapshot-button {
  display: none;
}

.ghost-button.active-toggle {
  background: linear-gradient(135deg, #f07d18 0%, #f59a36 100%);
  color: #fff;
}

#refresh-button {
  padding: 8px 8px;
  font-size: 12px;
  border-radius: 10px;
  align-self: end;
  min-height: 38px;
}

.toolbar {
  display: grid;
  grid-template-columns: 180px repeat(3, minmax(0, 1fr)) minmax(148px, auto);
  gap: 8px;
  padding: 12px;
  margin-bottom: 10px;
  align-items: start;
}

.toolbar-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  background: #fffdf9;
  color: var(--text);
  font-size: 13px;
}

input[type="search"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fffdf9;
  color: var(--text);
  font-size: 13px;
}

.filter-dropdown {
  position: relative;
}

.filter-dropdown-toggle {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf9;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.filter-dropdown-toggle.open {
  border-color: rgba(245, 130, 32, 0.45);
  box-shadow: 0 0 0 3px rgba(245, 130, 32, 0.08);
}

.filter-dropdown-toggle:disabled {
  background: rgba(240, 242, 236, 0.95);
  color: var(--muted);
  cursor: not-allowed;
}

.filter-dropdown-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-dropdown-arrow {
  flex: 0 0 auto;
  color: var(--muted);
}

.filter-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 30;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 249, 242, 0.99);
  box-shadow: 0 18px 36px rgba(52, 34, 23, 0.18);
}

.filter-dropdown-search {
  width: 100%;
}

.filter-dropdown-options {
  max-height: 220px;
  overflow: auto;
  display: grid;
  gap: 6px;
  padding-right: 2px;
}

.filter-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 10px;
  border: 1px solid #ebdfd2;
  border-radius: 10px;
  background: #fffdf9;
  cursor: pointer;
  font-size: 13px;
}

.filter-option input {
  margin-top: 2px;
}

.filter-empty {
  padding: 12px 10px;
  color: var(--muted);
  font-size: 12px;
}

.filter-actions {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.filter-action-button {
  flex: 1 1 0;
  border: 1px solid var(--line);
  background: rgba(245, 130, 32, 0.08);
  color: var(--accent-deep);
  border-radius: 9px;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.filter-action-button:hover {
  background: rgba(245, 130, 32, 0.16);
}

select:disabled {
  background: rgba(240, 242, 236, 0.95);
  color: var(--muted);
  cursor: not-allowed;
}

.meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
  margin-bottom: 10px;
}

.meta-pill {
  padding: 6px 9px;
  background: rgba(255, 250, 245, 0.92);
  border: 1px solid var(--line);
  border-radius: 999px;
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 12px;
}

.panel {
  padding: 10px;
}

.panel-head {
  margin-bottom: 10px;
}

.panel-head-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.panel-head-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.panel-head h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.panel-head p {
  margin: 0;
  font-size: 12px;
}

.summary-sheet-wrap {
  min-height: 300px;
}

.dashboard-toolbar {
  grid-template-columns: 180px repeat(4, minmax(0, 1fr)) auto;
  align-items: end;
}

.toolbar-action {
  display: flex;
  align-items: flex-end;
  justify-content: stretch;
  align-self: end;
  width: 100%;
}

.toolbar-action-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: flex-end;
  align-items: stretch;
  width: 100%;
}

#refresh-button,
#dashboards-refresh-button {
  width: 100%;
  min-width: 118px;
  min-height: 41px;
  padding: 10px 16px;
  border-radius: 12px;
  white-space: nowrap;
}

.dashboard-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  padding: 0 4px;
}

.dashboard-tab {
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 8px 2px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.dashboard-tab.active {
  color: var(--accent-deep);
  border-bottom-color: var(--accent);
}

.dashboard-tab:disabled {
  cursor: default;
  opacity: 0.8;
}

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

.dashboard-kpis {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-kpi-card {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(74, 53, 46, 0.98) 0%, rgba(93, 68, 58, 0.98) 100%);
  border-radius: 20px;
  color: #fff;
  box-shadow: var(--shadow);
}

.dashboard-kpi-card span,
.dashboard-kpi-card small {
  color: rgba(255, 255, 255, 0.78);
}

.dashboard-kpi-card strong {
  font-size: 28px;
  line-height: 1;
}

.dashboard-panel {
  min-width: 0;
}

.dashboard-panel-wide {
  grid-column: 1 / -1;
}

.culture-board {
  display: grid;
  gap: 18px;
}

.ops-board {
  display: grid;
  gap: 14px;
}

.ops-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.ops-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.ops-legend-swatch {
  width: 18px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.ops-legend-plan {
  background: linear-gradient(135deg, #d6c0af 0%, #ead8cb 100%);
}

.ops-legend-fact {
  background: linear-gradient(135deg, #f07d18 0%, #f59a36 100%);
}

.ops-region-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.dashboard-switches {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.dashboard-grouping-switches {
  flex-wrap: wrap;
}

.dashboard-grouping-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 248, 241, 0.98);
  border: 1px solid #ecdccc;
}

.dashboard-grouping-button {
  min-width: 0;
  padding: 8px 16px;
  border-radius: 999px;
  border-color: transparent;
  background: transparent;
  color: #8f715d;
}

.dashboard-secondary-toggles {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.dashboard-head-row {
  align-items: flex-start;
}

.dashboard-switch-button {
  min-width: 92px;
}

.dashboard-switch-button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.dashboard-panel-actions {
  margin-left: auto;
}

.dashboard-settings-button {
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 999px;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ops-region-card {
  border: 1px solid #ecdccf;
  border-radius: 20px;
  background: #fffdf9;
  overflow: hidden;
  box-shadow: 0 16px 30px rgba(80, 56, 42, 0.06);
}

.ops-region-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(74, 53, 46, 0.98) 0%, rgba(93, 68, 58, 0.98) 100%);
  color: #fff;
}

.ops-region-toggle {
  width: 100%;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s ease;
}

.ops-region-toggle:hover {
  background: linear-gradient(135deg, rgba(88, 63, 54, 0.98) 0%, rgba(107, 78, 66, 0.98) 100%);
}

.ops-region-toggle-icon {
  align-self: center;
  color: rgba(255, 255, 255, 0.84);
  font-size: 13px;
  line-height: 1;
  padding-left: 4px;
}

.ops-region-content {
  width: 100%;
}

.ops-region-title-block h3 {
  margin: 0;
  font-size: 18px;
}

.ops-region-title-block p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
}

.ops-region-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
  gap: 8px;
}

.ops-stat-chip {
  min-width: 88px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  display: grid;
  gap: 3px;
  justify-items: end;
  text-align: right;
}

.ops-stat-chip span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
}

.ops-stat-chip strong {
  font-size: 14px;
  color: #fff;
}

.ops-region-table {
  width: 100%;
  border-collapse: collapse;
}

.ops-region-table th,
.ops-region-table td {
  padding: 10px 11px;
  border-bottom: 1px solid #f0e3d8;
  vertical-align: middle;
  font-size: 13px;
  line-height: 1.28;
}

.ops-region-table th {
  background: #fbefe3;
  color: #8f715d;
  font-size: 12px;
  text-align: left;
}

.ops-region-table th:nth-child(n + 3),
.ops-region-table td:nth-child(n + 3) {
  text-align: right;
  white-space: nowrap;
}

.ops-region-table th:nth-child(1),
.ops-region-table td:nth-child(1),
.ops-region-table th:nth-child(2),
.ops-region-table td:nth-child(2) {
  text-align: left;
  white-space: normal;
}

.ops-region-table th:nth-child(1),
.ops-region-table td:nth-child(1) {
  width: 24%;
  min-width: 260px;
}

.ops-region-table th:nth-child(2),
.ops-region-table td:nth-child(2) {
  width: 26%;
  min-width: 240px;
}

.ops-region-table th:last-child,
.ops-region-table td:last-child {
  min-width: 160px;
}

.ops-region-table.ops-region-table-harvest th:last-child,
.ops-region-table.ops-region-table-harvest td:last-child {
  min-width: 160px;
}

.ops-region-table th:nth-child(7),
.ops-region-table td:nth-child(7),
.ops-region-table th:nth-child(8),
.ops-region-table td:nth-child(8) {
  min-width: 132px;
}

.ops-region-table.ops-region-table-harvest th:nth-child(6),
.ops-region-table.ops-region-table-harvest td:nth-child(6),
.ops-region-table.ops-region-table-harvest th:nth-child(7),
.ops-region-table.ops-region-table-harvest td:nth-child(7),
.ops-region-table.ops-region-table-harvest th:nth-child(8),
.ops-region-table.ops-region-table-harvest td:nth-child(8),
.ops-region-table.ops-region-table-harvest th:nth-child(9),
.ops-region-table.ops-region-table-harvest td:nth-child(9) {
  min-width: 132px;
}

.ops-company-row td {
  background: #f9ede1;
  font-weight: 700;
  color: var(--accent-deep);
}

.ops-mobile-label {
  display: none;
}

.ops-company-toggle {
  cursor: pointer;
}

.ops-company-toggle td {
  transition: background 0.16s ease, color 0.16s ease;
}

.ops-company-toggle:hover td {
  background: #f7e3d1;
}

.ops-region-table tbody tr {
  transition: background-color 0.14s ease;
}

.ops-region-table tbody tr:hover > td {
  background: #ffdcae !important;
}

.ops-region-table tbody tr:hover > td.ops-company-name,
.ops-region-table tbody tr:hover > td.ops-crop-name,
.ops-region-table tbody tr:hover > td.ops-crop-group-name,
.ops-region-table tbody tr:hover > td.ops-grouped-company-name {
  color: #6b3206 !important;
}

.ops-region-table tbody tr:hover > td .ops-value-content,
.ops-region-table tbody tr:hover > td .ops-mobile-label,
.ops-region-table tbody tr:hover > td .ops-company-toggle-icon {
  color: #6b3206 !important;
}

.ops-region-table tbody tr:hover > td .ops-bar-track {
  background: rgba(245, 130, 32, 0.16);
}

.ops-company-name {
  min-width: 260px;
}

.ops-crop-group-name,
.ops-grouped-company-name {
  min-width: 240px;
}

.ops-company-name-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.ops-company-name-wrap span:last-child {
  min-width: 0;
}

.ops-company-toggle-icon {
  flex: 0 0 auto;
  width: 12px;
  color: #8f715d;
  font-size: 12px;
  line-height: 1;
}

.ops-company-name small {
  display: block;
  margin-top: 2px;
  color: #9d7d68;
  font-weight: 500;
  font-size: 12px;
}

.ops-company-region-inline {
  display: inline;
  margin-left: 6px;
  color: #9d7d68;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.ops-company-caption {
  color: #9d7d68;
  font-weight: 600;
}

.ops-crop-row td {
  background: #fffdf9;
}

.ops-crop-group-row td {
  background: linear-gradient(135deg, #f7e7d9 0%, #fff4ea 100%);
}

.ops-crop-row:nth-child(even) td {
  background: #fff8f1;
}

.ops-crop-indent {
  width: 10px;
  min-width: 10px;
  padding-right: 0;
}

.ops-crop-name {
  position: relative;
  padding-left: 12px !important;
  color: var(--accent-deep);
  min-width: 240px;
}

.ops-crop-group-name {
  color: var(--accent-deep);
}

.ops-grouped-company-name {
  position: relative;
  color: #55392b;
  font-weight: 700;
  padding-left: 18px !important;
  letter-spacing: 0.01em;
}

.ops-grouped-company-name::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #f07d18;
  transform: translateY(-50%);
}

.ops-crop-name::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #e7bb92;
  transform: translateY(-50%);
}

.ops-bar-track {
  position: relative;
  height: 14px;
  border-radius: 999px;
  background: rgba(70, 53, 47, 0.08);
  overflow: hidden;
  min-width: 160px;
}

.ops-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 999px;
}

.ops-bar-plan {
  background: linear-gradient(135deg, #d3bcac 0%, #e7d4c7 100%);
  opacity: 0.95;
}

.ops-bar-fact {
  background: linear-gradient(135deg, #f07d18 0%, #f59a36 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28) inset;
}

.trend-board {
  display: grid;
  gap: 10px;
}

.trend-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 220px;
  gap: 12px;
  align-items: center;
}

.trend-date {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-deep);
}

.trend-bar-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(245, 130, 32, 0.1);
  overflow: hidden;
}

.trend-bar-fill {
  height: 100%;
  border-radius: 999px;
}

.trend-bar-plan {
  background: linear-gradient(135deg, #d9b18c 0%, #e6c7aa 100%);
}

.trend-bar-fact {
  background: linear-gradient(135deg, #f07d18 0%, #f59a36 100%);
}

.trend-double-bars {
  display: grid;
  gap: 8px;
}

.trend-bar-line {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 84px;
  gap: 8px;
  align-items: center;
}

.trend-bar-line span,
.histogram-bar-line span {
  font-size: 12px;
  color: var(--muted);
}

.trend-bar-line strong,
.histogram-bar-line strong {
  text-align: right;
  font-size: 12px;
  color: var(--accent-deep);
}

.histogram-board {
  display: grid;
  gap: 14px;
}

.histogram-row {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #ecdccf;
  border-radius: 14px;
  background: #fffdf9;
}

.histogram-label-wrap {
  display: grid;
  gap: 2px;
}

.histogram-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-deep);
}

.histogram-hint {
  font-size: 11px;
  color: var(--muted);
}

.histogram-row-region {
  background: linear-gradient(135deg, rgba(255, 243, 231, 0.96) 0%, rgba(255, 249, 242, 0.96) 100%);
}

.histogram-row-region .histogram-label {
  font-size: 15px;
}

.histogram-row-crop {
  margin-left: 18px;
}

.histogram-row-crop .histogram-label {
  padding-left: 12px;
  border-left: 3px solid #e7bb92;
}

.histogram-row-cluster {
  margin-left: 40px;
}

.histogram-row-cluster .histogram-label {
  padding-left: 12px;
  border-left: 3px solid #d8c2af;
  font-weight: 600;
}

.histogram-bars {
  display: grid;
  gap: 8px;
}

.histogram-bar-line {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 88px;
  gap: 8px;
  align-items: center;
}

.histogram-bar-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(70, 53, 47, 0.08);
  overflow: hidden;
}

.histogram-bar-fill {
  height: 100%;
  border-radius: 999px;
}

.histogram-bar-plan {
  background: linear-gradient(135deg, #cdb29d 0%, #dbc4b1 100%);
}

.histogram-bar-fact {
  background: linear-gradient(135deg, #f07d18 0%, #f59a36 100%);
}

.histogram-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

.trend-values {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
}

.dashboard-table th,
.dashboard-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #ebdfd2;
  font-size: 13px;
}

.dashboard-table th {
  text-align: left;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-table td:not(:first-child),
.dashboard-table th:not(:first-child) {
  text-align: right;
}

.region-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.region-tab {
  border: 1px solid var(--line);
  background: rgba(255, 250, 245, 0.95);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.region-tab.active {
  background: linear-gradient(135deg, #f07d18 0%, #f59a36 100%);
  color: #fff;
  border-color: transparent;
}

.summary-groups {
  display: grid;
  gap: 14px;
}

.summary-group {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 250, 245, 0.96);
  overflow: hidden;
  min-width: 0;
}

.summary-group-header {
  width: 100%;
  border: none;
  background: linear-gradient(135deg, #46352f 0%, #5b443b 100%);
  color: #fff;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  position: relative;
  z-index: 3;
  border-radius: 20px 20px 0 0;
}

.summary-group-header:hover {
  background: linear-gradient(135deg, #5a4339 0%, #6d5247 100%);
}

.summary-group-title {
  font-size: 16px;
  font-weight: 700;
}

.summary-group-meta {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 11px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.summary-toggle-icon {
  font-size: 18px;
  line-height: 1;
}

.summary-table-wrap {
  width: 100%;
  max-width: 100%;
  display: block;
  overflow-x: auto;
  overflow-y: visible;
  border-top: 1px solid var(--line);
  -webkit-overflow-scrolling: touch;
}

.summary-group-scroller {
  width: 100%;
  max-width: 100%;
  overflow-x: visible;
  overflow-y: visible;
  display: block;
}

.summary-table-shell {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.summary-sticky-overlay {
  display: none !important;
}

.summary-global-sticky {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  display: none;
  overflow: visible;
  pointer-events: none;
}

.summary-global-sticky.active {
  display: block;
}

.summary-global-sticky-crop {
  overflow: hidden;
  width: 100%;
  pointer-events: auto;
}

.summary-global-sticky-crop .summary-group-header {
  border-radius: 0;
  box-shadow: 0 10px 18px rgba(52, 34, 23, 0.16);
  pointer-events: auto;
}

.summary-global-sticky-table-viewport {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  background: rgba(255, 249, 242, 0.985);
  box-shadow: 0 10px 18px rgba(52, 34, 23, 0.12);
  border-bottom: 1px solid #eadfd2;
  scrollbar-width: none;
  -ms-overflow-style: none;
  pointer-events: none;
}

.summary-global-sticky-table-viewport::-webkit-scrollbar {
  display: none;
}

.summary-global-sticky .summary-table-overlay {
  min-width: 0;
  margin: 0;
  transform-origin: left top;
}

.summary-global-sticky .summary-table-overlay thead tr:first-child th:not(.summary-metric-head-overlay),
.summary-global-sticky .summary-table-overlay thead tr:nth-child(2) th:not(.summary-metric-head-overlay) {
  position: static !important;
}

.summary-global-sticky .summary-table-overlay .summary-metric-head-overlay {
  position: sticky !important;
  left: 0 !important;
  z-index: 5 !important;
  background: #f1dfcc !important;
  vertical-align: middle !important;
  text-align: center !important;
  box-shadow: 8px 0 12px rgba(95, 68, 54, 0.08) !important;
  transform: none !important;
}

.summary-global-sticky .summary-table-overlay thead tr:first-child th {
  border-top: none;
}

.region-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.summary-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  table-layout: auto;
}

.summary-table.summary-table-detailed.summary-table-tight {
  min-width: 0;
  table-layout: fixed;
}

.summary-table thead tr:first-child th {
  background: #f8ecdf;
  color: #5b4134;
  text-align: center;
  border: 1px solid #e7d7c7;
  padding: 8px 6px;
  font-weight: 700;
  font-size: 11px;
  white-space: normal;
  vertical-align: bottom;
  line-height: 1.15;
  position: static;
}

.summary-table thead tr:nth-child(2) th {
  background: #fff8f1;
  color: #9a7c68;
  border: 1px solid #eadfd2;
  padding: 5px 4px;
  text-align: center;
  font-size: 10px;
  text-transform: lowercase;
  white-space: normal;
  line-height: 1.1;
  position: static;
}

.summary-table th,
.summary-table td {
  border: 1px solid #ebdfd2;
  padding: 5px 6px;
  text-align: center;
  white-space: nowrap;
  background: #fff;
  font-size: 12px;
}

.summary-table tbody tr:nth-child(even) td {
  background: #fffaf4;
}

.summary-table tbody tr:hover > td {
  background: #ffdcae !important;
}

.summary-table tbody tr:hover > td.summary-metric-cell {
  background: #ffb54d !important;
}

.summary-table tbody tr:hover > td.summary-total-cell {
  background: #ffb54d !important;
}

.summary-table tbody tr:hover > td .summary-drilldown {
  background: #f59a36 !important;
  color: #5a2c07;
}

.summary-table tbody tr:hover > td .summary-drilldown {
  box-shadow: inset 0 0 0 9999px rgba(245, 154, 54, 0.72);
}

.summary-table tbody tr:hover > td.summary-metric-cell,
.summary-table tbody tr:hover > td.summary-total-cell {
  color: #6b3206 !important;
}

.summary-table tbody tr:hover td,
.summary-table tbody tr:hover .summary-metric-cell,
.summary-table tbody tr:hover .summary-total-cell,
.summary-table tbody tr:hover .summary-drilldown {
  transition: background-color 0.12s ease;
}

.summary-table tfoot td {
  background: #f9ede1;
  font-weight: 700;
  white-space: normal;
  line-height: 1.15;
}

.summary-table tfoot td.summary-metric-cell.summary-footer-label {
  background: #fff1e3 !important;
  color: #8a4713 !important;
  border-right: 3px solid #d8b18e !important;
}

.summary-metric-head-overlay,
.summary-metric-cell {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 320px;
  width: 320px;
  max-width: 320px;
  text-align: left !important;
  font-weight: 600;
  white-space: normal !important;
  word-break: break-word;
  line-height: 1.2;
  background: #fff !important;
  border-right: 3px solid #d8b18e !important;
  box-shadow: 8px 0 12px rgba(95, 68, 54, 0.08);
  transform: none;
}

.summary-table.summary-table-detailed.summary-table-tight .summary-metric-head-overlay,
.summary-table.summary-table-detailed.summary-table-tight .summary-metric-cell {
  min-width: 270px;
  width: 270px;
  max-width: 270px;
}

.summary-table thead .summary-metric-head-main {
  position: sticky !important;
  left: 0 !important;
  z-index: 6 !important;
  background: #f1dfcc !important;
  vertical-align: middle !important;
  text-align: center !important;
  box-shadow: 8px 0 12px rgba(95, 68, 54, 0.08) !important;
  transform: none !important;
}

.summary-metric-head-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100%;
  text-align: center;
}

.summary-table tbody .summary-metric-cell,
.summary-table tfoot .summary-metric-cell {
  z-index: 3;
}

.summary-table tbody tr:nth-child(even) .summary-metric-cell {
  background: #fffaf4 !important;
}

.summary-col-head {
  display: flex;
  flex-direction: column;
  gap: 1px;
  align-items: center;
  justify-content: center;
  min-height: 100%;
}

.summary-col-head > div {
  max-width: 150px;
  line-height: 1.1;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: break-word;
}

.summary-table.summary-table-detailed.summary-table-tight .summary-col-head > div {
  max-width: none;
}

.summary-col-head small {
  font-size: 10px;
  font-weight: 600;
  color: #9b806c;
  white-space: normal;
  text-align: center;
  line-height: 1.1;
}

.summary-total-head {
  background: #f6d8bd !important;
  color: #8a4713 !important;
  border-left: 2px solid #d9ab7f !important;
  vertical-align: middle !important;
}

.summary-total-cell {
  background: #fff1e3 !important;
  color: #8a4713;
  font-weight: 700;
  min-width: 0;
  border-left: 2px solid #e1b284 !important;
}

.summary-table.summary-table-detailed thead tr:nth-child(2) .summary-total-head,
.summary-table.summary-table-detailed tbody .summary-total-cell,
.summary-table.summary-table-detailed tfoot .summary-total-cell {
  min-width: 84px;
}

.summary-table tbody tr:nth-child(even) .summary-total-cell {
  background: #fff0e1 !important;
}

.summary-col-group-start {
  border-left: 2px solid #d8b18e !important;
}

.summary-col-group-end {
  border-right: 2px solid #d8b18e !important;
}

.summary-col-group-first,
.summary-col-start-first {
  border-left: 3px solid #d8b18e !important;
}

.summary-col-group-last {
  box-shadow: 10px 0 0 rgba(225, 178, 132, 0.08);
}

.summary-table thead tr:first-child th[colspan="3"],
.summary-table thead tr:first-child th[colspan="4"] {
  border-left: 2px solid #e0c1a4;
}

.summary-table td:not(.summary-metric-cell) + td,
.summary-table th:not(.summary-metric-head-main):not(.summary-metric-head-overlay) + th {
  border-left-color: rgba(95, 68, 54, 0.1);
}

.summary-percent-head,
.summary-percent-cell {
  width: 76px;
  min-width: 76px;
  max-width: 76px;
}

.summary-table.summary-table-detailed.summary-table-tight thead tr:nth-child(2) th,
.summary-table.summary-table-detailed.summary-table-tight tbody td:not(.summary-metric-cell),
.summary-table.summary-table-detailed.summary-table-tight tfoot td:not(.summary-metric-cell) {
  min-width: 0;
  width: auto;
}

.summary-table.summary-table-detailed.summary-table-tight th,
.summary-table.summary-table-detailed.summary-table-tight td {
  padding: 5px 5px;
}

.summary-table.summary-table-detailed.summary-table-tight thead tr:first-child th {
  padding: 7px 5px;
}

.percent-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.summary-percent-cell .percent-badge,
.summary-total-cell .percent-badge {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.percent-badge-empty {
  color: #8b7365;
  border-color: #e7d5c5;
  background: rgba(255, 248, 240, 0.96);
}

.percent-badge-low {
  color: #8e4d2a;
  border-color: #efc7ab;
  background: #fff0e4;
}

.percent-badge-warn {
  color: #8b5a1b;
  border-color: #efcf9e;
  background: #fff2df;
}

.percent-badge-ok {
  color: #7a4c1f;
  border-color: #efc48d;
  background: #ffe8cf;
}

.percent-badge-over {
  color: #6a3f1d;
  border-color: #efb370;
  background: linear-gradient(135deg, #ffe0bd 0%, #ffd1a0 100%);
}

.summary-drilldown {
  border: none;
  background: rgba(245, 130, 32, 0.14);
  color: #9a4f16;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease;
}

.summary-drilldown:hover {
  background: rgba(245, 130, 32, 0.22);
  color: #7c3d10;
}

.summary-drilldown:focus-visible {
  outline: 2px solid rgba(245, 130, 32, 0.35);
  outline-offset: 1px;
}

.summary-footer-label {
  color: #1f5d45;
}

.drilldown-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 1000;
}

.drilldown-modal.open {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.drilldown-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(63, 42, 31, 0.42);
}

.drilldown-dialog {
  position: relative;
  width: min(960px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  margin: 0;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(20, 28, 24, 0.24);
  overflow: hidden;
}

.drilldown-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #ebdfd2;
}

.drilldown-head h3 {
  margin: 0 0 6px;
  font-size: 20px;
}

.drilldown-head p {
  margin: 0;
  color: var(--muted);
}

.drilldown-close {
  border: 1px solid var(--line);
  background: rgba(229, 138, 47, 0.12);
  color: var(--accent-deep);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.drilldown-body {
  padding: 0 20px 20px;
  overflow: auto;
  max-height: calc(100vh - 130px);
}

.crop-visibility-dialog {
  width: min(720px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
}

.crop-visibility-dialog .drilldown-body {
  flex: 1 1 auto;
  min-height: 0;
  padding-bottom: 28px;
}

.crop-visibility-actions {
  display: flex;
  gap: 8px;
  padding: 14px 20px 0;
  margin-bottom: 14px;
}

.crop-visibility-section {
  display: grid;
  gap: 10px;
}

.crop-visibility-help {
  margin: -2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.crop-visibility-search-row {
  margin-bottom: 16px;
}

.crop-visibility-search {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fffdf9;
  color: var(--text);
  font: inherit;
}

.crop-visibility-section h4 {
  margin: 0;
  font-size: 14px;
  color: var(--accent-deep);
}

.crop-order-list {
  display: grid;
  gap: 8px;
}

.crop-order-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.crop-visibility-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
  padding-bottom: 8px;
}

.crop-visibility-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid #ebdfd2;
  border-radius: 12px;
  background: #fff9f3;
  cursor: pointer;
  min-height: 48px;
}

.crop-visibility-item input {
  margin-top: 2px;
}

.crop-visibility-item-ordered {
  margin: 0;
}

.crop-order-position {
  display: grid;
  gap: 4px;
  min-width: 92px;
  font-size: 11px;
  color: var(--muted);
}

.crop-order-position input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fffdf9;
  color: var(--text);
  font: inherit;
}

.drilldown-table {
  width: 100%;
  border-collapse: collapse;
}

.drilldown-table th,
.drilldown-table td {
  border: 1px solid #ebdfd2;
  padding: 10px 12px;
  text-align: left;
  background: #fff;
}

.drilldown-table th {
  background: #f6ede4;
  color: #52382c;
}

.drilldown-table td:not(:first-child),
.drilldown-table th:not(:first-child) {
  text-align: right;
}

.drilldown-dialog:not(.crop-visibility-dialog) .drilldown-head {
  align-items: center;
}

.drilldown-dialog:not(.crop-visibility-dialog) .drilldown-head > div {
  flex: 1 1 auto;
  text-align: center;
}

.drilldown-dialog:not(.crop-visibility-dialog) .drilldown-head p {
  text-align: center;
}

.drilldown-dialog:not(.crop-visibility-dialog) .drilldown-close {
  align-self: center;
}

.drilldown-dialog:not(.crop-visibility-dialog) .drilldown-table th,
.drilldown-dialog:not(.crop-visibility-dialog) .drilldown-table td {
  text-align: center;
}

.drilldown-dialog:not(.crop-visibility-dialog) .drilldown-table td:not(:first-child),
.drilldown-dialog:not(.crop-visibility-dialog) .drilldown-table th:not(:first-child) {
  text-align: center;
}

.empty-state {
  color: var(--muted);
  padding: 18px 12px;
}

@media (max-width: 1180px) {
  .topbar,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .brand-shell {
    gap: 12px;
  }

  .brand-logo-link {
    width: 100%;
    justify-content: flex-start;
  }

  .brand-logo-image {
    width: min(100%, 203px);
  }

  .dashboard-toolbar,
  .dashboard-grid,
  .dashboard-kpis {
    grid-template-columns: 1fr;
  }

  .dashboard-panel-wide,
  .dashboard-kpis {
    grid-column: auto;
  }

  .trend-row {
    grid-template-columns: 1fr;
  }

  .trend-bar-line,
  .histogram-bar-line {
    grid-template-columns: 38px minmax(0, 1fr) 72px;
  }

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

  .ops-region-head {
    flex-direction: column;
  }

  .ops-region-stats {
    justify-content: flex-start;
  }

  .ops-region-table {
    display: block;
    overflow-x: auto;
  }

  .trend-values {
    justify-content: flex-start;
  }

  .panel-head-row {
    flex-direction: column;
  }

  .panel-head-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .summary-group-header {
    padding: 10px 12px;
  }

  .toolbar-action {
    justify-content: stretch;
  }

  #dashboards-refresh-button {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 10px;
  }

  .brand-block,
  .panel,
  .toolbar,
  .meta-strip,
  .summary-group,
  .ops-region-card,
  .dashboard-kpi-card {
    border-radius: 18px;
  }

  .brand-shell {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .page-nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-nav-link {
    justify-content: center;
    min-height: 40px;
    font-size: 13px;
  }

  .toolbar {
    padding: 8px;
    gap: 8px;
  }

  .toolbar-field {
    gap: 3px;
  }

  .toolbar-field label {
    font-size: 11px;
  }

  .filter-dropdown-toggle {
    min-height: 40px;
    padding: 8px 10px;
    font-size: 13px;
  }

  .filter-dropdown-menu {
    padding: 8px;
    gap: 6px;
    border-radius: 12px;
  }

  .filter-dropdown-options {
    max-height: 48vh;
  }

  .meta-strip {
    display: grid;
    grid-template-columns: 1fr;
    padding: 8px;
  }

  .meta-pill {
    justify-content: space-between;
    font-size: 11px;
    padding: 6px 9px;
  }

  .panel {
    padding: 8px;
  }

  .panel-head h2 {
    font-size: 16px;
  }

  .panel-head p {
    font-size: 11px;
    line-height: 1.35;
  }

  .panel-head-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .panel-head-actions > .ghost-button {
    width: 100%;
    min-height: 40px;
  }

  .dashboard-switches {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-switch-button {
    width: 100%;
    min-width: 0;
  }

  .dashboard-grouping-button {
    width: auto;
    flex: 1 1 160px;
  }

  .dashboard-kpis {
    gap: 8px;
  }

  .dashboard-kpi-card {
    padding: 12px 14px;
    gap: 4px;
  }

  .dashboard-kpi-card strong {
    font-size: 20px;
  }

  .dashboard-kpi-card span,
  .dashboard-kpi-card small {
    font-size: 11px;
  }

  .dashboard-grouping-toggle {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .dashboard-secondary-toggles {
    width: 100%;
  }

  .ops-region-head {
    padding: 14px;
    gap: 12px;
    align-items: flex-start;
  }

  .ops-region-title-block {
    width: 100%;
    text-align: left;
  }

  .ops-region-title-block h3 {
    font-size: 17px;
    text-align: left;
  }

  .ops-region-title-block p {
    font-size: 12px;
    text-align: left;
  }

  .ops-region-stats {
    width: 100%;
    margin-left: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .ops-stat-chip {
    min-width: 0;
    justify-items: start;
    text-align: left;
  }

  .ops-region-content {
    padding: 10px;
  }

  .ops-region-table {
    display: block;
    overflow: visible;
  }

  .ops-region-table thead {
    display: none;
  }

  .ops-region-table tbody {
    display: grid;
    gap: 10px;
  }

  .ops-region-table tr {
    display: grid;
    gap: 7px;
    padding: 12px;
    border: 1px solid #ebdfd2;
    border-radius: 16px;
    background: #fffdf9;
  }

  .ops-company-row {
    background: linear-gradient(135deg, #f9ede1 0%, #fff7ef 100%);
  }

  .ops-crop-group-row {
    background: linear-gradient(135deg, #f7e6d8 0%, #fff5ea 100%);
  }

  .ops-crop-row {
    margin-left: 14px;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    border-color: #f3ddc8 !important;
    border-left: 2px solid #f0bf91 !important;
    border-radius: 14px;
    background: #fffdf9 !important;
    box-shadow: inset 0 0 0 1px rgba(216, 177, 142, 0.16);
  }

  .ops-region-table th,
  .ops-region-table td,
  .ops-company-row td,
  .ops-crop-row td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    min-width: 0 !important;
    padding: 0;
    border: 0;
    background: transparent !important;
    white-space: normal;
    text-align: left !important;
  }

  .ops-region-table th:nth-child(1),
  .ops-region-table td:nth-child(1),
  .ops-region-table th:nth-child(2),
  .ops-region-table td:nth-child(2) {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
  }

  .ops-region-table td::before {
    content: attr(data-label);
    flex: 0 0 38%;
    max-width: 38%;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
  }

  .ops-company-caption,
  .ops-crop-indent {
    display: none !important;
  }

  .ops-company-name,
  .ops-crop-name,
  .ops-crop-group-name,
  .ops-grouped-company-name {
    display: block !important;
    min-width: 0;
    width: 100%;
    padding-left: 0 !important;
  }

  .ops-region-table td.ops-company-name::before,
  .ops-region-table td.ops-crop-name::before,
  .ops-region-table td.ops-crop-group-name::before,
  .ops-region-table td.ops-grouped-company-name::before {
    content: attr(data-label);
    position: static;
    width: auto;
    height: auto;
    flex: none;
    max-width: none;
    border-radius: 0;
    background: none;
    transform: none;
    display: block;
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
  }

  .ops-region-table td.ops-crop-name::before {
    color: #c26a1b;
  }

  .ops-region-table td.ops-grouped-company-name::before {
    color: #9d7d68;
  }

  .ops-company-name-wrap {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr);
    width: 100%;
    min-width: 0;
    align-items: flex-start;
    gap: 8px;
  }

  .ops-company-toggle-icon {
    margin-top: 2px;
  }

  .ops-company-name-wrap span:last-child,
  .ops-crop-name,
  .ops-crop-group-name,
  .ops-grouped-company-name {
    display: block;
    width: auto;
    min-width: 0;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
    white-space: normal;
    font-size: 14px;
    line-height: 1.35;
    font-weight: 700;
    color: var(--accent-deep);
  }

  .ops-crop-name {
    color: #744f35;
  }

  .ops-crop-group-name {
    color: var(--accent-deep);
  }

  .ops-grouped-company-name {
    color: #744f35;
  }

  .ops-company-region-inline {
    margin-left: 4px;
    font-size: 11px;
  }

  .ops-company-name-wrap span:last-child {
    display: block;
    width: 100%;
    max-width: none;
    justify-self: stretch;
    min-width: 0;
  }

  .ops-company-row td:not(.ops-company-name),
  .ops-crop-row td:not(.ops-crop-name),
  .ops-crop-group-row td:not(.ops-crop-group-name),
  .ops-grouped-company-row td:not(.ops-grouped-company-name) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 10px;
  }

  .ops-region-table td:not(.ops-company-name):not(.ops-crop-name):not(.ops-crop-group-name):not(.ops-grouped-company-name) {
    font-size: 13px;
  }

  .ops-region-table td:not(.ops-company-name):not(.ops-crop-name):not(.ops-crop-group-name):not(.ops-grouped-company-name)::before {
    flex: none;
    max-width: none;
    min-width: 0;
  }

  .ops-region-table td.ops-value-cell {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 10px;
  }

  .ops-region-table td.ops-value-cell::before {
    content: none;
    display: none;
  }

  .ops-region-table td.ops-value-cell .ops-mobile-label {
    display: block;
    min-width: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
  }

  .ops-region-table td.ops-value-cell .ops-value-content {
    justify-self: end;
    min-width: 0;
    text-align: right;
    font-weight: 700;
    color: var(--accent-deep);
  }

  .ops-region-table td.ops-value-bar {
    grid-template-columns: 1fr;
    row-gap: 8px;
  }

  .ops-region-table td.ops-value-bar .ops-value-content {
    justify-self: stretch;
    width: 100%;
  }

  .ops-bar-track {
    flex: 1 1 auto;
    min-width: 120px;
  }

  .region-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .region-tab {
    flex: 0 0 auto;
  }

  .summary-group-header {
    align-items: flex-start;
    padding: 12px;
    gap: 8px;
  }

  .summary-group-title {
    font-size: 15px;
  }

  .summary-group-meta {
    display: grid;
    gap: 4px;
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.3;
  }

  .summary-toggle-icon {
    align-self: flex-end;
  }

  .summary-table-wrap {
    margin: 0 -4px;
    padding-bottom: 4px;
    max-height: none;
    overflow-y: visible;
  }

  .summary-table {
    min-width: 620px;
  }

  .summary-table th,
  .summary-table td {
    padding: 6px 5px;
    font-size: 11px;
  }

  .summary-table thead tr:first-child th {
    padding: 7px 5px;
    font-size: 10px;
  }

  .summary-table thead tr:nth-child(2) th {
    padding: 6px 4px;
    font-size: 9px;
  }

  .summary-metric-head-main,
  .summary-metric-head-overlay,
  .summary-metric-cell {
    min-width: 190px;
    width: 190px;
    max-width: 190px;
    font-size: 11px;
    box-shadow: 6px 0 10px rgba(95, 68, 54, 0.08);
  }

  .summary-table.summary-table-detailed.summary-table-tight .summary-metric-head-main,
  .summary-table.summary-table-detailed.summary-table-tight .summary-metric-head-overlay,
  .summary-table.summary-table-detailed.summary-table-tight .summary-metric-cell {
    min-width: 190px;
    width: 190px;
    max-width: 190px;
  }

  .summary-col-head > div {
    max-width: 108px;
  }

  .summary-col-head small {
    font-size: 9px;
  }

  .summary-percent-head,
  .summary-percent-cell {
    min-width: 64px;
    width: 64px;
    max-width: 64px;
  }

  .percent-badge {
    min-width: 54px;
    padding: 2px 6px;
    font-size: 11px;
  }

  .drilldown-modal.open {
    padding: 10px;
    align-items: center;
  }

  .drilldown-dialog {
    width: min(100vw - 16px, 960px);
    max-height: min(92vh, calc(100vh - 16px));
    border-radius: 16px;
  }

  .drilldown-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 14px 14px 12px;
  }

  .drilldown-head h3 {
    font-size: 17px;
    line-height: 1.25;
  }

  .drilldown-head p {
    font-size: 12px;
    line-height: 1.35;
  }

  .drilldown-close {
    width: 100%;
    min-height: 42px;
  }

  .drilldown-body {
    padding: 0 14px 14px;
    max-height: calc(92vh - 120px);
  }

  .drilldown-table {
    display: block;
  }

  .drilldown-table thead {
    display: none;
  }

  .drilldown-table tbody {
    display: grid;
    gap: 10px;
  }

  .drilldown-table tr {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid #ebdfd2;
    border-radius: 14px;
    background: #fffaf5;
  }

  .drilldown-table td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left !important;
  }

  .drilldown-table td::before {
    content: attr(data-label);
    flex: 0 0 42%;
    max-width: 42%;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
  }

  .drilldown-table td:first-child {
    flex-direction: column;
    gap: 6px;
  }

  .drilldown-table td:first-child::before {
    max-width: none;
  }

  .drilldown-table td:first-child:not(:empty) {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-deep);
  }
}

@media (max-width: 480px) {
  .page-shell {
    padding: 8px;
  }

  .panel-head-actions {
    grid-template-columns: 1fr;
  }

  .dashboard-panel-actions {
    display: flex;
    flex-wrap: wrap;
  }

  .dashboard-collapse-button,
  .dashboard-settings-button {
    width: 100%;
  }

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

  .ops-region-table tr {
    padding: 12px;
  }

  .ops-region-table td {
    gap: 10px;
  }

  .ops-region-table td::before {
    flex: 0 0 34%;
    max-width: 34%;
  }

  .ops-region-table td.ops-company-name,
  .ops-region-table td.ops-crop-name {
    padding-bottom: 6px;
    gap: 4px !important;
  }

  .ops-crop-row {
    margin-left: 10px;
    border: 1px solid #ecd9c9 !important;
    border-left: 2px solid #e3b88f !important;
    border-radius: 12px !important;
    background: #fffdfa !important;
    box-shadow: none !important;
  }

  .ops-region-table td.ops-company-name::before,
  .ops-region-table td.ops-crop-name::before {
    font-size: 10px;
  }

  .ops-company-name-wrap span:last-child,
  .ops-crop-name {
    font-size: 15px;
    line-height: 1.3;
  }

  .drilldown-modal.open {
    padding: 8px;
  }

  .drilldown-dialog {
    width: min(100vw - 12px, 960px);
    max-height: min(94vh, calc(100vh - 12px));
  }

  .summary-table {
    min-width: 560px;
  }

  .summary-metric-head-main,
  .summary-metric-head-overlay,
  .summary-metric-cell,
  .summary-table.summary-table-detailed.summary-table-tight .summary-metric-head-main,
  .summary-table.summary-table-detailed.summary-table-tight .summary-metric-head-overlay,
  .summary-table.summary-table-detailed.summary-table-tight .summary-metric-cell {
    min-width: 170px;
    width: 170px;
    max-width: 170px;
  }
}

@media (hover: none), (pointer: coarse) {
  .ops-company-toggle,
  .ops-company-toggle td,
  .ops-region-table tbody tr,
  .ops-region-table tbody td {
    -webkit-tap-highlight-color: transparent;
  }

  .ops-company-toggle:hover td,
  .ops-region-table tbody tr:hover > td {
    background: transparent !important;
  }

  .ops-region-table tbody tr:hover > td.ops-company-name,
  .ops-region-table tbody tr:hover > td.ops-crop-name,
  .ops-region-table tbody tr:hover > td.ops-crop-group-name,
  .ops-region-table tbody tr:hover > td.ops-grouped-company-name,
  .ops-region-table tbody tr:hover > td .ops-value-content,
  .ops-region-table tbody tr:hover > td .ops-mobile-label,
  .ops-region-table tbody tr:hover > td .ops-company-toggle-icon {
    color: inherit !important;
  }

  .ops-region-table tbody tr:hover > td .ops-bar-track {
    background: rgba(70, 53, 47, 0.08) !important;
  }
}

@media (max-width: 1180px) and (orientation: landscape) and (pointer: coarse) {
  .ops-region-head {
    flex-direction: row;
    align-items: flex-start;
  }

  .ops-region-title-block {
    width: auto;
    min-width: 0;
    text-align: left;
  }

  .ops-region-title-block h3,
  .ops-region-title-block p {
    text-align: left;
  }

  .ops-region-stats {
    width: auto;
    margin-left: auto;
    display: grid;
    grid-template-columns: repeat(4, minmax(88px, 1fr));
    justify-content: end;
  }

  .ops-stat-chip {
    min-width: 88px;
    justify-items: end;
    text-align: right;
  }
}

