/* =========================================================
   Pier21 Cost Management System - Stylesheet
   Base: white / Accent: Pier21 brand colors
   ========================================================= */

:root {
  --ink: #1F2A2E;
  --ink-soft: #5B6B68;
  --paper: #FBFBF9;
  --mist: #F0F5F3;
  --line: #E4EAE8;
  --teal: #1AAF9C;
  --teal-deep: #0E7C6B;
  --yellow: #F7C331;
  --orange: #FF8A3D;
  --danger: #D14B2E;
}

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

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Noto Sans JP', sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: 'M PLUS Rounded 1c', 'Noto Sans JP', sans-serif;
  margin: 0;
}

button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }
a { text-decoration: none; color: inherit; }

.page { position: relative; width: 100%; min-height: 100vh; overflow: hidden; }

/* ---------- Balloon decoration ---------- */
.balloon-layer {
  position: absolute; inset: 0;
  overflow: hidden; pointer-events: none; z-index: 0;
}
.balloon-float {
  position: absolute; display: block;
  filter: drop-shadow(0 18px 24px rgba(15, 40, 35, 0.06));
  animation-timing-function: cubic-bezier(0.45, 0.05, 0.55, 0.95);
  animation-iteration-count: infinite;
  transform-origin: 50% 50%;
  will-change: transform;
}
.drift-a { animation-name: driftA; }
.drift-b { animation-name: driftB; }
.drift-c { animation-name: driftC; }

@keyframes driftA {
  0%   { transform: translate(0, 0) rotate(0deg); }
  50%  { transform: translate(-16px, -24px) rotate(2deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}
@keyframes driftB {
  0%   { transform: translate(0, 0) rotate(0deg); }
  50%  { transform: translate(14px, -20px) rotate(-2deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}
@keyframes driftC {
  0%   { transform: translate(0, 0) rotate(0deg); }
  50%  { transform: translate(-10px, -28px) rotate(1.5deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

@media (prefers-reduced-motion: reduce) {
  .balloon-float { animation: none; }
}

/* ---------- Brand ---------- */
.brand-badge {
  display: inline-flex; align-items: center; gap: 2px;
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-weight: 700; font-size: 20px;
  padding: 9px 16px; border-radius: 999px;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-deep) 100%);
  color: #fff;
  box-shadow: 0 6px 16px rgba(14, 124, 107, 0.28);
  letter-spacing: 0.5px;
}
.brand-badge strong { font-weight: 800; }
.brand-badge--sm { font-size: 15px; padding: 6px 12px; box-shadow: none; }
.brand-caption {
  margin-top: 10px; text-align: center;
  color: var(--ink-soft); font-size: 13px; letter-spacing: 2px;
}

/* ---------- Login ---------- */
.login-page {
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(120% 90% at 15% 0%, #EAF6F2 0%, var(--paper) 45%),
    radial-gradient(90% 70% at 90% 100%, #FBF3E2 0%, var(--paper) 50%);
  padding: 32px 16px;
}
.login-wrap {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
  width: 100%; max-width: 420px;
}
.brand-mark {
  display: flex; flex-direction: column; align-items: center;
  margin-bottom: 28px;
}
.login-card {
  width: 100%; background: #fff;
  border-radius: 26px; padding: 36px 32px;
  box-shadow: 0 20px 50px rgba(15, 50, 45, 0.10), 0 2px 8px rgba(15, 50, 45, 0.06);
  border: 1px solid var(--line);
}
.login-card h1 { font-size: 24px; margin-bottom: 6px; }
.login-sub {
  font-size: 13px; color: var(--ink-soft);
  line-height: 1.6; margin: 0 0 26px;
}

.field { display: block; margin-bottom: 18px; }
.field__label {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: var(--ink);
  margin-bottom: 8px;
}
.field input {
  width: 100%; border: 1.5px solid var(--line);
  border-radius: 12px; padding: 12px 14px;
  font-size: 14px; outline: none; background: #FCFDFC;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(26, 175, 156, 0.14);
  background: #fff;
}

.pw-row { position: relative; }
.pw-row input { padding-right: 42px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none; padding: 6px;
  color: var(--ink-soft); display: flex;
}

.error-text {
  color: var(--danger); font-size: 12.5px;
  margin: -6px 0 14px; font-weight: 600;
}

.remember-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--ink-soft);
  margin-bottom: 20px; cursor: pointer;
}
.remember-row input { accent-color: var(--teal); cursor: pointer; }

.btn-primary {
  width: 100%; display: flex; align-items: center; justify-content: center;
  gap: 8px; background: var(--yellow); color: #4A3300;
  border: none; border-radius: 999px; padding: 14px;
  font-size: 15px; font-weight: 800; letter-spacing: 1px;
  box-shadow: 0 10px 22px rgba(247, 195, 49, 0.38);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(247, 195, 49, 0.46);
  filter: brightness(1.02);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .75; cursor: default; transform: none; }

.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid rgba(74, 51, 0, 0.25);
  border-top-color: #4A3300;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.login-footer { margin-top: 22px; font-size: 11.5px; color: #A6B0AD; }

/* ---------- Dashboard ---------- */
.dashboard-page { background: var(--paper); }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  background: linear-gradient(90deg, #0E7C6B 0%, #1AAF9C 100%);
  position: sticky; top: 0; z-index: 5;
  box-shadow: 0 4px 14px rgba(14, 124, 107, 0.18);
}
.topbar__brand { display: flex; align-items: center; gap: 12px; }
.topbar__title {
  color: #fff; font-weight: 700;
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-size: 15px; letter-spacing: .5px; opacity: .95;
}
.topbar__user { display: flex; align-items: center; gap: 12px; }
.user-chip {
  display: flex; align-items: center; gap: 8px;
  color: #fff; font-size: 13.5px; font-weight: 600;
  background: rgba(255, 255, 255, 0.14);
  padding: 6px 14px 6px 6px; border-radius: 999px;
}
.user-chip__avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: #F7C331; color: #4A3300;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12.5px;
}
.user-chip__role {
  font-size: 10.5px; font-weight: 700;
  background: rgba(255, 255, 255, 0.22);
  padding: 2px 8px; border-radius: 999px;
}
.btn-ghost {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff; padding: 8px 14px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700;
  transition: background .15s;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.22); }

.dash-hero {
  position: relative; overflow: hidden;
  padding: 40px 28px 32px;
  background: var(--mist);
  border-bottom: 1px solid var(--line);
}
.dash-hero__inner { position: relative; z-index: 1; max-width: 900px; }
.dash-eyebrow {
  font-size: 12.5px; color: var(--ink-soft);
  font-weight: 700; letter-spacing: 1px; margin: 0 0 6px;
}
.dash-hero h1 { font-size: 26px; margin: 0 0 6px; }
.dash-lead { margin: 0; color: var(--ink-soft); font-size: 13.5px; }

.dash-main { padding: 30px 28px 60px; max-width: 1180px; margin: 0 auto; }
.section-title { font-size: 15px; font-weight: 700; margin: 0 0 14px; }
.dash-main section + section { margin-top: 34px; }

.grid { display: grid; gap: 16px; }
.grid--main { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--sub  { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

/* ---------- Nav cards ---------- */
.nav-card {
  position: relative; text-align: left;
  background: #fff; border: 1px solid var(--line);
  border-radius: 20px; padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
  min-height: 150px; color: inherit;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.nav-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 30px rgba(15, 50, 45, 0.12);
  border-color: var(--accent);
}
.nav-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.nav-card--lg { min-height: 172px; }
.nav-card--disabled { opacity: .62; cursor: not-allowed; }
.nav-card--disabled:hover { transform: none; box-shadow: none; border-color: var(--line); }

.nav-card__top {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 10px;
}
.icon-badge {
  width: 46px; height: 46px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-tint); color: var(--accent-fg);
  flex-shrink: 0;
  transition: transform .28s cubic-bezier(.34, 1.56, .64, 1);
}
.nav-card:not(.nav-card--disabled):hover .icon-badge {
  transform: scale(1.16) rotate(-6deg);
}
.nav-card__body h3 { font-size: 15.5px; margin: 0 0 4px; }
.nav-card__body p {
  margin: 0; font-size: 12.5px;
  color: var(--ink-soft); line-height: 1.5;
}
.nav-card__go {
  margin-top: auto; display: inline-flex; align-items: center; gap: 2px;
  font-size: 12px; font-weight: 700;
  color: var(--accent-fg); opacity: .85;
}
.pill {
  font-size: 11px; font-weight: 800;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .topbar { padding: 12px 16px; }
  .topbar__title { display: none; }
  .user-chip__role { display: none; }
  .dash-hero { padding: 28px 18px 24px; }
  .dash-hero h1 { font-size: 21px; }
  .dash-main { padding: 22px 16px 50px; }
  .login-card { padding: 28px 22px; }
}

/* ---------- User menu ---------- */
.topbar__brand { display: flex; align-items: center; gap: 12px; }
.topbar__user { position: relative; }
.user-chip {
  display: flex; align-items: center; gap: 8px;
  color: #fff; font-size: 13.5px; font-weight: 600;
  background: rgba(255, 255, 255, 0.14);
  padding: 6px 14px 6px 6px; border-radius: 999px;
  border: none; cursor: pointer;
}
.user-menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: #fff; border: 1px solid var(--line);
  border-radius: 14px; min-width: 210px; padding: 6px;
  box-shadow: 0 14px 34px rgba(15, 50, 45, 0.16);
  z-index: 20;
}
.user-menu__head {
  padding: 10px 12px 12px; border-bottom: 1px solid var(--line);
  margin-bottom: 6px; display: flex; flex-direction: column; gap: 2px;
}
.user-menu__head strong { font-size: 13.5px; }
.user-menu__head span { font-size: 11.5px; color: var(--ink-soft); }
.user-menu__item {
  display: block; width: 100%; text-align: left;
  padding: 10px 12px; border: none; background: none;
  font-size: 13px; color: var(--ink); border-radius: 9px;
  cursor: pointer;
}
.user-menu__item:hover { background: var(--mist); }
.user-menu__item--danger { color: var(--danger); font-weight: 700; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff;
  padding: 12px 22px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22);
  z-index: 60; max-width: calc(100% - 32px);
}
.toast__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); }
.toast--error .toast__dot { background: #FF8A7A; }

/* ---------- Helper text ---------- */
.login-help {
  text-align: center; font-size: 11.5px;
  color: #9AA6A3; margin: 16px 0 0; line-height: 1.6;
}
.login-sub.notice {
  background: #FDF6E3; border: 1px solid #F3E2B0;
  color: #7A5A10; padding: 12px 14px; border-radius: 12px;
}

/* ---------- Mobile optimization ---------- */
@media (max-width: 640px) {
  .user-chip__name { display: none; }
  .field input {
    font-size: 16px;  /* prevent iOS auto-zoom on focus */
    padding: 13px 14px;
  }
  .btn-primary { padding: 15px; }
  .nav-card { min-height: 0; padding: 16px; }
  .nav-card--lg { min-height: 0; }
  .grid { gap: 12px; }
  .grid--sub { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .icon-badge { width: 40px; height: 40px; border-radius: 12px; }
  .toast { bottom: 16px; font-size: 12.5px; padding: 11px 18px; }
}

/* =========================================================
   Master pages (users / clients / cost items)
   ========================================================= */

/* ---------- Page header ---------- */
.page-head {
  background: var(--mist);
  border-bottom: 1px solid var(--line);
  padding: 26px 28px 22px;
}
.page-head__inner { max-width: 1180px; margin: 0 auto; }
.page-head__row {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.page-head h1 {
  font-size: 22px; margin: 0 0 4px;
  font-family: 'M PLUS Rounded 1c', 'Noto Sans JP', sans-serif;
}
.page-lead { margin: 0; font-size: 13px; color: var(--ink-soft); }
.crumb { font-size: 12px; color: var(--ink-soft); margin: 0 0 10px; }
.crumb a { color: var(--teal-deep); font-weight: 600; }
.crumb a:hover { text-decoration: underline; }

.page-main { padding: 24px 28px 60px; max-width: 1180px; margin: 0 auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 999px; border: 1px solid transparent;
  font-size: 13px; font-weight: 700; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  background: #fff; color: var(--ink); border-color: var(--line);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary {
  background: var(--yellow); color: #4A3300; border-color: transparent;
  box-shadow: 0 8px 18px rgba(247, 195, 49, 0.34);
}
.btn--primary:hover { box-shadow: 0 12px 22px rgba(247, 195, 49, 0.42); }
.btn--ghost { background: #fff; border-color: var(--line); color: var(--ink-soft); }
.btn--ghost:hover { border-color: var(--teal); color: var(--teal-deep); }
.btn--text { background: none; border: none; color: var(--ink-soft); font-size: 12.5px; }
.btn--text:hover { color: var(--teal-deep); text-decoration: underline; }
.btn--sm { padding: 6px 14px; font-size: 12px; }
.btn--danger { color: var(--danger); border-color: #F3D5CD; background: #FFF7F5; }
.btn--danger:hover { background: var(--danger); color: #fff; border-color: transparent; }

/* ---------- Filter bar ---------- */
.filter-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 14px 16px; margin-bottom: 18px;
}
.filter-bar__input {
  flex: 1 1 280px; min-width: 200px;
  border: 1.5px solid var(--line); border-radius: 10px;
  padding: 9px 13px; font-size: 13.5px; outline: none; background: #FCFDFC;
  transition: border-color .15s, box-shadow .15s;
}
.filter-bar__input:focus {
  border-color: var(--teal); background: #fff;
  box-shadow: 0 0 0 3px rgba(26, 175, 156, 0.13);
}
.filter-bar__select {
  border: 1.5px solid var(--line); border-radius: 10px;
  padding: 9px 12px; font-size: 13px; background: #FCFDFC; outline: none;
}
.filter-bar__count {
  margin-left: auto; font-size: 12.5px; color: var(--ink-soft); font-weight: 700;
}

/* ---------- Table ---------- */
.table-card {
  background: #fff; border: 1px solid var(--line);
  border-radius: 18px; overflow: hidden;
}
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  background: #F7FAF9; text-align: left; font-weight: 700;
  padding: 13px 14px; color: var(--ink-soft); font-size: 12px;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.data-table td {
  padding: 13px 14px; border-bottom: 1px solid #F0F4F3; vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #FAFCFB; }
.data-table .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.data-table .strong { font-weight: 700; }
.data-table .muted { color: var(--ink-soft); }
.data-table .sm { font-size: 12px; }
.data-table .ta-r { text-align: right; }
.data-table .nowrap { white-space: nowrap; }
.row--off { background: #FCFCFC; }
.row--off .strong, .row--off .mono { opacity: .55; }

.empty { padding: 44px 20px; text-align: center; color: var(--ink-soft); font-size: 13.5px; margin: 0; }

.inline-form { display: inline; }

/* ---------- Tags ---------- */
.tag {
  display: inline-block; font-size: 11px; font-weight: 800;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
.tag--admin    { background: #FFEADB; color: #D9631E; }
.tag--approver { background: #E1F4F0; color: #0E7C6B; }
.tag--staff    { background: #EFF2F1; color: #5B6B68; }
.tag--on       { background: #E6F5DE; color: #4C9A2A; }
.tag--off      { background: #F0EFEF; color: #8A8A8A; }
.tag--lock     { background: #FDF2D0; color: #A9790A; margin-left: 6px; }

/* ---------- Forms ---------- */
.form-card {
  background: #fff; border: 1px solid var(--line);
  border-radius: 20px; padding: 28px;
  box-shadow: 0 8px 24px rgba(15, 50, 45, 0.05);
}
.form-section { margin-bottom: 28px; }
.form-section:last-of-type { margin-bottom: 20px; }
.form-section h2 {
  font-size: 15px; margin: 0 0 4px; padding-bottom: 10px;
  border-bottom: 2px solid var(--mist);
  font-family: 'M PLUS Rounded 1c', 'Noto Sans JP', sans-serif;
}
.form-note {
  font-size: 12.5px; color: var(--ink-soft);
  line-height: 1.7; margin: 12px 0 16px;
}
.form-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px; margin-top: 16px;
}
.form-field { display: block; }
.form-label {
  display: block; font-size: 12.5px; font-weight: 700;
  margin-bottom: 7px; color: var(--ink);
}
.form-label em {
  font-style: normal; font-size: 10.5px; font-weight: 800;
  background: #FCE4DF; color: #D14B2E;
  padding: 2px 7px; border-radius: 999px; margin-left: 6px;
}
.form-field input, .form-field select {
  width: 100%; box-sizing: border-box;
  border: 1.5px solid var(--line); border-radius: 11px;
  padding: 11px 13px; font-size: 14px; background: #FCFDFC; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-field input:focus, .form-field select:focus {
  border-color: var(--teal); background: #fff;
  box-shadow: 0 0 0 4px rgba(26, 175, 156, 0.13);
}
.form-help {
  display: block; font-size: 11.5px; color: #97A3A0; margin-top: 6px; line-height: 1.5;
}
.check-row {
  display: flex; align-items: center; gap: 9px;
  margin-top: 18px; font-size: 13.5px; cursor: pointer;
}
.check-row input { accent-color: var(--teal); width: 17px; height: 17px; cursor: pointer; }

.form-meta {
  display: flex; gap: 20px; flex-wrap: wrap;
  padding: 14px 16px; background: #F7FAF9; border-radius: 12px;
  font-size: 11.5px; color: var(--ink-soft); margin-bottom: 20px;
}
.form-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  padding-top: 20px; border-top: 1px solid var(--line);
}

/* ---------- Alerts ---------- */
.alert {
  border-radius: 12px; padding: 14px 16px;
  font-size: 13px; margin-bottom: 20px; line-height: 1.6;
}
.alert--error { background: #FDF1EE; border: 1px solid #F3D5CD; color: #A63A20; }
.alert--error strong { display: block; margin-bottom: 6px; }
.alert--error ul { margin: 0; padding-left: 18px; }
.alert--info { background: #EAF6F2; border: 1px solid #C9E5DD; color: #0E7C6B; }

.note {
  font-size: 12px; color: var(--ink-soft);
  margin-top: 16px; line-height: 1.7;
}

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .page-head { padding: 20px 16px 18px; }
  .page-head h1 { font-size: 19px; }
  .page-main { padding: 18px 16px 48px; }
  .form-card { padding: 20px 16px; }
  .form-row { grid-template-columns: 1fr; }
  .filter-bar { padding: 12px; }
  .filter-bar__count { margin-left: 0; }
  .data-table { font-size: 12.5px; }
  .data-table th, .data-table td { padding: 11px 12px; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; }
  .form-field input, .form-field select { font-size: 16px; }
}

/* =========================================================
   Client pages (list / form / detail)
   ========================================================= */

.link { color: var(--teal-deep); font-weight: 700; }
.link:hover { text-decoration: underline; }

.input--locked {
  background: #F2F5F4 !important;
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  cursor: not-allowed;
}

.form-field textarea {
  width: 100%; box-sizing: border-box;
  border: 1.5px solid var(--line); border-radius: 11px;
  padding: 11px 13px; font-size: 14px; background: #FCFDFC;
  outline: none; font-family: inherit; resize: vertical; line-height: 1.7;
  transition: border-color .15s, box-shadow .15s;
}
.form-field textarea:focus {
  border-color: var(--teal); background: #fff;
  box-shadow: 0 0 0 4px rgba(26, 175, 156, 0.13);
}

/* ---------- Contact rows (dynamic) ---------- */
.contact-list { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }

.contact-row {
  border: 1.5px solid var(--line); border-radius: 14px;
  padding: 16px; background: #FCFDFC;
  transition: border-color .15s, background .15s;
}
.contact-row:hover { border-color: #D5E2DF; background: #fff; }

.contact-row__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 4px;
}

.primary-pick {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 700; color: var(--ink-soft);
  cursor: pointer; padding: 5px 12px; border-radius: 999px;
  background: #fff; border: 1.5px solid var(--line);
  transition: border-color .15s, color .15s, background .15s;
}
.primary-pick:has(input:checked) {
  border-color: var(--teal); color: var(--teal-deep); background: #E9F6F3;
}
.primary-pick input { accent-color: var(--teal); cursor: pointer; }

.btn--add { width: 100%; margin-top: 14px; border-style: dashed; }
.btn--add:hover { border-color: var(--teal); color: var(--teal-deep); }

/* ---------- Detail page ---------- */
.detail-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px; align-items: start;
}
.detail-card {
  background: #fff; border: 1px solid var(--line);
  border-radius: 18px; padding: 22px;
}
.detail-card h2 {
  font-size: 15px; margin: 0 0 16px; padding-bottom: 10px;
  border-bottom: 2px solid var(--mist);
  font-family: 'M PLUS Rounded 1c', 'Noto Sans JP', sans-serif;
}
.detail-list { margin: 0; }
.detail-list > div {
  display: grid; grid-template-columns: 110px 1fr;
  gap: 12px; padding: 9px 0; border-bottom: 1px solid #F2F6F5;
}
.detail-list > div:last-child { border-bottom: none; }
.detail-list dt { font-size: 12px; color: var(--ink-soft); font-weight: 700; margin: 0; }
.detail-list dd { margin: 0; font-size: 13.5px; }

.detail-note { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.detail-note h3 { font-size: 12.5px; color: var(--ink-soft); margin: 0 0 8px; }
.detail-note p { margin: 0; font-size: 13px; line-height: 1.8; }

.contact-cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.contact-card {
  border: 1px solid var(--line); border-radius: 13px;
  padding: 14px 16px; background: #FCFDFC;
}
.contact-card__head {
  display: flex; align-items: center; gap: 9px; margin-bottom: 5px;
}
.contact-card__head strong { font-size: 14px; }
.contact-card p { margin: 3px 0 0; line-height: 1.6; }

@media (max-width: 640px) {
  .detail-list > div { grid-template-columns: 92px 1fr; gap: 8px; }
  .contact-row { padding: 13px; }
  .contact-row__head { flex-wrap: wrap; }
  .form-field textarea { font-size: 16px; }
}

/* =========================================================
   Cost item master
   ========================================================= */

.cat-block { margin-bottom: 22px; }
.cat-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; margin: 0 0 10px; padding-left: 2px;
  font-family: 'M PLUS Rounded 1c', 'Noto Sans JP', sans-serif;
}
.cat-title::before {
  content: ''; width: 4px; height: 15px; border-radius: 2px;
  background: var(--teal); display: inline-block;
}
.cat-title__count {
  font-size: 11px; font-weight: 800; color: var(--ink-soft);
  background: var(--mist); padding: 3px 9px; border-radius: 999px;
}

.yen-input { position: relative; }
.yen-input__mark {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  font-size: 14px; color: var(--ink-soft); font-weight: 700; pointer-events: none;
}
.yen-input input { padding-left: 30px !important; text-align: right; }

.data-table td.ta-r.mono { font-variant-numeric: tabular-nums; }

/* =========================================================
   Cost sheet template editor (Excel-like grid)
   ========================================================= */

[x-cloak] { display: none !important; }

.page-main--wide { max-width: 1500px; }
.form-card--tight { padding: 18px 20px; margin-bottom: 16px; }

.sheet-hint {
  font-size: 12px; color: var(--ink-soft);
  background: #F3F8F7; border: 1px solid #DCEAE6;
  border-radius: 10px; padding: 9px 14px; margin: 0 0 14px;
}

.tpl-section { margin-bottom: 16px; }
.tpl-section__head {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 2px 8px 0;
}
.tpl-section__head h2 {
  font-size: 14px; margin: 0;
  font-family: 'M PLUS Rounded 1c', 'Noto Sans JP', sans-serif;
}
.tpl-toggle {
  width: 22px; height: 22px; border-radius: 6px;
  border: 1px solid var(--line); background: #fff;
  color: var(--ink-soft); font-size: 14px; font-weight: 700;
  line-height: 1; display: flex; align-items: center; justify-content: center;
}
.tpl-toggle:hover { border-color: var(--teal); color: var(--teal-deep); }
.tpl-count {
  font-size: 11px; font-weight: 800; color: var(--ink-soft);
  background: var(--mist); padding: 3px 9px; border-radius: 999px;
}
.tpl-add { margin-left: auto; }

/* ---- Excel-like sheet ---- */
.sheet-wrap {
  border: 1px solid var(--line); border-radius: 12px;
  overflow-x: auto; background: #fff;
}
.sheet { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.sheet th {
  background: #F4F8F7; text-align: left; font-weight: 700;
  font-size: 11px; color: var(--ink-soft);
  padding: 7px 8px; border-bottom: 1px solid var(--line);
  border-right: 1px solid #EDF2F1; white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
.sheet td {
  padding: 0; border-bottom: 1px solid #F0F4F3;
  border-right: 1px solid #F0F4F3;
}
.sheet tr:last-child td { border-bottom: none; }
.sheet td:last-child, .sheet th:last-child { border-right: none; }

.sheet .w-no   { width: 34px; text-align: center; color: #A9B4B1; font-size: 11px; }
.sheet .w-item { min-width: 170px; }
.sheet .w-task { min-width: 260px; }
.sheet .w-unit { width: 70px; }
.sheet .w-price{ width: 120px; }
.sheet .w-note { min-width: 180px; }
.sheet .w-act  { width: 34px; text-align: center; }

.cell {
  width: 100%; box-sizing: border-box;
  border: none; background: transparent;
  padding: 6px 8px; font-size: 12.5px; font-family: inherit;
  outline: none; line-height: 1.4;
}
.cell:focus {
  background: #EAF6F2;
  box-shadow: inset 0 0 0 2px var(--teal);
  border-radius: 3px;
}
.cell--r { text-align: right; font-variant-numeric: tabular-nums; }
.cell--c { text-align: center; }
.cell::-webkit-outer-spin-button,
.cell::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cell[type=number] { -moz-appearance: textfield; }

.row-del {
  width: 20px; height: 20px; border-radius: 5px;
  border: none; background: transparent; color: #C4CFCC;
  font-size: 15px; line-height: 1; cursor: pointer;
}
.row-del:hover { background: #FDECE8; color: var(--danger); }

.sheet-empty {
  padding: 16px; text-align: center;
  color: var(--ink-soft); font-size: 12px;
}

.form-actions--sticky {
  position: sticky; bottom: 0;
  background: rgba(251, 251, 249, 0.94);
  backdrop-filter: blur(6px);
  padding: 14px 0; margin-top: 18px;
  border-top: 1px solid var(--line);
}

@media (max-width: 640px) {
  .sheet { font-size: 12px; }
  .cell { font-size: 16px; }
  .tpl-add { margin-left: 0; }
  .tpl-section__head { flex-wrap: wrap; }
}

/* =========================================================
   Cost sheet (estimate) screens
   ========================================================= */

.page-head--slim { padding: 18px 28px 16px; }

.stat-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.stat-chip {
  display: flex; align-items: baseline; gap: 7px;
  background: #fff; border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 16px;
  transition: border-color .15s, transform .15s;
}
.stat-chip:hover { border-color: var(--teal); transform: translateY(-1px); }
.stat-chip__num { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-chip__label { font-size: 12px; color: var(--ink-soft); font-weight: 700; }
.stat-chip--warn .stat-chip__num { color: #D9631E; }
.stat-chip--info .stat-chip__num { color: var(--teal-deep); }

.check-inline {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--ink-soft); cursor: pointer; white-space: nowrap;
}
.check-inline input { accent-color: var(--teal); }

.head-fold { margin-bottom: 14px; }
.head-fold > summary {
  cursor: pointer; font-size: 12.5px; font-weight: 700;
  color: var(--teal-deep); padding: 8px 2px; list-style: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.head-fold > summary::before { content: '\25b8'; transition: transform .15s; }
.head-fold[open] > summary::before { transform: rotate(90deg); }
.head-fold > summary::-webkit-details-marker { display: none; }

.hide-zero {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; cursor: pointer;
}
.hide-zero input { accent-color: var(--teal); }
.sheet-hint { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.sec-sum {
  margin-left: auto; font-size: 12px; color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.sec-sum strong { color: var(--ink); font-size: 13px; }

/* sheet columns for the cost sheet grid */
.sheet .w-qty  { width: 74px; }
.sheet .w-coef { width: 64px; }
.sheet .w-sub  { width: 108px; text-align: right; }
.sheet td.num {
  padding: 6px 8px; text-align: right;
  font-variant-numeric: tabular-nums; font-size: 12px;
  background: #FAFCFB; color: var(--ink-soft);
}
.sheet td.num--est { color: var(--teal-deep); font-weight: 700; background: #F2FAF8; }
.sheet .label-cell {
  display: block; padding: 6px 8px; font-size: 12px;
  color: var(--ink); line-height: 1.4;
}
.sheet td.pad { padding: 6px 8px; font-size: 12px; }
.sheet .ta-c { text-align: center; }
.row--zero { background: #FCFCFC; }
.row--zero .label-cell { color: #A7B2AF; }
.row--zero td.num { color: #C3CCCA; }

.rate--high { color: var(--danger) !important; font-weight: 800; }

/* summary */
.summary-card {
  background: #fff; border: 1px solid var(--line);
  border-radius: 16px; padding: 20px; margin-top: 18px;
}
.summary-card h2 {
  font-size: 14px; margin: 0 0 14px;
  font-family: 'M PLUS Rounded 1c', 'Noto Sans JP', sans-serif;
}
.summary-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px;
}
.sum-item {
  display: flex; flex-direction: column; gap: 5px;
  padding: 12px 14px; background: #F8FBFA;
  border: 1px solid var(--line); border-radius: 12px;
}
.sum-label { font-size: 11.5px; color: var(--ink-soft); font-weight: 700; }
.sum-value {
  font-size: 18px; font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-family: 'M PLUS Rounded 1c', 'Noto Sans JP', sans-serif;
}
.sum-item--input { background: #FFFDF5; border-color: #F2E4B8; }
.sum-item--input .yen-input input {
  border: 1.5px solid #E8D89B; border-radius: 9px;
  padding: 7px 10px 7px 26px; font-size: 16px; font-weight: 700;
  width: 100%; box-sizing: border-box; text-align: right; background: #fff;
}

.sub-h {
  font-size: 12px; color: var(--ink-soft);
  margin: 18px 0 8px; padding-top: 14px;
  border-top: 1px solid var(--line);
}
.mini-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.mini-table th {
  text-align: left; font-size: 11px; color: var(--ink-soft);
  padding: 6px 8px; border-bottom: 1px solid var(--line);
}
.mini-table td { padding: 6px 8px; border-bottom: 1px solid #F2F6F5; }
.mini-table tr:last-child td { border-bottom: none; }

.tag--red { background: #FCE4DF; color: #D14B2E; }

@media (max-width: 640px) {
  .stat-row { gap: 8px; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .sec-sum { margin-left: 0; width: 100%; }
}

/* =========================================================
   Approval flow / images
   ========================================================= */

.action-panel {
  background: #fff; border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 14px; padding: 16px 18px; margin-bottom: 16px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
}
.action-panel__msg { flex: 1 1 260px; font-size: 13px; line-height: 1.7; }
.action-panel__msg strong { display: block; margin-bottom: 2px; }
.warn-text { display: block; color: var(--danger); font-size: 12px; font-weight: 700; }

.action-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.action-input {
  border: 1.5px solid var(--line); border-radius: 9px;
  padding: 8px 12px; font-size: 12.5px; min-width: 190px;
  background: #FCFDFC; outline: none; font-family: inherit;
}
.action-input:focus {
  border-color: var(--teal); background: #fff;
  box-shadow: 0 0 0 3px rgba(26, 175, 156, 0.13);
}

/* ---- history ---- */
.history-card { margin-bottom: 16px; }
.history { list-style: none; margin: 0; padding: 0; }
.history__item {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 0; border-bottom: 1px solid #F2F6F5; font-size: 12.5px;
}
.history__item:last-child { border-bottom: none; }
.history__badge {
  font-size: 11px; font-weight: 800; padding: 3px 10px;
  border-radius: 999px; background: #EFF2F1; color: #5B6B68;
}
.history__badge--submitted { background: #E1F4F0; color: #0E7C6B; }
.history__badge--approved  { background: #E6F5DE; color: #4C9A2A; }
.history__badge--returned,
.history__badge--rejected  { background: #FCE4DF; color: #D14B2E; }
.history__badge--ordered   { background: #FDF2D0; color: #A9790A; }
.history__badge--lost      { background: #F0EFEF; color: #8A8A8A; }
.history__who  { font-weight: 700; }
.history__when { color: var(--ink-soft); font-size: 11.5px; }
.history__comment {
  flex: 1 1 100%; color: var(--ink-soft);
  background: #F8FAF9; border-radius: 8px; padding: 7px 11px; margin-top: 2px;
}

/* ---- images ---- */
.img-gallery { margin-bottom: 16px; }
.img-main {
  display: block; width: 100%; padding: 0; border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden; background: #F7FAF9; cursor: zoom-in;
}
.img-main img { display: block; width: 100%; height: auto; max-height: 320px; object-fit: contain; }
.img-thumbs { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.img-thumb {
  width: 62px; height: 62px; padding: 0; border-radius: 9px;
  border: 1px solid var(--line); overflow: hidden; cursor: zoom-in; background: #F7FAF9;
}
.img-thumb img { width: 100%; height: 100%; object-fit: cover; }
.img-thumb:hover { border-color: var(--teal); }

.img-panel {
  background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 16px 18px; margin-bottom: 14px;
}
.img-panel__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.img-panel__head h2 {
  font-size: 14px; margin: 0;
  font-family: 'M PLUS Rounded 1c', 'Noto Sans JP', sans-serif;
}
.img-count {
  font-size: 11px; font-weight: 800; color: var(--ink-soft);
  background: var(--mist); padding: 3px 9px; border-radius: 999px;
}
.img-list { display: flex; gap: 12px; flex-wrap: wrap; }
.img-item {
  width: 150px; display: flex; flex-direction: column; gap: 5px;
  border: 1px solid var(--line); border-radius: 11px; padding: 9px; background: #FCFDFC;
}
.img-item img {
  width: 100%; height: 96px; object-fit: cover;
  border-radius: 7px; background: #F0F4F3;
}
.img-item__name {
  font-size: 11px; color: var(--ink); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.img-item__size { font-size: 10.5px; color: var(--ink-soft); }
.img-empty { font-size: 12.5px; color: var(--ink-soft); margin: 0; }

.img-manage {
  background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 18px; margin-top: 18px;
}
.img-manage h2 {
  font-size: 14px; margin: 0 0 6px;
  font-family: 'M PLUS Rounded 1c', 'Noto Sans JP', sans-serif;
}
.img-list--manage { margin: 14px 0; }
.img-upload {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding-top: 14px; border-top: 1px solid var(--line);
}
.img-upload input[type=file] { font-size: 12.5px; max-width: 100%; }

.img-modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(20, 32, 30, 0.86);
  display: flex; align-items: center; justify-content: center;
  padding: 30px; cursor: zoom-out;
}
.img-modal img {
  max-width: 100%; max-height: 100%;
  border-radius: 10px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

@media (max-width: 640px) {
  .action-panel { flex-direction: column; align-items: stretch; }
  .action-form { flex-direction: column; align-items: stretch; }
  .action-input { min-width: 0; }
  .img-item { width: calc(50% - 6px); }
}

/* =========================================================
   Order / lost decision form
   ========================================================= */

.decide-form {
  display: flex; flex-direction: column; gap: 12px;
  width: 100%; padding-top: 12px; border-top: 1px solid var(--line);
}
.decide-pick { display: flex; gap: 10px; flex-wrap: wrap; }
.decide-opt {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; border-radius: 999px;
  border: 1.5px solid var(--line); background: #fff;
  font-size: 13.5px; font-weight: 800; cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.decide-opt input { accent-color: var(--teal); }
.decide-opt.is-on { border-color: var(--teal); background: #E9F6F3; color: var(--teal-deep); }
.decide-opt--lost.is-on { border-color: #C9C9C9; background: #F2F2F2; color: #6B6B6B; }

.decide-fields {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px;
}
.decide-field { display: flex; flex-direction: column; gap: 5px; }
.decide-label { font-size: 12px; font-weight: 700; color: var(--ink); }
.decide-label em {
  font-style: normal; font-size: 10px; font-weight: 800;
  background: #FCE4DF; color: #D14B2E;
  padding: 2px 7px; border-radius: 999px; margin-left: 5px;
}
.decide-form .action-input { min-width: 0; width: 100%; box-sizing: border-box; }
.decide-form .btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.decide-form > .btn { align-self: flex-start; }

@media (max-width: 640px) {
  .decide-fields { grid-template-columns: 1fr; }
  .decide-form > .btn { align-self: stretch; }
}

/* =========================================================
   Production record
   ========================================================= */

.sheet th.est, .sheet td.est {
  background: #F7F9FA;
  color: var(--ink-soft);
}
.sheet th.est { background: #EEF3F4; }

.row--changed { background: #FFFBEF; }
.row--changed td.pad, .row--changed .label-cell { font-weight: 600; }
.row--changed::after { content: ''; }
.row--changed td:first-child { box-shadow: inset 3px 0 0 var(--yellow); }

.row--alert { background: #FFF6F4; }
.row--alert td { border-bottom-color: #F5DED7; }

.diff--over { color: var(--danger) !important; font-weight: 800; }

.complete-panel {
  background: #fff; border: 1px solid var(--line);
  border-left: 4px solid var(--yellow);
  border-radius: 14px; padding: 18px; margin-top: 20px;
}
.complete-panel h2 {
  font-size: 14px; margin: 0 0 6px;
  font-family: 'M PLUS Rounded 1c', 'Noto Sans JP', sans-serif;
}
.complete-panel form { margin-top: 12px; }

.alert--error strong { display: block; margin-bottom: 4px; }
.alert .inline-form { margin-left: 10px; display: inline-block; }

@media (max-width: 640px) {
  .sheet th.est, .sheet td.est { font-size: 11px; }
}

/* =========================================================
   Board sync / monthly report
   ========================================================= */

.ym-picker select {
  border: 1.5px solid var(--line); border-radius: 999px;
  padding: 9px 18px; font-size: 14px; font-weight: 700;
  background: #fff; outline: none; cursor: pointer;
  font-family: inherit;
}
.ym-picker select:focus { border-color: var(--teal); }

.sync-panel {
  background: #fff; border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 14px; padding: 16px 18px; margin-bottom: 16px;
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 14px;
}
.sync-panel__status { display: flex; align-items: flex-start; gap: 10px; flex: 1 1 300px; }
.sync-msg { font-size: 12.5px; line-height: 1.7; }
.sync-msg code {
  background: #F0F4F3; padding: 1px 6px; border-radius: 5px;
  font-size: 11.5px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.sync-panel__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sync-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sync-field { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-soft); }
.sync-field input {
  border: 1.5px solid var(--line); border-radius: 9px;
  padding: 7px 10px; font-size: 12.5px; background: #FCFDFC;
  outline: none; font-family: inherit;
}
.sync-field input:focus { border-color: var(--teal); background: #fff; }
.sync-sep { color: var(--ink-soft); font-size: 12px; }

.alert--warn {
  background: #FFFBEF; border: 1px solid #F0E0AE; color: #8A6A0B;
}
.alert--warn strong { display: block; margin-bottom: 6px; }
.alert-list { margin: 0; padding-left: 18px; }
.alert-list li { margin: 2px 0; }

.total-row {
  background: #F4F8F7; font-weight: 700;
}
.total-row td { border-top: 2px solid var(--line); padding: 12px 14px; }

.sum-value small { font-size: 12px; font-weight: 700; margin-left: 2px; color: var(--ink-soft); }

@media (max-width: 640px) {
  .sync-panel { flex-direction: column; align-items: stretch; }
  .sync-form { flex-direction: column; align-items: stretch; }
  .ym-picker select { width: 100%; }
}

/* =========================================================
   Maintenance alerts (added 2026-08-15)
   All comments in English on purpose: keep this file pure ASCII.
   ========================================================= */

/* --- small shared helpers --- */
.form-hint {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-soft);
}
.form-static {
  margin: 0;
  padding: 9px 0;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}
.section-title--flush { margin-bottom: 4px; }
.stat-chip--active {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(26, 175, 156, .12);
}
.radio-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 5px 0;
  font-size: 13px;
  line-height: 1.6;
  cursor: pointer;
}
/* Cancel the width:100% coming from .form-field input */
.radio-row input[type="radio"],
.radio-row input[type="checkbox"] {
  width: auto;
  min-width: 0;
  flex: 0 0 auto;
  margin: 2px 0 0;
  accent-color: var(--teal);
}
.radio-row > span { min-width: 0; }
fieldset.form-field { border: none; margin: 0; padding: 0; }

/* Boxed radio options, for choices that need a description */
.radio-card-group { display: flex; flex-direction: column; gap: 8px; }
.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 15px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease;
}
.radio-card:hover { border-color: #C6D6D1; }
.radio-card:has(input:checked) {
  border-color: var(--teal);
  background: #F5FBFA;
  box-shadow: 0 0 0 3px rgba(26, 175, 156, .1);
}
.radio-card input[type="radio"] {
  width: auto;
  min-width: 0;
  flex: 0 0 auto;
  margin: 2px 0 0;
  accent-color: var(--teal);
}
.radio-card__body { min-width: 0; }
.radio-card__body strong { display: block; font-size: 13.5px; font-weight: 800; }
.radio-card__body span {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--ink-soft);
  line-height: 1.65;
}

/* --- maintenance definition editor (template / production record) --- */
.mt-def { margin-bottom: 22px; }
.mt-def__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.mt-def__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.sheet--def { min-width: 720px; }
.sheet--def .w-qty { width: 110px; }
.sheet--def .w-unit { width: 60px; }

.mt-alerts { margin-bottom: 12px; }
.mt-alerts .row--alert td { background: #FFF6F4; }

/* --- alert list --- */
.alert-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.mt-card {
  background: #fff;
  border: 1.5px solid var(--line);
  border-left: 5px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(31, 42, 46, .04);
}
.mt-card--due    { border-left-color: var(--orange); }
.mt-card--over   { border-left-color: var(--danger); background: #FFFCFB; }
.mt-card--done   { border-left-color: var(--teal); opacity: .82; }
.mt-card--off    { border-left-color: #C9D3D0; opacity: .68; }

.mt-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.mt-card__title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.mt-card__title h2 { font-size: 15.5px; font-weight: 800; }

.mt-card__due {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.mt-card__due-label { font-size: 11.5px; color: var(--ink-soft); font-weight: 700; }
.mt-card__due strong { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.mt-card__left {
  font-size: 12px;
  font-weight: 700;
  color: var(--teal-deep);
  background: #E1F4F0;
  border-radius: 999px;
  padding: 2px 9px;
}
.mt-card__left.is-over { color: var(--danger); background: #FCE4DF; }

.mt-card__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px 18px;
  margin: 0 0 12px;
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
}
.mt-card__meta > div { display: flex; gap: 8px; align-items: baseline; }
.mt-card__meta dt {
  font-size: 11.5px;
  color: var(--ink-soft);
  font-weight: 700;
  min-width: 66px;
  flex-shrink: 0;
}
.mt-card__meta dd { margin: 0; font-size: 13px; font-weight: 700; }

.mt-card__result {
  margin: 0 0 10px;
  padding: 9px 12px;
  background: var(--mist);
  border-radius: 9px;
  font-size: 12.5px;
  color: var(--ink-soft);
}
.mt-card__note {
  margin: 0 0 10px;
  padding: 9px 12px;
  background: #FFFBEF;
  border: 1px solid #F0E0AE;
  border-radius: 9px;
  font-size: 12.5px;
  line-height: 1.7;
}
.mt-card__actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.mt-panel {
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--mist);
  border-radius: 11px;
}
.mt-panel__lead { margin: 0 0 10px; font-size: 12.5px; color: var(--ink-soft); }
.mt-panel__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px 18px;
  margin-bottom: 12px;
}
.mt-panel .form-field textarea,
.mt-panel .form-field input { background: #fff; }
.mt-panel__actions { margin-top: 12px; }

@media (max-width: 640px) {
  .mt-card__head { flex-direction: column; align-items: stretch; }
  .mt-card__actions .btn { flex: 1 1 auto; justify-content: center; }
  .mt-def__head { flex-direction: column; align-items: stretch; }
}



/* =========================================================
   Dashboard v3 (added 2026-08-15)
   Menu cards on top, then tasks (left) and team status (right).
   Comments in English on purpose: keep this file pure ASCII.
   ========================================================= */

.dash-main { max-width: 1280px; }

/* Five business cards fit on one row on a wide screen */
.grid--biz { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }

/* Divider between the menu area and the task area */
.dash-split {
  margin: 34px 0 0;
  border-top: 1px solid var(--line);
  padding-top: 30px;
}

.dash-lower {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr);
  gap: 24px;
  align-items: start;
}
.dash-lower--single { grid-template-columns: minmax(0, 1fr); }
.dash-lower__col { min-width: 0; }

.section-count {
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: var(--teal);
  border-radius: 999px;
  padding: 1px 8px;
  font-variant-numeric: tabular-nums;
}
.section-note { font-size: 11.5px; font-weight: 700; color: #9AAAA6; }

/* ---------- Empty state: one slim line ---------- */
.task-none {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 12.5px;
  color: var(--ink-soft);
}
.task-none__mark {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #E1F4F0;
  color: var(--teal-deep);
  font-size: 11px;
  font-weight: 800;
}

/* ---------- Task card ---------- */
.task-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(31, 42, 46, .05);
}
.task-block { padding: 14px 18px 12px; }
.task-block + .task-block { border-top: 1px solid var(--line); }

.task-block__head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 5px;
}
.task-block__head h3 {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  flex: 1;
  min-width: 0;
}
.task-block__num {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.task-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--teal);
}
.task-dot--teal   { background: var(--teal); }
.task-dot--yellow { background: var(--yellow); }
.task-dot--orange { background: var(--orange); }
.task-dot--red    { background: var(--danger); }

.task-list { list-style: none; margin: 0; padding: 0; }

.task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  margin: 0 -10px;
  border-radius: 10px;
  transition: background .12s ease;
}
.task-item:hover { background: var(--mist); }
.task-item.is-alert:hover { background: #FFF6F4; }

.task-item__main { min-width: 0; }
.task-item__title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-item__sub {
  display: block;
  font-size: 11px;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-item .tag { flex-shrink: 0; }

.task-more {
  display: inline-block;
  margin-top: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--teal-deep);
}
.task-more:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .dash-lower { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .dash-split { margin-top: 26px; padding-top: 24px; }
  .task-block { padding: 12px 14px 10px; }
}

/* =========================================================
   Light topbar (added 2026-08-15)
   The heavy green bar is replaced by a thin accent strip plus
   a light bar, so the header merges into the page itself.
   ========================================================= */

/* Thin brand strip across the very top */
.page::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--teal-deep) 0%, var(--teal) 55%, var(--yellow) 100%);
}

.topbar {
  padding: 12px 28px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}
.topbar__title {
  color: var(--ink);
  font-size: 14.5px;
  letter-spacing: .3px;
  opacity: 1;
}
.topbar .brand-badge--sm { box-shadow: 0 3px 10px rgba(14, 124, 107, .22); }

.user-chip {
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  transition: border-color .14s ease, background .14s ease;
}
.user-chip:hover { border-color: var(--teal); background: var(--mist); }
.user-chip__role {
  color: var(--ink-soft);
  background: var(--mist);
}

/* On the dashboard the bar shares the hero background, so the
   title, the account chip and the greeting read as one block. */
.is-dashboard .user-chip { background: rgba(255, 255, 255, .55); }
.is-dashboard .user-chip:hover { background: #fff; }

@media (max-width: 640px) {
  .topbar { padding: 10px 16px; }
}

/* =========================================================
   Dashboard header block (updated 2026-08-15)
   The greeting block starts right under the brand stripe and the
   bar floats on top of it, so the balloons fill the whole area.
   ========================================================= */

.is-dashboard .topbar {
  position: absolute;
  top: 3px;
  left: 0;
  right: 0;
  background: transparent;
  border-bottom: none;
  z-index: 3;
}
.is-dashboard .dash-hero {
  padding: 74px 28px 34px;
  border-top: none;
}

/* A little more travel so the drift is easier to notice */
@keyframes driftA {
  0%   { transform: translate(0, 0) rotate(0deg); }
  50%  { transform: translate(-26px, -34px) rotate(3deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}
@keyframes driftB {
  0%   { transform: translate(0, 0) rotate(0deg); }
  50%  { transform: translate(24px, -30px) rotate(-3deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}
@keyframes driftC {
  0%   { transform: translate(0, 0) rotate(0deg); }
  50%  { transform: translate(-18px, -38px) rotate(2.5deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

@media (max-width: 640px) {
  .is-dashboard .dash-hero { padding: 62px 16px 24px; }
}

/* =========================================================
   Monthly report v2 + guide (added 2026-08-15)
   Comments in English on purpose: keep this file pure ASCII.
   ========================================================= */

/* ---------- Sample banner ---------- */
.sample-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 13px 18px;
  margin-bottom: 18px;
  background: #FFFBEF;
  border: 1.5px solid #F0DFA6;
  border-radius: 14px;
}
.sample-banner__tag {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  color: #8A6A08;
  background: #F7E3A1;
  border-radius: 999px;
  padding: 3px 11px;
}
.sample-banner__body { flex: 1; min-width: 220px; }
.sample-banner__body strong { display: block; font-size: 13.5px; }
.sample-banner__body p { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-soft); }

/* ---------- KPI tiles ---------- */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
}
.kpi--accent {
  background: linear-gradient(160deg, #E9F7F4 0%, #fff 70%);
  border-color: #BCE5DC;
}
.kpi__label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 5px;
}
.kpi__value {
  display: block;
  font-size: 21px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}
.kpi__sub {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--ink-soft);
}
.kpi__sub .is-minus { color: var(--danger); font-weight: 700; }
.kpi__sub .is-plus  { color: var(--teal-deep); font-weight: 700; }

/* ---------- Charts ---------- */
.chart-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 14px;
  margin-bottom: 20px;
  align-items: start;
}
.chart-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
}
.chart-card__title {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-soft);
  letter-spacing: .03em;
  margin-bottom: 14px;
}
.chart-card__note {
  margin: 12px 0 0;
  font-size: 11.5px;
  color: var(--ink-soft);
  line-height: 1.7;
}

.bar-chart { display: flex; flex-direction: column; gap: 11px; }
.bar-chart__row {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}
.bar-chart__label { font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.bar-chart__track {
  display: block;
  height: 15px;
  border-radius: 999px;
  background: var(--mist);
  overflow: hidden;
}
.bar-chart__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width .5s cubic-bezier(.22,.61,.36,1);
}
.bar-chart__value { font-size: 12px; font-weight: 700; white-space: nowrap; }

.donut-wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.donut { width: 160px; height: 160px; flex-shrink: 0; }
.donut__num { font-size: 20px; font-weight: 800; fill: var(--ink); }
.donut__unit { font-size: 10px; font-weight: 700; fill: var(--ink-soft); }

.legend {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  min-width: 240px;
  columns: 1;
}
.legend li {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  font-size: 11.5px;
}
.legend__dot { width: 9px; height: 9px; border-radius: 3px; }
.legend__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend__pct { font-weight: 800; text-align: right; }
.legend__amt { color: var(--ink-soft); text-align: right; min-width: 82px; }

/* ---------- Sortable table headers ---------- */
.table-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.th-sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: inherit;
  white-space: nowrap;
}
.th-sort:hover { color: var(--teal-deep); text-decoration: underline; }
.th-sort span { font-size: 9px; color: var(--teal); }
.th-sort.is-on { color: var(--teal-deep); font-weight: 800; }

/* ---------- Guide ---------- */
.guide-section { margin-bottom: 34px; }
.guide-h2 {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--line);
}
.guide-lead { font-size: 13px; color: var(--ink-soft); line-height: 1.85; margin-bottom: 16px; }

.flow-steps { list-style: none; margin: 0; padding: 0; }
.flow-steps li {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}
.flow-steps li:last-child { border-bottom: none; }
.flow-steps__num {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-size: 12.5px;
  font-weight: 800;
}
.flow-steps strong { display: block; font-size: 13.5px; margin-bottom: 3px; }
.flow-steps p { margin: 0; font-size: 12.5px; color: var(--ink-soft); line-height: 1.8; }

.guide-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}
.guide-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
}
.guide-card h3 {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 8px;
  padding-left: 10px;
  border-left: 3px solid var(--teal);
}
.guide-card p { margin: 0 0 8px; font-size: 12.5px; line-height: 1.8; }
.guide-card ul { margin: 0 0 8px; padding-left: 18px; }
.guide-card li { font-size: 12.5px; line-height: 1.85; color: var(--ink-soft); }
.guide-card :last-child { margin-bottom: 0; }
.guide-flow {
  background: var(--mist);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px !important;
  font-weight: 700;
}
.guide-cta { margin-top: 12px !important; }

.term-list { margin: 0; }
.term-list > div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.term-list > div:last-child { border-bottom: none; }
.term-list dt { font-size: 13px; font-weight: 800; }
.term-list dd { margin: 0; font-size: 12.5px; color: var(--ink-soft); line-height: 1.8; }

.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
}
.faq summary {
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: "+";
  color: var(--teal-deep);
  font-weight: 800;
  font-size: 15px;
  line-height: 1;
}
.faq[open] summary::before { content: "-"; }
.faq[open] summary { margin-bottom: 8px; }
.faq p { margin: 0; font-size: 12.5px; color: var(--ink-soft); line-height: 1.85; padding-left: 18px; }

@media (max-width: 900px) {
  .chart-row { grid-template-columns: 1fr; }
  .term-list > div { grid-template-columns: 1fr; gap: 3px; }
}
@media (max-width: 640px) {
  .bar-chart__row { grid-template-columns: 58px minmax(0, 1fr); }
  .bar-chart__value { grid-column: 2; text-align: right; }
  .donut-wrap { justify-content: center; }
}

/* ---------- Monthly report: extra summary bits (2026-08-15) ---------- */
.stat-heading { margin-bottom: 10px; }

.kpi--sm .kpi__value { font-size: 19px; }
.kpi__value small { font-size: 12px; font-weight: 700; margin-left: 2px; color: var(--ink-soft); }

.mini-kpi {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.mini-kpi > div { display: flex; flex-direction: column; gap: 2px; }
.mini-kpi span { font-size: 11px; color: var(--ink-soft); font-weight: 700; }
.mini-kpi strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.mini-kpi .is-minus { color: var(--danger); }
.mini-kpi .is-plus  { color: var(--teal-deep); }

.stack-bar {
  display: flex;
  height: 12px;
  margin-top: 16px;
  border-radius: 999px;
  overflow: hidden;
  background: #EEF3F1;
}
.stack-bar__seg { display: block; height: 100%; }

/* =========================================================
   Guide: two-part manual (added 2026-08-16)
   Comments in English on purpose: keep this file pure ASCII.
   ========================================================= */

/* ---------- Table of contents ---------- */
.toc {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  padding: 18px 20px;
  margin-bottom: 34px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.toc__group h2 {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--teal-deep);
  margin-bottom: 8px;
}
.toc__group ol { margin: 0; padding-left: 20px; }
.toc__group li { font-size: 12.5px; line-height: 2; }
.toc__group a { color: var(--ink); }
.toc__group a:hover { color: var(--teal-deep); text-decoration: underline; }

/* ---------- Part headers ---------- */
.part-label {
  display: inline-block;
  margin: 0 0 6px;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
}
.part-title {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 8px;
}
.part-lead {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.85;
  margin: 0 0 26px;
  padding-bottom: 18px;
  border-bottom: 3px solid var(--teal);
}

.guide-section { scroll-margin-top: 80px; }
.guide-section .guide-h2 { font-size: 15.5px; }

/* ---------- Before / after ---------- */
.issue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.issue {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
}
.issue p { margin: 0 0 10px; font-size: 12.5px; line-height: 1.8; color: var(--ink-soft); }
.issue p:last-child { margin-bottom: 0; color: var(--ink); }
.issue__before, .issue__after {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 999px;
  margin-bottom: 5px;
}
.issue__before { background: var(--mist); color: var(--ink-soft); }
.issue__after  { background: #E1F4F0; color: var(--teal-deep); }

/* ---------- Callouts ---------- */
.callout {
  background: #FCFDFD;
  border: 1px solid var(--line);
  border-left: 4px solid var(--ink-soft);
  border-radius: 12px;
  padding: 14px 18px;
  margin-top: 16px;
}
.callout strong { display: block; font-size: 13px; margin-bottom: 5px; }
.callout p { margin: 0; font-size: 12.5px; line-height: 1.85; color: var(--ink-soft); }
.callout--teal { border-left-color: var(--teal); background: #F5FBFA; }
.callout--warn { border-left-color: var(--orange); background: #FFFBF6; }

/* ---------- Flow map ---------- */
.flow-map {
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow-x: auto;
}
.flow-map__col {
  flex: 1 1 210px;
  min-width: 190px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.flow-map__col h4 {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--ink-soft);
  letter-spacing: .04em;
  margin-bottom: 3px;
}
.flow-map__col--base { background: #F7FAF9; border-radius: 12px; padding: 10px; margin: -10px 0; }
.flow-map__arrow {
  display: flex;
  align-items: center;
  color: #B7C4C1;
  font-size: 17px;
  font-weight: 800;
  flex-shrink: 0;
}

.fm-box {
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.4;
}
.fm-box span {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-soft);
  line-height: 1.5;
}
.fm-box--base  { border-color: #D5E2DE; }
.fm-box--main  { border-color: var(--teal); background: #F3FAF8; }
.fm-box--alert { border-color: #F0C7BC; background: #FFF7F5; }
.fm-box--ext   { border-color: #D9D3C4; background: #FBFAF5; border-style: dashed; }
.fm-box--goal  { border-color: var(--teal-deep); background: #E4F4F0; }
.fm-chain {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-soft);
  text-align: center;
  line-height: 1.2;
}

/* ---------- Setup steps ---------- */
.setup-steps { list-style: none; margin: 0 0 4px; padding: 0; }
.setup-steps li {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.setup-steps li:last-child { border-bottom: none; }
.setup-steps__num {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 9px;
  background: var(--teal-deep);
  color: #fff;
  font-size: 13.5px;
  font-weight: 800;
}
.setup-steps__body { min-width: 0; }
.setup-steps__body h4 {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 5px;
}
.setup-steps__who {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-soft);
  background: var(--mist);
  border-radius: 999px;
  padding: 2px 9px;
}
.setup-steps__body p { margin: 0 0 7px; font-size: 12.5px; line-height: 1.8; }
.setup-steps__body ul { margin: 0; padding-left: 18px; }
.setup-steps__body li {
  display: list-item;
  padding: 0;
  border: none;
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--ink-soft);
}
.setup-steps__warn {
  margin-top: 9px !important;
  padding: 9px 12px;
  background: #FFF7F5;
  border-radius: 9px;
  font-size: 12px !important;
  color: #A8442A;
}

@media (max-width: 640px) {
  .part-title { font-size: 19px; }
  .flow-map { flex-direction: column; }
  .flow-map__arrow { justify-content: center; transform: rotate(90deg); }
  .flow-map__col--base { margin: 0; }
}

/* =========================================================
   Monthly report v3 (added 2026-08-16)
   Fiscal-year picker, template-type breakdown.
   Comments in English on purpose: keep this file pure ASCII.
   ========================================================= */


/* ---------- Summary ---------- */
.kpi-row--main { grid-template-columns: 0.7fr repeat(4, minmax(160px, 1fr)); }

.kpi-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  padding: 11px 18px;
  margin: -4px 0 22px;
  background: #FCFDFD;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.kpi-sub > div { display: flex; align-items: baseline; gap: 9px; }
.kpi-sub span { font-size: 11.5px; font-weight: 700; color: var(--ink-soft); }
.kpi-sub strong { font-size: 13.5px; font-weight: 800; }
.kpi-sub .is-minus { color: var(--danger); }

/* ---------- Template cards ---------- */
.tpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.tpl-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px 18px;
  overflow: hidden;
}
.tpl-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--tpl-accent);
}

.tpl-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.tpl-card__id { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; min-width: 0; }
.tpl-card__mark {
  width: 10px; height: 10px;
  border-radius: 3px;
  background: var(--tpl-accent);
  flex-shrink: 0;
}
.tpl-card__id h3 { font-size: 15px; font-weight: 800; }
.tpl-card__count {
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-soft);
  background: var(--mist);
  border-radius: 999px;
  padding: 2px 9px;
}
.tpl-card__share { text-align: right; flex-shrink: 0; }
.tpl-card__share span { display: block; font-size: 10.5px; font-weight: 700; color: var(--ink-soft); }
.tpl-card__share strong { font-size: 15px; font-weight: 800; }

.tpl-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.tpl-metrics > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tpl-metrics span { font-size: 10.5px; font-weight: 700; color: var(--ink-soft); }
.tpl-metrics strong { font-size: 14px; font-weight: 800; }
.tpl-metrics__rate strong { color: var(--tpl-accent); font-size: 16px; }

/* Cost vs profit in one bar */
.split-bar {
  display: flex;
  height: 22px;
  margin: 14px 0 0;
  border-radius: 7px;
  overflow: hidden;
  background: var(--mist);
}
.split-bar span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
}
.split-bar em {
  font-style: normal;
  font-size: 10.5px;
  font-weight: 800;
  white-space: nowrap;
  color: #fff;
}
.split-bar__cost   { background: #6E7C79; }
.split-bar__profit { background: var(--tpl-accent); }

.tpl-breakdown { margin-top: 16px; }
.tpl-breakdown h4 {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--ink-soft);
  letter-spacing: .03em;
  margin-bottom: 8px;
}
.stack-bar--lg { height: 14px; margin-top: 0; }

.legend--grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0 16px;
  margin-top: 10px;
  min-width: 0;
}
.legend--grid li { grid-template-columns: 10px minmax(0, 1fr) auto; gap: 7px; }
.legend--grid .legend__amt { display: none; }

.empty--sm { padding: 14px; font-size: 12px; }

/* ---------- Template comparison ---------- */
.compare-card { margin-bottom: 20px; }
.compare-rows { display: flex; flex-direction: column; gap: 12px; }
.compare-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) 150px;
  align-items: center;
  gap: 12px;
}
.compare-row__name {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.compare-row__track {
  display: flex;
  height: 17px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--mist);
}
.compare-row__cost   { display: block; height: 100%; background: #6E7C79; }
.compare-row__profit { display: block; height: 100%; }
.compare-row__val { font-size: 12.5px; font-weight: 800; text-align: right; }
.compare-row__val em {
  display: block;
  font-style: normal;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-soft);
}

@media (max-width: 900px) {
  .kpi-row--main { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .tpl-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .tpl-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .compare-row { grid-template-columns: 100px minmax(0, 1fr); }
  .compare-row__val { grid-column: 2; text-align: left; }
}

/* ---------- Period picker (year + month) ---------- */
.period-picker {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  box-shadow: 0 1px 3px rgba(31, 42, 46, .06);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.period-picker:hover { border-color: #C6D6D1; }
.period-picker:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(26, 175, 156, .14);
}

.period-picker__field { position: relative; display: flex; align-items: center; }
.period-picker__field + .period-picker__field::before {
  content: "";
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 1px;
  background: var(--line);
}

.period-picker select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border: none;
  outline: none;
  background: transparent;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
  padding: 8px 30px 8px 16px;
  min-width: 0;
  transition: background .14s ease;
}
.period-picker select:hover { background: var(--mist); }
.period-picker select:focus-visible { background: var(--mist); }
.period-picker select::-ms-expand { display: none; }

/* Year is quieter than the period itself */
.period-picker__field--year select { color: var(--ink-soft); font-weight: 700; }

.period-picker__caret {
  position: absolute;
  right: 12px;
  width: 9px;
  height: 9px;
  pointer-events: none;
  color: #9AAAA6;
}
.period-picker__field:hover .period-picker__caret { color: var(--teal-deep); }

@media (max-width: 640px) {
  .period-picker { width: 100%; }
  .period-picker__field { flex: 1; }
  .period-picker select { width: 100%; padding-left: 13px; }
}

/* Group headings inside the period picker */
.period-picker optgroup {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--ink-soft);
  background: #fff;
}
.period-picker option {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  padding: 4px 0;
}

/* =========================================================
   Cost sheet: create mode switch (added 2026-08-19)
   Comments in English on purpose: keep this file pure ASCII.
   ========================================================= */

.mode-switch {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.mode-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 15px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease;
}
.mode-option:hover { border-color: #C6D6D1; }
.mode-option.is-on {
  border-color: var(--teal);
  background: #F5FBFA;
  box-shadow: 0 0 0 3px rgba(26, 175, 156, .1);
}
.mode-option input { margin: 3px 0 0; flex-shrink: 0; }
.mode-option__body { min-width: 0; }
.mode-option__body strong { display: block; font-size: 13.5px; font-weight: 800; }
.mode-option__body span {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--ink-soft);
  line-height: 1.6;
}

.copy-preview {
  padding: 13px 16px;
  margin-bottom: 16px;
  background: var(--mist);
  border-radius: 12px;
}
.copy-preview__head {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 7px;
}
.copy-preview__head strong { font-size: 13.5px; font-weight: 800; }
.copy-preview__note {
  margin: 0;
  font-size: 12px;
  line-height: 1.85;
  color: var(--ink-soft);
}
.copy-preview__note strong { color: var(--ink); }

/* Buttons on the right of a page heading */
.page-head__actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }

/* =========================================================
   Teams (added 2026-08-20)
   Comments in English on purpose: keep this file pure ASCII.
   ========================================================= */

.tag--prod { background: #EDE9FB; color: #5A47B8; }

.team-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
}
.team-chip__dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--team-color, #8C9A97);
  flex-shrink: 0;
}
.team-chip--sm {
  font-size: 11.5px;
  font-weight: 700;
  background: var(--mist);
  border-radius: 999px;
  padding: 2px 9px;
  margin: 1px 3px 1px 0;
}
.team-chip__lead {
  font-size: 9.5px;
  font-weight: 800;
  color: #fff;
  background: var(--team-color, #8C9A97);
  border-radius: 3px;
  padding: 0 4px;
  line-height: 1.5;
}

/* Colour picker */
.color-picker { display: flex; gap: 8px; flex-wrap: wrap; padding: 4px 0; }
.color-swatch {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--swatch);
  cursor: pointer;
  border: 2px solid transparent;
  box-shadow: inset 0 0 0 2px #fff;
  transition: transform .12s ease, border-color .12s ease;
}
.color-swatch:hover { transform: translateY(-1px); }
.color-swatch.is-on { border-color: var(--swatch); }
.color-swatch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

/* Member picker */
.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 9px;
}
.member-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  transition: border-color .14s ease, background .14s ease;
}
.member-card.is-on { border-color: var(--teal); background: #F5FBFA; }
.member-card__main {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  cursor: pointer;
  min-width: 0;
  flex: 1;
}
.member-card__main input[type="checkbox"] {
  width: auto;
  min-width: 0;
  flex: 0 0 auto;
  margin: 2px 0 0;
  accent-color: var(--teal);
}
.member-card__main strong { display: block; font-size: 13px; font-weight: 700; }
.member-card__meta {
  display: block;
  margin-top: 1px;
  font-size: 11px;
  color: var(--ink-soft);
}
.member-card__leader {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--teal-deep);
  cursor: pointer;
}
.member-card__leader input[type="checkbox"] {
  width: auto;
  min-width: 0;
  margin: 0;
  accent-color: var(--teal);
}

/* =========================================================
   Product categories (added 2026-08-20)
   Comments in English on purpose: keep this file pure ASCII.
   ========================================================= */

.cat-list { display: flex; flex-direction: column; gap: 12px; }

.cat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 15px 18px;
}
.cat-card.is-off { opacity: .62; }

.cat-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.cat-card__id { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; min-width: 0; }
.cat-card__id h2 { font-size: 15px; font-weight: 800; }
.cat-card__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cat-card__count { font-size: 11.5px; font-weight: 700; color: var(--ink-soft); }
.cat-card__desc { margin: 6px 0 0; font-size: 12.5px; color: var(--ink-soft); }

.cat-card__templates {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.cat-card__empty { margin: 0; font-size: 12px; color: var(--ink-soft); }

.fmt-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  background: var(--mist);
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12.5px;
  transition: border-color .14s ease, background .14s ease;
}
.fmt-chip:hover { background: #fff; border-color: var(--teal); }
.fmt-chip strong { font-weight: 700; }
.fmt-chip.is-off { opacity: .55; }

/* =========================================================
   Cost request flow: team assignment (added 2026-08-20)
   Comments in English on purpose: keep this file pure ASCII.
   ========================================================= */

.request-note {
  background: #FFFBEF;
  border: 1px solid #F0DFA6;
  border-radius: 14px;
  padding: 15px 18px;
  margin-bottom: 20px;
}
.request-note h2 {
  font-size: 12.5px;
  font-weight: 800;
  color: #8A6A08;
  margin-bottom: 8px;
}
.request-note__amount { margin: 0 0 7px; font-size: 13px; }
.request-note__amount strong { font-size: 16px; font-weight: 800; }
.request-note__body { margin: 0; font-size: 12.5px; line-height: 1.85; }

/* ---------- Steps ---------- */
.assign-step {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 16px;
}
.assign-step__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.assign-step__num {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-size: 12.5px;
  font-weight: 800;
}
.assign-step__head h2 { font-size: 15px; font-weight: 800; }
.assign-step__head p { margin: 2px 0 0; font-size: 12px; color: var(--ink-soft); }
.assign-step__stat { margin-left: auto; text-align: right; flex-shrink: 0; }
.assign-step__stat span { display: block; font-size: 10.5px; font-weight: 700; color: var(--ink-soft); }
.assign-step__stat strong { font-size: 16px; font-weight: 800; }
.assign-step__stat .is-alert { color: var(--danger); }

/* ---------- Team picker ---------- */
.team-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 9px;
}
.team-pick {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease;
}
.team-pick:hover { border-color: #C6D6D1; }
.team-pick.is-on { border-color: var(--team-color); background: #FAFDFC; }
.team-pick input[type="checkbox"] {
  width: auto;
  min-width: 0;
  flex: 0 0 auto;
  margin: 2px 0 0;
  accent-color: var(--team-color);
}
.team-pick__body { min-width: 0; }
.team-pick__body strong { display: block; font-size: 13px; font-weight: 800; }
.team-pick__body span {
  display: block;
  margin-top: 1px;
  font-size: 11px;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Section assignment ---------- */
.assign-sections { display: flex; flex-direction: column; gap: 9px; }
.assign-section {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 15px;
}
.assign-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.assign-section__id { display: flex; align-items: baseline; gap: 8px; }
.assign-section__id strong { font-size: 13.5px; font-weight: 800; }
.assign-section__count { font-size: 11px; color: var(--ink-soft); font-weight: 700; }
.assign-section__bulk { display: flex; align-items: center; gap: 8px; }
.assign-section__bulk select { font-size: 12px; padding: 6px 10px; min-width: 168px; }

.assign-section__state {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 9px;
}
.assign-warn {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--danger);
  background: #FCE4DF;
  border-radius: 999px;
  padding: 2px 9px;
}

.assign-rows {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  max-height: 420px;
  overflow-y: auto;
}
.assign-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 10px;
  border-radius: 8px;
}
.assign-row:hover { background: var(--mist); }
.assign-row.is-unassigned { background: #FFF6F4; }
.assign-row__label { min-width: 0; }
.assign-row__label strong {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.assign-row__label span {
  display: block;
  font-size: 11px;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.assign-row select { width: 168px; flex-shrink: 0; font-size: 12px; padding: 5px 9px; }

.assign-guard {
  font-size: 12px;
  font-weight: 700;
  color: var(--danger);
  margin-right: auto;
}

@media (max-width: 640px) {
  .assign-section__head { flex-direction: column; align-items: stretch; }
  .assign-section__bulk select { flex: 1; min-width: 0; }
  .assign-row { flex-direction: column; align-items: stretch; gap: 5px; }
  .assign-row select { width: 100%; }
}

/* ---------- Cost input phase (team based) ---------- */
.input-guide {
  background: #F5FBFA;
  border: 1px solid #BCE5DC;
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 14px;
}
.input-guide__msg { font-size: 12.5px; line-height: 1.8; }
.input-guide__msg strong { font-weight: 800; }
.input-guide__note { margin-top: 10px; }
.input-guide__note summary {
  font-size: 12px;
  font-weight: 700;
  color: var(--teal-deep);
  cursor: pointer;
}
.input-guide__note p { margin: 8px 0 0; font-size: 12.5px; line-height: 1.8; }

.team-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.team-board__item {
  background: #fff;
  border: 1.5px solid var(--line);
  border-left: 4px solid var(--team-color, #8C9A97);
  border-radius: 12px;
  padding: 12px 15px;
}
.team-board__item.is-done { background: #FAFDFC; }
.team-board__item.is-mine { border-color: var(--teal); border-left-color: var(--team-color, var(--teal)); }
.team-board__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.team-board__head strong { font-size: 13.5px; font-weight: 800; }
.team-board__mark {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--mist);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
}
.team-board__item.is-done .team-board__mark { background: #E1F4F0; color: var(--teal-deep); }
.team-board__state { margin: 5px 0 0; font-size: 11.5px; color: var(--ink-soft); }
.team-board__note {
  margin: 7px 0 0;
  padding: 7px 10px;
  background: var(--mist);
  border-radius: 8px;
  font-size: 11.5px;
  line-height: 1.7;
}
.team-board__form { display: flex; gap: 7px; margin-top: 10px; flex-wrap: wrap; }
.team-board__form .action-input { flex: 1; min-width: 120px; font-size: 12px; }

.row-team {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 7px;
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-soft);
  white-space: nowrap;
}
.row-team .team-chip__dot { width: 7px; height: 7px; }

.sheet tr.row--locked { background: #FBFCFC; }
.sheet tr.row--locked .cell {
  background: transparent;
  color: #A9B5B2;
  cursor: not-allowed;
}
.sheet tr.row--locked .label-cell { opacity: .55; }

/* ---------- Request form on the detail screen ---------- */
.request-form {
  width: 100%;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
  margin-top: 12px;
}
.request-form__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.request-form__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.team-progress {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
  margin: 4px 0 12px;
}
.team-progress__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--team-color, #8C9A97);
  border-radius: 10px;
}
.team-progress__item.is-done { background: #FAFDFC; }
.team-progress__mark {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--mist);
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
}
.team-progress__item.is-done .team-progress__mark { background: #E1F4F0; color: var(--teal-deep); }
.team-progress__body strong { display: block; font-size: 12.5px; font-weight: 700; }
.team-progress__body span { display: block; font-size: 10.5px; color: var(--ink-soft); }

.action-panel__row { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }

/* =========================================================
   Cost requests (added 2026-08-21)
   Comments in English on purpose: keep this file pure ASCII.
   ========================================================= */

.return-reason {
  width: 100%;
  padding: 12px 15px;
  margin: 10px 0;
  background: #FFF6F4;
  border: 1px solid #F0C7BC;
  border-radius: 11px;
}
.return-reason strong { display: block; font-size: 12px; font-weight: 800; color: #A8442A; margin-bottom: 4px; }
.return-reason p { margin: 0; font-size: 12.5px; line-height: 1.8; }

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.detail-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
}
.detail-card h2 {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .03em;
  color: var(--ink-soft);
  margin-bottom: 10px;
}
.detail-list { margin: 0; }
.detail-list > div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid #F2F6F5;
}
.detail-list > div:last-child { border-bottom: none; }
.detail-list dt { font-size: 11.5px; font-weight: 700; color: var(--ink-soft); }
.detail-list dd { margin: 0; font-size: 12.5px; font-weight: 700; }
.detail-note {
  margin: 10px 0 0;
  padding: 10px 13px;
  background: var(--mist);
  border-radius: 9px;
  font-size: 12.5px;
  line-height: 1.85;
}

.target-amount {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 8px;
  padding: 10px 13px;
  background: #FFFBEF;
  border-radius: 9px;
}
.target-amount span { font-size: 11.5px; font-weight: 700; color: #8A6A08; }
.target-amount strong { font-size: 18px; font-weight: 800; }


@media (max-width: 640px) {
  .detail-list > div { grid-template-columns: 1fr; gap: 2px; }
}

/* =========================================================
   Cost item picker on the template editor (added 2026-08-21)
   Comments in English on purpose: keep this file pure ASCII.
   ========================================================= */

/* Small "+" select tucked next to the item name cell */
.cell-with-pick { position: relative; }
.cell-with-pick .cell { padding-right: 26px; }
.cell-pick {
  position: absolute;
  top: 50%;
  right: 3px;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: var(--mist);
  color: var(--teal-deep);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}
.cell-pick:hover { background: #E1F4F0; }

/* Modal */
.picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(31, 42, 46, .35);
}
.picker {
  display: flex;
  flex-direction: column;
  width: min(720px, 100%);
  max-height: min(78vh, 720px);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(31, 42, 46, .25);
  overflow: hidden;
}
.picker__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
}
.picker__head h2 { font-size: 15.5px; font-weight: 800; }
.picker__head p { margin: 3px 0 0; font-size: 12px; color: var(--ink-soft); }
.picker__close {
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 0 4px;
}
.picker__close:hover { color: var(--ink); }

.picker__search {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
}
.picker__search input {
  flex: 1;
  padding: 9px 13px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
}
.picker__search input:focus { outline: none; border-color: var(--teal); }
.picker__count { font-size: 11.5px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }

.picker__list { flex: 1; overflow-y: auto; padding: 8px 14px; }
.picker__item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .12s ease;
}
.picker__item:hover { background: var(--mist); }
.picker__item.is-on { background: #F0FAF8; }
.picker__item input[type="checkbox"] {
  width: auto;
  min-width: 0;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--teal);
}
.picker__body { flex: 1; min-width: 0; }
.picker__body strong { display: block; font-size: 13px; font-weight: 700; }
.picker__meta {
  display: block;
  font-size: 11px;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.picker__price { text-align: right; flex-shrink: 0; }
.picker__price .mono { font-size: 12.5px; font-weight: 800; }
.picker__unit { display: block; font-size: 10.5px; color: var(--ink-soft); }
.picker__empty { padding: 26px; text-align: center; font-size: 12.5px; color: var(--ink-soft); }

.picker__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: #FCFDFD;
}
.picker__foot > span { font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.picker__foot > div { display: flex; gap: 8px; }

@media (max-width: 640px) {
  .picker-overlay { padding: 12px; }
  .picker { max-height: 88vh; }
  .picker__foot { flex-direction: column; align-items: stretch; }
}

/* =========================================================
   Row hierarchy + money formatting (added 2026-08-26)
   Comments in English on purpose: keep this file pure ASCII.
   ========================================================= */

/* Row type column on the template editor */
.sheet .w-type { width: 76px; }
.cell--type {
  font-size: 11.5px;
  font-weight: 700;
  text-align: center;
  padding: 5px 4px;
}

/* Parent / child rows */
.sheet tr.row--parent > td { background: #F5FBFA; }
.sheet tr.row--parent .cell { font-weight: 800; }
.sheet tr.row--child .w-item,
.sheet tr.row--child .w-task { padding-left: 20px; position: relative; }
.sheet tr.row--child .w-item::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 50%;
  width: 6px;
  height: 1px;
  background: #C6D6D1;
}
.sheet tr.row--child > td { background: #FCFDFD; }

.row-add-child {
  border: none;
  background: #E1F4F0;
  color: var(--teal-deep);
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 7px;
  margin-right: 4px;
  cursor: pointer;
}
.row-add-child:hover { background: var(--teal); color: #fff; }

/* Auto-calculated quantity on the parent row */
.qty-cell { position: relative; }
.auto-hint {
  position: absolute;
  right: 6px;
  bottom: 1px;
  font-size: 9.5px;
  font-weight: 700;
  color: var(--teal-deep);
  pointer-events: none;
}
.sheet input[readonly] { background: #F2F7F6; color: var(--teal-deep); font-weight: 800; }

/* Keep the section header buttons on one line, aligned to the right */
.tpl-section__head { flex-wrap: wrap; row-gap: 8px; }
.tpl-section__head h2 { flex: 0 0 auto; }
.tpl-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}
.tpl-actions .btn { white-space: nowrap; }

@media (max-width: 560px) {
  .tpl-actions { width: 100%; margin-left: 0; }
  .tpl-actions .btn { flex: 1; justify-content: center; }
}

/* Money helpers */
.money-view { font-variant-numeric: tabular-nums; }
.money-echo {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .sheet .w-type { width: 64px; }
}

/* =========================================================
   Cost request: accept form and note thread (2026-08-26)
   Comments in English on purpose: keep this file pure ASCII.
   ========================================================= */

.accept-form {
  width: 100%;
  padding: 14px 0 0;
  margin-top: 12px;
  border-top: 1px solid var(--line);
}
.accept-form .form-field { max-width: 460px; margin-bottom: 12px; }

.note-thread {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.note-thread h3 {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--ink-soft);
  letter-spacing: .03em;
  margin-bottom: 8px;
}
.note-item {
  padding: 9px 12px;
  margin-bottom: 7px;
  background: var(--mist);
  border-radius: 9px;
}
.note-item__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
}
.note-item__head strong { font-size: 12px; font-weight: 800; }
.note-item p { margin: 0; font-size: 12.5px; line-height: 1.75; }

.note-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.note-form .form-field { margin-bottom: 8px; }

/* =========================================================
   Cost item sections, child sets, plan tabs (2026-08-28)
   Comments in English on purpose: keep this file pure ASCII.
   ========================================================= */

/* Section picker on the cost item form */
.section-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.section-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease;
}
.section-chip:hover { border-color: #C6D6D1; }
.section-chip.is-on { border-color: var(--teal); background: #F0FAF8; color: var(--teal-deep); }
.section-chip input[type="checkbox"] {
  width: auto;
  min-width: 0;
  margin: 0;
  accent-color: var(--teal);
}

/* Child rows editor on the cost item form */
.child-editor { margin-top: 14px; }
.child-editor__actions { margin-top: 10px; }

/* Plan tabs (A / B proposals from one request) */
.plan-tabs {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin-bottom: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.plan-tabs__label {
  display: flex;
  align-items: center;
  padding-right: 12px;
  margin-right: 4px;
  border-right: 1px solid var(--line);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-soft);
  white-space: nowrap;
}
.plan-tab {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 7px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  transition: border-color .14s ease, background .14s ease;
}
.plan-tab:hover { border-color: #C6D6D1; background: var(--mist); }
.plan-tab.is-on {
  border-color: var(--teal);
  background: #F0FAF8;
  box-shadow: 0 0 0 2px rgba(26, 175, 156, .1);
}
.plan-tab strong { font-size: 13px; font-weight: 800; }
.plan-tab__meta {
  font-size: 10.5px;
  color: var(--ink-soft);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .plan-tabs__label { width: 100%; border-right: none; padding-right: 0; margin-bottom: 4px; }
}

/* Section labels under a cost item name */
.item-sections {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
}
.item-sections span {
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-soft);
  background: var(--mist);
  border-radius: 4px;
  padding: 1px 6px;
}

/* =========================================================
   Sub sections (middle layer) - added 2026-08-29
   Comments in English on purpose: keep this file pure ASCII.
   ========================================================= */

.sheet .w-sub { width: 150px; }
.cell--sub { font-size: 11.5px; padding: 5px 6px; }

.sub-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 12px;
}
.sub-group {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
}
.sub-group__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.sub-group__head h2 { font-size: 14px; font-weight: 800; }
.sub-group__count { font-size: 11px; font-weight: 700; color: var(--ink-soft); }
.sub-group__empty { margin: 0; font-size: 12px; color: var(--ink-soft); }

.sub-list { list-style: none; margin: 0; padding: 0; }
.sub-list > li + li { border-top: 1px solid #F2F6F5; }

.sub-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
}
.sub-item__name { font-size: 12.5px; font-weight: 700; }
.sub-item__name.is-off { opacity: .55; }
.sub-item__actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.btn--danger-text { color: var(--danger); }

.sub-edit {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 9px 0;
}
.sub-edit select, .sub-edit input[type="text"] { font-size: 12px; padding: 6px 9px; }
.sub-edit input[type="text"] { flex: 1; min-width: 120px; }

/* Drill-down in the monthly report legend */
.legend-row { display: block; }
.legend-row__main {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 7px;
  padding: 3px 0;
}
.legend-row__main.is-clickable { cursor: pointer; border-radius: 6px; }
.legend-row__main.is-clickable:hover { background: var(--mist); }
.legend__caret {
  display: inline-block;
  margin-left: 5px;
  font-size: 10px;
  font-weight: 800;
  color: var(--teal-deep);
}

.legend-subs {
  list-style: none;
  margin: 2px 0 6px 17px;
  padding: 6px 0 6px 10px;
  border-left: 2px solid var(--line);
}
.legend-subs li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  padding: 2px 0;
  font-size: 11px;
  color: var(--ink-soft);
}
.legend-subs__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-subs__pct { font-weight: 700; text-align: right; }
.legend-subs__amt { text-align: right; min-width: 78px; }

@media (max-width: 640px) {
  .sheet .w-sub { width: 118px; }
}

/* Default sub-section select on the cost item form */
.form-field--sub { margin-top: 14px; max-width: 480px; }

/* =========================================================
   Add another plan (B / C proposal) - added 2026-08-29
   Made deliberately prominent: this is a key action.
   Comments in English on purpose: keep this file pure ASCII.
   ========================================================= */

.add-plan {
  position: relative;
  margin: 20px 0;
  padding: 22px 26px;
  background: linear-gradient(135deg, #FFF9E8 0%, #FFFDF7 60%);
  border: 2px dashed var(--yellow);
  border-radius: 18px;
}

.add-plan__head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}
.add-plan__badge {
  display: grid;
  place-items: center;
  min-width: 46px;
  height: 46px;
  padding: 0 10px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--yellow);
  color: #6B5200;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 3px 10px rgba(247, 195, 49, .4);
}
.add-plan__head h2 {
  font-size: 16.5px;
  font-weight: 800;
  margin-bottom: 4px;
}
.add-plan__head p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--ink-soft);
}

.add-plan__form {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid #F0DFA6;
}
.add-plan__field { flex: 1; min-width: 260px; }
.add-plan__field .form-label { display: block; margin-bottom: 5px; }
.add-plan__field select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #E4D5A4;
  border-radius: 11px;
  background: #fff;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
}
.add-plan__field select:focus {
  outline: none;
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(247, 195, 49, .22);
}

.add-plan__btn {
  flex-shrink: 0;
  padding: 12px 24px;
  font-size: 14px;
}

@media (max-width: 640px) {
  .add-plan { padding: 18px 16px; }
  .add-plan__form { flex-direction: column; align-items: stretch; }
  .add-plan__btn { width: 100%; justify-content: center; }
}

/* =========================================================
   Progress panel (added 2026-08-29)
   Shows the whole flow and where the sheet currently stands.
   Comments in English on purpose: keep this file pure ASCII.
   ========================================================= */

.progress-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 22px;
  margin-bottom: 16px;
}
.progress-panel__title {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .03em;
  color: var(--ink-soft);
  margin-bottom: 14px;
}

.progress-returned {
  padding: 12px 15px;
  margin-bottom: 14px;
  background: #FFF6F4;
  border: 1px solid #F0C7BC;
  border-radius: 11px;
}
.progress-returned strong { font-size: 13px; font-weight: 800; color: #A8442A; }
.progress-returned span { margin-left: 8px; font-size: 11.5px; color: var(--ink-soft); }
.progress-returned p { margin: 5px 0 0; font-size: 12.5px; line-height: 1.7; }

/* Beat the browser default list styling regardless of context */
.progress-panel ol,
.progress-panel ul,
.progress-steps,
.progress-teams {
  list-style: none !important;
  margin: 0;
  padding: 0;
}
.progress-panel li { list-style: none !important; }
.progress-steps { list-style: none; margin: 0; padding: 0; }

.progress-step {
  position: relative;
  display: flex;
  gap: 14px;
  padding: 0 0 16px;
}
.progress-step:last-child { padding-bottom: 0; }

/* Connector line between steps */
.progress-step::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 30px;
  bottom: 0;
  width: 2px;
  background: var(--line);
}
.progress-step:last-child::before { display: none; }
.progress-step.is-done::before { background: #BCE5DC; }

.progress-step__mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--mist);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
  position: relative;
  z-index: 1;
}
.progress-step.is-done .progress-step__mark {
  background: var(--teal);
  color: #fff;
}
.progress-step.is-current .progress-step__mark {
  background: #fff;
  color: var(--teal-deep);
  border: 2px solid var(--teal);
  box-shadow: 0 0 0 4px rgba(26, 175, 156, .14);
}
.progress-step.is-skipped .progress-step__mark { background: #EFF2F1; color: #B7C4C1; }

.progress-step__body { flex: 1; min-width: 0; padding-top: 3px; }
.progress-step__head {
  display: flex;
  align-items: baseline;
  gap: 9px;
  flex-wrap: wrap;
}
.progress-step__head strong { font-size: 13.5px; font-weight: 800; }
.progress-step.is-waiting .progress-step__head strong { color: var(--ink-soft); font-weight: 700; }

.progress-step__now {
  font-size: 10.5px;
  font-weight: 800;
  color: #fff;
  background: var(--teal);
  border-radius: 999px;
  padding: 2px 9px;
}
.progress-step__at {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.progress-step__desc {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--ink-soft);
  line-height: 1.6;
}
.progress-step__note {
  margin: 5px 0 0;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--orange);
}

/* Per-team completion under the input step */
.progress-teams {
  list-style: none;
  margin: 9px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.progress-team {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  padding: 7px 12px;
  background: var(--mist);
  border-left: 3px solid var(--team-color, #8C9A97);
  border-radius: 8px;
}
.progress-team.is-done { background: #F3FAF8; }
.progress-team__mark {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
}
.progress-team.is-done .progress-team__mark { background: var(--teal); color: #fff; }
.progress-team__name { font-size: 12.5px; font-weight: 700; }
.progress-team__at {
  font-size: 11px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  margin-left: auto;
}
.progress-team__note {
  width: 100%;
  font-size: 11.5px;
  color: var(--ink-soft);
  line-height: 1.6;
}

@media (max-width: 640px) {
  .progress-panel { padding: 16px 15px; }
  .progress-team__at { margin-left: 0; width: 100%; }
}

/* =========================================================
   Request attachments (added 2026-08-30)
   Files live on the request; cost sheets only view them.
   Comments in English on purpose: keep this file pure ASCII.
   ========================================================= */

.files-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 22px;
  margin-bottom: 20px;
}
.files-card__head { margin-bottom: 12px; }
.files-card__count {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
  background: var(--mist);
  border-radius: 999px;
  padding: 2px 9px;
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.file-item {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color .14s ease;
}
.file-item:hover { border-color: var(--teal); }
.file-item__body { display: flex; align-items: center; gap: 11px; padding: 10px 12px; }
.file-item__thumb {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--mist);
}
.file-item__thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-item__icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--mist);
  color: var(--ink-soft);
}
.file-item__meta { min-width: 0; }
.file-item__meta strong {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-item__meta span { display: block; font-size: 10.5px; color: var(--ink-soft); }
.file-item__del {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
.file-item__del:hover { background: var(--danger); color: #fff; }

.file-upload {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.file-upload input[type="file"] { font-size: 12px; }

/* Read-only view of request files on a cost sheet */
.ref-files {
  background: #FCFDFD;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.ref-files__head {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-bottom: 10px;
}
.ref-files__head h2 { font-size: 12.5px; font-weight: 800; color: var(--ink-soft); }
.ref-files__count { font-size: 11px; font-weight: 700; color: var(--ink-soft); }
.ref-files__list { display: flex; gap: 8px; flex-wrap: wrap; }

.ref-file {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 220px;
  padding: 7px 11px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 12px;
  transition: border-color .14s ease;
}
.ref-file:hover { border-color: var(--teal); }
.ref-file img { width: 28px; height: 28px; border-radius: 5px; object-fit: cover; flex-shrink: 0; }
.ref-file__icon { color: var(--ink-soft); flex-shrink: 0; display: grid; place-items: center; }
.ref-file__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.img-thumb--doc {
  display: grid;
  place-items: center;
  background: var(--mist);
  color: var(--ink-soft);
}

/* Role label on the flow steps in the guide */
.flow-steps__who {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--mist);
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 700;
  vertical-align: middle;
}

/* =========================================================
   Exclusive choice: sale price OR coefficient (2026-08-31)
   Comments in English on purpose: keep this file pure ASCII.
   ========================================================= */

.exclusive {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
  margin-bottom: 6px;
}
.exclusive__item {
  padding: 12px 14px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease;
}
.exclusive__item:hover { border-color: #C6D6D1; }
.exclusive__item.is-on {
  border-color: var(--teal);
  background: #F7FCFB;
  box-shadow: 0 0 0 3px rgba(26, 175, 156, .1);
}
.exclusive__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.exclusive__head input[type="radio"] {
  width: auto;
  min-width: 0;
  margin: 0;
  accent-color: var(--teal);
}
.exclusive__head strong { font-size: 13px; font-weight: 800; }
.exclusive__item input[type="number"] { width: 100%; }
.exclusive__item input:disabled { background: #F4F6F6; color: #A9B5B2; }
.exclusive__note {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  color: var(--ink-soft);
  line-height: 1.6;
}

/* =========================================================
   Add / delete rows on a cost sheet (2026-08-31)
   Comments in English on purpose: keep this file pure ASCII.
   ========================================================= */

.add-row {
  background: #fff;
  border: 1.5px dashed #C6D6D1;
  border-radius: 16px;
  padding: 18px 22px;
  margin-top: 18px;
}
.add-row__head { margin-bottom: 14px; }
.add-row__head h2 { font-size: 14px; font-weight: 800; margin-bottom: 4px; }
.add-row__head p { margin: 0; font-size: 12px; color: var(--ink-soft); line-height: 1.7; }

.add-row__form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.add-row__pick { flex: 1; min-width: 280px; }
.add-row__team { flex: 0 0 160px; }
.add-row__form select optgroup { font-weight: 800; color: var(--ink-soft); }
.add-row__form select option { font-weight: 400; color: var(--ink); }
.add-row__form input[type="text"],
.add-row__form select {
  width: 100%;
  padding: 9px 13px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
}
.add-row__form input:focus,
.add-row__form select:focus { outline: none; border-color: var(--teal); }
.add-row__form .btn { flex-shrink: 0; }

.add-row__preview {
  display: flex;
  align-items: baseline;
  gap: 7px;
  flex-wrap: wrap;
  margin: 12px 0 0;
  padding: 9px 13px;
  background: #F5FBFA;
  border-radius: 9px;
  font-size: 12px;
  color: var(--ink-soft);
}
.add-row__preview strong { font-size: 13px; font-weight: 800; color: var(--ink); }
.add-row__note {
  font-size: 11px;
  font-weight: 700;
  color: var(--teal-deep);
  background: #E1F4F0;
  border-radius: 999px;
  padding: 1px 9px;
}

/* Rows added on the sheet itself */
.sheet tr.row--added .w-item::after {
  content: "\8FFD\52A0";
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 4px;
  background: #FFF3D6;
  color: #8A6A08;
  font-size: 9.5px;
  font-weight: 800;
  vertical-align: middle;
}
.sheet .w-act { width: 34px; text-align: center; }
.sheet .row-del:disabled { opacity: .25; cursor: not-allowed; }

@media (max-width: 640px) {
  .add-row__form { flex-direction: column; align-items: stretch; }
  .add-row__team { flex: 1; }
}

/* =========================================================
   Row picker: bulk select from master, or free input
   (2026-08-31)
   Comments in English on purpose: keep this file pure ASCII.
   ========================================================= */

.add-row__tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.add-row__tab {
  padding: 8px 16px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease, color .14s ease;
}
.add-row__tab:hover { border-color: #C6D6D1; }
.add-row__tab.is-on {
  border-color: var(--teal);
  background: #F0FAF8;
  color: var(--teal-deep);
}

/* Grouped checkbox list */
.pick-list {
  max-height: 380px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px;
}
.pick-group + .pick-group { margin-top: 4px; }
.pick-group__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 7px 12px;
  background: var(--mist);
  border-radius: 8px;
  position: sticky;
  top: 0;
  z-index: 1;
}
.pick-group__head strong { font-size: 12px; font-weight: 800; }
.pick-group__head span { font-size: 10.5px; color: var(--ink-soft); }
.pick-group__body {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 2px;
  padding: 4px 0;
}

.pick-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 7px 11px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .12s ease;
}
.pick-item:hover { background: #F5FBFA; }
.pick-item:has(input:checked) { background: #E9F7F4; }
.pick-item input[type="checkbox"] {
  width: auto;
  min-width: 0;
  flex: 0 0 auto;
  margin: 2px 0 0;
  accent-color: var(--teal);
}
.pick-item__body { min-width: 0; flex: 1; }
.pick-item__body strong { display: block; font-size: 12.5px; font-weight: 700; }
.pick-item__meta {
  display: block;
  font-size: 10.5px;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pick-item.is-used { opacity: .45; cursor: not-allowed; background: transparent; }
.pick-item.is-used:hover { background: transparent; }
.pick-item__used {
  flex-shrink: 0;
  align-self: center;
  font-size: 9.5px;
  font-weight: 800;
  color: var(--ink-soft);
  background: var(--mist);
  border-radius: 999px;
  padding: 1px 8px;
}

.add-row__actions {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.add-row__count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
}
.add-row__note-bottom { margin-top: 12px; }

/* Free input */
.free-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.free-row__wide { grid-column: span 2; }

@media (max-width: 640px) {
  .add-row__actions { flex-direction: column; align-items: stretch; }
  .add-row__count { margin-left: 0; }
  .free-row__wide { grid-column: span 1; }
}

/* Badge for data imported from the old Excel sheets */
.tag--import {
  background: #EDE9FB;
  color: #5A47B8;
  font-weight: 800;
}

/* =========================================================
   Personal templates + mobile input (2026-09-02)
   Comments in English on purpose: keep this file pure ASCII.
   ========================================================= */

/* Shared / personal tabs on the template list */
.tpl-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.tpl-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease, color .14s ease;
}
.tpl-tab:hover { border-color: #C6D6D1; }
.tpl-tab.is-on {
  border-color: var(--teal);
  background: #F0FAF8;
  color: var(--teal-deep);
}
.tpl-tab__num {
  font-size: 11px;
  font-weight: 800;
  background: var(--mist);
  border-radius: 999px;
  padding: 1px 8px;
}
.tpl-tab.is-on .tpl-tab__num { background: #fff; }

.tag--mine { background: #E1F4F0; color: #0E7C6B; }

/* Shared / personal choice on the create form */
.scope-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.scope-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 15px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease;
}
.scope-item:hover { border-color: #C6D6D1; }
.scope-item.is-on {
  border-color: var(--teal);
  background: #F5FBFA;
  box-shadow: 0 0 0 3px rgba(26, 175, 156, .1);
}
.scope-item input[type="radio"] {
  width: auto;
  min-width: 0;
  flex: 0 0 auto;
  margin: 3px 0 0;
  accent-color: var(--teal);
}
.scope-item strong { display: block; font-size: 13.5px; font-weight: 800; }
.scope-item span span {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--ink-soft);
}

/* =========================================================
   Mobile input: make forms comfortable on a phone
   ========================================================= */

@media (max-width: 640px) {
  /* iOS zooms in when the font is under 16px, so keep it at 16 */
  .form-field input,
  .form-field select,
  .form-field textarea,
  .filter-bar__input,
  .filter-bar__select,
  .action-input {
    font-size: 16px;
    padding: 12px 14px;
    border-radius: 10px;
  }

  .form-field textarea { min-height: 96px; }

  /* Keep tap targets tall enough for a finger */
  .btn {
    min-height: 44px;
    padding: 11px 18px;
    font-size: 14px;
  }
  .btn--sm { min-height: 36px; padding: 8px 14px; font-size: 12.5px; }

  .form-card { padding: 18px 15px; border-radius: 14px; }
  .form-section { margin-bottom: 22px; }
  .form-section h2 { font-size: 14px; }

  /* Pin the submit button so long forms stay usable */
  .form-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    flex-direction: column-reverse;
    gap: 8px;
    margin: 20px -15px -18px;
    padding: 12px 15px calc(12px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .96);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(6px);
  }
  .form-actions .btn { width: 100%; justify-content: center; }

  /* Tighten the page header on small screens */
  .page-head { padding: 14px 0 12px; }
  .page-head h1 { font-size: 18px; }
  .page-head__row { flex-direction: column; align-items: stretch; gap: 10px; }
  .page-head__actions { width: 100%; }
  .page-head__actions .btn { flex: 1; justify-content: center; }
  .crumb { font-size: 11px; }

  .page-main, .page-main--wide { padding-left: 14px; padding-right: 14px; }

  /* Attachment and note fields */
  .file-upload { flex-direction: column; align-items: stretch; }
  .file-upload input[type="file"] { font-size: 14px; }
  .note-form .btn { width: 100%; }

  /* Let wide tables scroll sideways */
  .table-scroll { -webkit-overflow-scrolling: touch; }
}

/* Camera button: only useful on a phone */
.file-upload__camera { display: none; }

@media (max-width: 640px) {
  .file-upload__camera { display: inline-flex; justify-content: center; width: 100%; }
}

/* =========================================================
   File attachment on the request form (2026-09-04)
   Comments in English on purpose: keep this file pure ASCII.
   ========================================================= */

.upload-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px 18px;
  background: #FCFDFD;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
}
.upload-box__btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease;
}
.upload-box__btn:hover { border-color: var(--teal); background: #F5FBFA; }
.upload-box__btn svg { color: var(--teal-deep); flex-shrink: 0; }
.upload-box__btn--camera { display: none; }
.upload-box__note {
  font-size: 11.5px;
  color: var(--ink-soft);
  line-height: 1.6;
}

.upload-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.upload-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  background: #F0FAF8;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
}
.upload-list li::before {
  content: "\2713";
  color: var(--teal-deep);
  font-weight: 800;
}

@media (max-width: 640px) {
  .upload-box { flex-direction: column; align-items: stretch; padding: 14px; }
  .upload-box__btn { justify-content: center; width: 100%; min-height: 46px; }
  .upload-box__btn--camera { display: inline-flex; }
  .upload-box__note { text-align: center; }
}

/* Note under the board sync panel */
.sync-note {
  margin: 10px 0 0;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--ink-soft);
}

/* board client sync status on the client list */
.sync-status {
  padding: 10px 14px;
  margin-bottom: 14px;
  background: #F5FBFA;
  border: 1px solid #BCE5DC;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-soft);
}
.sync-status .mono { display: block; margin-top: 3px; }

/* =========================================================
   Invoice to cost sheet links (2026-09-05)
   Normally one to one; a few invoices span several sheets.
   Comments in English on purpose: keep this file pure ASCII.
   ========================================================= */

.tag--split { background: #EDE9FB; color: #5A47B8; font-weight: 800; }

.invoice-sum {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  padding: 14px 20px;
  margin-bottom: 16px;
  background: var(--mist);
  border-radius: 12px;
}
.invoice-sum__label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 2px;
}
.invoice-sum__value { font-size: 17px; font-weight: 800; color: var(--ink); }

.link-rows { display: flex; flex-direction: column; gap: 10px; }
.link-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.link-row__sheet  { flex: 3; min-width: 220px; }
.link-row__amount { flex: 0 0 190px; }
.link-row__note   { flex: 2; min-width: 140px; }
.link-row select,
.link-row input[type="text"],
.link-row input[type="number"] { width: 100%; }

.link-row__del {
  flex: 0 0 auto;
  width: 32px;
  height: 38px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 15px;
  cursor: pointer;
}
.link-row__del:hover { border-color: var(--danger); color: var(--danger); }

.link-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.link-actions__hint { font-size: 12px; color: var(--ink-soft); }

/* Keep field labels on one line */
.link-row .form-label { white-space: nowrap; }

/* Allocation summary */
.alloc {
  margin-top: 18px;
  padding: 14px 18px;
  background: #FCFDFD;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  max-width: 380px;
}
.alloc__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 0;
  font-size: 13px;
  color: var(--ink-soft);
  white-space: nowrap;
}
.alloc__row--total {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
}
.alloc.is-over {
  background: #FDF3F0;
  border-color: var(--danger);
}
.alloc.is-over .alloc__row--total { color: var(--danger); }
.alloc.is-done {
  background: #F0FAF8;
  border-color: var(--teal);
}
.alloc.is-done .alloc__row--total { color: var(--teal-deep); }

.alloc__msg {
  margin: 10px 0 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--danger);
}
.alloc__msg--ok { color: var(--teal-deep); }

@media (max-width: 640px) {
  .link-row { flex-direction: column; align-items: stretch; }
  .link-row__amount, .link-row__note { flex: 1; }
  .link-row__del { width: 100%; }
  .alloc { max-width: none; }
}

/* =========================================================
   Editing after approval (2026-09-06)
   Admins may fix an approved sheet; every change is logged.
   Comments in English on purpose: keep this file pure ASCII.
   ========================================================= */

.after-approval {
  padding: 16px 20px;
  margin-bottom: 16px;
  background: #FFF8E8;
  border: 1.5px solid var(--yellow);
  border-radius: 12px;
}
.after-approval__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.after-approval__head strong { font-size: 15px; font-weight: 800; color: #8A6A08; }
.after-approval__head span {
  font-size: 11px;
  font-weight: 700;
  color: #8A6A08;
  background: #FFF;
  border-radius: 999px;
  padding: 2px 10px;
}
.after-approval p {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--ink);
}
.after-approval__reason { display: block; max-width: 560px; }
.after-approval__reason input {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid #E4D5A4;
  border-radius: 10px;
  background: #fff;
  font-family: inherit;
  font-size: 13.5px;
}
.after-approval__reason input:focus {
  outline: none;
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(247, 195, 49, .22);
}

/* Change history on the detail screen */
.edit-logs {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 16px;
  overflow: hidden;
}
.edit-logs__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 13px 20px;
  border: none;
  background: #FFFDF6;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}
.edit-logs__head:hover { background: #FFF8E8; }
.edit-logs__title { font-size: 13.5px; font-weight: 800; color: #8A6A08; }
.edit-logs__count {
  margin-left: 8px;
  font-size: 11px;
  font-weight: 700;
  background: var(--yellow);
  color: #6B5200;
  border-radius: 999px;
  padding: 1px 9px;
}
.edit-logs__toggle { font-size: 12px; font-weight: 700; color: var(--ink-soft); }

.edit-log { padding: 14px 20px; border-top: 1px solid var(--line); }
.edit-log__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.edit-log__meta strong { font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums; }
.edit-log__meta span { font-size: 11.5px; color: var(--ink-soft); }
.edit-log__reason {
  margin: 0 0 10px;
  padding: 8px 12px;
  background: var(--mist);
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--ink);
}
.edit-log__items { list-style: none; margin: 0; padding: 0; }
.edit-log__items li {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  padding: 5px 0;
  border-bottom: 1px solid #F4F7F6;
}
.edit-log__items li:last-child { border-bottom: none; }
.edit-log__label { flex: 1; min-width: 200px; font-size: 12.5px; font-weight: 700; }
.edit-log__change { font-size: 12.5px; color: var(--ink-soft); }

/* Button for editing after approval: stands apart from normal actions */
.btn--warn {
  background: #FFF8E8;
  border: 1.5px solid var(--yellow);
  color: #8A6A08;
  font-weight: 700;
}
.btn--warn:hover {
  background: var(--yellow);
  border-color: var(--yellow);
  color: #6B5200;
}

/* Owner note next to the person who accepted the request */
.owner-note {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--ink-soft);
}
