﻿:root {
  color-scheme: light;
  --bg: #f2efe7;
  --bg-2: #e4ebdf;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.9);
  --surface-dark: rgba(20, 34, 27, 0.86);
  --text: #1f2d24;
  --muted: #647466;
  --line: rgba(31, 45, 36, 0.12);
  --shadow: 0 24px 80px rgba(25, 40, 31, 0.16);
  --accent: #6d8d59;
  --accent-2: #c19c58;
  --danger: #9d4d4d;
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --content-width: 1200px;
  --page-gap: clamp(1rem, 1.8vw, 1.5rem);
  --page-gutter: clamp(1rem, 2vw, 1.5rem);
  --sidebar-rail-width: clamp(4.75rem, 5vw, 5.5rem);
  --sidebar-width: clamp(16rem, 20vw, 18rem);
  --font-display: "Iowan Old Style", "Hiragino Mincho ProN", "Yu Mincho", Georgia, serif;
  --font-body: "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  font-size: clamp(15px, 0.35vw + 13.5px, 17px);
}

html,
body {
  margin: 0;
  min-height: 100%;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(109, 141, 89, 0.14), transparent 32%),
    radial-gradient(circle at right 15%, rgba(193, 156, 88, 0.14), transparent 22%),
  linear-gradient(135deg, var(--bg), var(--bg-2));
  overflow-x: hidden;
}

body.is-sidebar-open {
  overflow: hidden;
}

body.is-field-sheet-open {
  overflow: auto;
}

body.is-entity-modal-open {
  overflow: auto;
}

body.is-delete-modal-open {
  overflow: hidden;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
.table-card::-webkit-scrollbar {
  width: 0;
  height: 0;
}

html,
body,
.table-card {
  scrollbar-color: transparent transparent;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(31, 45, 36, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 45, 36, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), transparent);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.hero {
  display: none !important;
}

.bg-orb {
  position: fixed;
  inset: auto;
  border-radius: 999px;
  filter: blur(10px);
  pointer-events: none;
  opacity: 0.38;
}

.bg-orb-a {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(109, 141, 89, 0.35), transparent 70%);
  top: -140px;
  right: -80px;
}

.bg-orb-b {
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(193, 156, 88, 0.26), transparent 68%);
  bottom: -120px;
  left: -100px;
}

.app-icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.auth-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 2rem);
}

.auth-card {
  width: min(34rem, 100%);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface-strong);
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow);
}

.auth-card h1,
.hero h1,
.panel h3,
.chart-card h4 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: 0.01em;
}

.auth-card h1 {
  font-size: clamp(2.1rem, 5vw, 3.2rem);
  line-height: 1.05;
  margin-bottom: 16px;
}

.lede {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
}

.login-form,
.editor {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.login-form label,
.editor label {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.login-form span,
.editor span {
  font-size: 0.86rem;
  color: var(--muted);
}

.login-form input,
.editor input,
.editor select,
.editor textarea {
  width: 100%;
  min-width: 0;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid rgba(31, 45, 36, 0.14);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.login-form input:focus,
.editor input:focus,
.editor select:focus,
.editor textarea:focus {
  border-color: rgba(109, 141, 89, 0.72);
  box-shadow: 0 0 0 4px rgba(109, 141, 89, 0.12);
}

.primary,
.ghost,
.nav-btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.primary {
  color: white;
  background: linear-gradient(135deg, var(--accent), #567244);
  box-shadow: 0 14px 28px rgba(86, 114, 68, 0.26);
}

.ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
}

.primary:hover,
.ghost:hover,
.nav-btn:hover {
  transform: translateY(-1px);
}

.form-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.workspace {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: var(--page-gap);
  padding: var(--page-gutter);
}

.sidebar-backdrop {
  display: none;
}

.sidebar {
  position: sticky;
  top: var(--page-gutter);
  height: calc(100dvh - (var(--page-gutter) * 2));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: var(--page-gap);
  padding: var(--page-gutter);
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: var(--surface-dark);
  color: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  overflow: hidden;
  overscroll-behavior: auto;
}

.mobile-topbar {
  display: none;
}

.mobile-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.mobile-menu-icon {
  display: grid;
  gap: 4px;
}

.mobile-menu-icon span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.brand {
  display: grid;
  gap: 0.7rem;
  min-width: 0;
}

.sidebar-brand-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.9rem;
  height: 2.9rem;
  min-width: 2.9rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.sidebar-brand-toggle:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.45);
  outline-offset: 3px;
}

.sidebar-brand-mark {
  font-family: var(--font-display);
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
}

.brand-copy {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.brand-copy h2,
.hero h1 {
  font-family: var(--font-display);
  margin: 0;
}

.brand-copy h2 {
  font-size: clamp(1.15rem, 1.6vw, 1.45rem);
  line-height: 1.05;
}

.brand-copy .eyebrow {
  margin: 0;
  font-size: 0.72rem;
}

.nav {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: auto;
  padding-right: 4px;
}

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  min-height: 40px;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.2;
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-label,
.button-label {
  display: inline;
}

.nav-btn .sidebar-icon,
#logout-btn .sidebar-icon {
  width: 1.1rem;
  height: 1.1rem;
  flex: 0 0 auto;
  object-fit: contain;
  display: block;
}

.nav-btn.is-active {
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.sidebar-footer {
  display: grid;
  gap: 14px;
  min-height: 0;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-card {
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

#logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.muted {
  color: var(--muted);
}

.main {
  display: grid;
  gap: clamp(1rem, 1.6vw, 1.25rem);
  align-content: start;
  justify-self: center;
  width: min(var(--content-width), 100%);
  min-width: 0;
}

.hero,
.panel,
.chart-card {
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 28px 30px;
}

.hero h1 {
  font-size: clamp(2.6rem, 5vw, 4.2rem);
  line-height: 0.95;
  margin-bottom: 12px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.panel {
  display: none;
  padding: clamp(1rem, 1.8vw, 1.5rem);
}

.panel.is-active {
  display: grid;
  gap: clamp(1rem, 1.4vw, 1.25rem);
}

.panel-header,
.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

.chart-card--ring .chart-head {
  display: grid;
  gap: 4px;
  align-items: start;
  justify-items: start;
}

#dashboard-composition-label {
  display: grid;
  gap: 4px;
  max-width: min(48ch, 100%);
  white-space: normal;
  line-height: 1.5;
  text-wrap: balance;
}

#dashboard-composition-label .dashboard-composition-main {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

#dashboard-composition-label .dashboard-composition-sub {
  font-size: 0.84rem;
  color: var(--muted);
}

.panel-header h3 {
  font-size: clamp(1.3rem, 1.8vw, 1.6rem);
}

.panel-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.panel-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.panel-toolbar > .filter-bar {
  flex: 1 1 100%;
}

body.is-filter-ui-ready .panel-toolbar > .filter-bar {
  display: none;
}

.filter-launcher-slot {
  position: fixed;
  top: clamp(0.85rem, 1.6vw, 1.25rem);
  right: clamp(0.85rem, 1.6vw, 1.25rem);
  z-index: 1150;
  display: inline-flex;
  width: auto;
  height: auto;
  pointer-events: none;
}

.filter-launcher-button {
  width: 3.15rem;
  height: 3.15rem;
  min-width: 3.15rem;
  padding: 0;
  border-radius: 999px;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.68);
  color: var(--text);
  border: 1px solid rgba(31, 45, 36, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 10px 20px rgba(25, 40, 31, 0.08);
  backdrop-filter: blur(12px) saturate(125%);
  -webkit-backdrop-filter: blur(12px) saturate(125%);
  pointer-events: auto;
}

.filter-launcher-button.icon-button .button-icon {
  width: 2.35rem;
  height: 2.35rem;
  object-fit: contain;
  display: block;
  transform: none;
}

.filter-launcher-button.is-active {
  border-color: rgba(109, 141, 89, 0.34);
  background: rgba(255, 255, 255, 0.72);
  color: #446033;
  box-shadow:
    0 0 0 3px rgba(109, 141, 89, 0.12),
    0 10px 20px rgba(25, 40, 31, 0.08);
}

.filter-drawer {
  position: fixed;
  inset: 0;
  z-index: 3020;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
}

.filter-drawer[hidden] {
  display: none !important;
}

.filter-drawer-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(17, 29, 22, 0.42);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 240ms ease;
  cursor: pointer;
}

.filter-drawer-panel {
  position: relative;
  z-index: 1;
  width: min(34rem, calc(100vw - 1.5rem));
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border-left: 1px solid rgba(31, 45, 36, 0.12);
  border-radius: 24px 0 0 24px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  box-shadow: -28px 0 48px rgba(25, 40, 31, 0.2);
  transform: translateX(104%);
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: auto;
}

.filter-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.1rem 0.85rem;
}

.filter-drawer-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2vw, 1.7rem);
  line-height: 1.15;
}

.filter-drawer-lead {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.6;
}

.filter-drawer-close {
  flex: 0 0 auto;
  width: 2.75rem;
  height: 2.75rem;
  min-width: 2.75rem;
  padding: 0;
}

.filter-drawer-close svg {
  width: 1.15rem;
  height: 1.15rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.filter-drawer-body {
  min-height: 0;
  overflow: auto;
  padding: 0 1.1rem 1.1rem;
}

.filter-drawer .filter-bar {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.7rem 0.8rem;
}

.filter-drawer .button-row.compact {
  grid-column: 1 / -1;
  justify-content: flex-end;
}

body.is-filter-drawer-open {
  overflow: auto;
}

body.is-filter-drawer-open .filter-drawer {
  pointer-events: auto;
}

body.is-filter-drawer-open .filter-drawer-backdrop {
  opacity: 1;
}

body.is-filter-drawer-open .filter-drawer-panel {
  transform: translateX(0);
}

.section-actions {
  position: fixed;
  right: clamp(0.85rem, 1.6vw, 1.25rem);
  bottom: clamp(0.85rem, 1.6vw, 1.25rem);
  z-index: 1150;
  display: inline-flex;
  justify-content: flex-end;
  align-items: center;
  pointer-events: none;
}

.section-actions .create-launcher-button {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.35rem;
  height: 3.35rem;
  min-width: 3.35rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, var(--accent), #567244);
  box-shadow: 0 14px 28px rgba(86, 114, 68, 0.26), 0 8px 16px rgba(25, 40, 31, 0.08);
}

.section-actions .create-launcher-button svg {
  width: 1.7rem;
  height: 1.7rem;
  fill: currentColor;
  stroke: none;
  display: block;
}

.section-actions .create-launcher-button:hover {
  transform: translateY(-1px);
}

.panel[data-panel="bojo"],
.panel[data-panel="staff"],
.panel[data-panel="assistant_income"],
.panel[data-panel="expenses"] {
  padding-bottom: clamp(4rem, 6vw, 4.75rem);
}

.page-summary {
  --summary-accent: var(--accent);
  --summary-accent-soft: rgba(109, 141, 89, 0.12);
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 16px;
  margin-top: 12px;
  padding: 18px 20px 20px;
  border-radius: 24px;
  border: 1px solid rgba(31, 45, 36, 0.1);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.8)),
    radial-gradient(circle at top right, var(--summary-accent-soft), transparent 60%);
  box-shadow: 0 18px 40px rgba(25, 40, 31, 0.08);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.page-summary::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: linear-gradient(180deg, var(--summary-accent), rgba(255, 255, 255, 0));
}

.page-summary::after {
  content: "";
  position: absolute;
  top: -42px;
  right: -46px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--summary-accent-soft), transparent 70%);
  opacity: 0.9;
  pointer-events: none;
}

.page-summary--bojo {
  --summary-accent: #6d8d59;
  --summary-accent-soft: rgba(109, 141, 89, 0.14);
}

.page-summary--staff {
  --summary-accent: #4f6d8a;
  --summary-accent-soft: rgba(79, 109, 138, 0.14);
}

.page-summary--assistant_income {
  --summary-accent: #b08a3d;
  --summary-accent-soft: rgba(176, 138, 61, 0.14);
}

.page-summary--expenses {
  --summary-accent: #9d4d4d;
  --summary-accent-soft: rgba(157, 77, 77, 0.14);
}

.page-summary__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.page-summary__heading {
  min-width: 0;
}

.page-summary__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
  color: var(--summary-accent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.page-summary__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--text);
}

.page-summary__period {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(31, 45, 36, 0.1);
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
  font-size: 0.84rem;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.page-summary__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
  position: relative;
  z-index: 1;
}

.page-summary__amount-block {
  display: grid;
  gap: 6px;
  align-content: start;
}

.page-summary__label {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.page-summary__amount {
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  line-height: 1;
  font-weight: 900;
  color: var(--summary-accent);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
}

.page-summary__chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid rgba(31, 45, 36, 0.1);
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.summary-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--summary-accent);
  box-shadow: 0 0 0 4px var(--summary-accent-soft);
}

.summary-pill--strong {
  background: linear-gradient(135deg, var(--summary-accent-soft), rgba(255, 255, 255, 0.94));
  border-color: rgba(31, 45, 36, 0.08);
}

.toolbar-actions {
  margin-left: auto;
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

.toolbar-actions.wrap {
  flex-wrap: wrap;
  gap: 10px;
}

.page-summary--fields {
  --summary-accent: #4f7c91;
  --summary-accent-soft: rgba(79, 124, 145, 0.16);
}

.page-summary--workdays {
  --summary-accent: #5d6f93;
  --summary-accent-soft: rgba(93, 111, 147, 0.16);
}

.field-layout {
  display: grid;
  grid-template-columns: minmax(240px, 290px) minmax(0, 1.45fr);
  gap: 18px;
  align-items: start;
}

.field-sidebar {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.field-list-card,
.field-detail-card,
.field-map-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.field-map-card {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  min-width: 0;
}

.field-list-head,
.field-detail-head {
  display: grid;
  gap: 10px;
}

.field-detail-head-main {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  min-width: 0;
  flex-wrap: wrap;
}

.field-list-head h4,
.field-detail-head h4 {
  margin: 0;
  font-size: 1.05rem;
}

.field-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

.field-item {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(31, 45, 36, 0.1);
  background: rgba(255, 255, 255, 0.8);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.field-item:hover {
  transform: translateY(-1px);
  border-color: rgba(79, 124, 145, 0.32);
  box-shadow: 0 10px 24px rgba(25, 40, 31, 0.08);
}

.field-item.is-selected {
  border-color: rgba(79, 124, 145, 0.42);
  box-shadow: 0 12px 30px rgba(79, 124, 145, 0.12);
}

.field-item-top,
.field-activity-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.field-item-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.field-swatch {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  flex: 0 0 auto;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.7);
}

.field-item-name {
  font-weight: 700;
}

.field-item-meta,
.field-activity-sub,
.field-activity-date {
  color: var(--muted);
  font-size: 0.86rem;
}

.field-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(109, 141, 89, 0.12);
  color: #4d6840;
  font-size: 0.8rem;
  font-weight: 700;
  width: fit-content;
}

.field-chip.alert {
  background: rgba(193, 156, 88, 0.14);
  color: #805f21;
}

.field-detail-card {
  display: grid;
  gap: 14px;
}

.field-detail-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  align-items: center;
}

.field-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.workday-day-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.field-detail-stat {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(31, 45, 36, 0.1);
  background: rgba(255, 255, 255, 0.75);
}

.field-detail-stat span {
  color: var(--muted);
  font-size: 0.85rem;
}

.field-detail-stat strong {
  font-size: 1.1rem;
}

.field-detail-alert {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(79, 124, 145, 0.1);
  color: #35525f;
  font-size: 0.92rem;
}

.field-detail-alert.is-warning {
  background: rgba(193, 156, 88, 0.14);
  color: #7b5a1b;
}

.field-activity-list {
  display: grid;
  gap: 10px;
}

.field-activity-groups {
  display: grid;
  gap: 12px;
}

.workdays-list {
  display: grid;
  gap: 12px;
}

.field-activity-group {
  border-radius: 18px;
  border: 1px solid rgba(31, 45, 36, 0.1);
  background: rgba(255, 255, 255, 0.78);
  overflow: hidden;
}

.field-activity-group summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-left: 4px solid var(--field-activity-accent, var(--accent));
}

.field-activity-group summary::-webkit-details-marker {
  display: none;
}

.field-activity-group-heading {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.field-activity-group-heading strong {
  font-size: 0.98rem;
}

.field-activity-group-heading span {
  color: var(--muted);
  font-size: 0.84rem;
}

.field-activity-group-summary {
  display: block;
}

.field-activity-group-meta {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.field-activity-group-toggle {
  color: var(--muted);
  font-size: 1rem;
  transition: transform 200ms ease;
  transform-origin: center;
  display: inline-flex;
  width: 1.3rem;
  height: 1.3rem;
  align-items: center;
  justify-content: center;
}

.field-activity-group-toggle svg {
  width: 100%;
  height: 100%;
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 200ms ease;
  transform-origin: center;
}

.field-activity-group.is-open > summary .field-activity-group-toggle svg {
  transform: rotate(180deg);
}

.field-activity-group-body {
  height: 0;
  opacity: 0;
  overflow: hidden;
  transition: height 260ms cubic-bezier(0.22, 1, 0.36, 1), opacity 180ms ease;
}

.field-activity-group[open] > .field-activity-group-body {
  height: auto;
  opacity: 1;
}

.field-activity-group-body-inner {
  min-height: 0;
  display: grid;
  gap: 10px;
  padding: 12px 16px 16px;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 220ms ease, transform 220ms ease;
  will-change: opacity, transform;
}

.field-detail-records .field-activity-group-body-inner {
  background: linear-gradient(180deg, rgba(79, 124, 145, 0.12), rgba(255, 255, 255, 0.9));
  border-radius: 0;
  overflow: hidden;
}

.field-detail-records .field-activity-item {
  color: var(--text);
  background: rgba(248, 250, 244, 0.96);
  border-color: rgba(79, 124, 145, 0.14);
  box-shadow: 0 12px 28px rgba(31, 45, 36, 0.06);
}

.field-detail-records .field-empty {
  background: rgba(248, 250, 244, 0.96);
  color: var(--text);
  border: 1px dashed rgba(79, 124, 145, 0.2);
}

.field-detail-records {
  margin-top: 14px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(79, 124, 145, 0.05), rgba(255, 255, 255, 0.78));
  border: 1px solid rgba(79, 124, 145, 0.12);
}

.field-detail-records .field-activity-group-heading strong,
.field-detail-records .field-activity-top,
.field-detail-records .field-activity-sub,
.field-detail-records .field-activity-date {
  color: var(--text);
}

.field-detail-records .field-activity-group {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(79, 124, 145, 0.16);
}

.field-detail-records .field-activity-group summary {
  background: rgba(79, 124, 145, 0.05);
}

#field-add-bojo-btn {
  min-width: 0;
  padding-inline: 12px;
}

.field-activity-group[open] .field-activity-group-body-inner,
.field-activity-group.is-opening .field-activity-group-body-inner {
  opacity: 1;
  transform: none;
}

.field-activity-group.is-closing .field-activity-group-body-inner {
  opacity: 0;
  transform: translateY(-6px);
}

.field-activity-item {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(31, 45, 36, 0.1);
  background: rgba(255, 255, 255, 0.76);
}

.field-activity-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  color: white;
  font-size: 0.78rem;
  font-weight: 700;
}

.field-activity-amount {
  font-weight: 700;
}

.field-map-shell {
  position: relative;
  min-height: clamp(26rem, 52vh, 42rem);
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
  overflow: hidden;
}

.field-map {
  min-height: clamp(26rem, 52vh, 42rem);
  width: 100%;
  border-radius: 20px;
  border: 1px solid rgba(31, 45, 36, 0.12);
  overflow: hidden;
  background: linear-gradient(135deg, rgba(109, 141, 89, 0.08), rgba(255, 255, 255, 0.88));
}

.field-map.leaflet-container {
  font-family: var(--font-body);
}

.field-map .leaflet-control-container {
  font-family: var(--font-body);
}

.field-map .leaflet-top,
.field-map .leaflet-bottom {
  z-index: 500;
}

.field-map .leaflet-draw,
.field-map .leaflet-control-zoom {
  display: none !important;
}

.field-map-controls {
  position: absolute;
  inset: 0;
  z-index: 650;
  pointer-events: none;
}

.field-map-stack {
  position: absolute;
  display: grid;
  gap: 12px;
  pointer-events: auto;
}

.field-map-stack--left {
  top: 26px;
  left: 26px;
  justify-items: start;
}

.field-map-stack--right {
  top: 26px;
  right: 26px;
  justify-items: end;
  width: fit-content;
  max-width: min(420px, calc(100% - 3rem));
  pointer-events: none;
}

.field-map-status {
  max-width: min(420px, 100%);
  padding: 11px 14px;
  border-radius: 16px;
  border: 1px solid rgba(31, 45, 36, 0.1);
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 24px rgba(25, 40, 31, 0.08);
  pointer-events: none;
}

.field-map-hint {
  max-width: min(420px, 100%);
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid rgba(193, 156, 88, 0.22);
  background: rgba(255, 247, 229, 0.94);
  color: #7b5a1b;
  box-shadow: 0 12px 24px rgba(25, 40, 31, 0.08);
  pointer-events: none;
  font-size: 0.9rem;
  line-height: 1.5;
}

.field-map-actions {
  display: grid;
  gap: 8px;
  justify-items: end;
  pointer-events: auto;
}

.field-map-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  pointer-events: auto;
}

.field-map-group--zoom {
  display: grid;
  gap: 8px;
}

.field-map-stack--bottom-right {
  right: 26px;
  bottom: 56px;
  justify-items: end;
}

.field-map-group--utility {
  display: flex;
  gap: 8px;
}

.field-base-switcher {
  position: relative;
  display: inline-flex;
  justify-content: flex-end;
  pointer-events: auto;
}

.field-base-toggle {
  position: relative;
}

.field-base-switcher.is-open .field-base-toggle {
  border-color: rgba(79, 124, 145, 0.4);
  background: rgba(79, 124, 145, 0.16);
  color: #365b74;
}

.field-base-menu {
  position: absolute;
  bottom: 54px;
  right: 0;
  z-index: 700;
  width: min(17.5rem, calc(100vw - 3rem));
  max-height: min(20rem, calc(100vh - 6rem));
  overflow: auto;
  padding: 10px;
  border-radius: 20px;
  border: 1px solid rgba(33, 77, 55, 0.16);
  background: rgba(247, 251, 244, 0.96);
  backdrop-filter: blur(20px);
  box-shadow: 0 18px 36px rgba(25, 40, 31, 0.14);
  display: grid;
  gap: 8px;
}

.field-base-menu[hidden] {
  display: none !important;
}

.field-base-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: rgba(247, 251, 244, 0.96);
  color: #214d37;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.field-base-menu-item .menu-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
  flex: none;
}

.field-base-menu-item.is-active {
  border-color: rgba(79, 124, 145, 0.34);
  background: rgba(79, 124, 145, 0.16);
  color: #365b74;
}

.field-map-actions .ghost {
  background: rgba(247, 251, 244, 0.96);
  color: #214d37;
  border: 1px solid rgba(33, 77, 55, 0.16);
  box-shadow: 0 10px 20px rgba(25, 40, 31, 0.08);
}

.field-base-switcher .ghost.icon-button,
.field-map-stack--bottom-right .ghost.icon-button {
  background: rgba(247, 251, 244, 0.96);
  color: #214d37;
  border: 1px solid rgba(33, 77, 55, 0.16);
  box-shadow: 0 10px 20px rgba(25, 40, 31, 0.08);
}

.icon-button {
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.field-map-actions .ghost.icon-button {
  width: 46px;
  height: 46px;
}

.icon-button svg,
.icon-button .button-icon {
  width: 20px;
  height: 20px;
  display: block;
  transform: none;
}

.icon-button .button-icon,
.generated-icon {
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.field-map-actions .ghost.icon-button.is-active {
  border-color: rgba(79, 124, 145, 0.4);
  background: rgba(79, 124, 145, 0.16);
  color: #365b74;
}

.field-map-stack--left .ghost.icon-button {
  background: rgba(247, 251, 244, 0.96);
  color: #214d37;
  border: 1px solid rgba(33, 77, 55, 0.16);
  box-shadow: 0 10px 20px rgba(25, 40, 31, 0.08);
}

.field-base-switcher .ghost.icon-button.is-active,
.field-map-stack--bottom-right .ghost.icon-button.is-active {
  border-color: rgba(79, 124, 145, 0.34);
  background: rgba(79, 124, 145, 0.14);
  color: #365b74;
}

.field-detail-actions .icon-button {
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 20px rgba(25, 40, 31, 0.08);
}

.field-layer-selected {
  animation: field-layer-pulse 1.8s ease-in-out infinite;
}

@keyframes field-layer-pulse {
  0% {
    opacity: 0.96;
    filter: drop-shadow(0 0 0 rgba(79, 124, 145, 0));
  }
  50% {
    opacity: 1;
    filter: drop-shadow(0 0 12px rgba(79, 124, 145, 0.42));
  }
  100% {
    opacity: 0.96;
    filter: drop-shadow(0 0 0 rgba(79, 124, 145, 0));
  }
}

.field-selection-glow {
  animation: field-selection-glow 1.5s ease-in-out infinite;
}

@keyframes field-selection-glow {
  0% {
    stroke-opacity: 0.3;
    stroke-width: 8px;
    opacity: 0.7;
  }
  50% {
    stroke-opacity: 0.8;
    stroke-width: 12px;
    opacity: 1;
  }
  100% {
    stroke-opacity: 0.3;
    stroke-width: 8px;
    opacity: 0.7;
  }
}

.field-map .leaflet-editing-icon,
.field-map .leaflet-edit-marker {
  width: 16px !important;
  height: 16px !important;
  margin-left: -8px !important;
  margin-top: -8px !important;
  border: 2px solid #4f7c91 !important;
  border-radius: 0 !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 2px rgba(79, 124, 145, 0.18), 0 3px 10px rgba(25, 40, 31, 0.14) !important;
  opacity: 1 !important;
  z-index: 1200 !important;
  cursor: move;
}

.field-map .leaflet-editing-icon {
  animation: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.field-empty {
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed rgba(31, 45, 36, 0.14);
  color: var(--text);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.field-detail-records .field-empty {
  margin-top: 10px;
}

.filter-bar {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.75rem 0.875rem;
  align-items: end;
  padding: 1rem 1.125rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.filter-bar label {
  display: grid;
  gap: 8px;
  min-width: 0;
  overflow: visible;
}

.filter-bar span {
  font-size: 0.82rem;
  color: var(--muted);
}

.filter-bar input,
.filter-bar select {
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid rgba(31, 45, 36, 0.14);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  color-scheme: light;
  outline: none;
}

.field-search-autocomplete {
  position: relative;
  min-width: 0;
}

.field-search-autocomplete input {
  width: 100%;
}

.field-name-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 40;
  display: grid;
  gap: 4px;
  max-height: 240px;
  overflow: auto;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid rgba(31, 45, 36, 0.12);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 34px rgba(31, 45, 36, 0.16);
}

.field-name-suggestions[hidden] {
  display: none;
}

.field-name-suggestion {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.field-name-suggestion:hover,
.field-name-suggestion:focus-visible {
  background: rgba(109, 141, 89, 0.1);
  outline: none;
}

.field-name-suggestion strong {
  display: block;
  font-size: 0.92rem;
  line-height: 1.3;
}

.field-name-suggestion-empty {
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.84rem;
}

.filter-bar input:focus,
.filter-bar select:focus {
  border-color: rgba(109, 141, 89, 0.72);
  box-shadow: 0 0 0 4px rgba(109, 141, 89, 0.12);
}

.button-row.compact {
  align-self: end;
  justify-content: flex-end;
}

.field-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 29, 22, 0.42);
  backdrop-filter: blur(6px);
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
  cursor: pointer;
}

.field-sheet[hidden] {
  display: none !important;
}

.field-sheet {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  bottom: 1.5rem;
  width: min(35rem, calc(100vw - 3rem));
  padding: 1.25rem;
  border-radius: 26px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  z-index: 3010;
  overflow: auto;
  display: grid;
  gap: 16px;
  opacity: 0;
  transform: translateY(1rem);
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease;
  will-change: transform, opacity;
}

body.is-field-sheet-open .field-sheet-backdrop {
  opacity: 1;
  pointer-events: auto;
}

body.is-field-sheet-open .field-sheet {
  opacity: 1;
  transform: translateY(0);
}

.field-sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.field-sheet-head h4 {
  margin: 0;
  font-family: inherit;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.25;
}

.field-sheet-lead {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

#field-sheet-close.field-sheet-close {
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  border-radius: 14px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 1.4rem;
  line-height: 1;
}

.field-sheet-form {
  margin-top: 0;
}

.summary-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}

.dashboard-visuals {
  --dashboard-chart-height: clamp(20rem, 26vw, 30rem);
  --dashboard-line-height: clamp(14rem, 16vw, 18rem);
  display: grid;
  grid-template-columns: minmax(20rem, 21.875rem) minmax(0, 1.35fr);
  grid-template-rows: var(--dashboard-chart-height) var(--dashboard-line-height);
  gap: 16px;
  align-items: stretch;
  min-height: calc(var(--dashboard-chart-height) + var(--dashboard-line-height) + 16px);
}

.summary-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.summary-card h4 {
  margin: 0 0 8px;
  font-size: 0.92rem;
  color: var(--muted);
}

.summary-value {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 800;
}

.summary-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.chart-card {
  padding: 20px;
  height: 100%;
  min-height: 0;
}

.chart-card--ring {
  display: grid;
  gap: 10px;
  align-content: start;
  grid-template-rows: auto auto minmax(0, 1fr);
  grid-column: 1;
  grid-row: 1 / span 2;
  min-height: 0;
  overflow: hidden;
}

.chart-card--bars {
  display: grid;
  gap: 16px;
  align-content: start;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  grid-column: 2;
  grid-row: 1;
}

.chart-card--line {
  display: grid;
  gap: 16px;
  align-content: start;
  grid-template-rows: auto minmax(0, 1fr);
  grid-column: 2;
  grid-row: 2;
}

.chart-card--bars .bar-chart {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  max-height: none;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: auto;
  padding-right: 8px;
}

.chart-card--line .line-chart {
  height: 100%;
  min-height: 0;
}

.chart-card--line .line-chart svg {
  height: 100%;
  min-height: 0;
}

.chart-card--bars .bar-row {
  margin: 0;
  padding: 8px 10px;
  grid-template-columns: minmax(7.5rem, 1fr) minmax(0, 1fr) minmax(7rem, 8.5rem);
}

.chart-card--bars .bar-track {
  height: 14px;
  width: 100%;
  transition: width 700ms cubic-bezier(0.22, 1, 0.36, 1), opacity 240ms ease;
}

.chart-card--bars .bar-label strong {
  font-size: 0.92rem;
}

.chart-card--bars .bar-label span,
.chart-card--bars .bar-total,
.chart-card--bars .bar-balance {
  font-size: 0.78rem;
}

@media (min-width: 1640px) {
  .dashboard-visuals {
    grid-template-columns: minmax(340px, 380px) minmax(0, 1.45fr);
    grid-template-rows: var(--dashboard-chart-height) var(--dashboard-line-height);
    min-height: calc(var(--dashboard-chart-height) + var(--dashboard-line-height) + 16px);
  }

  .chart-card--ring {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .chart-card--bars {
    grid-column: 2;
    grid-row: 1;
  }

  .chart-card--line {
    grid-column: 2;
    grid-row: 2;
  }
}

.donut-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 220px;
}

.donut-chart {
  width: min(100%, 286px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--donut-gradient, rgba(109, 141, 89, 0.5) 0 100%));
  -webkit-mask: radial-gradient(circle at center, transparent 0 47%, #000 48%);
  mask: radial-gradient(circle at center, transparent 0 47%, #000 48%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.62);
  transform-origin: center;
  will-change: transform, opacity;
}

.donut-chart.chart-sweep-in {
  animation: donut-sweep-in 900ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.donut-center {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 144px;
  height: 144px;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  text-align: center;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  padding: 26px 12px 10px;
}

.donut-center strong {
  display: block;
  font-size: clamp(0.92rem, 1vw, 1.12rem);
  line-height: 1.05;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  transform: translateY(2px);
}

.donut-center span {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.2;
  white-space: nowrap;
  transform: translateY(5px);
}

.legend-list {
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
  overscroll-behavior: auto;
}

@media (min-width: 1120px) {
  .chart-card--ring .legend-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

.legend-group {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(31, 45, 36, 0.08);
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 10px 18px rgba(31, 45, 36, 0.05);
  min-width: 0;
}

.legend-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(31, 45, 36, 0.08);
  cursor: help;
  flex-wrap: wrap;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.legend-group-head:hover {
  transform: translateY(-1px);
}

.legend-group-head .legend-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  flex: 1 1 240px;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  flex: 0 0 auto;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.8);
}

.legend-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.legend-text strong,
.legend-text span {
  display: block;
}

.legend-text strong {
  font-size: 0.94rem;
}

.legend-text span {
  font-size: 0.8rem;
  color: var(--muted);
  word-break: break-word;
}

.legend-value {
  display: grid;
  justify-items: end;
  gap: 2px;
  white-space: nowrap;
  min-width: 0;
  flex: 0 0 auto;
}

.legend-value strong {
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.legend-value span {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.legend-sublist {
  display: grid;
  gap: 8px;
}

.legend-subitem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(31, 45, 36, 0.06);
  cursor: help;
  flex-wrap: wrap;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.legend-subitem:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 18px rgba(31, 45, 36, 0.08);
}

.legend-subitem .legend-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  flex: 1 1 220px;
}

.legend-subitem .legend-swatch {
  width: 10px;
  height: 10px;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.82);
}

.legend-subitem .legend-text strong {
  font-size: 0.88rem;
}

.legend-subitem .legend-text span {
  font-size: 0.76rem;
}

.legend-subitem .legend-value strong {
  font-size: 0.9rem;
}

.legend-subitem .legend-value span {
  font-size: 0.72rem;
}

.bar-chart {
  display: grid;
  gap: 10px;
}

.line-chart {
  position: relative;
  overflow: hidden;
  min-height: 240px;
  padding: 14px 14px 10px;
  border-radius: 20px;
  border: 1px solid rgba(31, 45, 36, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.78)),
    radial-gradient(circle at top right, rgba(109, 141, 89, 0.12), transparent 65%);
}

.line-chart svg {
  display: block;
  width: 100%;
  height: 240px;
}

.line-chart-grid {
  stroke: rgba(31, 45, 36, 0.08);
  stroke-dasharray: 4 8;
}

.line-chart-axis {
  stroke: rgba(31, 45, 36, 0.12);
  stroke-width: 1.2;
}

.line-chart-fill {
  fill: url(#line-chart-fill-gradient);
  will-change: opacity;
}

.line-chart-line {
  fill: none;
  stroke: #6d8d59;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 8px 12px rgba(109, 141, 89, 0.12));
  will-change: stroke-dashoffset;
}

.line-chart-point {
  fill: #ffffff;
  stroke: #6d8d59;
  stroke-width: 3;
  cursor: help;
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity 180ms ease, transform 180ms ease, fill 180ms ease, stroke 180ms ease;
}

.line-chart-point:hover {
  fill: #6d8d59;
  stroke: #ffffff;
}

.line-chart-label,
.line-chart-value {
  font-size: 11px;
  fill: var(--muted);
}

.line-chart-axis-labels--x .line-chart-x-label {
  font-size: 10px;
  fill: var(--muted);
}

.line-chart-value {
  font-weight: 700;
  fill: var(--text);
}

.line-chart-empty {
  display: grid;
  place-items: center;
  min-height: 240px;
  color: var(--muted);
  font-size: 0.92rem;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(7.5rem, 1fr) minmax(0, 1fr) minmax(7rem, 8.5rem);
  gap: 10px;
  align-items: center;
  cursor: help;
  padding: 8px 10px;
  margin: 0 -10px;
  border-radius: 16px;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.bar-row:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 10px 18px rgba(31, 45, 36, 0.08);
}

.bar-label {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.bar-label strong {
  font-size: 0.92rem;
}

.bar-label span {
  font-size: 0.78rem;
  color: var(--muted);
}

.bar-track {
  position: relative;
  display: flex;
  overflow: hidden;
  height: 16px;
  border-radius: 999px;
  background: rgba(31, 45, 36, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.bar-segment {
  min-width: 4px;
}

.bar-segment.bojo {
  background: linear-gradient(90deg, #6d8d59, #4d6840);
}

.bar-segment.assistant-income {
  background: linear-gradient(90deg, #4f7c91, #3d6273);
}

.bar-segment.staff {
  background: linear-gradient(90deg, #c19c58, #a77b2a);
}

.bar-segment.expense {
  background: linear-gradient(90deg, #c95f5f, #a84949);
}

.bar-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: end;
  text-align: right;
  white-space: nowrap;
}

.bar-total {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.bar-balance {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(31, 45, 36, 0.06);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

@keyframes donut-sweep-in {
  0% {
    transform: rotate(-20deg) scale(0.92);
    opacity: 0.35;
  }

  60% {
    transform: rotate(4deg) scale(1.02);
    opacity: 1;
  }

  100% {
    transform: rotate(0deg) scale(1);
    opacity: 1;
  }
}

.bar-balance.positive {
  color: #4d6840;
  background: rgba(109, 141, 89, 0.12);
}

.bar-balance.negative {
  color: var(--danger);
  background: rgba(157, 77, 77, 0.12);
}

.chart {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.form-grid.one-column {
  grid-template-columns: minmax(0, 1fr);
}

.editor {
  align-self: start;
  align-content: start;
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
}

.field-row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-row--full {
  grid-template-columns: minmax(0, 1fr);
}

.field-row > label {
  min-width: 0;
}

.field-row input,
.field-row select,
.field-row textarea {
  min-width: 0;
}

.editor label.toggle-field {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 100%;
  padding: 6px 2px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  white-space: nowrap;
  transform: translateY(12px);
}

.editor label.toggle-field input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 48px;
  height: 28px;
  margin: 0;
  flex: 0 0 auto;
  border: 1px solid rgba(33, 77, 55, 0.24);
  border-radius: 999px;
  background: rgba(33, 77, 55, 0.12);
  position: relative;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.editor label.toggle-field input[type="checkbox"]::after {
  content: "";
  position: absolute;
  inset: 3px auto 3px 3px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 24, 17, 0.18);
  transition: transform 0.18s ease, background 0.18s ease;
}

.editor label.toggle-field input[type="checkbox"]:checked {
  background: linear-gradient(135deg, var(--accent), #2f7a54);
  border-color: transparent;
}

.editor label.toggle-field input[type="checkbox"]:checked::after {
  transform: translateX(20px);
}

.editor label.toggle-field input[type="checkbox"]:focus-visible {
  outline: 2px solid rgba(33, 77, 55, 0.28);
  outline-offset: 2px;
}

.editor label.toggle-field span {
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--text);
  line-height: 1.2;
  white-space: nowrap;
}

#bojo-total_amount[data-mode="manual"] {
  background: rgba(255, 255, 255, 0.96);
}

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.entity-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: clamp(0.75rem, 2vw, 1.25rem);
}

.entity-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 29, 22, 0.42);
  backdrop-filter: blur(8px);
}

.entity-modal-panel {
  position: relative;
  z-index: 1;
  width: min(48rem, calc(100vw - 2rem));
  max-height: min(88dvh, 56rem);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(31, 45, 36, 0.12);
  border-radius: var(--radius-xl);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.entity-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1rem, 2vw, 1.5rem) clamp(1rem, 2vw, 1.5rem) 0;
}

.entity-modal-head h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  line-height: 1.15;
  letter-spacing: 0.01em;
}

.entity-modal-lead {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.entity-modal-close {
  flex: 0 0 auto;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  border-radius: 999px;
  font-size: 1.45rem;
  line-height: 1;
}

.entity-modal-body {
  min-height: 0;
  overflow: auto;
  padding: clamp(1rem, 2vw, 1.5rem);
}

.entity-modal .editor {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.delete-modal {
  position: fixed;
  inset: 0;
  z-index: 1250;
  display: grid;
  place-items: center;
  padding: clamp(0.75rem, 2vw, 1.25rem);
}

.delete-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 29, 22, 0.58);
  backdrop-filter: blur(8px);
}

.delete-modal-panel {
  position: relative;
  z-index: 1;
  width: min(40rem, calc(100vw - 2rem));
  max-height: min(32rem, calc(100dvh - 2rem));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(31, 45, 36, 0.12);
  border-radius: var(--radius-xl);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.delete-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1rem, 2vw, 1.35rem) clamp(1rem, 2vw, 1.35rem) 0;
}

.delete-modal-head h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.8vw, 1.55rem);
  line-height: 1.15;
  letter-spacing: 0.01em;
}

.delete-modal-lead {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

.delete-modal-close {
  flex: 0 0 auto;
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding: 0;
  border-radius: 999px;
  font-size: 1.4rem;
  line-height: 1;
}

.delete-modal-body {
  min-height: 0;
  display: grid;
  gap: 0.8rem;
  padding: clamp(0.9rem, 2vw, 1.2rem);
  overflow: auto;
}

.delete-modal-card {
  display: grid;
  gap: 0.6rem;
  padding: 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(31, 45, 36, 0.1);
  background: rgba(255, 255, 255, 0.78);
}

.delete-modal-card-head {
  display: grid;
  gap: 0.4rem;
}

.delete-modal-label {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.delete-modal-card strong {
  font-size: 0.98rem;
  line-height: 1.5;
  word-break: break-word;
}

.delete-modal-detail-table {
  display: grid;
  gap: 0.25rem;
}

.delete-modal-detail-table-head,
.delete-modal-detail-row {
  display: grid;
  grid-template-columns: minmax(6rem, 7rem) minmax(0, 1fr);
  gap: 0.6rem;
  align-items: start;
}

.delete-modal-detail-table-head {
  padding: 0.1rem 0.1rem 0.25rem;
  border-bottom: 1px solid rgba(31, 45, 36, 0.1);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.delete-modal-detail-row {
  padding: 0.45rem 0.1rem;
  border-radius: 12px;
  border-bottom: 1px solid rgba(31, 45, 36, 0.06);
}

.delete-modal-detail-key {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.5;
}

.delete-modal-detail-value {
  min-width: 0;
  line-height: 1.5;
  word-break: break-word;
}

.delete-modal-detail-empty {
  padding: 0.2rem 0.1rem 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.delete-modal-actions {
  justify-content: flex-end;
}

.delete-modal-actions > button {
  flex: 1 1 10rem;
}

.delete-modal .primary.danger {
  background: linear-gradient(135deg, var(--danger), #7d3535);
  box-shadow: 0 14px 28px rgba(125, 53, 53, 0.26);
}

.delete-modal .primary.danger:hover {
  transform: translateY(-1px);
}

@media (min-width: 1024px) {
  .entity-modal {
    inset: 0;
    z-index: 3020;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    padding: 0.75rem;
  }

  .entity-modal-panel {
    position: relative;
    z-index: 1;
    width: min(44rem, calc(100vw - 1.5rem));
    height: auto;
    max-height: calc(100dvh - 1.5rem);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid rgba(31, 45, 36, 0.12);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    box-shadow: var(--shadow);
    transform: translateY(1.25rem);
    transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: auto;
  }

  .entity-modal.is-open .entity-modal-panel {
    transform: translateY(0);
  }

  .entity-modal-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    background: rgba(17, 29, 22, 0.42);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 240ms ease;
    cursor: pointer;
  }

  .entity-modal-body {
    min-height: 0;
    overflow: auto;
    padding: 0 1rem 1rem;
  }

  .entity-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1rem 0.75rem;
  }

  .entity-modal-head h4 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 2vw, 1.7rem);
    line-height: 1.15;
    letter-spacing: 0.01em;
  }

  .entity-modal-lead {
    margin: 0.45rem 0 0;
    color: var(--muted);
    font-size: 0.94rem;
    line-height: 1.6;
  }

  .entity-modal-close {
    flex: 0 0 auto;
    width: 2.75rem;
    height: 2.75rem;
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding: 0;
    border-radius: 999px;
    font-size: 1.45rem;
    line-height: 1;
  }

  body.is-filter-drawer-open,
  body.is-entity-modal-open {
    overflow: auto;
  }

  body.is-filter-drawer-open .filter-drawer,
  body.is-entity-modal-open .entity-modal {
    pointer-events: auto;
  }

  body.is-filter-drawer-open .filter-drawer-backdrop,
  body.is-entity-modal-open .entity-modal-backdrop {
    opacity: 1;
  }

  body.is-filter-drawer-open .filter-drawer-panel,
  body.is-entity-modal-open .entity-modal-panel {
    transform: translateY(0);
  }

  .entity-modal .editor {
    padding: 0;
    gap: 10px;
  }

  .entity-modal .field-row {
    gap: 10px;
  }

  .entity-modal .editor label {
    gap: 6px;
  }

  .entity-modal .editor span {
    font-size: 0.82rem;
  }

  .entity-modal .editor input,
  .entity-modal .editor select,
  .entity-modal .editor textarea {
    padding: 10px 12px;
  }

  .entity-modal .editor label.toggle-field {
    padding: 0;
    transform: none;
    min-height: 2.75rem;
  }

  .entity-modal .editor label.toggle-field input[type="checkbox"] {
    width: 44px;
    height: 26px;
  }

  .entity-modal .editor label.toggle-field input[type="checkbox"]::after {
    width: 18px;
    height: 18px;
  }

  .entity-modal .editor label.toggle-field input[type="checkbox"]:checked::after {
    transform: translateX(18px);
  }

  .entity-modal .button-row {
    gap: 8px;
  }

  .entity-modal .button-row > button {
    min-height: 2.75rem;
    padding: 11px 16px;
  }

  .delete-modal-panel {
    width: min(44rem, calc(100vw - 3rem));
    max-height: min(36rem, calc(100dvh - 2rem));
  }

  .delete-modal-head {
    padding: 0.9rem 1rem 0;
  }

  .delete-modal-body {
    padding: 0.85rem 1rem 0.95rem;
  }

  .delete-modal-card {
    gap: 0.55rem;
    padding: 0.8rem 0.9rem;
  }

  .delete-modal-detail-table-head,
  .delete-modal-detail-row {
    grid-template-columns: minmax(6.5rem, 7.5rem) minmax(0, 1fr);
  }
}

.table-card {
  overflow: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: var(--radius-md);
  border: 1px solid rgba(31, 45, 36, 0.08);
  background: rgba(255, 255, 255, 0.62);
  -webkit-overflow-scrolling: touch;
}

.table-wrap table {
  margin: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 45rem;
}

th,
td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(31, 45, 36, 0.08);
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.94);
  font-size: 0.83rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

tbody tr:hover {
  background: rgba(109, 141, 89, 0.05);
}

.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  flex-wrap: nowrap;
  min-width: 6.8rem;
  white-space: nowrap;
}

.table-action-button {
  width: 2.7rem;
  height: 2.7rem;
  flex: 0 0 auto;
  padding: 0;
  border-radius: 14px;
}

.table-action-button svg {
  width: 1.5rem;
  height: 1.5rem;
}

#bojo-tbody td:last-child {
  white-space: nowrap;
}

#bojo-tbody .table-actions {
  justify-content: flex-end;
}

.categories-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

.category-sort-control {
  display: grid;
  gap: 8px;
  min-width: 220px;
}

.category-sort-control span {
  font-size: 0.82rem;
  color: var(--muted);
}

.category-sort-control select {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid rgba(31, 45, 36, 0.14);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  outline: none;
}

.category-sort-control select:focus {
  border-color: rgba(109, 141, 89, 0.72);
  box-shadow: 0 0 0 4px rgba(109, 141, 89, 0.12);
}

.category-sort-note {
  color: var(--muted);
  font-size: 0.86rem;
  align-self: end;
}

.category-order-cell {
  white-space: nowrap;
}

.category-order-content {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(31, 45, 36, 0.12);
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
  user-select: none;
  cursor: grab;
  flex: 0 0 auto;
  touch-action: none;
  padding: 0;
  line-height: 1;
}

.drag-handle:active {
  cursor: grabbing;
}

.category-order-number {
  min-width: 3ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.categories-table {
  min-width: 0;
  table-layout: fixed;
}

.categories-table th,
.categories-table td {
  vertical-align: middle;
}

.categories-table th:nth-child(1),
.categories-table td:nth-child(1) {
  width: 9.75rem;
}

.categories-table th:nth-child(3),
.categories-table td:nth-child(3) {
  width: 6.875rem;
}

.categories-table th:nth-child(4),
.categories-table td:nth-child(4) {
  width: 10.5rem;
}

.category-row.can-drag {
  cursor: default;
}

.category-row.can-drag .drag-handle {
  color: var(--accent);
  border-color: rgba(109, 141, 89, 0.26);
  background: rgba(109, 141, 89, 0.1);
  cursor: grab;
}

.category-row.view-only .drag-handle {
  cursor: default;
  opacity: 0.5;
}

.category-row.is-dragging {
  opacity: 0.45;
}

.category-row.drop-before td {
  box-shadow: inset 0 2px 0 rgba(109, 141, 89, 0.9);
}

.category-row.drop-after td {
  box-shadow: inset 0 -2px 0 rgba(109, 141, 89, 0.9);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(109, 141, 89, 0.12);
  color: var(--accent);
}

.tag.off {
  background: rgba(157, 77, 77, 0.12);
  color: var(--danger);
}

.tag.warning {
  background: rgba(193, 156, 88, 0.14);
  color: #7b5a1b;
}

.data-table tr.is-muted {
  opacity: 0.68;
}

.flight-log-review-card {
  margin-top: 18px;
}

.admin-settings-card {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(33, 77, 55, 0.12);
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 14px 32px rgba(25, 40, 31, 0.08);
}

.compact-editor {
  box-shadow: none;
  border: 1px solid rgba(33, 77, 55, 0.1);
}

.checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(24, 36, 28, 0.92);
  color: white;
  box-shadow: var(--shadow);
  z-index: 30;
}

.toast.is-error {
  background: rgba(157, 77, 77, 0.94);
}

.chart-tooltip {
  position: fixed;
  z-index: 40;
  max-width: min(20rem, calc(100vw - 2rem));
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(24, 36, 28, 0.94);
  color: white;
  box-shadow: 0 14px 30px rgba(24, 36, 28, 0.24);
  backdrop-filter: blur(18px);
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition: opacity 220ms cubic-bezier(0.22, 1, 0.36, 1), transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
  white-space: pre-line;
  font-size: 0.88rem;
  line-height: 1.55;
}

.chart-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@media (max-width: 1199px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-visuals {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    min-height: 0;
  }

  .chart-card--ring,
  .chart-card--bars,
  .chart-card--line {
    grid-column: auto;
    grid-row: auto;
    height: auto;
  }

  .chart-card--bars .bar-chart {
    grid-template-columns: 1fr;
    max-height: min(46vh, 28rem);
    height: auto;
  }

  .chart-card--line .line-chart {
    height: auto;
  }

  .chart-card--line .line-chart svg {
    height: 15rem;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .toolbar-actions {
    width: auto;
  }

  .filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-sheet {
    left: 50%;
    top: 50%;
    right: auto;
    bottom: auto;
    width: min(35rem, calc(100vw - 1.5rem));
    max-height: calc(100dvh - 1.5rem);
    padding: 1rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.9);
    transform: translate(-50%, calc(-50% + 1.25rem));
    transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease;
  }

  body.is-field-sheet-open .field-sheet {
    transform: translate(-50%, -50%);
  }

  table {
    min-width: 40rem;
  }
}

@media (max-width: 1023px) {
  .workspace {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 58;
    display: block;
    border: 0;
    padding: 0;
    background: rgba(18, 27, 21, 0.42);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 60;
    width: min(20rem, 84vw);
    height: 100dvh;
    border-radius: 0 1.75rem 1.75rem 0;
    transform: translateX(-102%);
    transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar-brand-toggle {
    display: none;
  }

  .workspace.is-sidebar-open .sidebar {
    transform: translateX(0);
  }

  .workspace.is-sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-topbar {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 50;
    display: block;
    align-items: center;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .mobile-menu-btn {
    z-index: 50;
  }

  .main {
    min-width: 0;
    padding-top: 4.25rem;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-visuals {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    min-height: 0;
  }

  .chart-card--ring {
    grid-row: auto;
    grid-column: auto;
  }

  .chart-card--bars,
  .chart-card--line {
    grid-column: auto;
    grid-row: auto;
    height: auto;
  }

  .chart-card--bars .bar-chart {
    grid-template-columns: 1fr;
    max-height: min(46vh, 400px);
  }

  .filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar-actions {
    width: auto;
  }

  .filter-launcher-slot {
    top: 0.9rem;
    right: 0.9rem;
  }

  .filter-drawer {
    justify-content: center;
    align-items: center;
    padding: 0.75rem;
  }

  .filter-drawer-panel {
    width: min(100vw - 1.5rem, 42rem);
    height: auto;
    max-height: calc(100dvh - 1.5rem);
    border: 1px solid rgba(31, 45, 36, 0.12);
    border-radius: 24px;
    transform: translateY(1.25rem);
    background: rgba(255, 255, 255, 0.9);
  }

  body.is-filter-drawer-open .filter-drawer-panel {
    transform: translateY(0);
  }

  .filter-drawer-head {
    padding: 1rem 1rem 0.75rem;
  }

  .filter-drawer-body {
    padding: 0 1rem 1rem;
  }

  .filter-drawer .filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-layout {
    grid-template-columns: 1fr;
  }

  .field-map-shell,
  .field-map {
    min-height: clamp(22rem, 48vh, 34rem);
  }

  .field-sheet {
    right: 1rem;
    top: 1rem;
    bottom: 1rem;
    width: min(35rem, calc(100vw - 2rem));
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  table {
    min-width: 640px;
  }

  .field-detail-grid {
    grid-template-columns: 1fr;
  }

  .field-map-controls {
    inset: 0;
  }

  .field-map-stack--left {
    top: 0.75rem;
    left: 0.75rem;
  }

  .field-map-stack--right {
    top: 0.75rem;
    right: 0.75rem;
  }

  .field-map-stack--bottom-right {
    right: 0.75rem;
    bottom: 2.75rem;
  }

  .field-base-menu {
    top: 3.125rem;
    width: min(17.5rem, calc(100vw - 1.5rem));
  }

  .table-card {
    overflow: hidden;
  }

  .table-card table {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .table-card thead {
    display: none;
  }

  .table-card tbody {
    display: grid;
    gap: 0.75rem;
  }

  .table-card tbody tr {
    display: grid;
    gap: 0.75rem;
    margin: 0;
    padding: 1rem;
    border-radius: 1.125rem;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.86);
  }

  .table-card tbody td {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    min-width: 0;
    padding: 0;
    border-bottom: 0;
    text-align: left;
  }

  .table-card tbody td::before {
    display: block;
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: normal;
    content: "";
  }

  #bojo-tbody td:nth-child(1)::before {
    content: "日付";
  }

  #bojo-tbody td:nth-child(2)::before {
    content: "顧客";
  }

  #bojo-tbody td:nth-child(3)::before {
    content: "場所";
  }

  #bojo-tbody td:nth-child(4)::before {
    content: "薬剤";
  }

  #bojo-tbody td:nth-child(5)::before {
    content: "面積";
  }

  #bojo-tbody td:nth-child(6)::before {
    content: "10a単価";
  }

  #bojo-tbody td:nth-child(7)::before {
    content: "合計";
  }

  #bojo-tbody td:nth-child(8)::before {
    content: "操作";
  }

  #staff-tbody td:nth-child(1)::before {
    content: "日付";
  }

  #staff-tbody td:nth-child(2)::before {
    content: "作業員";
  }

  #staff-tbody td:nth-child(3)::before {
    content: "日当";
  }

  #staff-tbody td:nth-child(4)::before {
    content: "手当";
  }

  #staff-tbody td:nth-child(5)::before {
    content: "合計";
  }

  #staff-tbody td:nth-child(6)::before {
    content: "操作";
  }

  #assistant_income-tbody td:nth-child(1)::before {
    content: "日付";
  }

  #assistant_income-tbody td:nth-child(2)::before {
    content: "補助員";
  }

  #assistant_income-tbody td:nth-child(3)::before {
    content: "内容";
  }

  #assistant_income-tbody td:nth-child(4)::before {
    content: "収益";
  }

  #assistant_income-tbody td:nth-child(5)::before {
    content: "操作";
  }

  #expense-tbody td:nth-child(1)::before {
    content: "日付";
  }

  #expense-tbody td:nth-child(2)::before {
    content: "品目";
  }

  #expense-tbody td:nth-child(3)::before {
    content: "カテゴリ";
  }

  #expense-tbody td:nth-child(4)::before {
    content: "金額";
  }

  #expense-tbody td:nth-child(5)::before {
    content: "操作";
  }

  #category-tbody td:nth-child(1)::before {
    content: "表示順";
  }

  #category-tbody td:nth-child(2)::before {
    content: "カテゴリ";
  }

  #category-tbody td:nth-child(3)::before {
    content: "状態";
  }

  #category-tbody td:nth-child(4)::before {
    content: "操作";
  }

  .table-card tbody tr > td[colspan] {
    display: block;
    text-align: center;
  }

  .table-card tbody tr > td[colspan]::before {
    content: none;
  }

  .table-actions {
    justify-content: flex-start;
  }

  #bojo-tbody .table-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 767px) {
  .auth-screen,
  .workspace {
    padding: 1rem;
  }

  .auth-card,
  .hero,
  .panel {
    padding: 1.25rem;
  }

  .hero {
    flex-direction: column;
    align-items: start;
  }

  .field-row,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .chart-card--ring {
    grid-row: auto;
    grid-column: auto;
  }

  .chart-card--bars,
  .chart-card--line {
    grid-column: auto;
    grid-row: auto;
    height: auto;
  }

  .chart-card--bars .bar-chart {
    grid-template-columns: 1fr;
    max-height: min(52vh, 420px);
  }

  .editor label.toggle-field {
    padding: 4px 2px 0;
    transform: none;
  }

  .bar-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .bar-meta {
    align-items: flex-start;
    text-align: left;
  }

  .nav {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    grid-template-columns: 1fr;
  }

  .filter-launcher-slot {
    top: 0.75rem;
    right: 0.75rem;
  }

  .filter-drawer {
    padding: 0.5rem;
  }

  .filter-drawer-panel {
    width: min(100vw - 1rem, 42rem);
    max-height: calc(100dvh - 1rem);
    border-radius: 24px;
    transform: translateY(1rem);
    background: rgba(255, 255, 255, 0.9);
  }

  .filter-drawer-head {
    padding: 0.95rem 0.95rem 0.7rem;
  }

  .filter-drawer-body {
    padding: 0 0.95rem 0.95rem;
  }

  .filter-drawer .filter-bar {
    grid-template-columns: 1fr;
  }

  .filter-drawer .button-row.compact {
    justify-content: flex-start;
  }

  .filter-drawer .button-row.compact .primary {
    width: 100%;
  }

  .toolbar-actions {
    width: 100%;
  }

  .section-actions {
    right: 0.85rem;
    bottom: 0.85rem;
  }

  .section-actions .create-launcher-button {
    width: 3.1rem;
    height: 3.1rem;
    min-width: 3.1rem;
  }

  .section-actions .create-launcher-button svg {
    width: 1.55rem;
    height: 1.55rem;
  }

  .entity-modal {
    padding: 0.5rem;
  }

  .entity-modal-panel {
    width: min(100vw - 1rem, 42rem);
    max-height: calc(100dvh - 1rem);
    border-radius: 24px;
  }

  .entity-modal-head {
    padding: 1rem 1rem 0;
  }

  .entity-modal-body {
    padding: 1rem;
  }

  .entity-modal .button-row > button {
    flex: 1 1 0;
  }

  .entity-modal .button-row,
  .field-sheet .button-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .entity-modal .button-row > button,
  .field-sheet .button-row > button {
    width: 100%;
    min-height: 2.75rem;
    padding: 11px 16px;
  }

  .field-sheet .button-row > button:nth-child(3) {
    grid-column: 1 / -1;
  }

  .field-layout {
    grid-template-columns: 1fr;
  }

  .field-detail-grid {
    grid-template-columns: 1fr;
  }

  .field-map-shell,
  .field-map {
    min-height: clamp(20rem, 48vh, 32rem);
  }

  .field-map-controls {
    inset: 0;
  }

  .field-map-status {
    max-width: none;
  }

  .field-map-stack--left {
    top: 0.75rem;
    left: 0.75rem;
  }

  .field-map-stack--right {
    top: 0.75rem;
    right: 0.75rem;
  }

  .field-map-stack--bottom-right {
    right: 0.75rem;
    bottom: 2.75rem;
  }

  .field-base-menu {
    top: 50px;
    width: min(17.5rem, calc(100vw - 1.5rem));
  }

  .field-sheet {
    top: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    left: 0.75rem;
    width: auto;
  }

  .button-row.compact {
    justify-content: flex-start;
  }

  .button-row.compact .primary {
    width: 100%;
  }

  .sidebar {
    gap: 18px;
  }

  .page-summary__top,
  .page-summary__body {
    grid-template-columns: 1fr;
  }

  .page-summary__top {
    display: grid;
  }

  .page-summary__period,
  .page-summary__chips {
    justify-content: flex-start;
  }

  .page-summary__body {
    align-items: start;
  }

  table {
    min-width: 0;
  }
}

@media (min-width: 1024px) {
  .entity-modal {
    inset: 0;
    z-index: 3020;
    display: flex;
    justify-content: flex-end;
    pointer-events: none;
    padding: 0;
  }

  .entity-modal-panel {
    position: relative;
    z-index: 1;
    width: min(34rem, calc(100vw - 1.5rem));
    height: 100dvh;
    max-height: none;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    border-left: 1px solid rgba(31, 45, 36, 0.12);
    border-radius: 24px 0 0 24px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    box-shadow: -28px 0 48px rgba(25, 40, 31, 0.2);
    transform: translateX(104%);
    transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: auto;
  }

  .entity-modal.is-open .entity-modal-panel {
    transform: translateX(0);
  }

  body.is-entity-modal-open .entity-modal-panel {
    transform: translateX(0);
  }

  .entity-modal-head {
    padding: 1.1rem 1.1rem 0.85rem;
  }

  .entity-modal-body {
    padding: 0 1.1rem 1.1rem;
  }

  .field-sheet {
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: min(34rem, calc(100vw - 1.5rem));
    height: 100dvh;
    max-height: none;
    padding: 0;
    gap: 0;
    overflow: hidden;
    border-left: 1px solid rgba(31, 45, 36, 0.12);
    border-radius: 24px 0 0 24px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    box-shadow: -28px 0 48px rgba(25, 40, 31, 0.18);
    transform: translateX(104%);
  }

  body.is-field-sheet-open .field-sheet {
    transform: translateX(0);
  }

  .field-sheet-head {
    padding: 1.1rem 1.1rem 0.85rem;
  }

  .field-sheet-form {
    min-height: 0;
    overflow: auto;
    padding: 0 1.1rem 1.1rem;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  body.is-delete-modal-open {
    overflow: auto;
  }

  .delete-modal {
    inset: 0;
    z-index: 3030;
    display: flex;
    justify-content: flex-end;
    pointer-events: none;
    padding: 0;
  }

  .delete-modal-panel {
    position: relative;
    z-index: 1;
    width: min(34rem, calc(100vw - 1.5rem));
    height: 100dvh;
    max-height: none;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    border-left: 1px solid rgba(31, 45, 36, 0.12);
    border-radius: 24px 0 0 24px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    box-shadow: -28px 0 48px rgba(25, 40, 31, 0.2);
    transform: translateX(104%);
    transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: auto;
  }

  .delete-modal.is-open .delete-modal-panel,
  body.is-delete-modal-open .delete-modal-panel {
    transform: translateX(0);
  }

  .delete-modal-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    background: rgba(17, 29, 22, 0.42);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 240ms ease;
    cursor: pointer;
  }

  body.is-delete-modal-open .delete-modal {
    pointer-events: auto;
  }

  body.is-delete-modal-open .delete-modal-backdrop {
    opacity: 1;
  }

  .delete-modal-head {
    padding: 1.1rem 1.1rem 0.85rem;
  }

  .delete-modal-body {
    padding: 0 1.1rem 1.1rem;
  }

  .delete-modal-body {
    align-content: start;
    grid-auto-rows: max-content;
  }

  .delete-modal-actions {
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
    flex-wrap: nowrap;
    width: 100%;
    align-self: start;
  }

  .delete-modal-actions > button {
    flex: 0 0 auto;
    width: auto;
    min-width: 6.25rem;
    min-height: 2.75rem;
    padding: 0.72rem 1.05rem;
  }

  .workspace {
    --sidebar-current-width: var(--sidebar-rail-width);
    grid-template-columns: var(--sidebar-current-width) minmax(0, 1fr);
  }

  .workspace.is-sidebar-expanded {
    --sidebar-current-width: var(--sidebar-width);
  }

  .sidebar {
    width: var(--sidebar-current-width);
    justify-items: stretch;
    gap: 0.95rem;
    padding: 0.95rem 0.7rem 1rem;
    transition: width 220ms ease;
  }

  .brand {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: 2.9rem;
    min-width: 0;
    padding-left: calc((var(--sidebar-rail-width) - 2.9rem) / 2);
    gap: 0;
  }

  .brand-copy {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    white-space: nowrap;
    transition: max-width 220ms ease, opacity 180ms ease;
  }

  .brand-copy .eyebrow,
  .brand-copy h2 {
    white-space: nowrap;
  }

  .nav-btn,
  #logout-btn {
    overflow: hidden;
  }

  .nav-label,
  .button-label,
  .user-card-label,
  .user-card-name {
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    max-width: 0;
    opacity: 0;
    transition: max-width 220ms ease, opacity 160ms ease;
  }

  .nav {
    width: 100%;
    padding-right: 0;
    gap: 8px;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .nav-btn {
    justify-content: flex-start;
    gap: 0;
    width: 100%;
    min-height: 3rem;
    padding: 0 calc((var(--sidebar-rail-width) - 1.15rem) / 2);
    font-size: 0.92rem;
    border-radius: 16px;
  }

  .nav-btn .sidebar-icon,
  #logout-btn .sidebar-icon {
    width: 1.15rem;
    height: 1.15rem;
  }

  .sidebar-footer {
    width: 100%;
    justify-items: stretch;
    padding-top: 0.85rem;
  }

  .sidebar-footer .user-card {
    display: grid;
    gap: 0.3rem;
    min-width: 0;
    min-height: 4.6rem;
    opacity: 0;
    overflow: hidden;
    padding: 14px;
    border-color: transparent;
    background: transparent;
    pointer-events: none;
    transition: opacity 180ms ease, background 220ms ease, border-color 220ms ease;
  }

  #logout-btn {
    width: 100%;
    min-height: 3rem;
    padding: 0 calc((var(--sidebar-rail-width) - 1.15rem) / 2);
    font-size: 0.92rem;
    gap: 0;
    color: rgba(255, 255, 255, 0.92);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: none;
  }

  #logout-btn:hover {
    background: rgba(255, 255, 255, 0.16);
  }

  .workspace.is-sidebar-expanded-content .brand {
    gap: 0.75rem;
  }

  .workspace.is-sidebar-expanded-content .brand-copy {
    max-width: 10rem;
    opacity: 1;
    pointer-events: auto;
  }

  .workspace.is-sidebar-expanded-content .sidebar-footer .user-card {
    opacity: 1;
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.08);
    pointer-events: auto;
  }

  .workspace.is-sidebar-expanded-content .nav-label,
  .workspace.is-sidebar-expanded-content .button-label,
  .workspace.is-sidebar-expanded-content .user-card-label,
  .workspace.is-sidebar-expanded-content .user-card-name {
    max-width: 12rem;
    opacity: 1;
  }

  .workspace.is-sidebar-expanded-content .nav-btn {
    gap: 0.75rem;
  }

  .workspace.is-sidebar-expanded-content #logout-btn {
    gap: 0.6rem;
  }

  .field-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "map"
      "sidebar";
    gap: 1.25rem;
  }

  .field-map-card {
    grid-area: map;
  }

  .field-sidebar {
    grid-area: sidebar;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
  }

  .field-map-shell,
  .field-map {
    min-height: clamp(30rem, 58vh, 48rem);
  }

  .field-list {
    max-height: clamp(18rem, 36vh, 28rem);
  }
}

.mobile-tab-label {
  display: none;
  align-items: center;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.workflow-panel {
  padding-bottom: clamp(4.5rem, 7vw, 5.25rem);
}

.workflow-grid {
  display: grid;
  gap: clamp(0.9rem, 1.6vw, 1.2rem);
  align-items: start;
}

.workflow-grid--split,
.workflow-grid--masters {
  grid-template-columns: minmax(0, 1.05fr) minmax(20rem, 0.95fr);
}

.workflow-grid--split .job-card,
.workflow-grid--masters .job-card {
  grid-column: 1 / -1;
}

.workflow-grid--faq {
  grid-template-columns: minmax(18rem, 0.72fr) minmax(0, 1.28fr);
}

.workflow-card,
.job-card {
  min-width: 0;
  padding: clamp(1rem, 1.8vw, 1.35rem);
  border: 1px solid rgba(31, 45, 36, 0.1);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52), 0 14px 34px rgba(25, 40, 31, 0.07);
}

.workflow-card--hero {
  background:
    radial-gradient(circle at top right, rgba(109, 141, 89, 0.16), transparent 58%),
    rgba(255, 255, 255, 0.82);
}

.workflow-card-title {
  display: grid;
  gap: 0.35rem;
}

.workflow-card-title h4,
.workflow-action-sheet-head h2 {
  margin: 0;
  font-family: var(--font-display);
  line-height: 1.2;
}

.workflow-card-title .eyebrow {
  margin: 0;
}

.workflow-steps {
  display: grid;
  gap: 0.7rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: workflow-step;
}

.workflow-steps li {
  position: relative;
  display: grid;
  gap: 0.15rem;
  padding: 0.85rem 0.9rem 0.85rem 3.1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(31, 45, 36, 0.08);
}

.workflow-steps li::before {
  counter-increment: workflow-step;
  content: counter(workflow-step);
  position: absolute;
  left: 0.85rem;
  top: 0.85rem;
  display: inline-grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
}

.workflow-steps span,
.candidate-row span,
.workflow-action-item span,
.order-preview span,
.file-drop small {
  color: var(--muted);
  font-size: 0.9rem;
}

.workflow-inline-action {
  margin-top: 1rem;
}

.file-drop {
  display: grid;
  gap: 0.55rem;
  padding: 1rem;
  border: 1px dashed rgba(31, 45, 36, 0.22);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
}

.file-drop input[type="file"] {
  padding: 0.7rem;
  background: rgba(255, 255, 255, 0.86);
}

.candidate-list,
.faq-list,
.order-preview {
  display: grid;
  gap: 0.7rem;
}

.candidate-row,
.order-preview > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(31, 45, 36, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.66);
}

.candidate-row em {
  flex: 0 0 auto;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(193, 156, 88, 0.14);
  color: #7c6130;
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 700;
}

.order-preview {
  margin-bottom: 0.8rem;
}

.order-preview strong {
  text-align: right;
}

.job-card {
  overflow: hidden;
}

.job-card-head {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.job-card-head strong {
  display: block;
  font-size: 1rem;
}

.job-card-head p {
  margin: 0.2rem 0 0;
  color: var(--muted);
}

.job-indicator {
  display: inline-flex;
  width: 0.95rem;
  height: 0.95rem;
  margin-top: 0.3rem;
  border-radius: 999px;
  background: rgba(100, 116, 102, 0.5);
  box-shadow: 0 0 0 5px rgba(100, 116, 102, 0.08);
}

.job-card[data-job-state="running"] .job-indicator {
  background: var(--accent-2);
  box-shadow: 0 0 0 5px rgba(193, 156, 88, 0.16);
  animation: job-pulse 1.1s ease-in-out infinite;
}

.job-card[data-job-state="success"] .job-indicator {
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(109, 141, 89, 0.16);
}

.job-card[data-job-state="error"] .job-indicator {
  background: var(--danger);
  box-shadow: 0 0 0 5px rgba(157, 77, 77, 0.16);
}

@keyframes job-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.78); opacity: 0.72; }
}

.job-progress {
  height: 0.42rem;
  margin: 1rem 0 0.9rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(31, 45, 36, 0.08);
}

.job-progress span {
  display: block;
  width: 34%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: translateX(-110%);
}

.job-card[data-job-state="running"] .job-progress span {
  animation: job-progress 1.25s ease-in-out infinite;
}

.job-card[data-job-state="success"] .job-progress span,
.job-card[data-job-state="error"] .job-progress span {
  width: 100%;
  transform: translateX(0);
  animation: none;
}

.job-card[data-job-state="error"] .job-progress span {
  background: linear-gradient(90deg, var(--danger), #c47a60);
}

@keyframes job-progress {
  0% { transform: translateX(-110%); }
  55% { transform: translateX(90%); }
  100% { transform: translateX(220%); }
}

.job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0;
}

.job-meta > div {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(31, 45, 36, 0.08);
}

.job-meta dt,
.job-meta dd {
  margin: 0;
  font-size: 0.82rem;
}

.job-meta dt {
  color: var(--muted);
}

.job-result {
  max-height: 14rem;
  overflow: auto;
  margin: 0.9rem 0 0;
  padding: 0.85rem;
  border-radius: 14px;
  background: rgba(24, 36, 28, 0.9);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.82rem;
  white-space: pre-wrap;
}

.faq-search {
  display: grid;
  gap: 0.5rem;
}

.faq-item {
  border: 1px solid rgba(31, 45, 36, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  padding: 0.95rem 1rem;
  font-weight: 800;
}

.faq-item p {
  margin: 0;
  padding: 0 1rem 1rem;
  color: var(--muted);
}

.workflow-action-slot {
  position: fixed;
  right: clamp(0.85rem, 1.6vw, 1.25rem);
  bottom: clamp(0.85rem, 1.6vw, 1.25rem);
  z-index: 1160;
  pointer-events: none;
}

.workflow-fab {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 3.35rem;
  padding: 0 1.1rem;
  border-radius: 999px;
}

.workflow-fab svg {
  width: 1.3rem;
  height: 1.3rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

.workflow-action-sheet {
  position: fixed;
  inset: 0;
  z-index: 3040;
  display: grid;
  align-items: end;
  justify-items: center;
  padding: 0.75rem;
  pointer-events: none;
}

.workflow-action-sheet[hidden] {
  display: none !important;
}

.workflow-action-sheet-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(17, 29, 22, 0.42);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 220ms ease;
}

.workflow-action-sheet-panel {
  position: relative;
  z-index: 1;
  width: min(38rem, calc(100vw - 1.5rem));
  max-height: min(78dvh, 40rem);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(31, 45, 36, 0.12);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 -20px 48px rgba(25, 40, 31, 0.22);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  transform: translateY(110%);
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.is-workflow-sheet-open .workflow-action-sheet {
  pointer-events: auto;
}

body.is-workflow-sheet-open .workflow-action-sheet-backdrop {
  opacity: 1;
}

body.is-workflow-sheet-open .workflow-action-sheet-panel {
  transform: translateY(0);
}

.workflow-action-sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1rem 0.75rem;
}

.workflow-action-sheet-lead {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.workflow-action-sheet-close {
  width: 2.75rem;
  height: 2.75rem;
  min-width: 2.75rem;
  padding: 0;
}

.workflow-action-sheet-close svg {
  width: 1.1rem;
  height: 1.1rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.workflow-action-sheet-body {
  display: grid;
  gap: 0.65rem;
  overflow: auto;
  padding: 0 1rem 1rem;
}

.workflow-action-item {
  display: grid;
  gap: 0.2rem;
  width: 100%;
  padding: 0.95rem 1rem;
  text-align: left;
  border: 1px solid rgba(31, 45, 36, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--text);
}

.workflow-action-item:hover,
.workflow-action-item:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(109, 141, 89, 0.24);
  box-shadow: 0 12px 28px rgba(25, 40, 31, 0.08);
  outline: none;
}

@media (max-width: 1023px) {
  .mobile-topbar {
    display: flex;
    gap: 0.65rem;
  }

  .mobile-tab-label {
    display: inline-flex;
  }

  .workflow-grid--split,
  .workflow-grid--masters,
  .workflow-grid--faq,
  .ocr-review-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .workflow-card,
  .job-card {
    padding: 0.95rem;
    border-radius: 20px;
  }

  .candidate-row,
  .order-preview > div {
    align-items: flex-start;
    flex-direction: column;
  }

  .order-preview strong {
    text-align: left;
  }

  .workflow-fab {
    width: 3.15rem;
    height: 3.15rem;
    min-width: 3.15rem;
    padding: 0;
    justify-content: center;
  }

  .workflow-fab span {
    display: none;
  }

  .workflow-action-sheet {
    padding: 0;
  }

  .workflow-action-sheet-panel {
    width: 100%;
    max-height: 84dvh;
    border-radius: 28px 28px 0 0;
    border-right: 0;
    border-left: 0;
    border-bottom: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 最終系ワークフロー画面: ボタン過多を避けるため主要操作はFABとボトムシートに集約する。 */
.workflow-grid {
  display: grid;
  gap: 1rem;
}

.workflow-grid--split,
.workflow-grid--masters {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.workflow-grid--faq {
  grid-template-columns: minmax(16rem, 0.8fr) minmax(0, 1.2fr);
  align-items: start;
}

.workflow-card,
.job-card,
.faq-item {
  border: 1px solid rgba(75, 92, 64, 0.14);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 46px rgba(62, 78, 58, 0.08);
}

.workflow-card,
.job-card {
  padding: 1rem;
}

.workflow-card--hero {
  background: linear-gradient(135deg, rgba(245, 250, 239, 0.94), rgba(255, 255, 255, 0.9));
}

.workflow-card-title {
  display: grid;
  gap: 0.25rem;
  margin-bottom: 0.85rem;
}

.workflow-card-title h4 {
  margin: 0;
}

.workflow-steps {
  display: grid;
  gap: 0.65rem;
  padding-left: 1.25rem;
}

.workflow-steps li span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.workflow-inline-action {
  margin-top: 0.75rem;
}

.candidate-list {
  display: grid;
  gap: 0.6rem;
}

.candidate-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid rgba(75, 92, 64, 0.12);
  border-radius: 16px;
  background: rgba(247, 250, 244, 0.9);
}

.candidate-row span {
  color: var(--muted);
  min-width: 0;
}

.candidate-row em {
  font-style: normal;
  color: #6d8d59;
  font-weight: 700;
}

.ocr-review-card {
  display: grid;
  gap: 0.85rem;
}

.ocr-batch-rollback {
  display: grid;
  gap: 0.7rem;
  padding: 0.9rem;
  border: 1px solid rgba(157, 77, 77, 0.18);
  border-radius: 18px;
  background: rgba(157, 77, 77, 0.05);
}

.ocr-review-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  align-items: start;
}

.ocr-review-columns > div {
  display: grid;
  gap: 0.55rem;
  min-width: 0;
}

.ocr-job-list,
.ocr-candidate-list,
.ocr-batch-field-list {
  max-height: 18rem;
  overflow: auto;
}

.ocr-candidate-bulkbar {
  display: grid;
  gap: 0.45rem;
  padding: 0.75rem;
  border: 1px solid rgba(79, 124, 145, 0.16);
  border-radius: 16px;
  background: rgba(79, 124, 145, 0.07);
}

.ocr-candidate-bulkbar > div:first-child,
.ocr-candidate-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.ocr-job-row,
.ocr-candidate-row,
.ocr-batch-field-row {
  width: 100%;
  text-align: left;
}

.ocr-candidate-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.ocr-candidate-main {
  min-width: 0;
}

.ocr-candidate-check {
  display: inline-grid;
  place-items: center;
}

.ocr-candidate-check input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: #4f7c91;
}

.ocr-candidate-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.ocr-candidate-actions .mini {
  min-height: 2rem;
  padding: 0.32rem 0.58rem;
  font-size: 0.78rem;
}

.ocr-job-row.is-selected {
  border-color: rgba(79, 124, 145, 0.45);
  background: rgba(79, 124, 145, 0.08);
}

.order-preview {
  display: grid;
  gap: 0.65rem;
}

.order-preview div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px dashed rgba(75, 92, 64, 0.18);
}

.job-card {
  grid-column: 1 / -1;
}

.job-card-head {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.job-indicator {
  width: 0.8rem;
  height: 0.8rem;
  margin-top: 0.25rem;
  border-radius: 50%;
  background: #a8b39f;
}

.job-card[data-job-state="running"] .job-indicator {
  background: #4f7c91;
  animation: workflowPulse 1.2s ease-in-out infinite;
}

.job-card[data-job-state="success"] .job-indicator {
  background: #6d8d59;
}

.job-card[data-job-state="error"] .job-indicator {
  background: #b64a3b;
}

.job-progress {
  height: 0.45rem;
  margin-top: 0.85rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(75, 92, 64, 0.1);
}

.job-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6d8d59, #4f7c91);
  transition: width 220ms ease;
}

.job-card[data-job-state="running"] .job-progress span {
  width: 65%;
  animation: workflowProgress 1.8s ease-in-out infinite;
}

.job-card[data-job-state="success"] .job-progress span {
  width: 100%;
}

.job-card[data-job-state="error"] .job-progress span {
  width: 100%;
  background: #b64a3b;
}

.job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0.8rem 0 0;
  color: var(--muted);
}

.job-meta div {
  display: flex;
  gap: 0.4rem;
}

.job-meta dt,
.job-meta dd {
  margin: 0;
}

.job-result {
  max-height: 12rem;
  overflow: auto;
  padding: 0.75rem;
  border-radius: 14px;
  background: #1f281c;
  color: #f6fff1;
  white-space: pre-wrap;
}

.workflow-action-slot {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: 90;
}

.workflow-fab {
  min-width: 6.4rem;
  min-height: 3.25rem;
  border-radius: 999px;
  box-shadow: 0 18px 42px rgba(62, 78, 58, 0.22);
}

.workflow-fab svg {
  width: 1.15rem;
  height: 1.15rem;
}

.workflow-action-sheet {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}

.workflow-action-sheet.is-open {
  pointer-events: auto;
}

.workflow-action-sheet-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(21, 31, 19, 0.22);
  opacity: 0;
  transition: opacity 180ms ease;
}

.workflow-action-sheet.is-open .workflow-action-sheet-backdrop {
  opacity: 1;
}

.workflow-action-sheet-panel {
  position: absolute;
  right: clamp(0.75rem, 3vw, 2rem);
  bottom: clamp(0.75rem, 3vw, 2rem);
  width: min(28rem, calc(100vw - 1.5rem));
  max-height: min(72vh, 34rem);
  overflow: auto;
  padding: 1rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 68px rgba(42, 54, 38, 0.26);
  transform: translateY(1rem);
  opacity: 0;
  transition: opacity 180ms ease, transform 180ms ease;
}

.workflow-action-sheet.is-open .workflow-action-sheet-panel {
  transform: translateY(0);
  opacity: 1;
}

.workflow-action-sheet-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.workflow-action-sheet-body {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.85rem;
}

.workflow-action-item {
  display: grid;
  gap: 0.2rem;
  width: 100%;
  padding: 0.9rem;
  border: 1px solid rgba(75, 92, 64, 0.14);
  border-radius: 18px;
  background: rgba(247, 250, 244, 0.92);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.workflow-action-item:hover {
  border-color: rgba(109, 141, 89, 0.45);
  background: #fff;
}

.workflow-action-item span {
  color: var(--muted);
  font-size: 0.9rem;
}

.faq-search {
  display: grid;
  gap: 0.4rem;
}

.faq-list {
  display: grid;
  gap: 0.75rem;
}

.faq-item {
  padding: 0.85rem 1rem;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 800;
}

.field-candidate-card {
  display: grid;
  gap: 0.75rem;
}

.field-candidate-form {
  display: grid;
  gap: 0.65rem;
}

.field-candidate-form label {
  display: grid;
  gap: 0.35rem;
}

.field-candidate-list {
  display: grid;
  gap: 0.55rem;
  max-height: 18rem;
  overflow: auto;
}

.field-candidate-row {
  display: grid;
  gap: 0.55rem;
  width: 100%;
  padding: 0.72rem 0.78rem;
  border: 1px solid rgba(75, 92, 64, 0.14);
  border-radius: 16px;
  background: rgba(247, 250, 244, 0.92);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.field-candidate-main {
  display: grid;
  gap: 0.2rem;
}

.field-candidate-actions,
.field-link-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.field-candidate-actions .mini {
  min-height: 2rem;
  padding: 0.32rem 0.58rem;
  font-size: 0.78rem;
}

.field-candidate-row:hover {
  border-color: rgba(109, 141, 89, 0.45);
  background: #fff;
}

.field-candidate-row span,
.field-candidate-saved small {
  color: var(--muted);
  font-size: 0.86rem;
}

.field-candidate-saved {
  display: grid;
  gap: 0.45rem;
  padding: 0.72rem 0.78rem;
  border: 1px dashed rgba(75, 92, 64, 0.22);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.68);
}

.field-link-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.78rem;
  background: rgba(75, 92, 64, 0.08);
  color: var(--muted);
}

.field-link-chip.is-adopted {
  background: rgba(64, 128, 88, 0.12);
  color: #2f6c45;
}

.field-link-chip.is-pending {
  background: rgba(193, 156, 88, 0.15);
  color: #876421;
}

.field-link-chip.is-excluded {
  background: rgba(157, 77, 77, 0.12);
  color: #8a3d3d;
}

.field-link-row {
  display: flex;
  justify-content: space-between;
  gap: 0.65rem;
  font-size: 0.86rem;
}

.field-parcel-detail {
  display: grid;
  gap: 0.55rem;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(75, 92, 64, 0.14);
  border-radius: 18px;
  background: rgba(248, 250, 244, 0.9);
}

.field-parcel-detail-head,
.field-parcel-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.field-parcel-detail-list {
  display: grid;
  gap: 0.45rem;
}

.field-parcel-detail-row {
  padding: 0.62rem 0.7rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
  border-left: 4px solid rgba(75, 92, 64, 0.22);
}

.field-parcel-detail-row.is-adopted {
  border-left-color: #408058;
}

.field-parcel-detail-row.is-pending {
  border-left-color: #c19c58;
}

.field-parcel-detail-row.is-excluded {
  border-left-color: #9d4d4d;
}

.field-parcel-detail-row span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.field-parcel-detail-row em {
  flex: 0 0 auto;
  font-style: normal;
  color: var(--muted);
  font-size: 0.82rem;
}

@keyframes workflowPulse {
  0%, 100% { transform: scale(0.9); opacity: 0.65; }
  50% { transform: scale(1.18); opacity: 1; }
}

@keyframes workflowProgress {
  0% { transform: translateX(-30%); }
  50% { transform: translateX(45%); }
  100% { transform: translateX(110%); }
}

@media (max-width: 900px) {
  .workflow-grid--split,
  .workflow-grid--masters,
  .workflow-grid--faq {
    grid-template-columns: 1fr;
  }

  .workflow-action-sheet-panel {
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-height: 78vh;
    border-radius: 24px 24px 0 0;
  }

  .workflow-action-slot {
    right: 1rem;
    bottom: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .job-card[data-job-state="running"] .job-indicator,
  .job-card[data-job-state="running"] .job-progress span {
    animation: none !important;
  }
}

.field-activity-group-toggle .toggle-icon {
  width: 1rem;
  height: 1rem;
  display: block;
  object-fit: contain;
}


/* --------------------------------------------------------------------------
   AgriPilot Next UI refresh
   Mockup-guided UI refresh for map-first drone spraying operations.
   Keep primary actions compact and place secondary actions in FAB/sheets.
-------------------------------------------------------------------------- */
:root {
  --bg: #f6f4ee;
  --bg-2: #eaf2e8;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: rgba(255, 255, 255, 0.96);
  --surface-dark: #173728;
  --text: #17251d;
  --muted: #64756b;
  --line: rgba(23, 55, 40, 0.11);
  --shadow: 0 22px 60px rgba(18, 45, 31, 0.12);
  --accent: #247447;
  --accent-2: #4aa3c7;
  --warning: #c88a24;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --content-width: 1320px;
  --font-display: "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
}

body {
  background:
    radial-gradient(circle at 18% 8%, rgba(36, 116, 71, 0.13), transparent 28%),
    radial-gradient(circle at 85% 12%, rgba(74, 163, 199, 0.12), transparent 24%),
    linear-gradient(135deg, var(--bg), var(--bg-2));
}

body::before {
  opacity: 0.45;
  background-size: 72px 72px;
}

.auth-card,
.panel,
.chart-card,
.table-card,
.map-shell,
.field-register-card,
.ocr-card,
.vnext-card,
.work-order-card {
  background: var(--surface-strong);
  border-color: rgba(23, 55, 40, 0.1);
  box-shadow: var(--shadow);
}

.auth-card h1,
.panel h3,
.chart-card h4,
.brand-copy h2 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.auth-card {
  position: relative;
  overflow: hidden;
}

.auth-card::after {
  content: "";
  position: absolute;
  inset: auto -14% -28% 48%;
  height: 13rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(36, 116, 71, 0.15), transparent 68%);
  pointer-events: none;
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.07), transparent 24%),
    #173728;
  border-color: rgba(255,255,255,0.12);
}

.sidebar-brand-mark {
  background: rgba(255,255,255,0.96);
  color: #173728;
  box-shadow: 0 10px 28px rgba(0,0,0,0.18);
}

.nav-btn {
  gap: 0.75rem;
  border-radius: 18px;
  background: transparent;
  border-color: transparent;
}

.nav-btn .sidebar-icon,
#logout-btn .sidebar-icon {
  width: 1.45rem;
  height: 1.45rem;
  padding: 0.18rem;
  border-radius: 0.55rem;
  background: rgba(255,255,255,0.92);
  box-shadow: inset 0 0 0 1px rgba(23,55,40,0.08);
}

.nav-btn.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.13), 0 12px 24px rgba(0,0,0,0.12);
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.11);
}

.mobile-topbar {
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.86);
  box-shadow: 0 16px 36px rgba(18,45,31,0.10);
  backdrop-filter: blur(18px);
}

.panel {
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), rgba(200,138,36,0.75));
  opacity: 0.9;
}

.panel-header {
  padding-bottom: 0.2rem;
}

.panel-header h3 {
  letter-spacing: -0.04em;
}

.eyebrow {
  color: var(--accent);
  letter-spacing: 0.16em;
}

.primary {
  background: linear-gradient(135deg, #247447, #1f5f3c);
  box-shadow: 0 16px 32px rgba(36, 116, 71, 0.24);
}

.ghost {
  background: rgba(255,255,255,0.78);
  border-color: rgba(23,55,40,0.12);
}

.filter-bar,
.editor,
.settings-grid,
.field-register-layout,
.ocr-layout,
.work-order-builder,
.agrichemical-layout {
  border-radius: var(--radius-lg);
}

.summary-grid {
  gap: clamp(0.9rem, 1.4vw, 1.2rem);
}

.summary-card,
.kpi-card,
.stat-card,
.field-card,
.vnext-card,
.ocr-card,
.work-order-card {
  border-radius: 22px !important;
  border: 1px solid rgba(23,55,40,0.10) !important;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(250,252,248,0.92)) !important;
  box-shadow: 0 14px 34px rgba(18,45,31,0.09) !important;
}

.table-card {
  overflow: hidden;
}

.table-card table {
  border-spacing: 0 0.45rem;
  border-collapse: separate;
}

.table-card thead th {
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: transparent;
}

.table-card tbody tr {
  background: rgba(255,255,255,0.82);
  box-shadow: 0 8px 24px rgba(18,45,31,0.06);
}

.table-card tbody td:first-child {
  border-top-left-radius: 16px;
  border-bottom-left-radius: 16px;
}

.table-card tbody td:last-child {
  border-top-right-radius: 16px;
  border-bottom-right-radius: 16px;
}

.map-shell,
#field-map,
#field-register-map,
#candidate-map,
.leaflet-container {
  border-radius: 24px !important;
}

.fab,
.field-fab,
.map-fab,
.quick-action-fab,
.filter-launcher-button {
  background: linear-gradient(135deg, #247447, #1f5f3c) !important;
  color: #fff !important;
  border: 0 !important;
  box-shadow: 0 18px 38px rgba(36,116,71,0.28) !important;
}

.toast,
.status-pill,
.chip,
.badge {
  border-radius: 999px;
}

@media (max-width: 1023px) {
  .workspace {
    padding: 0.8rem;
    gap: 0.8rem;
  }

  .panel {
    border-radius: 24px;
    padding: 1rem;
  }

  .panel-toolbar,
  .button-row {
    gap: 0.65rem;
  }

  .primary,
  .ghost {
    min-height: 44px;
  }
}

@media (max-width: 767px) {
  body {
    background: linear-gradient(180deg, #f7f5ef, #edf4ea);
  }

  .panel.is-active {
    gap: 0.85rem;
  }

  .panel-header {
    align-items: flex-start;
  }

  .panel-header h3 {
    font-size: 1.35rem;
  }

  .summary-grid,
  .dashboard-visuals {
    grid-template-columns: 1fr !important;
  }

  .table-card tbody tr {
    border-radius: 18px;
  }
}

.ops-command-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0 18px;
}

.ops-command-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  border: 1px solid rgba(37, 99, 235, 0.08);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(240, 253, 250, 0.78)),
    var(--card-bg, #fff);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.08);
}

.ops-command-icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 16px;
  background: rgba(20, 184, 166, 0.1);
  border: 1px solid rgba(20, 184, 166, 0.16);
}

.ops-command-icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.ops-command-card h4 {
  margin: 2px 0 6px;
  font-size: 0.98rem;
}

.ops-command-card p:not(.eyebrow) {
  margin: 0;
  color: var(--muted, #64748b);
  line-height: 1.6;
  font-size: 0.85rem;
}

.work-order-checklist,
.policy-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.work-order-checklist span,
.policy-badges span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(20, 184, 166, 0.1);
  color: #0f766e;
  border: 1px solid rgba(20, 184, 166, 0.16);
  font-size: 0.82rem;
  font-weight: 700;
}

.agrichemical-policy-card {
  border-color: rgba(245, 158, 11, 0.22);
  background:
    linear-gradient(145deg, rgba(255, 251, 235, 0.9), rgba(255, 255, 255, 0.96)),
    var(--card-bg, #fff);
}

@media (max-width: 1180px) {
  .ops-command-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .ops-command-grid {
    grid-template-columns: 1fr;
  }

  .ops-command-card {
    border-radius: 20px;
    padding: 14px;
  }
}

.workflow-fab {
  width: auto;
  min-width: 3.5rem;
  max-width: min(16rem, calc(100vw - 2rem));
}

.workflow-fab .button-icon,
.workflow-fab img {
  width: 1.2rem !important;
  height: 1.2rem !important;
  object-fit: contain;
  flex: 0 0 auto;
}

.nav-btn--secondary {
  opacity: 0.72;
}

.nav-btn--secondary .nav-label {
  font-size: 0.82rem;
}

.mobile-bottom-nav {
  display: none;
}

.map-mode-strip,
.ocr-upload-steps,
.work-order-stepper,
.help-category-grid {
  display: grid;
  gap: 10px;
}

.map-mode-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 12px 0;
}

.map-mode-strip span,
.ocr-upload-steps span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(20, 184, 166, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #32513d;
  font-weight: 700;
  font-size: 0.84rem;
}

.map-mode-strip img {
  width: 18px;
  height: 18px;
}

.map-mode-strip .is-active {
  color: #fff;
  background: linear-gradient(135deg, #0f766e, #166534);
}

.ocr-upload-steps {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
}

.ocr-review-layout {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(180px, 0.8fr);
  gap: 14px;
  margin-bottom: 14px;
}

.ocr-document-preview,
.ocr-confidence-panel,
.pdf-preview-shell,
.pesticide-master-browser,
.pesticide-detail-panel {
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.78);
}

.ocr-document-preview {
  padding: 12px;
}

.ocr-document-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font-weight: 800;
}

.ocr-document-paper {
  position: relative;
  min-height: 210px;
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(15, 118, 110, 0.06) 1px, transparent 1px),
    #fffdf7;
  background-size: 34px 34px;
  overflow: hidden;
}

.ocr-document-paper::before {
  content: "";
  position: absolute;
  inset: 22px 28px 30px;
  border: 2px solid rgba(100, 116, 139, 0.28);
  transform: rotate(-4deg);
}

.ocr-bbox {
  position: absolute;
  padding: 4px 7px;
  border: 2px solid #f59e0b;
  border-radius: 8px;
  background: rgba(255, 251, 235, 0.8);
  font-weight: 900;
  color: #92400e;
}

.ocr-bbox-a { left: 20%; top: 28%; }
.ocr-bbox-b { right: 24%; top: 44%; }
.ocr-bbox-c { left: 45%; bottom: 22%; }

.ocr-confidence-panel {
  padding: 14px;
}

.ocr-confidence-panel dl,
.pesticide-detail-list {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
}

.ocr-confidence-panel dl div,
.pesticide-detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(240, 253, 250, 0.8);
}

.work-order-stepper {
  align-content: start;
}

.work-order-stepper .step {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "num title" "num small";
  gap: 2px 10px;
  padding: 13px;
  border-radius: 18px;
  border: 1px solid rgba(20, 184, 166, 0.14);
  background: rgba(255, 255, 255, 0.82);
}

.work-order-stepper .step span {
  grid-area: num;
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(20, 184, 166, 0.12);
  color: #0f766e;
  font-weight: 900;
}

.work-order-stepper .step strong { grid-area: title; }
.work-order-stepper .step small { grid-area: small; color: var(--muted, #64748b); }
.work-order-stepper .step.is-current {
  border-color: rgba(20, 184, 166, 0.38);
  box-shadow: 0 14px 28px rgba(20, 184, 166, 0.12);
}

.pdf-preview-shell {
  padding: 14px;
  margin-bottom: 12px;
}

.pdf-preview-page {
  min-height: 260px;
  padding: 16px;
  border-radius: 14px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.pdf-preview-page header {
  display: flex;
  justify-content: space-between;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 2px solid rgba(15, 118, 110, 0.18);
}

.pdf-preview-row,
.pdf-preview-grid span,
.pdf-preview-map {
  display: block;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(15,118,110,0.13), rgba(148,163,184,0.12));
}

.pdf-preview-row { height: 16px; width: 70%; margin-bottom: 10px; }
.pdf-preview-row.wide { width: 100%; }
.pdf-preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.pdf-preview-grid span { height: 48px; }
.pdf-preview-map { height: 76px; margin: 12px 0; }

.pesticide-master-cards {
  display: grid;
  gap: 10px;
}

.pesticide-card {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.84);
}

.pesticide-card.is-selected {
  border-color: rgba(15, 118, 110, 0.42);
  background: rgba(240, 253, 250, 0.9);
}

.pesticide-card span,
.pesticide-card small {
  color: var(--muted, #64748b);
}

.help-category-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.help-category-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.84);
}

.help-category-card img {
  width: 28px;
  height: 28px;
}

.help-category-card span {
  color: var(--muted, #64748b);
  line-height: 1.5;
}

@media (min-width: 768px) and (max-width: 1180px) {
  .workflow-grid--split,
  .workflow-grid--masters {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .work-order-stepper,
  .agrichemical-policy-card {
    grid-column: 1 / -1;
  }

  .field-layout {
    grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.2fr);
  }
}

@media (max-width: 767px) {
  .main {
    padding-bottom: 6.2rem;
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 1300;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: end;
    gap: 6px;
    padding: 8px;
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(15, 118, 110, 0.14);
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(16px);
  }

  .mobile-bottom-nav-btn {
    min-height: 48px !important;
    height: auto !important;
    padding: 6px 4px !important;
    display: grid !important;
    place-items: center;
    gap: 3px;
    border-radius: 18px !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #475569 !important;
  }

  .mobile-bottom-nav-btn img {
    width: 21px !important;
    height: 21px !important;
  }

  .mobile-bottom-nav-btn span {
    display: inline !important;
    font-size: 0.68rem;
    font-weight: 800;
  }

  .mobile-bottom-nav-btn.is-active {
    background: rgba(20, 184, 166, 0.1) !important;
    color: #0f766e !important;
  }

  .mobile-bottom-nav-btn--fab {
    transform: translateY(-16px);
    width: 58px !important;
    min-height: 58px !important;
    margin-inline: auto;
    border-radius: 22px !important;
    background: linear-gradient(135deg, #0f766e, #166534) !important;
    color: #fff !important;
    box-shadow: 0 16px 34px rgba(15, 118, 110, 0.32) !important;
  }

  .mobile-bottom-nav-btn--fab img {
    filter: brightness(0) invert(1);
  }

  .workflow-fab {
    min-width: 56px !important;
    width: 56px !important;
    min-height: 56px !important;
    height: 56px !important;
    padding: 0 !important;
    justify-content: center;
  }

  .workflow-fab span {
    display: none;
  }

  .map-mode-strip,
  .ocr-upload-steps,
  .help-category-grid {
    grid-template-columns: 1fr 1fr;
  }

  .ocr-review-layout {
    grid-template-columns: 1fr;
  }

  .work-order-stepper {
    grid-template-columns: 1fr 1fr;
  }
}




/* 2026 mockup parity uplift: map-first dashboard, polished auth, and loading motion */
.app-loading { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; gap: 1rem; color: #123b2a; background: radial-gradient(circle at 50% 35%, rgba(16, 132, 103, 0.20), transparent 24rem), linear-gradient(135deg, rgba(247,250,246,.96), rgba(228,240,234,.96)); transition: opacity 420ms ease, visibility 420ms ease; }
.app-loading > div:last-child { display: grid; justify-items: center; gap: .2rem; }
.app-loading span { color: #5d7064; font-size: .92rem; }
.app-loading.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loading-drone { position: relative; width: 6.2rem; height: 6.2rem; animation: drone-float 1.8s ease-in-out infinite; }
.drone-body { position: absolute; inset: 2rem; border-radius: 1.2rem; background: linear-gradient(135deg, #0f8f7f, #184c33); box-shadow: 0 18px 44px rgba(15,87,63,.28); }
.drone-rotor { position: absolute; width: 1.6rem; height: 1.6rem; border: .22rem solid rgba(15,89,66,.38); border-top-color: #0f8f7f; border-radius: 50%; animation: rotor-spin .58s linear infinite; }
.rotor-a { left: .6rem; top: .6rem; } .rotor-b { right: .6rem; top: .6rem; } .rotor-c { left: .6rem; bottom: .6rem; } .rotor-d { right: .6rem; bottom: .6rem; }
@keyframes drone-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes rotor-spin { to { transform: rotate(360deg); } }
.auth-screen { padding: clamp(1rem, 4vw, 3rem); align-items: center; background: linear-gradient(140deg, rgba(244,248,241,.75), rgba(222,237,232,.68)); }
.auth-card { max-width: 1040px; width: min(1040px, 100%); display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(20rem, .78fr); gap: clamp(1.1rem, 3vw, 2.2rem); overflow: hidden; position: relative; }
.auth-card::before { content: ""; position: absolute; inset: 0 42% 0 0; background: radial-gradient(circle at 38% 46%, rgba(0,139,126,.17), transparent 38%), linear-gradient(135deg, rgba(255,255,255,.24), transparent); pointer-events: none; }
.auth-brand-lockup, .auth-card > .lede, .auth-preview-map { position: relative; z-index: 1; grid-column: 1; }
.auth-brand-lockup { display: flex; gap: 1rem; align-items: flex-start; }
.auth-logo { width: 4.8rem; height: 4.8rem; border-radius: 1.6rem; display: grid; place-items: center; background: rgba(255,255,255,.8); box-shadow: 0 20px 48px rgba(21,70,51,.16); }
.auth-logo img { width: 3.2rem; height: 3.2rem; object-fit: contain; }
.auth-card h1 { font-size: clamp(2rem, 4.2vw, 4.3rem); line-height: 1.08; letter-spacing: -.05em; }
.auth-preview-map { min-height: 17rem; border-radius: 2rem; margin-top: .4rem; background: linear-gradient(135deg, rgba(129,177,133,.32), rgba(73,159,172,.2)), repeating-linear-gradient(35deg, rgba(255,255,255,.54) 0 2px, transparent 2px 72px); border: 1px solid rgba(255,255,255,.74); box-shadow: inset 0 0 0 1px rgba(22,75,51,.06), 0 28px 70px rgba(25,71,51,.14); overflow: hidden; }
.auth-field { position: absolute; display: grid; place-items: center; color: #fff; font-weight: 800; border: 2px solid rgba(255,255,255,.9); box-shadow: 0 18px 35px rgba(18,75,53,.22); }
.auth-field-a { left: 9%; top: 18%; width: 34%; height: 32%; background: rgba(0,137,125,.68); transform: skew(-12deg); } .auth-field-b { right: 14%; top: 25%; width: 28%; height: 25%; background: rgba(46,139,87,.62); transform: skew(9deg); } .auth-field-c { left: 33%; bottom: 12%; width: 38%; height: 28%; background: rgba(43,126,210,.42); transform: skew(-5deg); }
.auth-route { position: absolute; left: 18%; right: 18%; top: 55%; border-top: 4px dashed rgba(255,176,40,.82); transform: rotate(-8deg); filter: drop-shadow(0 5px 8px rgba(0,0,0,.12)); }
.auth-drone { position: absolute; right: 26%; top: 46%; width: 4.4rem; height: 4.4rem; border-radius: 999px; background: rgba(255,255,255,.9); display: grid; place-items: center; animation: drone-float 2.4s ease-in-out infinite; }
.auth-drone img { width: 3rem; }
.login-form { grid-column: 2; grid-row: 1 / span 3; align-self: center; background: rgba(255,255,255,.78); border: 1px solid rgba(255,255,255,.86); border-radius: 1.8rem; padding: clamp(1.2rem, 2.5vw, 2rem); box-shadow: 0 26px 70px rgba(28,65,47,.14); backdrop-filter: blur(18px); }
.login-form .primary.is-loading { position: relative; color: transparent; } .login-form .primary.is-loading::after { content: ""; position: absolute; left: 50%; top: 50%; width: 1.2rem; height: 1.2rem; margin: -.6rem 0 0 -.6rem; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 999px; animation: rotor-spin .7s linear infinite; }
.dashboard-mockup-shell { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(20rem, .95fr); grid-template-areas: "map missions" "ocr region" "ocr order"; gap: 1rem; margin: 0 0 1.25rem; animation: ui-rise .62s cubic-bezier(.22,1,.36,1) both; }
@keyframes ui-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.mock-map-card, .today-mission-card, .dashboard-alert-card { border: 1px solid rgba(31,45,36,.10); background: rgba(255,255,255,.86); border-radius: 1.45rem; box-shadow: 0 22px 52px rgba(36,58,44,.10); }
.mock-map-card { grid-area: map; padding: 1rem; } .today-mission-card { grid-area: missions; padding: 1.1rem 1.25rem; } .ocr-card { grid-area: ocr; } .region-card { grid-area: region; } .order-card { grid-area: order; }
.mock-card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; } .mock-card-head h4 { margin: 0; font-size: 1.2rem; } .mock-card-head a { color: #0d715e; font-weight: 800; text-decoration: none; }
.weather-pill { display: inline-flex; align-items: center; gap: .45rem; border: 1px solid rgba(31,45,36,.12); border-radius: 999px; padding: .45rem .75rem; background: #fff; color: #4d5d55; font-weight: 700; } .weather-pill img { width: 1.45rem; height: 1.45rem; object-fit: contain; }
.mock-map-canvas { position: relative; min-height: clamp(22rem, 36vw, 31rem); border-radius: 1.05rem; overflow: hidden; background: linear-gradient(120deg, rgba(138,181,117,.64), rgba(195,222,165,.50)), repeating-linear-gradient(90deg, rgba(255,255,255,.46) 0 3px, transparent 3px 92px), repeating-linear-gradient(0deg, rgba(255,255,255,.36) 0 2px, transparent 2px 78px); }
.mock-map-canvas::before { content:""; position:absolute; inset:-12%; background: linear-gradient(38deg, transparent 0 46%, rgba(75,137,201,.30) 47% 53%, transparent 54%), linear-gradient(-28deg, transparent 0 58%, rgba(255,255,255,.38) 59% 61%, transparent 62%); }
.field-poly { position: absolute; z-index: 1; display: grid; place-items: center; color: #083b2e; font-weight: 900; font-size: .78rem; border: 3px solid rgba(255,255,255,.92); box-shadow: 0 12px 28px rgba(24,75,53,.16); backdrop-filter: blur(4px); }
.poly-a { left: 33%; top: 10%; width: 20%; height: 30%; background: rgba(73,171,102,.48); transform: skew(-18deg) rotate(7deg); } .poly-b { left: 50%; top: 18%; width: 18%; height: 24%; background: rgba(87,179,219,.48); transform: skew(-8deg); } .poly-c { right: 10%; top: 38%; width: 22%; height: 26%; background: rgba(255,189,65,.64); border-radius: 0 3rem 0 0; transform: rotate(-10deg); } .poly-d { left: 39%; bottom: 11%; width: 31%; height: 27%; background: rgba(34,142,111,.46); transform: skew(13deg); }
.route-line { position: absolute; z-index: 2; height: 4px; background: linear-gradient(90deg, transparent, #0a8f82, #f5b736, transparent); border-radius: 999px; filter: drop-shadow(0 4px 6px rgba(0,0,0,.14)); animation: route-glow 1.8s ease-in-out infinite; } .route-main { left: 19%; right: 18%; top: 48%; transform: rotate(-8deg); } .route-sub { left: 33%; right: 31%; bottom: 27%; transform: rotate(15deg); animation-delay: .3s; } @keyframes route-glow { 0%,100% { opacity: .55; } 50% { opacity: 1; } }
.map-pin { position: absolute; z-index: 3; width: 3.3rem; height: 3.3rem; border-radius: 50%; background: rgba(255,255,255,.92); display: grid; place-items: center; box-shadow: 0 14px 32px rgba(20,61,43,.22); } .map-pin img { width: 2.15rem; height: 2.15rem; object-fit: contain; } .pin-a { left: 47%; top: 33%; } .pin-b { right: 23%; top: 49%; }
.map-legend-card { position: absolute; z-index: 4; left: 1rem; bottom: 1rem; display: grid; gap: .35rem; min-width: 10rem; padding: .9rem 1rem; border-radius: 1rem; background: rgba(255,255,255,.9); box-shadow: 0 16px 38px rgba(26,65,44,.13); } .map-legend-card span { color: #506258; font-size: .88rem; display: flex; gap: .5rem; align-items: center; }
.dot { width: .58rem; height: .58rem; border-radius: 50%; display: inline-block; } .dot-blue { background:#2f80ed; } .dot-teal { background:#0f9f8f; } .dot-green { background:#188d43; }
.map-refresh-chip { position: absolute; z-index: 4; right: 1rem; bottom: 1rem; padding: .5rem .8rem; border-radius: 999px; background: rgba(255,255,255,.9); color: #506258; font-size: .86rem; font-weight: 800; }
.mission-timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; } .mission-timeline li { display: grid; grid-template-columns: 4.2rem 1fr auto; gap: .8rem; align-items: start; padding-bottom: .8rem; border-bottom: 1px solid rgba(31,45,36,.08); } .mission-timeline time { color: #52635a; font-weight: 800; } .mission-timeline strong, .mission-timeline small { display: block; } .mission-timeline small { color: #647466; } .status-chip { display: inline-flex; width: fit-content; padding: .18rem .58rem; border-radius: 999px; background: #eaf4ff; color: #2178cf; font-size: .76rem; font-weight: 900; margin-bottom: .22rem; } .status-active { background: #dff4dc; color: #16803c; } .status-muted { background:#eef0ef; color:#7b8780; } .mission-timeline b { color: #078a68; }
.dashboard-alert-card { display: flex; align-items: center; gap: .9rem; padding: 1rem; min-height: 7.2rem; } .dashboard-alert-card span { width: 3.8rem; height: 3.8rem; flex: 0 0 auto; border-radius: 1.2rem; display: grid; place-items: center; background: linear-gradient(135deg, rgba(16,143,127,.10), rgba(46,128,237,.08)); } .dashboard-alert-card img { width: 2.4rem; height: 2.4rem; object-fit: contain; } .dashboard-alert-card p { margin: 0; color: #586b60; font-weight: 800; } .dashboard-alert-card strong { display:block; font-size: 1.55rem; line-height:1.1; } .dashboard-alert-card small { color: #647466; }
@media (max-width: 900px) { .auth-card { grid-template-columns: 1fr; } .auth-card::before { inset: 0; } .login-form { grid-column: 1; grid-row: auto; } .auth-preview-map { min-height: 12rem; } .dashboard-mockup-shell { grid-template-columns: 1fr; grid-template-areas: "missions" "map" "ocr" "region" "order"; } .mock-map-card { padding: .8rem; } .mock-map-canvas { min-height: 20rem; } }
@media (max-width: 767px) { .panel-toolbar:has(#dashboard-filter-form) { display: none; } .dashboard-mockup-shell { margin-top: .5rem; gap: .9rem; } .today-mission-card { order: -1; } .today-mission-card::before { content: "eca5e5Æeb5deeafc"; display: block; font-size: 1.35rem; font-weight: 900; margin-bottom: .7rem; } .mission-timeline li { grid-template-columns: 3.5rem 1fr auto; } .mock-card-head .weather-pill { display: none; } .mock-map-canvas { min-height: 18rem; } .ops-command-grid, .summary-grid, .dashboard-visuals { display: none; } .dashboard-alert-card { min-height: 5.6rem; } }
@media (prefers-reduced-motion: reduce) { .loading-drone, .drone-rotor, .auth-drone, .route-line, .dashboard-mockup-shell { animation: none !important; } }

/* Ensure mockup dashboard is the primary first-view surface. */
section[data-panel="dashboard"] .ops-command-grid { display: none; }
section[data-panel="dashboard"] .panel-toolbar { margin-bottom: 1rem; }
section[data-panel="dashboard"] .dashboard-mockup-shell { margin-top: .5rem; }

@media (max-width: 767px) {
  section[data-panel="dashboard"] .panel-header { margin-bottom: .8rem; }
  .today-mission-card { border-radius: 1.35rem; }
  .today-mission-card .mock-card-head { align-items: center; }
  .today-mission-card .mock-card-head::before { content: ""; width: 1.8rem; height: 1.8rem; border-radius: .6rem; background: linear-gradient(135deg, #0f9f8f, #1d7fd1); margin-right: .3rem; }
  .dashboard-mockup-shell::before { content: ""; display: grid; grid-template-columns: repeat(4, minmax(4.6rem, 1fr)); gap: .65rem; order: -2; }
  .mock-map-card { border-radius: 1.35rem; }
  .mock-map-card::before { content: "\7dca\6025\30bf\30b9\30af  2\4ef6"; display: block; margin: 0 0 .75rem; padding: .75rem .9rem; border-radius: 1rem; color: #9a1f1f; font-weight: 900; background: linear-gradient(135deg, rgba(255,80,80,.10), rgba(255,180,60,.10)); border: 1px solid rgba(196,60,60,.18); }
}

/* Dashboard functional parity refinements */
.dashboard-command-bar { display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; padding: .2rem .2rem 1.1rem; }
.dashboard-brand { display: flex; align-items: center; gap: .65rem; font-size: 1.55rem; color: #0f5132; }
.leaf-mark { color: #0f9f8f; transform: rotate(45deg); display: inline-block; }
.dashboard-greeting { display: flex; align-items: center; gap: .6rem; color: #344238; font-weight: 700; margin-right: auto; }
.dashboard-greeting p { margin: 0; }
.dashboard-command-actions { display: flex; align-items: center; gap: .8rem; }
.weather-chip, .notify-chip { border: 1px solid rgba(31,45,36,.12); background: rgba(255,255,255,.88); border-radius: 999px; min-height: 3rem; padding: .55rem 1rem; box-shadow: 0 12px 30px rgba(27,64,45,.08); }
.notify-chip { width: 3rem; padding: 0; color: #df3457; }
.dashboard-action { min-height: 3rem; border-radius: 999px; padding-inline: 1.25rem; background: linear-gradient(135deg, #0f5132, #0b6b52); }
@media (min-width: 901px) {
  section[data-panel="dashboard"] > .panel-header, section[data-panel="dashboard"] > .panel-toolbar { display: none; }
  .workspace { grid-template-columns: 13.8rem minmax(0, 1fr); }
  .sidebar { width: 13rem; }
  .brand-copy, .nav-label, .button-label, .user-card-label, .user-card-name { display: inline-block !important; max-width: 12rem !important; opacity: 1 !important; }
  .sidebar .nav-btn { justify-content: flex-start; gap: .72rem; padding-inline: .85rem; }
  .mock-map-canvas { min-height: 26rem; }
  .dashboard-alert-card { min-height: 6.3rem; }
}
.mobile-home-stack { display: none; }
@media (max-width: 767px) {
  .mobile-topbar { align-items: center; gap: .55rem; padding-inline: 1.1rem; }
  .mobile-tab-label { display: none; }
  .mobile-brand-home { margin-right: auto; font-size: 1.35rem; color: #0f5132; }
  .mobile-weather-home, .mobile-sync-home { display: grid; line-height: 1.1; font-weight: 900; color: #0f766e; }
  .mobile-weather-home small, .mobile-sync-home small { font-size: .62rem; color: #5f6e65; font-weight: 700; }
  section[data-panel="dashboard"] > .panel-header { display: none; }
  .dashboard-command-bar { display: none; }
  .mobile-home-stack { display: grid; gap: 1rem; margin-bottom: 1rem; position: relative; }
  .mobile-summary-head { display: flex; justify-content: space-between; align-items: center; }
  .mobile-summary-head h4 { margin: 0; font-size: 1.35rem; }
  .mobile-summary-head button { border: 0; background: transparent; color: #0f766e; font-weight: 900; }
  .mobile-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: .65rem; }
  .mobile-summary-grid button { border: 1px solid rgba(31,45,36,.10); background: rgba(255,255,255,.9); border-radius: 1rem; padding: .7rem .35rem; display: grid; justify-items: center; gap: .15rem; box-shadow: 0 14px 32px rgba(30,64,50,.08); }
  .mobile-summary-grid img { width: 1.55rem; height: 1.55rem; object-fit: contain; }
  .mobile-summary-grid span { font-size: .7rem; color: #486057; font-weight: 900; }
  .mobile-summary-grid strong { font-size: 1.75rem; line-height: 1.05; color: #0f8f7f; }
  .mobile-summary-grid small { color: #4d5d55; font-weight: 800; }
  .mobile-urgent-card, .mobile-quick-card { border: 1px solid rgba(31,45,36,.10); background: rgba(255,255,255,.92); border-radius: 1.25rem; padding: 1rem; box-shadow: 0 18px 42px rgba(30,64,50,.09); }
  .mobile-urgent-card > div { display: flex; align-items: center; gap: .75rem; margin-bottom: .55rem; }
  .mobile-urgent-card strong { font-size: 1.1rem; }
  .mobile-urgent-card span { background: #ffe2e2; color: #cc3333; padding: .2rem .55rem; border-radius: 999px; font-weight: 900; }
  .mobile-urgent-card button { width: 100%; display: flex; justify-content: space-between; border: 0; border-top: 1px solid rgba(31,45,36,.08); background: transparent; padding: .7rem 0; font-weight: 800; text-align: left; }
  .mobile-urgent-card b { color: #c26100; }
  .mobile-quick-card { display: grid; grid-template-columns: 4rem 1fr auto; align-items: center; gap: .8rem; }
  .mobile-quick-card img { width: 3.5rem; height: 3.5rem; object-fit: contain; border-radius: .8rem; background: #eef8f5; }
  .mobile-quick-card strong, .mobile-quick-card span { display: block; }
  .mobile-quick-card span { color: #647466; font-size: .86rem; }
  .mobile-quick-fab { position: fixed; right: 1.2rem; bottom: 5.8rem; z-index: 31; width: 6.8rem; height: 6.8rem; border: 0; border-radius: 999px; color: #fff; background: linear-gradient(135deg,#0f9f8f,#087064); display: grid; place-items: center; align-content: center; font-weight: 900; box-shadow: 0 22px 45px rgba(0,100,84,.28); }
  .mobile-quick-fab span { font-size: 2.4rem; line-height: 1; }
  .today-mission-card::before { content: none !important; }
  .mock-map-card::before { content: none !important; }
  .dashboard-mockup-shell::before { content: none !important; }
  .dashboard-mockup-shell { padding-bottom: 7rem; }
  .mobile-bottom-nav { z-index: 30; }
}

/* Final dashboard parity adjustments with functional layout preserved. */
.sun-icon { color: #f5a623; font-size: .8rem; font-weight: 900; letter-spacing: .04em; }
@media (min-width: 901px) {
  .dashboard-command-bar { padding-bottom: .75rem; }
  section[data-panel="dashboard"] { padding-top: 1.05rem; }
  .dashboard-mockup-shell { grid-template-columns: minmax(0, 1.38fr) minmax(18rem, .92fr); }
  .mock-map-canvas { min-height: clamp(18rem, 28vw, 22rem) !important; }
  .today-mission-card { padding-block: .95rem; }
  .mission-timeline { gap: .5rem; }
  .mission-timeline li { padding-bottom: .5rem; }
  .dashboard-alert-card { min-height: 5.2rem !important; padding: .8rem; }
}
@media (max-width: 767px) {
  .mobile-topbar { grid-template-columns: auto 1fr auto auto; }
  .mobile-brand-home { display: inline-flex !important; align-items: center; font-weight: 900; }
  .mobile-weather-home, .mobile-sync-home { display: grid !important; }
  .mobile-menu-btn { width: 3rem; min-width: 3rem; }
}

/* Final review fixes: bottom nav active state, mobile order, and desktop alert detail. */
.dashboard-mockup-shell { grid-template-areas: "map missions" "ocr region" "ocr order" "ocr pesticide"; }
.pesticide-alert-card { grid-area: pesticide; }
.dashboard-alert-card button { width: fit-content; margin-top: .45rem; border: 0; border-radius: 999px; padding: .35rem .75rem; color: #0f6f5c; background: rgba(15, 143, 127, .10); font-weight: 900; }
@media (max-width: 767px) {
  .mobile-bottom-nav-btn--fab { transform: none !important; width: auto !important; min-height: 48px !important; border-radius: 16px !important; background: transparent !important; color: inherit !important; box-shadow: none !important; }
  .mobile-bottom-nav-btn--fab img { filter: none !important; }
  .mobile-after-map-stack { display: grid; gap: 1rem; margin-top: -6rem; padding-bottom: 7rem; }
  .dashboard-mockup-shell { grid-template-areas: "map"; padding-bottom: 0 !important; }
  .dashboard-mockup-shell .today-mission-card, .dashboard-mockup-shell .dashboard-alert-card { display: none !important; }
  .mock-map-card { grid-area: map; }
  .mock-map-card .mock-card-head h4::before { content: "\4eca\65e5\306e\4f5c\696d\30de\30c3\30d7 "; }
  .mobile-bottom-nav-btn[data-tab="dashboard"].is-active { background: rgba(20, 184, 166, 0.14) !important; color: #0f766e !important; }
}
