/**
 * ============================================================
 * FIMS Cloud Ver.2.0
 * Main Stylesheet
 * ============================================================
 *
 * File:
 *   css/main.css
 *
 * Target screen:
 *   Province Selection
 *
 * Main layout:
 *   Upper:
 *     Province List | FMU List | Province Map
 *
 *   Lower:
 *     Main Menu | Province/FMU Summary | Reports
 * ============================================================
 */

/* ============================================================
   1. Design tokens
   ============================================================ */

:root {
  --font-family:
    "Segoe UI",
    "Helvetica Neue",
    Arial,
    sans-serif;

  --font-size-xs: 0.72rem;
  --font-size-sm: 0.82rem;
  --font-size-md: 0.92rem;
  --font-size-lg: 1.08rem;
  --font-size-xl: 1.45rem;

  --color-page-bg: #e8efe9;
  --color-shell-bg: #f7faf7;
  --color-panel-bg: #ffffff;
  --color-panel-alt: #f3f7f3;

  --color-header: #245b3a;
  --color-header-dark: #123d26;
  --color-header-light: #dcecdf;

  --color-primary: #2f6f46;
  --color-primary-hover: #255a39;
  --color-primary-active: #1b452c;
  --color-primary-soft: #e7f3e9;

  --color-accent: #d97706;
  --color-accent-soft: #fff3dc;

  --color-success: #2f6f46;
  --color-warning: #a45c00;
  --color-danger: #b42318;

  --color-text: #243128;
  --color-text-muted: #657268;
  --color-text-light: #ffffff;

  --color-border: #aebbb1;
  --color-border-light: #d7e1d9;
  --color-border-dark: #667a6b;

  --color-row-hover: #eef7ef;
  --color-row-selected: #dcefe0;
  --color-row-selected-border: #2f6f46;

  --color-disabled-bg: #e8eee9;
  --color-disabled-text: #8a958d;

  --shadow-shell:
    0 10px 28px rgba(24, 55, 35, 0.18);

  --shadow-panel:
    0 2px 7px rgba(28, 69, 42, 0.12);

  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 9px;

  --transition-fast: 120ms ease;
  --transition-normal: 180ms ease;

  --header-height: 76px;
  --status-bar-height: 34px;

  --province-column-width: 275px;
  --fmu-column-width: minmax(0, 1fr);
  --map-column-width: minmax(330px, 1.15fr);
}

/* ============================================================
   2. Reset and base styles
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  font-size: 16px;
  background: var(--color-page-bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: auto;
  color: var(--color-text);
  background:
    linear-gradient(
      180deg,
      #dce7de 0,
      var(--color-page-bg) 220px
    );
  font-family: var(--font-family);
  font-size: var(--font-size-md);
  line-height: 1.45;
}

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

button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

button {
  margin: 0;
}

a {
  color: inherit;
}

table {
  border-collapse: collapse;
}

[hidden] {
  display: none !important;
}

::selection {
  color: #ffffff;
  background: var(--color-primary);
}

/* ============================================================
   3. Accessibility
   ============================================================ */

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  border: 0 !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
}

:focus-visible {
  outline: 3px solid rgba(217, 119, 6, 0.6);
  outline-offset: 2px;
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible),
input:focus:not(:focus-visible) {
  outline: none;
}

/* ============================================================
   4. Application shell
   ============================================================ */

.app-shell {
  display: flex;
  flex-direction: column;
  width: min(1880px, calc(100% - 28px));
  min-height: calc(100vh - 28px);
  margin: 14px auto;
  overflow: hidden;
  background: var(--color-shell-bg);
  border: 1px solid var(--color-border-dark);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-shell);
}

/* ============================================================
   5. Application header
   ============================================================ */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  padding: 13px 22px;
  color: var(--color-text-light);
  background:
    linear-gradient(
      135deg,
      var(--color-header-dark),
      var(--color-header)
    );
  border-bottom: 4px solid var(--color-accent);
}

.brand-block {
  min-width: 0;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-title {
  margin: 0;
  overflow: hidden;
  color: #ffffff;
  font-size: var(--font-size-xl);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.version-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-height: 25px;
  padding: 3px 10px;
  color: #244634;
  background: #f7d59c;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 999px;
  font-size: var(--font-size-xs);
  font-weight: 700;
}

.brand-subtitle {
  margin: 5px 0 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: var(--font-size-sm);
  letter-spacing: 0.025em;
}

.header-meta {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-end;
  margin-left: 24px;
  text-align: right;
}

.header-meta strong {
  font-size: var(--font-size-sm);
  font-weight: 700;
}

.header-meta span {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.8);
  font-size: var(--font-size-xs);
}

/* ============================================================
   6. Screen heading
   ============================================================ */

.screen-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 18px;
  background: #ffffff;
  border-bottom: 1px solid var(--color-border);
}

.screen-heading h2 {
  margin: 0;
  color: var(--color-header-dark);
  font-size: 1.2rem;
  line-height: 1.25;
}

.screen-description {
  margin: 4px 0 0;
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.application-status {
  flex: 0 0 auto;
  max-width: 48%;
  padding: 7px 11px;
  overflow: hidden;
  color: #365543;
  background: #edf5ee;
  border: 1px solid #c7ddcc;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.application-status.is-loading {
  color: #815000;
  background: #fff7df;
  border-color: #e9cf83;
}

.application-status.is-success {
  color: var(--color-success);
  background: #eaf6ef;
  border-color: #a9d7bb;
}

.application-status.is-warning {
  color: var(--color-warning);
  background: #fff4de;
  border-color: #e8c785;
}

.application-status.is-error {
  color: var(--color-danger);
  background: #fff0ee;
  border-color: #e6b3ad;
}

/* ============================================================
   7. Main screen and grid
   ============================================================ */

.main-screen {
  flex: 1 1 auto;
  min-height: 0;
  padding: 12px;
}

.top-grid,
.bottom-grid {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.top-grid {
  grid-template-columns:
    var(--province-column-width)
    minmax(0, 1fr);
  align-items: stretch;
}

.bottom-grid {
  grid-template-columns:
    var(--province-column-width)
    var(--fmu-column-width)
    var(--map-column-width);
  align-items: stretch;
  margin-top: 12px;
}

/* ============================================================
   8. Panels
   ============================================================ */

.panel {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-panel-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-panel);
}

.panel-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  min-height: 49px;
  gap: 10px;
  padding: 8px 11px;
  color: #ffffff;
  background:
    linear-gradient(
      180deg,
      #3e7951,
      #2d6842
    );
  border-bottom: 1px solid var(--color-header-dark);
}

.panel-header h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.2;
}

.panel-header small {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.78);
  font-size: var(--font-size-xs);
}

.panel-body {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  padding: 10px;
}

.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  min-height: 24px;
  padding: 2px 8px;
  color: #264a36;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  font-size: var(--font-size-xs);
  font-weight: 700;
}

/* ============================================================
   9. Search inputs
   ============================================================ */

.search-box {
  display: block;
  width: 100%;
  margin-bottom: 8px;
}

.search-box input {
  width: 100%;
  min-height: 34px;
  padding: 6px 9px;
  color: var(--color-text);
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background-color var(--transition-fast);
}

.search-box input::placeholder {
  color: #89949e;
}

.search-box input:hover:not(:disabled) {
  border-color: #738b78;
}

.search-box input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(31, 95, 139, 0.15);
}

.search-box input:disabled {
  color: var(--color-disabled-text);
  background: var(--color-disabled-bg);
  cursor: not-allowed;
}

/* ============================================================
   10. Tables
   ============================================================ */

.table-wrap {
  position: relative;
  width: 100%;
  min-height: 0;
  overflow: auto;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.province-panel,
.fmu-panel {
  /*
   * Ver.3.9.1
   * The complete FMU panel, including Timber Volume controls,
   * is aligned to the exact height of the 22-row Province panel.
   */
  height: 667px;
  min-height: 667px;
  max-height: 667px;
}

.province-panel-body,
.fmu-panel-body {
  display: flex;
  min-height: 0;
  flex-direction: column;
}

.province-panel-body {
  flex: 0 0 auto;
  padding: 0;
  overflow: hidden;
}

.fmu-panel-body {
  flex: 1 1 auto;
  overflow: hidden;
}

.province-table-wrap {
  flex: 0 0 auto;
  min-height: 0;
  max-height: none;
}

.fmu-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

.data-table {
  width: 100%;
  min-width: 100%;
  table-layout: auto;
  color: var(--color-text);
  background: #ffffff;
  font-size: var(--font-size-sm);
}

.data-table thead {
  position: sticky;
  top: 0;
  z-index: 3;
}

.data-table th {
  padding: 7px 8px;
  color: #30483a;
  background:
    linear-gradient(
      180deg,
      #eef4ef,
      #dce7df
    );
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border-dark);
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}

.data-table th:last-child {
  border-right: 0;
}

.data-table td {
  padding: 6px 8px;
  vertical-align: middle;
  border-right: 1px solid var(--color-border-light);
  border-bottom: 1px solid var(--color-border-light);
}

.data-table td:last-child {
  border-right: 0;
}

.data-table tbody tr {
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.data-table tbody tr:nth-child(even) {
  background: #fafbfd;
}

.data-table tbody tr:hover {
  background: var(--color-row-hover);
}

.data-table tbody tr.is-selected,
.data-table tbody tr.selected,
.data-table tbody tr[aria-selected="true"] {
  background: var(--color-row-selected);
  box-shadow:
    inset 4px 0 0 var(--color-row-selected-border);
}

.data-table tbody tr.is-selected:hover,
.data-table tbody tr.selected:hover,
.data-table tbody tr[aria-selected="true"]:hover {
  background: #cee6d3;
}

.data-table .number-cell,
.data-table td[data-type="number"] {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.data-table .code-cell {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.province-table th:first-child,
.province-table td:first-child {
  width: 66px;
  text-align: center;
}

.province-table th:nth-child(2),
.province-table td:nth-child(2) {
  min-width: 130px;
}

.fmu-table {
  min-width: 780px;
}

.fmu-table th:nth-child(1),
.fmu-table td:nth-child(1) {
  width: 100px;
  white-space: nowrap;
}

.fmu-table th:nth-child(2),
.fmu-table td:nth-child(2) {
  min-width: 180px;
}

.fmu-table th:nth-child(3),
.fmu-table td:nth-child(3) {
  width: 105px;
  white-space: nowrap;
}

.fmu-table th:nth-child(4),
.fmu-table td:nth-child(4),
.fmu-table th:nth-child(5),
.fmu-table td:nth-child(5) {
  width: 145px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ============================================================
   11. Selected Province display
   ============================================================ */

.selected-province-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px;
  margin-top: 3px;
  font-size: var(--font-size-xs);
}

.selected-province-line span {
  color: rgba(255, 255, 255, 0.78);
}

.selected-province-line strong {
  color: #ffffff;
  font-weight: 700;
}

.selected-code {
  min-height: 1em;
}

/* ============================================================
   12. Empty states
   ============================================================ */

.empty-message {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  padding: 14px;
  color: var(--color-text-muted);
  background:
    repeating-linear-gradient(
      -45deg,
      #fbfdfb,
      #fbfdfb 10px,
      #f5f8f5 10px,
      #f5f8f5 20px
    );
  border: 1px dashed #bbc5ce;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  text-align: center;
}

.province-panel .empty-message,
.fmu-panel .empty-message {
  margin-top: 8px;
}

/* ============================================================
   13. Buttons
   ============================================================ */

.primary-button,
.secondary-button,
.module-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
}

.primary-button {
  color: #ffffff;
  background: var(--color-primary);
  border: 1px solid var(--color-primary-active);
}

.primary-button:hover:not(:disabled) {
  background: var(--color-primary-hover);
}

.primary-button:active:not(:disabled) {
  background: var(--color-primary-active);
  transform: translateY(1px);
}

.secondary-button {
  color: #344d3d;
  background:
    linear-gradient(
      180deg,
      #ffffff,
      #e6ede7
    );
  border: 1px solid var(--color-border);
}

.secondary-button:hover:not(:disabled) {
  color: #245235;
  background: #eef7ef;
  border-color: #73967c;
}

.secondary-button:active:not(:disabled) {
  background: #dceade;
  transform: translateY(1px);
}

.primary-button:disabled,
.secondary-button:disabled,
.module-button:disabled {
  color: var(--color-disabled-text);
  background: var(--color-disabled-bg);
  border-color: #c5cbd0;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.78;
}

/* ============================================================
   14. Timber Volume controls
   ============================================================ */

.timber-volume-panel {
  display: grid;
  grid-template-columns: minmax(290px, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  background: #f1f4f7;
  border-top: 1px solid var(--color-border);
}

.timber-volume-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.timber-volume-actions .secondary-button {
  min-height: 32px;
  padding: 5px 8px;
  font-size: var(--font-size-xs);
}

.new-volume-control {
  display: grid;
  grid-template-columns: auto 100px auto;
  align-items: center;
  gap: 7px;
}

.new-volume-control label {
  color: #425448;
  font-size: var(--font-size-sm);
  font-weight: 700;
  white-space: nowrap;
}

.new-volume-control input {
  width: 100px;
  min-height: 32px;
  padding: 5px 7px;
  text-align: right;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-variant-numeric: tabular-nums;
}

.new-volume-control input:disabled {
  color: var(--color-disabled-text);
  background: var(--color-disabled-bg);
}

/* ============================================================
   15. Map
   ============================================================ */

.map-panel {
  min-height: 505px;
}

.map-panel-body {
  display: flex;
  flex-direction: column;
}

.map-container-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 400px;
  overflow: hidden;
  background: #dce8df;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.map-container {
  width: 100%;
  height: 100%;
  min-height: 400px;
  background: #dbe7dd;
}

.map-overlay {
  position: absolute;
  z-index: 800;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  color: #315840;
  background: rgba(246, 250, 252, 0.88);
  font-size: var(--font-size-sm);
  font-weight: 600;
  text-align: center;
  backdrop-filter: blur(2px);
}

.map-error {
  color: var(--color-danger);
  background: rgba(255, 242, 240, 0.92);
}

.map-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}

.compact-layers {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 10px;
  min-width: 0;
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
}

.compact-layers label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.compact-layers input {
  margin: 0;
}

.map-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.map-actions .secondary-button {
  min-height: 30px;
  padding: 4px 8px;
  font-size: var(--font-size-xs);
}

/* Leaflet adjustments */

.leaflet-container {
  font-family: var(--font-family);
}

.leaflet-control-layers,
.leaflet-bar {
  border: 1px solid rgba(32, 56, 74, 0.35) !important;
  box-shadow: 0 2px 7px rgba(20, 38, 52, 0.2) !important;
}

.leaflet-control-attribution {
  font-size: 10px;
}

.leaflet-popup-content-wrapper {
  border-radius: var(--radius-sm);
}

.leaflet-popup-content {
  margin: 10px 12px;
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  line-height: 1.4;
}

/* ============================================================
   16. Main module menu
   ============================================================ */

.navigation-panel {
  min-height: 365px;
}

.module-menu {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.module-button {
  width: 100%;
  min-height: 39px;
  color: #374b3d;
  background:
    linear-gradient(
      180deg,
      #ffffff,
      #e8eee9
    );
  border: 1px solid var(--color-border);
  font-size: var(--font-size-sm);
}

.module-button:hover:not(:disabled) {
  color: #215536;
  background: var(--color-primary-soft);
  border-color: #709878;
}

.module-button.active,
.module-button[aria-current="page"] {
  color: #ffffff;
  background:
    linear-gradient(
      180deg,
      #347a4d,
      var(--color-primary)
    );
  border-color: var(--color-primary-active);
  box-shadow:
    inset 4px 0 0 var(--color-accent);
}

.module-link {
  text-decoration: none;
}

.exit-button {
  margin-top: 4px;
  color: #ffffff;
  background:
    linear-gradient(
      180deg,
      #68796d,
      #526157
    );
  border-color: #414f45;
}

.exit-button:hover {
  color: #ffffff;
  background:
    linear-gradient(
      180deg,
      #5e6d62,
      #435047
    );
  border-color: #354039;
}

/* ============================================================
   17. Summary
   ============================================================ */

.summary-panel {
  min-height: 365px;
}

.summary-panel-body {
  overflow: auto;
}

.summary-container {
  display: grid;
  grid-template-columns: repeat(2, minmax(210px, 1fr));
  gap: 9px 13px;
}

.summary-section {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(210px, 1fr));
  gap: 8px 13px;
  min-width: 0;
}

.summary-section + .summary-section {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--color-border-light);
}

.summary-section-title {
  grid-column: 1 / -1;
  margin: 0;
  padding: 4px 7px;
  color: #31583f;
  background: #eaf3ec;
  border-left: 4px solid var(--color-primary);
  font-size: var(--font-size-sm);
  font-weight: 700;
}

.summary-item {
  display: grid;
  grid-template-columns: minmax(145px, 1fr) minmax(100px, 0.72fr);
  align-items: center;
  min-width: 0;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  background: #ffffff;
}

.summary-label {
  min-width: 0;
  padding: 7px 8px;
  overflow: hidden;
  color: #45584a;
  background: #f3f7f4;
  border-right: 1px solid var(--color-border-light);
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-value {
  min-width: 0;
  padding: 7px 8px;
  overflow: hidden;
  color: #294535;
  font-size: var(--font-size-sm);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-item[data-empty="true"] .summary-value {
  color: #87928a;
  font-weight: 400;
}

/* Alternative generic structures supported by summary.js */

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(200px, 1fr));
  gap: 9px;
}

.summary-row {
  display: grid;
  grid-template-columns: minmax(145px, 1fr) minmax(95px, 0.72fr);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.summary-row dt,
.summary-row dd {
  margin: 0;
  padding: 7px 8px;
}

.summary-row dt {
  color: #45584a;
  background: #f3f7f4;
  font-size: var(--font-size-xs);
  font-weight: 600;
}

.summary-row dd {
  color: #294535;
  background: #ffffff;
  border-left: 1px solid var(--color-border-light);
  font-size: var(--font-size-sm);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
}



/* Old FIMS-compatible Province Summary arrangement */
.legacy-summary-wrapper {
  min-width: 0;
}

.legacy-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 5px 18px;
  align-items: start;
  margin-top: 8px;
}

.legacy-summary-column {
  display: grid;
  gap: 5px;
  align-content: start;
  min-width: 0;
}

.legacy-summary-item {
  display: grid;
  grid-template-columns: minmax(155px, 1fr) minmax(105px, 0.72fr);
  min-width: 0;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #ffffff;
}

.legacy-summary-label,
.legacy-summary-value {
  min-width: 0;
  padding: 6px 8px;
  line-height: 1.2;
}

.legacy-summary-label {
  overflow: hidden;
  color: #45584a;
  background: #f3f7f4;
  border-right: 1px solid var(--color-border-light);
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legacy-summary-value {
  color: #294535;
  background: #ffffff;
  font-size: var(--font-size-sm);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.legacy-summary-item[data-empty="true"] .legacy-summary-value {
  color: #87928a;
  font-weight: 400;
}

.legacy-summary-note {
  margin: 10px 0 0;
  color: #56685b;
  font-size: var(--font-size-xs);
  text-align: center;
}

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

/* ============================================================
   18. Reports
   ============================================================ */

.reports-panel {
  min-height: 365px;
}

.reports-panel-body {
  display: flex;
  flex-direction: column;
}

.report-list {
  display: grid;
  flex: 0 0 auto;
  gap: 5px;
}

.report-option {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 7px 8px;
  color: #3d5142;
  background: #f7faf7;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast);
}

.report-option:hover {
  background: #edf6ef;
  border-color: #99b29e;
}

.report-option:has(input:checked) {
  color: #235b38;
  background: #e4f2e7;
  border-color: #63976f;
  box-shadow: inset 3px 0 0 var(--color-primary);
}

.report-option input {
  flex: 0 0 auto;
  margin: 2px 0 0;
  accent-color: var(--color-primary);
}

.report-toolbar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 8px;
}

.report-toolbar button {
  min-width: 0;
  min-height: 32px;
  padding: 5px 7px;
  font-size: var(--font-size-xs);
}

.report-preview {
  flex: 1 1 auto;
  min-height: 155px;
  max-height: 300px;
  margin-top: 8px;
  overflow: auto;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.report-preview .empty-message {
  min-height: 153px;
  border: 0;
  border-radius: 0;
}

.report-document {
  min-width: 100%;
  padding: 14px;
  color: #253029;
  background: #ffffff;
}

.report-document h4,
.report-title {
  margin: 0 0 5px;
  color: var(--color-header-dark);
  font-size: 1rem;
}

.report-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-bottom: 10px;
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
}

.report-table {
  width: 100%;
  min-width: 580px;
  border: 1px solid var(--color-border);
  font-size: var(--font-size-xs);
}

.report-table th {
  padding: 6px 7px;
  color: #30483a;
  background: #e9f0ea;
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border-dark);
  text-align: left;
}

.report-table td {
  padding: 5px 7px;
  border-right: 1px solid var(--color-border-light);
  border-bottom: 1px solid var(--color-border-light);
}

.report-table th:last-child,
.report-table td:last-child {
  border-right: 0;
}

.report-table td[data-type="number"],
.report-table .number-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   19. Notifications
   ============================================================ */

.notification-area {
  position: fixed;
  z-index: 2000;
  right: 24px;
  bottom: 52px;
  display: grid;
  width: min(410px, calc(100vw - 48px));
  gap: 8px;
  pointer-events: none;
}

.notification,
.toast {
  padding: 10px 12px;
  color: #304538;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--color-border);
  border-left: 5px solid var(--color-primary);
  border-radius: var(--radius-md);
  box-shadow: 0 7px 22px rgba(21, 43, 59, 0.22);
  font-size: var(--font-size-sm);
  pointer-events: auto;
}

.notification.is-success,
.toast.success {
  border-left-color: var(--color-success);
}

.notification.is-warning,
.toast.warning {
  border-left-color: var(--color-warning);
}

.notification.is-error,
.toast.error {
  border-left-color: var(--color-danger);
}

/* ============================================================
   20. Status bar
   ============================================================ */

.status-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: center;
  min-height: var(--status-bar-height);
  gap: 18px;
  padding: 6px 12px;
  color: #e5eee7;
  background: #394c3e;
  border-top: 1px solid #223329;
  font-size: var(--font-size-xs);
}

.status-bar span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-bar span:nth-child(2),
.status-bar span:nth-child(3) {
  text-align: right;
}

/* ============================================================
   21. Loading overlay
   ============================================================ */

.loading-overlay {
  position: fixed;
  z-index: 3000;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(18, 36, 49, 0.55);
  backdrop-filter: blur(2px);
}

.loading-dialog {
  display: flex;
  min-width: min(340px, calc(100vw - 40px));
  align-items: center;
  gap: 14px;
  padding: 17px 20px;
  color: #304b3a;
  background: #ffffff;
  border: 1px solid #819585;
  border-radius: var(--radius-md);
  box-shadow: 0 14px 42px rgba(9, 24, 35, 0.35);
}

.loading-dialog p {
  margin: 0;
  font-weight: 600;
}

.loading-spinner {
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  border: 4px solid #d4e5d7;
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: fims-spin 0.85s linear infinite;
}

@keyframes fims-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================================
   22. Error dialog
   ============================================================ */

.error-dialog {
  width: min(500px, calc(100vw - 34px));
  padding: 0;
  color: var(--color-text);
  background: #ffffff;
  border: 1px solid var(--color-border-dark);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 45px rgba(9, 23, 33, 0.36);
}

.error-dialog::backdrop {
  background: rgba(15, 31, 42, 0.55);
  backdrop-filter: blur(2px);
}

.error-dialog form {
  margin: 0;
  padding: 18px;
}

.error-dialog h2 {
  margin: 0 -18px 14px;
  padding: 10px 18px;
  color: #ffffff;
  background: var(--color-header);
  font-size: 1.05rem;
}

.error-dialog p {
  margin: 0;
  white-space: pre-wrap;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

/* ============================================================
   23. Generic state helpers
   ============================================================ */

.is-loading {
  cursor: progress;
}

.is-disabled {
  opacity: 0.64;
  pointer-events: none;
}

.is-hidden {
  display: none !important;
}

.text-muted {
  color: var(--color-text-muted);
}

.text-right {
  text-align: right !important;
}

.text-center {
  text-align: center !important;
}

.numeric {
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   24. Responsive layout
   ============================================================ */

@media (max-width: 1450px) {
  :root {
    --province-column-width: 275px;
    --fmu-column-width: minmax(0, 1fr);
    --map-column-width: minmax(300px, 1fr);
  }

  .app-shell {
    width: calc(100% - 18px);
    min-height: calc(100vh - 18px);
    margin: 9px auto;
  }

  .main-screen {
    padding: 9px;
  }

  .top-grid,
  .bottom-grid {
    gap: 9px;
  }

  .bottom-grid {
    margin-top: 9px;
  }

  .summary-container,
  .summary-section,
  .summary-grid {
    grid-template-columns: 1fr;
  }
}

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

  .map-panel {
    grid-column: 1 / -1;
  }

  .map-container-wrap,
  .map-container {
    min-height: 430px;
  }

  .bottom-grid {
    grid-template-columns: 275px minmax(0, 1fr);
  }

  .reports-panel {
    grid-column: 1 / -1;
  }

  .reports-panel-body {
    display: grid;
    grid-template-columns: minmax(230px, 0.7fr) minmax(480px, 1.7fr);
    grid-template-rows: auto 1fr;
    gap: 8px 10px;
  }

  .report-toolbar {
    grid-column: 1;
  }

  .report-preview {
    grid-column: 2;
    grid-row: 1 / span 2;
    min-height: 230px;
    max-height: 340px;
    margin-top: 0;
  }
}

@media (max-width: 820px) {
  .app-shell {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .app-header {
    align-items: flex-start;
    padding: 12px 14px;
  }

  .header-meta {
    margin-left: 14px;
  }

  .screen-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .application-status {
    width: 100%;
    max-width: none;
    text-align: left;
  }

  .top-grid,
  .bottom-grid {
    display: flex;
    flex-direction: column;
  }

  .province-panel,
  .fmu-panel,
  .map-panel,
  .navigation-panel,
  .summary-panel,
  .reports-panel {
    min-height: auto;
  }

  .province-panel,
  .fmu-panel {
    height: auto;
    max-height: none;
  }

  .province-panel-body {
    overflow: visible;
  }

  .province-list {
    overflow-y: auto;
  }

  .province-table-wrap {
    min-height: 270px;
    max-height: 360px;
  }

  .fmu-table-wrap {
    min-height: 300px;
    max-height: 410px;
  }

  .map-container-wrap,
  .map-container {
    min-height: 400px;
  }

  .timber-volume-panel {
    grid-template-columns: 1fr;
  }

  .new-volume-control {
    justify-content: start;
  }

  .reports-panel-body {
    display: flex;
  }

  .report-preview {
    min-height: 250px;
    max-height: 420px;
    margin-top: 8px;
  }

  .status-bar {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .status-bar span:nth-child(2),
  .status-bar span:nth-child(3) {
    text-align: left;
  }
}

@media (max-width: 560px) {
  .app-header {
    flex-direction: column;
    gap: 8px;
  }

  .header-meta {
    align-items: flex-start;
    margin-left: 0;
    text-align: left;
  }

  .brand-title-row {
    flex-wrap: wrap;
  }

  .main-screen {
    padding: 7px;
  }

  .panel-body {
    padding: 8px;
  }

  .timber-volume-actions {
    grid-template-columns: 1fr;
  }

  .new-volume-control {
    grid-template-columns: 1fr;
  }

  .new-volume-control input {
    width: 100%;
  }

  .report-toolbar {
    grid-template-columns: 1fr;
  }

  .map-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .map-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .notification-area {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
  }
}

/* ============================================================
   25. Print styles
   ============================================================ */

@media print {
  @page {
    size: A4 landscape;
    margin: 12mm;
  }

  html,
  body {
    min-width: 0;
    background: #ffffff !important;
  }

  body {
    color: #000000;
  }

  .app-shell {
    display: block;
    width: 100%;
    min-height: 0;
    margin: 0;
    overflow: visible;
    border: 0;
    box-shadow: none;
  }

  .app-header,
  .screen-heading,
  .top-grid,
  .navigation-panel,
  .summary-panel,
  .status-bar,
  .notification-area,
  .loading-overlay,
  .error-dialog,
  .report-list,
  .report-toolbar {
    display: none !important;
  }

  .main-screen,
  .bottom-grid,
  .reports-panel,
  .reports-panel-body,
  .report-preview {
    display: block;
    width: 100%;
    min-height: 0;
    max-height: none;
    margin: 0;
    padding: 0;
    overflow: visible;
    border: 0;
    box-shadow: none;
  }

  .reports-panel .panel-header {
    display: none;
  }

  .report-document {
    padding: 0;
  }

  .report-table {
    min-width: 0;
    page-break-inside: auto;
  }

  .report-table tr {
    page-break-inside: avoid;
    page-break-after: auto;
  }

  .report-table thead {
    display: table-header-group;
  }

  .report-table th,
  .report-table td {
    color: #000000;
    background: #ffffff !important;
    border: 1px solid #666666;
  }
}

/* ============================================================
   26. Reduced-motion preference
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Province list: one Province per row */
.province-list {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 0;
  width: 100%;
  overflow: hidden;
}

.province-list-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  width: 100%;
  height: 28px;
  min-height: 28px;
  padding: 4px 8px;
  border: 0;
  border-bottom: 1px solid var(--color-border-light);
  border-radius: 0;
  background: #ffffff;
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
}

.province-list-item:hover {
  background: var(--color-row-hover);
}

.province-list-item.active,
.province-list-item[aria-selected="true"] {
  color: #ffffff;
  background: var(--color-success);
}

.province-list-item .list-code {
  text-align: left;
  font-variant-numeric: tabular-nums;
}

.province-list-item .list-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* ============================================================
   18A. Legacy report catalog buttons (Ver.2.3.0)
   ============================================================ */

.report-list {
  display: block;
  max-height: 280px;
  overflow: auto;
  padding-right: 3px;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  background: #f7faf7;
}

.report-category + .report-category {
  border-top: 1px solid #cbd9cd;
}

.report-category-title {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0;
  padding: 6px 8px;
  color: #ffffff;
  background: linear-gradient(#3d7b51, #2c6842);
  font-size: var(--font-size-xs);
  line-height: 1.2;
}

.report-button-list {
  display: grid;
  gap: 3px;
  padding: 5px;
}

.report-list-button {
  width: 100%;
  min-height: 34px;
  padding: 5px 7px;
  color: #364b3c;
  text-align: left;
  background: #ffffff;
  border: 1px solid #ccd9ce;
  border-radius: 2px;
  cursor: pointer;
}

.report-list-button:hover {
  background: #edf6ef;
  border-color: #83a98b;
}

.report-list-button.selected,
.report-list-button[aria-pressed="true"] {
  color: #235b38;
  background: #dcefe0;
  border-color: #579063;
  box-shadow: inset 4px 0 0 #f28c00;
}

.report-list-button strong,
.report-list-button small {
  display: block;
}

.report-list-button strong {
  font-size: var(--font-size-xs);
  line-height: 1.25;
}

.report-list-button small {
  margin-top: 2px;
  color: #68796c;
  font-size: 9px;
  line-height: 1.2;
}

.report-list-button.selected small {
  color: #3c6448;
}


/* ============================================================
   18B. Report export toolbar (Ver.2.3.1)
   ============================================================ */

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

.report-toolbar button {
  min-width: 0;
  white-space: nowrap;
}


/* ============================================================
   18C. PNG Forest Authority green theme (Ver.2.3.2)
   ============================================================ */

.app-header,
.panel-header,
.report-category-title {
  background-image:
    linear-gradient(
      135deg,
      #123d26,
      #2f6f46
    );
}

.primary-button,
.main-menu-button.active,
.report-list-button.selected,
.report-list-button[aria-pressed="true"] {
  border-color: #2f6f46;
}

.primary-button:hover {
  background: #255a39;
}

.status-bar {
  background: #213d2c;
}

.fmu-table-row.selected,
.province-list-item.active {
  box-shadow: inset 4px 0 0 #d97706;
}


/* ============================================================
   19. Timber Volume Zone editor (Ver.2.4.0)
   ============================================================ */

.timber-volume-dialog {
  width: min(1120px, calc(100vw - 32px));
  max-width: none;
  height: min(760px, calc(100vh - 32px));
  padding: 0;
  color: var(--color-text);
  background: #f7faf7;
  border: 1px solid #31583f;
  border-radius: var(--radius-md);
  box-shadow: 0 18px 55px rgba(18, 61, 38, 0.28);
}

.timber-volume-dialog::backdrop {
  background: rgba(18, 40, 25, 0.58);
}

.timber-dialog-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  height: 100%;
}

.timber-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  color: #ffffff;
  background: linear-gradient(135deg, #123d26, #2f6f46);
}

.timber-dialog-header h2,
.timber-dialog-header p {
  margin: 0;
}

.timber-dialog-header h2 {
  font-size: 1.05rem;
}

.timber-dialog-header p {
  margin-top: 3px;
  font-size: var(--font-size-xs);
}

.timber-dialog-toolbar {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #e8efe9;
  border-bottom: 1px solid var(--color-border);
}

.timber-dialog-toolbar label {
  font-weight: 700;
}

.timber-dialog-toolbar input {
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.timber-table-scroll {
  min-height: 0;
  overflow: auto;
  background: #ffffff;
}

.timber-update-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--font-size-xs);
}

.timber-update-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 7px 8px;
  color: #ffffff;
  background: #2f6f46;
  border-right: 1px solid #71937b;
  border-bottom: 1px solid #1f5133;
  text-align: left;
}

.timber-update-table td {
  padding: 4px 6px;
  border-right: 1px solid #d5e0d7;
  border-bottom: 1px solid #d5e0d7;
}

.timber-update-table tr:nth-child(even) td {
  background: #f6faf6;
}

.timber-update-table tr.edited td {
  background: #fff4d8;
}

.timber-update-table .number-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.timber-volume-input,
.timber-comment-input {
  width: 100%;
  min-height: 28px;
  padding: 3px 5px;
  border: 1px solid #aebbb1;
  border-radius: 2px;
  background: #ffffff;
}

.timber-volume-input {
  min-width: 90px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.timber-comment-input {
  min-width: 220px;
}

.timber-dialog-note {
  margin: 0;
  padding: 8px 12px;
  color: #526157;
  background: #eef4ef;
  border-top: 1px solid var(--color-border);
  font-size: var(--font-size-xs);
}

.timber-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 9px 12px;
  background: #e8efe9;
  border-top: 1px solid var(--color-border);
}

@media (max-width: 720px) {
  .timber-volume-dialog {
    width: calc(100vw - 12px);
    height: calc(100vh - 12px);
  }

  .timber-dialog-toolbar {
    grid-template-columns: 1fr;
  }

  .timber-dialog-header {
    align-items: flex-start;
  }
}


/* ============================================================
   API integration status — Ver.2.5.0
   ============================================================ */

.api-status {
  justify-self: end;
  padding: 3px 7px;
  color: #4b5c50;
  background: #f4f6f4;
  border: 1px solid #aeb9b0;
  border-radius: 999px;
  font-size: var(--font-size-xs);
  font-weight: 700;
  white-space: nowrap;
}

.api-status-connected {
  color: #174d2c;
  background: #dff2e4;
  border-color: #5d9870;
}

.api-status-fallback {
  color: #7a4b00;
  background: #fff2cf;
  border-color: #d8a94f;
}

.timber-volume-dialog.is-loading .timber-table-scroll {
  opacity: 0.55;
  pointer-events: none;
}

.timber-volume-dialog.is-loading .timber-dialog-actions {
  opacity: 0.7;
  pointer-events: none;
}

@media (max-width: 720px) {
  .api-status {
    justify-self: start;
  }
}


/* Individual FMU Timber Volume — User Guide Section 1.4.2 */
.fmu-volume-dialog {
  width: min(620px, calc(100vw - 28px));
  max-height: calc(100vh - 40px);
  padding: 0;
  color: #1d2a21;
  background: #f7faf7;
  border: 1px solid #274d34;
  border-radius: 5px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.32);
}

.fmu-volume-dialog::backdrop {
  background: rgba(11, 30, 18, 0.58);
}

.fmu-volume-dialog-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: calc(100vh - 42px);
}

.fmu-volume-dialog-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 13px 15px;
  color: #fff;
  background: linear-gradient(180deg, #1f6a3b, #15532e);
}

.fmu-volume-dialog-header h2 {
  margin: 0;
  font-size: var(--font-size-lg);
}

.fmu-volume-dialog-header p {
  margin: 3px 0 0;
  color: #dceee1;
  font-size: var(--font-size-xs);
}

.fmu-volume-dialog-body {
  overflow: auto;
  padding: 16px;
}

.fmu-volume-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 0 16px;
  border-top: 1px solid #c3cec5;
  border-left: 1px solid #c3cec5;
}

.fmu-volume-details > div {
  padding: 9px 10px;
  background: #fff;
  border-right: 1px solid #c3cec5;
  border-bottom: 1px solid #c3cec5;
}

.fmu-volume-details dt {
  margin-bottom: 3px;
  color: #526258;
  font-size: var(--font-size-xs);
  font-weight: 700;
}

.fmu-volume-details dd {
  margin: 0;
  font-weight: 700;
}

.fmu-volume-entry {
  padding: 13px;
  background: #edf5ef;
  border: 1px solid #86a78e;
  border-radius: 4px;
}

.fmu-volume-entry label {
  display: block;
  margin-bottom: 7px;
  font-weight: 700;
}

.number-with-unit {
  display: flex;
  align-items: center;
  gap: 8px;
}

.number-with-unit input {
  width: min(240px, 100%);
  padding: 8px 9px;
  border: 1px solid #798b7d;
  border-radius: 3px;
  font: inherit;
  text-align: right;
}

.fmu-volume-calculation-note {
  margin-top: 14px;
  padding: 10px 12px;
  color: #34473a;
  background: #fff8df;
  border: 1px solid #cdbb76;
  border-radius: 4px;
}

.fmu-volume-calculation-note p {
  margin: 4px 0 0;
  line-height: 1.45;
}

.fmu-volume-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 11px 15px;
  background: #edf2ee;
  border-top: 1px solid #bac6bc;
}

@media (max-width: 560px) {
  .fmu-volume-details {
    grid-template-columns: 1fr;
  }
}


/* ============================================================
   FIMS Cloud Ver.2.9.0 - Standalone Large Map MVP
   ============================================================ */
body.large-map-page {
  min-width: 0;
  min-height: 100vh;
  overflow: hidden;
  background: #e9efeb;
}

.large-map-shell {
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: 100%;
  height: 100vh;
  min-height: 620px;
  background: #f5f7f5;
}

.large-map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  color: #fff;
  background: linear-gradient(180deg, #205d3c, #17472e);
  border-bottom: 1px solid #0d3421;
}

.large-map-title-block h1 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.25;
}

.large-map-title-block p {
  margin: 3px 0 0;
  color: rgba(255,255,255,.82);
  font-size: .8rem;
}

.large-map-header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.large-map-header-actions button {
  min-height: 34px;
  padding: 6px 12px;
  color: #173524;
  background: #fff;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 4px;
  font-weight: 700;
  cursor: pointer;
}

.large-map-header-actions button[disabled] {
  color: #6f7772;
  background: #e7ebe8;
  cursor: not-allowed;
}

.large-map-workspace {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 0;
}

.large-map-sidebar {
  min-height: 0;
  overflow: auto;
  padding: 10px;
  background: #f7faf8;
  border-right: 1px solid #b8c6bc;
}

.large-map-sidebar section {
  margin-bottom: 10px;
  background: #fff;
  border: 1px solid #c7d2ca;
  border-radius: 5px;
  overflow: hidden;
}

.large-map-sidebar h2 {
  margin: 0;
  padding: 7px 9px;
  color: #244332;
  background: #e3ece6;
  border-bottom: 1px solid #c7d2ca;
  font-size: .9rem;
}

.large-map-sidebar-body { padding: 8px; }

.large-map-layer-list {
  display: grid;
  gap: 6px;
}

.large-map-layer-list label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  font-size: .82rem;
  cursor: pointer;
}

.large-map-layer-list input { margin: 0; }

.large-map-scope {
  display: grid;
  gap: 5px;
  font-size: .8rem;
}

.large-map-scope strong { color: #17472e; }

.large-map-canvas-wrap {
  position: relative;
  min-width: 0;
  min-height: 0;
}

#largeMap {
  width: 100%;
  height: 100%;
  min-height: 520px;
  background: #dfe8e2;
}

.large-map-message {
  position: absolute;
  z-index: 1000;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(620px, calc(100% - 28px));
  padding: 8px 12px;
  color: #23402f;
  background: rgba(255,255,255,.94);
  border: 1px solid #afbeb4;
  border-radius: 5px;
  box-shadow: 0 2px 8px rgba(0,0,0,.14);
  font-size: .82rem;
}

.large-map-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 32px;
  padding: 5px 12px;
  color: #33483b;
  background: #eef3ef;
  border-top: 1px solid #b8c6bc;
  font-size: .76rem;
}

@media (max-width: 760px) {
  body.large-map-page { overflow: auto; }
  .large-map-shell { height: auto; min-height: 100vh; }
  .large-map-workspace { grid-template-columns: 1fr; }
  .large-map-sidebar { border-right: 0; border-bottom: 1px solid #b8c6bc; }
  #largeMap { min-height: 68vh; }
}

/* Ver.2.9.0 Administrator GeoPackage Import */
.import-modal[hidden]{display:none!important}.import-modal{position:fixed;inset:0;z-index:5000;display:grid;place-items:center;padding:18px}.import-modal-backdrop{position:absolute;inset:0;background:rgba(8,27,17,.68)}.import-dialog{position:relative;width:min(850px,96vw);max-height:92vh;overflow:auto;background:#f8faf8;border:1px solid #77917f;border-radius:7px;box-shadow:0 12px 38px rgba(0,0,0,.35)}.import-dialog-header{display:flex;justify-content:space-between;gap:16px;padding:13px 15px;color:#fff;background:linear-gradient(180deg,#267044,#17512f)}.import-dialog-header h2{margin:0;font-size:1.08rem}.import-dialog-header p{margin:3px 0 0;font-size:.76rem}.import-dialog-header button{padding:6px 12px;background:#fff;border:0;border-radius:4px}.import-dialog-body{padding:14px}.import-warning{margin-bottom:13px;padding:10px 12px;color:#5b4200;background:#fff7d7;border:1px solid #e1c86b;border-radius:4px}.import-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.import-grid label,.import-inspection label{display:grid;gap:5px;font-size:.8rem;font-weight:700}.import-grid select,.import-grid input,.import-inspection select{width:100%;min-height:36px;padding:6px 8px;border:1px solid #aebeb3}.import-file-field{grid-column:1/-1}.import-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:13px}.import-actions button{min-height:36px;padding:7px 14px;color:#fff;background:#1c6339;border:1px solid #124c2a;border-radius:4px;font-weight:700}.import-actions .danger{background:#9b2f25}.import-actions button:disabled{opacity:.5}.import-inspection{margin-top:15px;padding:12px;background:#fff;border:1px solid #c4d1c8}.import-inspection dl{display:grid;grid-template-columns:150px 1fr}.import-inspection dt,.import-inspection dd{margin:0;padding:6px;border-bottom:1px solid #d9e1db}.import-inspection dt{font-weight:700;background:#eef3ef}.import-confirm{display:flex!important;align-items:center;margin-top:12px;font-weight:400!important}.import-progress{display:flex;gap:9px;align-items:center;margin-top:12px;padding:9px;background:#e8f2eb}.import-progress span{width:16px;height:16px;border:2px solid #9db7a5;border-top-color:#1c6339;border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.import-result{max-height:230px;overflow:auto;margin-top:12px;padding:10px;white-space:pre-wrap;background:#eef5f0;border:1px solid #b9cbbf}.import-result.error{color:#731d18;background:#fff0ef}


/* ============================================================
   FIMS Cloud Ver.3.0 - Large Map Administrator Workflow
   ============================================================ */

.large-map-workflow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: #9caf9f;
  border-bottom: 1px solid #718878;
}

.workflow-step {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  min-height: 70px;
  padding: 8px 12px;
  color: #294333;
  background: #edf3ee;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.workflow-step span {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: #fff;
  background: #617b68;
  border-radius: 50%;
  font-weight: 700;
}

.workflow-step strong {
  font-size: 0.84rem;
}

.workflow-step small {
  color: #65736a;
  font-size: 0.68rem;
}

.workflow-step.is-active {
  background: #fff5d9;
  box-shadow: inset 0 -4px #c88a18;
}

.workflow-step.is-active span {
  background: #a86c00;
}

.workflow-step.is-complete {
  background: #e4f3e8;
}

.workflow-step.is-complete span {
  background: #277744;
}

.workflow-step:disabled {
  color: #7d8981;
  background: #eef0ee;
  cursor: not-allowed;
  opacity: 0.76;
}

.large-map-layer-group {
  margin: 0 0 10px;
  padding: 0 0 8px;
  border-bottom: 1px solid #d7e0d9;
}

.large-map-layer-group:last-child {
  margin-bottom: 0;
  border-bottom: 0;
}

.large-map-layer-group h3 {
  margin: 0 0 5px;
  color: #31553d;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.035em;
}

.large-map-guidance {
  margin: 0;
  padding-left: 20px;
  color: #44584a;
  font-size: 0.75rem;
  line-height: 1.45;
}

.large-map-guidance li + li {
  margin-top: 5px;
}

.import-grid small {
  color: #65736a;
  font-size: 0.7rem;
  font-weight: 400;
}

.import-actions button {
  min-width: 150px;
}

@media (max-width: 1050px) {
  .large-map-workflow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .large-map-workflow {
    grid-template-columns: 1fr;
  }
}


/* ============================================================
   FIMS Cloud Ver.3.1 - Compact Large Map workflow
   ============================================================ */

.large-map-page .large-map-header {
  min-height: 43px;
}

.large-map-page .large-map-title-block h1 {
  font-size: 0.98rem;
}

.large-map-page .large-map-title-block p {
  margin-top: 1px;
  font-size: 0.62rem;
}

.compact-workflow {
  display: flex;
  align-items: stretch;
  justify-content: center;
  min-height: 54px;
  padding: 5px 10px;
  gap: 4px;
  background: #e5ece7;
  border-bottom: 1px solid #98aa9d;
}

.compact-workflow .workflow-step {
  display: flex;
  flex: 0 1 180px;
  min-width: 120px;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 5px 10px;
  color: #365342;
  background: #f7faf8;
  border: 1px solid #bac8be;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(30, 61, 42, 0.08);
}

.compact-workflow .workflow-icon {
  display: grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  place-items: center;
  color: #ffffff;
  background: #708779;
  border-radius: 50%;
  font-size: 0.92rem;
  font-weight: 800;
}

.compact-workflow .workflow-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.05;
}

.compact-workflow .workflow-copy strong {
  font-size: 0.76rem;
  white-space: nowrap;
}

.compact-workflow .workflow-copy small {
  margin-top: 3px;
  color: #718077;
  font-size: 0.58rem;
  white-space: nowrap;
}

.compact-workflow .workflow-arrow {
  display: grid;
  flex: 0 0 18px;
  place-items: center;
  color: #75877b;
  font-size: 1.35rem;
  font-weight: 700;
}

.compact-workflow .workflow-step.is-active {
  color: #724d00;
  background: #fff5d8;
  border-color: #d3a433;
  box-shadow:
    0 0 0 2px rgba(211, 164, 51, 0.16),
    0 2px 4px rgba(61, 48, 15, 0.12);
}

.compact-workflow .workflow-step.is-active .workflow-icon {
  background: #a96f00;
}

.compact-workflow .workflow-step.is-complete {
  color: #245f38;
  background: #e8f5eb;
  border-color: #8eb99a;
}

.compact-workflow .workflow-step.is-complete .workflow-icon {
  background: #2e7c49;
}

.compact-workflow .workflow-step:disabled {
  color: #79847d;
  background: #edf0ee;
  border-color: #d0d7d2;
  opacity: 0.75;
}

.large-map-sidebar {
  overflow-y: auto;
}

.large-map-sidebar > section:last-child {
  margin-bottom: 0;
}

.custom-file-control {
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  padding: 4px;
  background: #ffffff;
  border: 1px solid #aebcaf;
  border-radius: 3px;
}

.import-field-label {
  display: block;
  margin-bottom: 5px;
  color: #334b3a;
  font-size: 0.72rem;
  font-weight: 700;
}

.custom-file-button {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 27px;
  align-items: center;
  padding: 4px 10px;
  color: #ffffff;
  background: #356947;
  border: 1px solid #245238;
  border-radius: 3px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.custom-file-button:hover {
  background: #28583a;
}

.custom-file-name {
  min-width: 0;
  overflow: hidden;
  color: #58675d;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visually-hidden-file {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 980px) {
  .compact-workflow {
    overflow-x: auto;
    justify-content: flex-start;
  }

  .compact-workflow .workflow-step {
    flex-basis: 150px;
  }
}

@media (max-width: 640px) {
  .compact-workflow .workflow-copy small {
    display: none;
  }

  .compact-workflow .workflow-step {
    min-width: 105px;
  }
}


/* ============================================================
   FIMS Cloud Ver.3.2 - Simple workflow bar
   ============================================================ */

.simple-workflow {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 5px 12px;
  background: #e8eeea;
  border-bottom: 1px solid #aebbb2;
}

.simple-workflow .workflow-step {
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 112px;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 5px 13px;
  color: #365143;
  background: #f8faf9;
  border: 1px solid #b9c5bd;
  border-radius: 4px;
  box-shadow: none;
  cursor: pointer;
}

.simple-workflow .workflow-number {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: #ffffff;
  background: #718579;
  border-radius: 50%;
  font-size: 0.68rem;
  font-weight: 700;
}

.simple-workflow .workflow-step strong {
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.simple-workflow .workflow-arrow {
  display: inline-block;
  flex: 0 0 auto;
  color: #708077;
  font-size: 0.92rem;
  font-weight: 700;
}

.simple-workflow .workflow-step.is-active {
  color: #6f4c00;
  background: #fff5d8;
  border-color: #d1a13a;
  box-shadow: inset 0 -3px #c8860a;
}

.simple-workflow .workflow-step.is-active .workflow-number {
  background: #a96f00;
}

.simple-workflow .workflow-step.is-complete {
  color: #255f38;
  background: #e9f5ec;
  border-color: #94b99f;
}

.simple-workflow .workflow-step.is-complete .workflow-number {
  background: #2f7c49;
}

.simple-workflow .workflow-step:disabled {
  color: #7d8781;
  background: #eef1ef;
  border-color: #d1d8d3;
  cursor: not-allowed;
  opacity: 0.76;
}

@media (max-width: 760px) {
  .simple-workflow {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .simple-workflow .workflow-step {
    min-width: 100px;
  }
}


/* ============================================================
   FIMS Cloud Ver.3.4 - Review Imported Layer
   ============================================================ */

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

.review-modal {
  position: fixed;
  inset: 0;
  z-index: 5100;
  display: grid;
  place-items: center;
  padding: 18px;
}

.review-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 27, 17, 0.68);
}

.review-dialog {
  position: relative;
  width: min(720px, 96vw);
  max-height: 92vh;
  overflow: auto;
  background: #f8faf8;
  border: 1px solid #77917f;
  border-radius: 7px;
  box-shadow: 0 12px 38px rgba(0, 0, 0, 0.35);
}

.review-dialog-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 15px;
  color: #fff;
  background: linear-gradient(180deg, #267044, #17512f);
}

.review-dialog-header h2 {
  margin: 0;
  font-size: 1.08rem;
}

.review-dialog-header p {
  margin: 3px 0 0;
  font-size: 0.76rem;
}

.review-dialog-header button {
  align-self: flex-start;
  min-height: 34px;
  padding: 6px 12px;
  background: #fff;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

.review-dialog-body {
  padding: 14px;
}

.review-status-banner {
  margin-bottom: 12px;
  padding: 10px 12px;
  color: #215936;
  background: #e8f5eb;
  border: 1px solid #9cc3a6;
  border-radius: 4px;
  font-weight: 700;
}

.review-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border: 1px solid #c4d1c8;
  background: #fff;
}

.review-summary > div {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  min-width: 0;
  border-bottom: 1px solid #d9e1db;
}

.review-summary > div:nth-child(odd) {
  border-right: 1px solid #d9e1db;
}

.review-summary dt,
.review-summary dd {
  margin: 0;
  padding: 8px;
  overflow-wrap: anywhere;
}

.review-summary dt {
  color: #344b3b;
  background: #eef3ef;
  font-size: 0.75rem;
  font-weight: 700;
}

.review-summary dd {
  color: #263b2e;
  font-size: 0.78rem;
}

.review-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.review-actions button {
  min-height: 36px;
  padding: 7px 13px;
  color: #244332;
  background: #fff;
  border: 1px solid #9caf9f;
  border-radius: 4px;
  font-weight: 700;
  cursor: pointer;
}

.review-actions button.primary {
  color: #fff;
  background: #1c6339;
  border-color: #124c2a;
}

.review-actions button:hover {
  filter: brightness(0.97);
}

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

  .review-summary > div:nth-child(odd) {
    border-right: 0;
  }

  .review-actions {
    justify-content: stretch;
  }

  .review-actions button {
    flex: 1 1 100%;
  }
}


/* FIMS Cloud Ver.3.6 - Constraint Analysis */
.calculation-dialog {
  width: min(820px, 96vw);
}

.calculation-summary dd {
  font-variant-numeric: tabular-nums;
}

.calculation-summary > div:nth-last-child(-n + 3) dd {
  font-weight: 700;
  color: #185a33;
}


/* FIMS Cloud Ver.3.6.2 */
.calculation-scope {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin: 0 0 0.8rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid #b7cbbb;
  border-radius: 4px;
  background: #f5faf6;
}

.calculation-scope legend {
  padding: 0 0.35rem;
  font-weight: 700;
  color: #174e2d;
}

.calculation-scope label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
}

.calculation-scope p {
  flex-basis: 100%;
  margin: 0;
  color: #4d6254;
  font-size: 0.88rem;
}


/* Ver.3.8.1 Province Constraint report preview */
.fims-report-preview-card { padding: 14px; background: #f8fbf9; border: 1px solid #b8cbbf; min-height: 100%; }
.fims-report-preview-title { color: #165c36; font-weight: 800; font-size: 14px; }
.fims-report-preview-subtitle { margin-top: 2px; font-weight: 700; font-size: 12px; }
.fims-report-preview-meta { display: flex; gap: 16px; margin: 10px 0; font-size: 11px; }
.fims-report-preview-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.fims-report-preview-kpi { padding: 8px; border: 1px solid #cbd9d0; background: white; }
.fims-report-preview-kpi span { display:block; font-size: 9px; color:#52665a; }
.fims-report-preview-kpi strong { display:block; margin-top:3px; color:#174f31; font-size:11px; }
.fims-report-preview-note { margin: 10px 0 0; font-size: 9px; color:#5b685f; line-height:1.4; }


/* FIMS Cloud Ver.3.8.5 - Report availability states */
.report-list-button.report-unavailable,
.report-list-button:disabled {
  position: relative;
  border-color: #c8cfca;
  background: #ecefed;
  color: #7b847e;
  cursor: not-allowed;
  opacity: 0.82;
  box-shadow: none;
}

.report-list-button.report-unavailable:hover,
.report-list-button:disabled:hover {
  border-color: #c8cfca;
  background: #ecefed;
  color: #7b847e;
  transform: none;
  box-shadow: none;
}

.report-list-button.report-unavailable .report-legacy-name {
  color: #8e9691;
}

.report-coming-soon {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.15rem 0.45rem;
  border: 1px solid #c1c8c3;
  border-radius: 999px;
  background: #f4f5f4;
  color: #737b76;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
