/* extracted from mock page styles */

/* --- cultivation/dashboard.html --- */
.dash-period {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.dash-period-btn {
  min-width: 72px;
  padding: 6px 16px;
  border: none;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-jp);
  cursor: pointer;
  background: #e8f5ee;
  color: var(--color-main);
}
.dash-period-btn.active {
  background: var(--color-accent);
  color: #fff;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.work-card {
  background: #fff;
  border: none;
  border-radius: 10px;
  padding: 14px 12px 16px;
}
.work-card-title {
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  padding: 2px 8px 12px;
  color: var(--color-main);
}
.work-ab {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.work-col {
  background: #f3f4f3;
  padding: 0;
  border: none;
  border-radius: 8px;
  overflow: hidden;
}
.work-col-h {
  background: var(--color-main);
  color: #fff;
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  padding: 8px 0 9px;
  border-radius: 8px 8px 0 0;
}
.work-col-b {
  padding: 12px 6px 8px;
  background: #f3f4f3;
  text-align: center;
}
.work-metric-group {
  padding: 2px 4px 8px;
}
.work-metric-group .work-metric {
  padding: 6px 4px 8px;
}
.work-col-b > .work-metric {
  border-top: 1px solid #e1e3e1;
  padding: 12px 6px 13px;
}
.work-metric span {
  display: block;
  font-size: 12px;
  color: var(--color-main);
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
}
.work-metric-frac span {
  color: #5c5c5c;
  font-size: 11px;
}
.work-metric strong {
  display: block;
  font-size: 26px;
  font-weight: 800;
  color: #2d2d2d;
  line-height: 1.15;
}
.work-frac {
  display: block;
  font-weight: 800;
  color: #2d2d2d;
  line-height: 1.15;
}
.work-frac b {
  font-size: 26px;
  font-weight: 800;
}
.work-frac i {
  font-size: 16px;
  font-style: normal;
  font-weight: 700;
  color: #2d2d2d;
}
.work-frac.hit b { color: #c5a028; }

.bottom-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 14px;
}
@media (max-width: 1100px) {
  .bottom-grid { grid-template-columns: 1fr; }
}
.panel {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 12px 14px 14px;
}
.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.panel-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}
.sku-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.sku-tab {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid #ddd;
  background: #fff;
  color: #555;
  cursor: pointer;
  font-family: var(--font-jp);
  text-decoration: none;
  display: inline-block;
}
.sku-tab.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

.harvest-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-bottom: 14px;
}
.harvest-table th {
  background: var(--color-main);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 7px 8px;
  text-align: center;
  white-space: nowrap;
}
.harvest-table td {
  padding: 8px;
  text-align: center;
  border-bottom: 1px solid #f0f0f0;
  font-weight: 600;
}
.harvest-table .row-lab {
  color: var(--color-main);
  background: #e8f5ee;
  font-weight: 700;
}
.harvest-table .total-row td {
  background: #e8f5ee;
  font-weight: 700;
}

.prog-block { margin-top: 4px; }
.prog-block h3 {
  margin: 0 0 10px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  background: var(--color-main);
  color: #fff;
  border-radius: 6px 6px 0 0;
}
.prog-row {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.prog-row b { font-size: 13px; color: var(--color-main); }
.prog-track {
  position: relative;
  height: 22px;
  background: #e8eaed;
  border-radius: 3px;
  display: flex;
  overflow: hidden;
}
.prog-fill { height: 100%; background: var(--color-main); flex: none; }
.prog-over { height: 100%; background: var(--color-accent); flex: none; }
.prog-pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding-left: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 3px rgba(0,0,0,.35);
  pointer-events: none;
}

.sort-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.sort-empty { font-size: 13px; color: #6b7280; padding: 12px 4px; }
.sort-card {
  background: #fff;
  border: 1px solid #dce3e0;
  border-radius: 8px;
  overflow: hidden;
}
.sort-card-h {
  background: var(--color-main);
  color: #fff;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 6px 7px;
  line-height: 1.3;
  border-radius: 8px 8px 0 0;
}
.sort-card-h small {
  display: block;
  font-size: 10px;
  font-weight: 600;
  opacity: .85;
  margin-top: 2px;
}
.sort-card-b {
  padding: 8px 8px 10px;
  background: #fff;
}
.sort-metric { margin-bottom: 7px; }
.sort-metric span {
  display: block;
  font-size: 10px;
  color: #6b7280;
  font-weight: 600;
}
.sort-metric strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
}
.sort-metric strong.hit { color: var(--color-accent); }

/* --- cultivation/progress.html --- */
.progress-filter-panel {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px 16px 12px;
  margin-bottom: 14px;
}
.progress-filter-panel .filter-heading {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 10px;
}
.filter-row {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px 14px;
}
.filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.filter-field label {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}
.filter-field .form-control { min-width: 148px; }
.filter-date-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-date-refresh {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #fff;
  color: #4b5563;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-date-refresh:hover { background: #f9fafb; border-color: #9ca3af; }
.zone-toggle { display: flex; gap: 6px; }
.zone-toggle .tag-zone {
  min-width: 40px;
  justify-content: center;
  padding: 6px 14px;
  font-size: 13px;
}
.filter-actions { display: flex; align-items: center; gap: 8px; padding-bottom: 1px; }
.display-order-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 12px;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}
.display-order-row .form-control { width: 120px; }

.lane-grid-page { margin-bottom: 20px; }
.lane-block-wrap {
  margin-bottom: 12px;
  border: 1px solid #cfd4da;
  border-radius: 4px;
  background: #fff;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.lane-block-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  font-size: 11px;
  table-layout: fixed;
}
.lane-block-table th,
.lane-block-table td {
  border: 1px solid #d1d5db;
  padding: 4px 3px;
  vertical-align: middle;
  line-height: 1.25;
}
.lane-block-table .corner-cell,
.lane-block-table tbody th.scope-row {
  width: 76px;
  background: #eceff1;
  font-weight: 600;
  color: #374151;
  text-align: left;
  padding: 5px 8px;
  white-space: nowrap;
}
.lane-block-table .lane-head {
  background: #455a64;
  color: #fff;
  font-weight: 700;
  text-align: center;
  padding: 6px 2px;
  font-variant-numeric: tabular-nums;
}
.lane-head-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.lane-multi-ico {
  display: inline-flex;
  color: #fbbf24;
  line-height: 0;
}
.lane-block-table tbody td.data-cell {
  text-align: center;
  background: #fff;
  overflow: hidden;
}
.lane-block-table tbody td.data-cell.col-tint { background: #f3faf4; }
.lane-block-table tbody td.data-cell.cell-empty { color: #d1d5db; }
.lane-block-table tbody td.data-cell.is-done { background: #e5e7eb; }
.lane-block-table tbody td.data-cell.is-done.col-tint { background: #e2e8e4; }

.cell-elapsed { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 12px; }
.cell-elapsed.is-alert {
  background: #ef4444 !important;
  color: #fff;
}
.cell-elapsed .el-stack { display: flex; flex-direction: column; gap: 1px; line-height: 1.15; }

.cell-worker { font-size: 10px; line-height: 1.3; white-space: normal; word-break: break-all; }
.cell-time { font-variant-numeric: tabular-nums; white-space: nowrap; }

.cell-prog {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 36px;
  padding: 3px 2px;
}
.cell-prog-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #111;
}
.cell-prog-label {
  font-size: 9px;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
}
.ico-check { color: #9ca3af; }

/* --- cultivation/pest.html --- */
.panel {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 14px 16px 16px;
  margin-bottom: 16px;
}
.panel-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
}
.filter-panel { padding-top: 10px; }
.filter-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 4px;
}
.filter-summary::-webkit-details-marker { display: none; }
.filter-summary::before {
  content: '▶';
  font-size: 10px;
  color: #6b7280;
  transition: transform .15s;
}
.filter-panel[open] .filter-summary { margin-bottom: 12px; }
.filter-panel[open] .filter-summary::before { transform: rotate(90deg); }
.filter-summary-meta {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
}
.filter-block { margin-bottom: 14px; }
.filter-block:last-child { margin-bottom: 0; }
.filter-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-main);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  margin-right: 6px;
}
.filter-heading {
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 8px;
}
.filter-row {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px 14px;
}
.filter-field { display: flex; flex-direction: column; gap: 4px; }
.filter-field label { font-size: 12px; font-weight: 600; color: #374151; }
.filter-field .form-control { min-width: 140px; }
.radio-row { display: flex; gap: 16px; align-items: center; margin-bottom: 8px; }
.radio-row label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; cursor: pointer; }
.filter-actions { display: flex; gap: 8px; margin-top: 12px; }

.summary-wrap {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 14px;
  margin-bottom: 16px;
}
@media (max-width: 900px) { .summary-wrap { grid-template-columns: 1fr; } }
.summary-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 700px) { .summary-cards { grid-template-columns: 1fr; } }
.summary-card {
  border-radius: 8px;
  padding: 16px 14px;
  border: 1px solid transparent;
}
.summary-card .label { font-size: 12px; font-weight: 700; margin-bottom: 6px; }
.summary-card .value { font-size: 28px; font-weight: 700; line-height: 1.1; }
.summary-card .sub { font-size: 11px; margin-top: 6px; opacity: .8; }
.summary-card.total { background: #e8f1fb; border-color: #c5d8ef; }
.summary-card.total .value { color: #1d4ed8; }
.summary-card.disease { background: #fde8e8; border-color: #f3c6c6; }
.summary-card.disease .value { color: #c0392b; }
.summary-card.pest { background: #fff1e4; border-color: #f5d2b3; }
.summary-card.pest .value { color: #d35400; }

.pest-list {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 10px 12px;
  max-height: 168px;
  overflow: auto;
}
.pest-list-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 3px 0;
}
.pest-list-item input { accent-color: var(--color-main); }
.pest-list-item .cnt { margin-left: auto; color: #6b7280; font-weight: 700; }

.chart-wrap { height: 220px; margin-bottom: 12px; }
.heatmap-wrap { overflow-x: auto; border: 1px solid var(--color-border); border-radius: 6px; }
.heatmap-table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 640px; font-size: 12px; }
.heatmap-table th, .heatmap-table td {
  border-bottom: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  padding: 6px 4px;
  text-align: center;
}
.heatmap-table th:first-child, .heatmap-table td:first-child {
  text-align: center;
  font-weight: 700;
  background: #fff;
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 36px;
  border-right: 2px solid var(--color-border);
}
.heatmap-table thead th { background: #2d3436; color: #fff; font-weight: 600; }
.hcell {
  min-width: 40px;
  height: 32px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  font-weight: 700;
  font-size: 12px;
  border: 1px solid rgba(0,0,0,.05);
}
.hcell.heat-1, .heat-1 { background: #fdecea; }
.hcell.heat-2, .heat-2 { background: #f5b7b1; }
.hcell.heat-3, .heat-3 { background: #e74c3c; color: #fff; }
.hcell.heat-4, .heat-4 { background: #c0392b; color: #fff; }
.hcell.heat-5, .heat-5 { background: #7b1e1e; color: #fff; }
.equip-heat .hcell.heat-1, .equip-heat .heat-1 { background: #f3e8fb; color: inherit; }
.equip-heat .hcell.heat-2, .equip-heat .heat-2 { background: #d6b8ec; color: inherit; }
.equip-heat .hcell.heat-3, .equip-heat .heat-3 { background: #bb8fce; color: #fff; }
.equip-heat .hcell.heat-4, .equip-heat .heat-4 { background: #8e44ad; color: #fff; }
.equip-heat .hcell.heat-5, .equip-heat .heat-5 { background: #6c3483; color: #fff; }
.equip-heat .lcell.both {
  background: linear-gradient(90deg, #8e44ad 50%, #e8daef 50%);
  border-color: #6c3483;
}
.heatmap-legend { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 11px; color: #666; }
.heatmap-legend .bar { display: flex; height: 12px; width: 140px; border-radius: 2px; overflow: hidden; border: 1px solid #ddd; }
.heatmap-legend .bar span { flex: 1; }

.week-panel { padding-top: 12px; }
.week-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-main);
}
.week-summary::-webkit-details-marker { display: none; }
.week-collapse-btn {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-main);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.week-collapse-btn svg {
  width: 10px;
  height: 10px;
  display: block;
  transition: transform .15s;
}
.week-panel:not([open]) .week-collapse-btn svg { transform: rotate(180deg); }
.week-period {
  margin: 10px 0 14px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}
.week-grid-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
.week-card {
  border: 1px solid #d5d8dc;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
}
.week-card-head {
  position: relative;
  background: #2d3436;
  color: #fff;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  padding: 8px 40px;
}
.zoom-btn {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border: none;
  background: var(--color-accent);
  border-radius: 3px;
  cursor: pointer;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.zoom-btn:hover { filter: brightness(1.05); }
.week-card-body { padding: 8px 10px 10px; }
.week-xlab {
  text-align: center;
  font-size: 11px;
  color: #9ca3af;
  margin: 2px 0;
}
.week-xticks {
  display: flex;
  margin-left: 0;
  overflow: visible;
  font-size: 9px;
  color: #9ca3af;
  line-height: 1.1;
  user-select: none;
}
.week-xticks span {
  flex: none;
  position: relative;
  height: 1.2em;
  text-align: center;
  overflow: visible;
  white-space: nowrap;
}
.week-xticks em {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  font-style: normal;
  white-space: nowrap;
}
.week-canvas-row { display: flex; align-items: stretch; }
.week-yside {
  width: 28px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.week-tick-spacer { height: 1.2em; flex-shrink: 0; }
.week-yside .week-ycol { flex: 1; min-height: 0; width: auto; }
.week-xscroll {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
}
.week-ycol {
  width: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: stretch;
}
.week-ylab {
  font-size: 11px;
  color: #9ca3af;
  line-height: 1.25;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 14px;
}
.week-yticks {
  width: 14px;
  display: flex;
  flex-direction: column;
  font-size: 8px;
  color: #9ca3af;
  line-height: 1;
  user-select: none;
}
.week-yticks span {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 1px;
}
.week-canvas-wrap {
  position: relative;
  overflow: visible;
  background: #fff;
}
.week-tip {
  position: absolute;
  z-index: 4;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  padding: 7px 10px;
  font-size: 11px;
  line-height: 1.5;
  color: #374151;
  box-shadow: 0 3px 10px rgba(0,0,0,.12);
  pointer-events: none;
  white-space: nowrap;
  display: none;
}
.week-tip.is-on { display: block; }
.week-tip::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -5px;
  margin-left: -5px;
  border: 5px solid transparent;
  border-top-color: #fff;
  border-bottom: 0;
  filter: drop-shadow(0 1px 0 #d1d5db);
}

.layout-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 14px;
}
.layout-status {
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.7;
  min-width: 260px;
}
.layout-status-title { font-weight: 700; margin-bottom: 4px; }
.tag-disease, .tag-pest {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 700;
  font-size: 12px;
}
.tag-disease { background: #fde8e8; color: #c0392b; }
.tag-pest { background: #fff1e4; color: #d35400; }
.layout-pest-pop { position: relative; }
.layout-pest-toggle {
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.layout-pest-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 6;
  width: 220px;
  max-height: 260px;
  overflow: auto;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 10px;
  box-shadow: 0 4px 14px rgba(0,0,0,.1);
  display: none;
}
.layout-pest-pop.is-open .layout-pest-menu { display: block; }
.layout-board {
  background: #eceff1;
  border-radius: 6px;
  padding: 16px 14px;
  overflow-x: auto;
}
.layout-block {
  display: flex;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
}
.layout-sidelabel {
  width: 26px;
  background: #2d3436;
  color: #fff;
  font-weight: 800;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  flex-shrink: 0;
}
.layout-map-body {
  min-width: 0;
  overflow-x: auto;
}
.layout-cells,
.layout-nums {
  display: grid;
  gap: 2px;
  width: max-content;
}
.layout-nums {
  margin: 6px 0 0;
  font-size: 10px;
  color: #2d3436;
  text-align: center;
  line-height: 1.1;
}
.layout-nums span {
  position: relative;
  height: 1.2em;
  min-width: 0;
  overflow: visible;
  white-space: nowrap;
}
.layout-nums em {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  font-style: normal;
  white-space: nowrap;
}
.lcell {
  box-sizing: border-box;
  width: 18px;
  height: 16px;
  min-width: 0;
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 3px;
}
.lcell.is-gap { background: transparent; border-style: dashed; opacity: .35; }
.lcell.disease { background: #e74c3c; border-color: #c0392b; }
.lcell.pest { background: #f39c12; border-color: #d68910; }
.lcell.both {
  background: linear-gradient(90deg, #e74c3c 50%, #f39c12 50%);
  border-color: #c0392b;
}
.layout-pest-menu.pest-list {
  max-height: 280px;
  padding: 6px 8px;
}
.layout-pest-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 5px 2px;
  border-bottom: 1px solid #f3f4f6;
}
.layout-pest-item:last-child { border-bottom: 0; }
.layout-pest-item .cnt { margin-left: auto; color: #6b7280; font-weight: 700; }
.layout-pest-item input { accent-color: var(--color-main); }

/* --- cultivation/incidents.html --- */
.filter-heading { font-size:13px; font-weight:700; margin:0 0 8px; }
.filter-row { display:flex; align-items:flex-end; flex-wrap:wrap; gap:10px 14px; }
.filter-field { display:flex; flex-direction:column; gap:4px; }
.filter-field label { font-size:12px; font-weight:600; color:#374151; }
.filter-field .form-control { min-width:140px; }
.chk-group { display:flex; gap:10px; align-items:center; flex-wrap:wrap; min-height:34px; }
.chk-item { display:inline-flex; gap:5px; align-items:center; font-size:13px; font-weight:500; cursor:pointer; }
.chk-item input { accent-color:var(--color-main); }

.summary-cards { display:grid; grid-template-columns:repeat(3, 1fr); gap:10px; margin-bottom:16px; }
@media (max-width:700px) { .summary-cards { grid-template-columns:1fr; } }
.summary-card { border-radius:8px; padding:16px 14px; border:1px solid transparent; }
.summary-card .label { font-size:12px; font-weight:700; margin-bottom:6px; }
.summary-card .value { font-size:28px; font-weight:700; line-height:1.1; }
.summary-card .sub { font-size:11px; margin-top:6px; opacity:.8; }
.summary-card.total { background:#e8f1fb; border-color:#c5d8ef; }
.summary-card.total .value { color:#1d4ed8; }
.summary-card.confirmed { background:#e8f5ee; border-color:#b7e0c6; }
.summary-card.confirmed .value { color:#016833; }
.summary-card.pending { background:#f3e8fb; border-color:#d6b8ec; }
.summary-card.pending .value { color:#8e44ad; }

.heatmap-wrap { overflow-x:auto; border:1px solid var(--color-border); border-radius:6px; }
.heatmap-table { border-collapse:separate; border-spacing:0; width:100%; min-width:640px; font-size:12px; }
.heatmap-table th, .heatmap-table td {
  border-bottom:1px solid var(--color-border);
  border-right:1px solid var(--color-border);
  padding:6px 4px;
  text-align:center;
}
.heatmap-table th:first-child, .heatmap-table td:first-child {
  text-align:center;
  font-weight:700;
  background:#fff;
  position:sticky;
  left:0;
  z-index:2;
  min-width:36px;
  border-right:2px solid var(--color-border);
}
.heatmap-table thead th { background:#2d3436; color:#fff; font-weight:600; }
.hcell {
  min-width:40px;
  height:32px;
  border-radius:3px;
  display:flex;
  align-items:center;
  justify-content:center;
  margin:0 auto;
  font-weight:700;
  font-size:12px;
  border:1px solid rgba(0,0,0,.05);
}
.heatmap-legend { display:flex; align-items:center; gap:8px; margin-top:10px; font-size:11px; color:#666; }
.heatmap-legend .bar { display:flex; height:12px; width:140px; border-radius:2px; overflow:hidden; border:1px solid #ddd; }
.heatmap-legend .bar span { flex:1; }

.layout-toolbar { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin:12px 0 14px; }
.layout-status {
  background:#fff; border:1px solid #d1d5db; border-radius:8px;
  padding:10px 14px; font-size:13px; line-height:1.7; min-width:260px;
}
.layout-status-title { font-weight:700; margin-bottom:4px; }
.tag-confirmed, .tag-pending {
  display:inline-block; padding:1px 6px; border-radius:3px; font-weight:700; font-size:12px;
}
.tag-confirmed { background:#e8f5ee; color:#016833; }
.tag-pending { background:#f3e8fb; color:#8e44ad; }
.layout-board { background:#eceff1; border-radius:6px; padding:16px 14px; overflow-x:auto; }
.layout-block { display:flex; align-items:stretch; gap:8px; min-width:0; }
.layout-sidelabel {
  width:26px; background:#2d3436; color:#fff; font-weight:800; font-size:20px;
  display:flex; align-items:center; justify-content:center; border-radius:2px; flex-shrink:0;
}
.layout-map-body { min-width:0; overflow-x:auto; }
.layout-cells, .layout-nums { display:grid; gap:2px; width:max-content; }
.layout-nums {
  margin:6px 0 0; font-size:10px; color:#9ca3af; text-align:center; line-height:1.1;
}
.layout-nums span {
  position:relative; height:1.2em; min-width:0; overflow:visible; white-space:nowrap;
}
.layout-nums em {
  position:absolute; left:50%; top:0; transform:translateX(-50%); font-style:normal; white-space:nowrap;
}
.lcell { box-sizing:border-box; width:18px; height:16px; min-width:0; border:1px solid #d1d5db; background:#fff; border-radius:3px; }
.lcell.equipment { background:#8e44ad; border-color:#6c3483; }
.lcell.pending { background:#e8daef; border-color:#9b59b6; }

.photo-thumb { width:80px; height:60px; object-fit:cover; border-radius:4px; border:1px solid #ddd; background:#f0f0f0; display:flex; align-items:center; justify-content:center; font-size:22px; color:#ccc; }
.status-badge { padding:3px 8px; border-radius:10px; font-size:11px; font-weight:600; }
.status-report { background:#e3f2fd; color:#1565c0; }
.status-confirmed { background:#e8f5e9; color:#2e7d32; }
.comment-text { font-size:12px; color:#444; max-width:200px; line-height:1.4; }
.highlight-link { color:var(--color-accent); font-weight:600; font-size:12px; text-decoration:none; }
.highlight-link:hover { text-decoration:underline; }
.records-count { font-size:13px; color:#666; text-align:center; margin-bottom:12px; }
.records-count span { font-weight:700; color:var(--color-text); }

.week-panel { padding-top: 12px; }
.week-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-main);
}
.week-summary::-webkit-details-marker { display: none; }
.week-collapse-btn {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-main);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.week-collapse-btn svg {
  width: 10px;
  height: 10px;
  display: block;
  transition: transform .15s;
}
.week-panel:not([open]) .week-collapse-btn svg { transform: rotate(180deg); }
.week-period {
  margin: 10px 0 14px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}
.week-grid-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
.week-card {
  border: 1px solid #d5d8dc;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
}
.week-card-head {
  position: relative;
  background: #2d3436;
  color: #fff;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  padding: 8px 40px;
}
.zoom-btn {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border: none;
  background: var(--color-accent);
  border-radius: 3px;
  cursor: pointer;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.zoom-btn:hover { filter: brightness(1.05); }
.week-card-body { padding: 8px 10px 10px; }
.week-xlab {
  text-align: center;
  font-size: 11px;
  color: #9ca3af;
  margin: 2px 0;
}
.week-xticks {
  display: flex;
  margin-left: 0;
  overflow: visible;
  font-size: 9px;
  color: #9ca3af;
  line-height: 1.1;
  user-select: none;
}
.week-xticks span {
  flex: none;
  position: relative;
  height: 1.2em;
  text-align: center;
  overflow: visible;
  white-space: nowrap;
}
.week-xticks em {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  font-style: normal;
  white-space: nowrap;
}
.week-canvas-row { display: flex; align-items: stretch; }
.week-yside {
  width: 28px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.week-tick-spacer { height: 1.2em; flex-shrink: 0; }
.week-yside .week-ycol { flex: 1; min-height: 0; width: auto; }
.week-xscroll {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
}
.week-ycol {
  width: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: stretch;
}
.week-ylab {
  font-size: 11px;
  color: #9ca3af;
  line-height: 1.25;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 14px;
}
.week-yticks {
  width: 14px;
  display: flex;
  flex-direction: column;
  font-size: 8px;
  color: #9ca3af;
  line-height: 1;
  user-select: none;
}
.week-yticks span {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 1px;
}
.week-canvas-wrap {
  position: relative;
  overflow: visible;
  background: #fff;
}
.week-tip {
  position: absolute;
  z-index: 4;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  padding: 7px 10px;
  font-size: 11px;
  line-height: 1.5;
  color: #374151;
  box-shadow: 0 3px 10px rgba(0,0,0,.12);
  pointer-events: none;
  white-space: nowrap;
  display: none;
}
.week-tip.is-on { display: block; }
.week-tip::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -5px;
  margin-left: -5px;
  border: 5px solid transparent;
  border-top-color: #fff;
  border-bottom: 0;
  filter: drop-shadow(0 1px 0 #d1d5db);
}

/* --- cultivation/records.html --- */
.filter-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 12px;
}
.filter-heading::before {
  content: '';
  width: 4px;
  height: 16px;
  background: var(--color-main);
  border-radius: 2px;
}
.filter-row {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px 14px;
}
.filter-field { display: flex; flex-direction: column; gap: 5px; }
.filter-field > span,
.filter-field > label {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}
.filter-field .form-control { min-width: 132px; }
.filter-date-range { display: flex; align-items: center; gap: 6px; }
.filter-date-range .form-control { min-width: 190px; }
.filter-radios {
  display: flex;
  gap: 14px;
  font-size: 13px;
  align-items: center;
  min-height: 34px;
}
.filter-radios label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-weight: 500;
}
.zone-toggle { display: flex; gap: 6px; }
.zone-toggle .tag-zone {
  min-width: 40px;
  justify-content: center;
  padding: 6px 14px;
  font-size: 13px;
}
.filter-actions { display: flex; gap: 8px; padding-bottom: 1px; }
.user-filter-row .filter-field {
  flex: 1 1 150px;
  max-width: 200px;
}
.btn-outline-main {
  background: #fff;
  border: 1px solid var(--color-main);
  color: var(--color-main);
}
.btn-outline-main:hover { background: var(--color-main-light); }

.rec-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin: 4px 0 12px;
}
.rec-controls-left,
.rec-controls-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
}
.rec-controls-left { margin-right: auto; }
.rec-modal {
  max-width: 760px;
}
.rec-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}
.rec-form-wide { grid-column: span 2; }
.rec-note {
  min-height: 84px;
  resize: vertical;
}
.rec-request-note {
  margin-bottom: 16px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff7ed;
  border: 1px solid #fdba74;
}
.rec-request-note strong {
  display: block;
  font-size: 12px;
  color: #9a3412;
}
.rec-request-note p {
  margin: 4px 0 0;
  font-size: 13px;
  color: #7c2d12;
}
.rec-diff {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}
.rec-diff-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: #374151;
}
.rec-diff-item {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.rec-diff-meta {
  margin: 0 0 8px;
  font-size: 12px;
  color: #4b5563;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}
.rec-diff-row {
  display: grid;
  grid-template-columns: 88px 1fr 16px 1fr;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  margin-top: 4px;
}
.rec-diff-label { color: #6b7280; font-weight: 600; }
.rec-diff-from { color: #9a3412; }
.rec-diff-arrow { color: #9ca3af; text-align: center; }
.rec-diff-to { color: #166534; font-weight: 600; }
.revision-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fde8e8;
  color: #b71c1c;
  font-size: 12px;
  font-weight: 700;
}
.sidebar-nav a .nav-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #c62828;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.rec-controls label { font-size: 12px; font-weight: 600; color: #374151; }
.rec-controls .form-control { width: 110px; }

.rec-table th { text-align: center; white-space: nowrap; }
.rec-table th .th-sort { display: block; color: inherit; }
.rec-table td { text-align: center; font-size: 12px; vertical-align: middle; }
.rec-table td.col-name { text-align: left; }
.rec-table tbody tr:nth-child(even) td { background: #fafafa; }
.rec-table tbody tr.record-row--correction td { background: #fde8e8; }
.rec-table tbody tr.record-row--correction:hover td { background: #fcdada; }
.cell-stack {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.3;
}
.cell-stack span:last-child { color: #4b5563; }

.cat-pill {
  display: inline-block;
  min-width: 44px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}
.cat-高所 { background: #bbdefb; color: #0d47a1; }
.cat-低所 { background: #fff59d; color: #f57f17; }
.cat-作替え { background: #e1bee7; color: #4a148c; }
.cat-作付け { background: #ffe0b2; color: #e65100; }
.cat-選果 { background: #c8e6c9; color: #1b5e20; }
.cat-その他 { background: #e0e0e0; color: #424242; }

.status-ico {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}
.status-ico.ok { background: #2e7d32; color: #fff; }
.status-ico.warn { background: #ef6c00; color: #fff; }

.icon-btn {
  width: 32px;
  height: 28px;
  padding: 0;
  justify-content: center;
  position: relative;
}
.icon-btn-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.icon-btn-del {
  background: #fff;
  border: 1px solid #f5c2c2;
  color: #c62828;
}
.icon-btn-del:hover { background: #ffebee; }

/* --- cultivation/weekly-plan.html --- */
.weight-info { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 12px 16px; margin-bottom: 16px; }
.weight-title { font-size: 13px; font-weight: 700; background: var(--color-main); color: white; padding: 6px 12px; border-radius: var(--radius-sm); margin-bottom: 10px; display: inline-block; }
.weight-items { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; }
.weight-item { display: flex; align-items: center; gap: 6px; }
.weight-item strong { color: var(--color-main); }
.week-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.week-range { font-size: 13px; font-weight: 600; color: #444; }
.week-nav-btn { background: var(--color-main); color: white; border: none; border-radius: 50%; width: 28px; height: 28px; font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.plan-table-wrap { overflow-x: auto; }
.plan-table { border-collapse: collapse; width: 100%; font-size: 12px; min-width: 900px; }
.plan-table th { background: #2d3436; color: white; padding: 8px 10px; text-align: center; font-size: 12px; white-space: nowrap; }
.plan-table td { padding: 6px 8px; border: 1px solid #e0e0e0; vertical-align: middle; font-size: 12px; }
.plan-table tr.plan-sub-row td { background: #fafafa; }
.row-label { background: var(--color-main-light) !important; font-weight: 600; color: var(--color-main); }
.sub-label { color: #777; font-size: 11px; }
.cell-val-accent { color: var(--color-accent); font-weight: 700; }
.cell-val-light { color: #aaa; }
.zone-header td { background: var(--color-main) !important; color: white; font-weight: 700; font-size: 13px; }
.today-col { background: #fff9e6 !important; }
/* 選択日のヘッダー：背景が薄色でも th の白文字が残らないようコントラストを確保 */
.plan-table thead th.today-col {
  background: #e0f2fe !important;
  color: #0c4a6e !important;
  font-weight: 700;
}
.action-btns-row { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.nav-btn-double { background: #ddd; border: none; padding: 6px 10px; border-radius: 4px; cursor: pointer; font-size: 12px; text-decoration: none; color: #333; display: inline-flex; align-items: center; justify-content: center; }
.plan-table input.plan-qty {
  width: 68px;
  max-width: 100%;
  text-align: right;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 12px;
}
.plan-vis-cell { text-align: center; overflow: visible; }
.plan-vis-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  min-height: 22px;
}
.plan-vis-switch > input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.plan-vis-switch .wm-switch,
.plan-vis-switch .plan-vis-text,
.plan-vis-switch .plan-vis-tip { pointer-events: none; }
.plan-vis-switch:has(input:checked) .wm-switch { background: #2e7d32; }
.plan-vis-switch:has(input:checked) .wm-switch i { transform: translateX(20px); }
.plan-vis-text {
  font-size: 11px;
  font-weight: 600;
  color: #888;
  white-space: nowrap;
}
.plan-vis-text::before { content: '外す'; }
.plan-vis-switch:has(input:checked) .plan-vis-text { color: #2e7d32; }
.plan-vis-switch:has(input:checked) .plan-vis-text::before { content: '集計する'; }
.plan-vis-tip {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 8;
  width: max-content;
  max-width: 16em;
  padding: 6px 8px;
  border-radius: 6px;
  background: #1f2937;
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
  white-space: normal;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
}
.plan-vis-tip::after {
  content: '';
  position: absolute;
  bottom: 100%;
  right: 18px;
  border: 5px solid transparent;
  border-bottom-color: #1f2937;
}
.plan-vis-switch:hover .plan-vis-tip,
.plan-vis-switch:focus-within .plan-vis-tip { display: block; }

/* --- cultivation/harvest-plan.html --- */
.week-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.week-range { font-size: 13px; font-weight: 600; color: #444; }
.nav-btn-double { background: #ddd; border: none; padding: 6px 10px; border-radius: 4px; cursor: pointer; font-size: 12px; }
.plan-table-wrap { overflow-x: auto; }
.plan-table { border-collapse: collapse; width: 100%; font-size: 12px; min-width: 900px; }
.plan-table th { background: #2d3436; color: white; padding: 8px 10px; text-align: center; font-size: 12px; white-space: nowrap; }
.plan-table td { padding: 6px 8px; border: 1px solid #e0e0e0; vertical-align: middle; font-size: 12px; }
.row-label { background: var(--color-main-light) !important; font-weight: 600; color: var(--color-main); }
.sub-label { color: #777; font-size: 11px; }
.today-col { background: #fff9e6 !important; }
/* 選択日のヘッダー：薄背景でも曜日が読めるようコントラストを確保（週間計画と同様） */
.plan-table thead th.today-col {
  background: #e0f2fe !important;
  color: #0c4a6e !important;
  font-weight: 700;
}
.cell-val-accent { color: var(--color-accent); font-weight: 700; }

/* --- cultivation/users.html --- */
.search-bar { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.search-label { font-size:12px; font-weight:600; color:#555; white-space:nowrap; }
.radio-group { display:flex; gap:10px; align-items:center; }
.radio-item { display:flex; gap:4px; align-items:center; font-size:12px; }
.radio-item input { accent-color:var(--color-main); }
.status-dots { display:flex; gap:8px; align-items:center; }
.status-dot-btn { width:14px; height:14px; border-radius:50%; border:2px solid #ccc; cursor:pointer; }
.status-dot-btn.green { background:#27ae60; border-color:#27ae60; }
.status-dot-btn.gray { background:#95a5a6; border-color:#95a5a6; }
.status-dot-btn.red { background:#e74c3c; border-color:#e74c3c; }

/* --- cultivation/work-master.html --- */
.wm-note {
  font-size: 12px;
  color: #666;
  margin: 0 0 12px;
}
.wm-toolbar {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.filter-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 12px;
}
.filter-heading::before {
  content: '';
  width: 4px;
  height: 16px;
  background: var(--color-main);
  border-radius: 2px;
}
.filter-row {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 14px 18px;
}
.filter-field { display: flex; flex-direction: column; gap: 6px; }
.filter-field > span,
.filter-field > label {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}
.filter-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  font-size: 13px;
  color: #374151;
}
.filter-radios label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-weight: 500;
}
.filter-actions { display: flex; gap: 8px; padding-bottom: 1px; }
.btn-outline-main {
  background: #fff;
  border: 1px solid var(--color-main);
  color: var(--color-main);
}
.btn-outline-main:hover { background: var(--color-main-light); }

.wm-table-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px 20px;
  margin: 4px 0 12px;
  font-size: 13px;
}
.wm-table-controls label { font-weight: 600; color: #374151; }
.wm-table-controls .form-control { width: 120px; }
.wm-mode {
  display: flex;
  align-items: center;
  gap: 8px;
}
.wm-mode-hint { font-size: 12px; color: #6b7280; font-weight: 500; }

.wm-switch {
  position: relative;
  width: 42px;
  height: 22px;
  border: none;
  border-radius: 999px;
  background: #c5cdd3;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  vertical-align: middle;
}
.wm-switch.on { background: #2e7d32; }
.wm-switch i {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
  transition: transform .15s ease;
}
.wm-switch.on i { transform: translateX(20px); }

.wm-table th { text-align: center; }
.wm-table td { text-align: center; font-size: 12px; }
.wm-table td.col-name,
.wm-table td.col-note { text-align: left; }
.wm-table td.col-name { font-weight: 500; min-width: 160px; }
.wm-table td.col-note { font-size: 11px; color: #555; max-width: 220px; line-height: 1.4; }
.wm-table tbody tr:nth-child(even) td { background: #fafafa; }
.wm-table tbody tr.is-dragging td { background: #e8f5ee; opacity: .7; }
.wm-table tbody tr.is-reorder { cursor: grab; }
.wm-table tbody tr.is-reorder:active { cursor: grabbing; }

.cat-cell { font-weight: 600; }
.cat-高所 { background: #bbdefb !important; color: #0d47a1; }
.cat-低所 { background: #c8e6c9 !important; color: #1b5e20; }
.cat-その他 { background: #e0e0e0 !important; color: #424242; }
.cat-作替え { background: #e1bee7 !important; color: #4a148c; }
.cat-作付け { background: #ffe082 !important; color: #e65100; }
.cat-選果 { background: #f8bbd0 !important; color: #880e4f; }

.wm-edit {
  position: relative;
  padding: 4px 8px;
  min-width: 36px;
  justify-content: center;
}
.wm-edit-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* --- login.html --- */
/* Tomato decoration */
.tomato-deco {
  position: absolute;
  border-radius: 50% 50% 50% 50% / 55% 55% 45% 45%;
  opacity: 0.12;
  pointer-events: none;
}
.tomato-deco::before {
  content: '';
  position: absolute;
  top: -25%;
  left: 50%;
  transform: translateX(-50%);
  width: 35%;
  height: 30%;
  background: #4caf50;
  border-radius: 50% 50% 0 0;
  clip-path: polygon(20% 100%, 50% 0%, 80% 100%);
}
.td1 { width: 180px; height: 180px; background: #e53935; top: 8%; right: 6%; }
.td2 { width: 120px; height: 120px; background: #ff8948; bottom: 12%; left: 4%; }
.td3 { width: 80px;  height: 80px;  background: #e53935; bottom: 5%; right: 12%; }

.version-badge {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7);
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 11px;
}

.dummy-accounts {
  margin-top: 20px;
  background: #f8fff8;
  border: 1px solid #c8e6c9;
  border-radius: 10px;
  padding: 12px 16px;
}
.dummy-accounts-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-main);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.dummy-account-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  padding: 4px 0;
  color: #555;
  border-bottom: 1px dashed #e0e0e0;
}
.dummy-account-row:last-child { border-bottom: none; }
.fill-btn {
  background: none;
  border: 1px solid var(--color-main);
  color: var(--color-main);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-jp);
  transition: all 0.15s;
}
.fill-btn:hover { background: var(--color-main); color: white; }

.password-toggle {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #aaa;
  padding: 0;
}
.password-toggle:hover { color: #555; }

.table tbody tr.is-complete {
  background: #f3f4f6;
  color: #6b7280;
}
.table tbody tr.is-warn {
  background: #fef3c7;
}
.table tbody tr.is-warn.is-complete {
  background: #f3f4f6;
}
.table td.col-name {
  max-width: none;
  white-space: normal;
}

.incident-tabs { margin-bottom: 14px; }
.incident-cat {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
}
.incident-cat-disease { background: #fde8e8; color: #b42318; }
.incident-cat-pest { background: #f3e8ff; color: #6941c6; }
.incident-cat-equipment { background: #e0f2fe; color: #026aa2; }
.incident-cat-other { background: #f2f4f7; color: #344054; }

.pest-map-board { display: grid; gap: 12px; }
.pest-map-zone {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
}
.pest-map-zone-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 12px;
  background: #e8f5ee;
  font-size: 13px;
}
.pest-map-zone-head span { color: #667085; font-size: 12px; }
.pest-map-lanes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px;
}
.pest-map-lane {
  min-width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: #fff;
  border: 1px solid #d0d5dd;
  font-size: 11px;
  font-weight: 700;
}
.layout-board-panel {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px 16px 16px;
  margin-bottom: 16px;
}
.layout-board-size {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 12px;
  margin-bottom: 12px;
}
.layout-board-size-title { font-size: 13px; font-weight: 700; color: #334155; }
.layout-board-size-field { display: flex; flex-direction: column; gap: 4px; }
.layout-board-size-field span { font-size: 11px; font-weight: 600; color: #64748b; }
.layout-board-size-field .form-control { width: 72px; min-width: 72px; }
.layout-board-hint { font-size: 12px; color: #64748b; }
.layout-board-scroll {
  overflow: auto;
  max-height: min(70vh, 720px);
}
.layout-board-axis,
.layout-board-grid {
  display: grid;
  grid-template-columns: 28px repeat(var(--layout-cols, 2), minmax(88px, 88px));
  gap: 8px;
  width: max-content;
  min-width: 100%;
}
.layout-board-axis { margin-bottom: 6px; }
.layout-board-axis span,
.layout-board-row-label {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-align: center;
  align-self: center;
}
.layout-board-cell {
  min-height: 88px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #fff;
  padding: 6px;
}
.layout-board-cell.is-filled { border-style: solid; }
.layout-board-cell.is-over { outline: 2px solid var(--color-main); }
.layout-board-tile {
  height: 100%;
  min-height: 72px;
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: grab;
}
.layout-board-tile.is-dragging { opacity: .55; }
.layout-board-tile strong { font-size: 18px; line-height: 1; }
.layout-board-tile span { font-size: 12px; font-weight: 600; }
.layout-board-tile small { font-size: 11px; color: #64748b; }
.layout-board-tile--left { border-left: 4px solid #2563eb; }
.layout-board-tile--right { border-right: 4px solid #ea580c; text-align: right; }
.layout-board-tile--center { border-top: 4px solid #0f766e; }
.layout-board-status { margin: 10px 0 0; font-size: 12px; color: #166534; }
.lp-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 16px 0 10px; }
.lp-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.lp-tab {
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.lp-tab.is-on { background: #016833; color: #fff; border-color: #016833; }
.lp-legend { font-size: 12px; color: #64748b; }
.lp-wrap { display: flex; gap: 14px; align-items: flex-start; }
.lp-scroll { overflow: auto; max-height: min(70vh, 720px); flex: 1; min-width: 0; }
.lp-grid {
  display: grid;
  grid-template-columns: 36px repeat(var(--lp-cols, 15), 18px);
  gap: 2px;
  width: max-content;
}
.lp-h, .lp-y {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  text-align: center;
  line-height: 18px;
}
.lp-cell {
  width: 18px;
  height: 18px;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
}
.lp-cell.is-off {
  background: #f1f5f9;
  border-style: dashed;
  border-color: #94a3b8;
}
.lp-cell.is-on { background: #016833; border-color: #014f27; border-style: solid; cursor: grab; }
.lp-cell.is-over { outline: 2px solid #0ea5e9; }
.lp-cell.is-dragging { opacity: .4; }

.layout-overhead {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
  overflow: auto;
  width: 100%;
}
.layout-overhead-cell {
  background: #eceff1;
  border-radius: 6px;
  padding: 10px 10px 8px;
  min-height: 72px;
}
.layout-overhead-cell.is-empty {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  min-height: 24px;
  padding: 0;
}
.layout-overhead-cell .layout-block { margin: 0; }
.layout-overhead-cell .layout-nums { margin-top: 6px; }

.zone-toolbar { display:flex; gap:8px; margin-bottom:12px; flex-wrap:wrap; align-items:center; }
.zone-tabs { display:flex; gap:8px; flex-wrap:wrap; align-items:center; flex:1; min-width:0; }
.zone-tab {
  padding:6px 16px; border-radius:4px; border:1px solid #cbd5e1; background:#fff;
  font-size:13px; font-weight:600; text-decoration:none; color:inherit;
}
.zone-tab.active { background:var(--color-main, #2e7d32); color:#fff; border-color:transparent; }
.zone-tab:hover { opacity:0.9; }
.zone-meta {
  display:flex; gap:8px; flex-wrap:wrap; align-items:center;
  margin-bottom:12px; padding:10px 12px; background:#f8fafc; border:1px solid #e2e8f0; border-radius:6px;
  font-size:13px; color:#475569;
}
.zone-meta label { display:flex; align-items:center; gap:6px; font-weight:600; }
.zone-meta-item { display:inline-flex; align-items:center; gap:6px; font-weight:600; }
.zone-meta-item strong { font-weight:700; color:#0f172a; }
.zone-meta .form-control { width:88px; padding:6px 10px; }
.th-sort { color:inherit; text-decoration:none; font-weight:600; }
.th-sort:hover { color:inherit; text-decoration:underline; }
.th-sort.is-sorted { color:inherit; }
.layout-toolbar { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-bottom:14px; }
.layout-cards { display:flex; flex-direction:column; gap:12px; margin-bottom:18px; }
.layout-card {
  background:#fff; border:1px solid #e2e8f0; border-radius:8px; padding:14px 16px;
}
.layout-card-head {
  display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:12px;
}
.layout-card-title { font-size:15px; font-weight:700; color:#0f172a; }
.layout-card-actions { display:flex; align-items:center; gap:6px; }
.layout-card-actions form { margin:0; }
.layout-fields {
  display:grid; grid-template-columns:repeat(auto-fill, minmax(140px, 1fr)); gap:12px 14px;
}
.layout-fields .form-group { display:flex; flex-direction:column; gap:4px; margin:0; }
.layout-fields .form-label { font-size:11px; font-weight:600; color:#64748b; margin:0; }
.table tbody tr.is-pest td { background:#fff1f2; }
.table tbody tr.is-pest td:first-child { box-shadow: inset 3px 0 0 #e11d48; }
.pest-badge {
  display:inline-block; margin-left:6px; padding:1px 6px; border-radius:999px;
  background:#ffe4e6; color:#9f1239; font-size:10px; font-weight:700; vertical-align:middle;
}
.incident-list-panel { margin-top: 8px; }
.incident-list-panel .panel-title { margin: 0 0 8px; }

@media print {
  .sidebar, .page-header, .incident-tabs, .progress-filter-panel, .filter-panel, .page-actions, .pest-print-hide { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .pest-map-zone, .layout-block, .layout-overhead-cell { break-inside: avoid; }
}
