/* ==========================================================
   NAGARE 共通スタイル
   大きな文字・大きなボタン・十分な余白を基本にしています。
   ========================================================== */
:root {
  --c-main: #234B42;
  --c-main-hover: #193B34;
  --c-sub: #E7EFEB;
  --c-bg: #F4F6F5;
  --c-card: #FFFFFF;
  --c-text: #25332E;
  --c-muted: #64748B;
  --c-success: #27845C;
  --c-warn: #D97706;
  --c-warn-text: #92500A;
  --c-danger: #DC2626;
  --c-border: #E2E8E4;
  --sidebar-w: 240px;
  --radius: 14px;

  --bs-body-font-size: 1.0625rem;
  --bs-body-color: var(--c-text);
  --bs-body-bg: var(--c-bg);
  --bs-border-color: var(--c-border);
  --bs-link-color-rgb: 35, 75, 66;
  --bs-link-hover-color-rgb: 25, 59, 52;
  --bs-primary-rgb: 35, 75, 66;
}

html { font-size: 16px; }
body {
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: 17px;
  line-height: 1.75;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-text-size-adjust: 100%;
}
a { color: var(--c-main); text-underline-offset: 3px; }
a:hover { color: var(--c-main-hover); }
h1, h2, h3 { font-weight: 700; line-height: 1.4; margin: 0; }
.text-muted, .muted { color: var(--c-muted) !important; }
.small, small { font-size: 0.9rem; }
[data-lucide], svg.lucide { width: 1.2em; height: 1.2em; flex-shrink: 0; vertical-align: -0.2em; stroke-width: 2; }
:focus-visible { outline: 3px solid rgba(35, 75, 66, .45); outline-offset: 2px; }

/* ---------- 全体レイアウト ---------- */
.sidebar {
  background: #fff !important;
  border-right: 1px solid var(--c-border);
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
}
@media (min-width: 992px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 1030; overflow-y: auto; }
  .main { margin-left: var(--sidebar-w); }
}
.sidebar .offcanvas-body { display: flex; flex-direction: column; padding: 0; flex-grow: 1; overflow-y: auto; background: #fff !important; }
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 18px 16px; text-decoration: none; }
.brand img { width: 46px; height: 46px; border-radius: 11px; }
.brand-name { font-size: 1.3rem; font-weight: 800; letter-spacing: .06em; color: var(--c-main); line-height: 1.2; }
.brand-client { font-size: .85rem; color: var(--c-muted); line-height: 1.3; }

.side-nav { list-style: none; margin: 0; padding: 6px 12px; }
.side-nav a, .side-nav button {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 50px; padding: 8px 14px; margin-bottom: 4px;
  border: 0; border-radius: 11px; background: transparent;
  color: var(--c-text); font-size: 1.03rem; font-weight: 500; text-decoration: none; text-align: left;
}
.side-nav a:hover, .side-nav button:hover { background: var(--c-bg); color: var(--c-main-hover); }
.side-nav a.active { background: var(--c-main); color: #fff; font-weight: 700; }
.side-nav.sub a, .side-nav.sub button { min-height: 44px; font-size: .93rem; color: var(--c-muted); gap: 9px; padding-inline: 12px; white-space: nowrap; }
.side-nav.sub .nav-count { min-width: 24px; padding: 0 6px; line-height: 24px; }
.side-nav.sub a.active { background: var(--c-sub); color: var(--c-main); }
.side-label { padding: 14px 26px 4px; font-size: .8rem; color: var(--c-muted); letter-spacing: .08em; }
.side-foot { margin-top: auto; padding: 14px 20px 18px; font-size: .8rem; color: var(--c-muted); }
.nav-count {
  margin-left: auto; min-width: 26px; padding: 0 8px; border-radius: 999px;
  background: var(--c-warn); color: #fff; font-size: .82rem; font-weight: 700; text-align: center; line-height: 26px;
}

.topbar {
  position: sticky; top: 0; z-index: 1020;
  display: flex; align-items: center; gap: 12px;
  min-height: 64px; padding: 8px 28px;
  background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--c-border);
}
.topbar-title { font-weight: 700; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-date { color: var(--c-muted); font-size: .95rem; white-space: nowrap; }
.demo-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px;
  background: #FEF3C7; color: var(--c-warn-text); border: 1px solid #F5D48A;
  font-size: .88rem; font-weight: 700; white-space: nowrap;
}
.icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 48px; height: 48px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--c-border);
  background: #fff; color: var(--c-text); text-decoration: none; white-space: nowrap; flex-shrink: 0;
}
.icon-btn:hover { background: var(--c-sub); color: var(--c-main-hover); }
.icon-btn .dot {
  position: absolute; top: -6px; right: -6px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px;
  background: var(--c-danger); color: #fff; font-size: .8rem; font-weight: 700; line-height: 24px; text-align: center;
}
.user-chip { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; white-space: nowrap; }

.content { padding: 28px; max-width: 1320px; }
.page-foot { padding: 8px 28px 28px; color: var(--c-muted); font-size: .82rem; }
@media (max-width: 767.98px) {
  .topbar { padding: 8px 14px; gap: 8px; }
  .content { padding: 18px 14px; }
  .topbar-date, .user-chip span { display: none; }
}

/* ---------- 見出し ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.page-title { font-size: 1.75rem; }
.page-lead { color: var(--c-muted); margin: 4px 0 0; }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; font-weight: 500; text-decoration: none; min-height: 40px; }
@media (max-width: 575.98px) { .page-title { font-size: 1.5rem; } }

/* ---------- カード ---------- */
.card-n {
  background: var(--c-card); border: 1px solid var(--c-border); border-radius: var(--radius);
  padding: 24px; margin-bottom: 22px;
}
.card-n.tight { padding: 0; overflow: hidden; }
.card-title-n { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; font-weight: 700; margin-bottom: 16px; }
.card-title-n [data-lucide], .card-title-n svg { color: var(--c-main); }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.card-head .card-title-n { margin-bottom: 0; }
.card-attention { border: 2px solid #F0C36D; background: #FFFCF4; }
@media (max-width: 575.98px) { .card-n { padding: 18px 16px; } }

/* ---------- ボタン ---------- */
.btn {
  --bs-btn-font-size: 1.03rem; --bs-btn-padding-x: 20px; --bs-btn-padding-y: 9px; --bs-btn-border-radius: 12px;
  min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700;
}
.btn-sm { --bs-btn-font-size: .95rem; --bs-btn-padding-x: 14px; min-height: 44px; }
.btn-lg { --bs-btn-font-size: 1.15rem; --bs-btn-padding-x: 28px; min-height: 58px; }
.btn-primary {
  --bs-btn-bg: var(--c-main); --bs-btn-border-color: var(--c-main);
  --bs-btn-hover-bg: var(--c-main-hover); --bs-btn-hover-border-color: var(--c-main-hover);
  --bs-btn-active-bg: var(--c-main-hover); --bs-btn-active-border-color: var(--c-main-hover);
  --bs-btn-disabled-bg: #8AA39C; --bs-btn-disabled-border-color: #8AA39C;
}
.btn-outline-primary {
  --bs-btn-color: var(--c-main); --bs-btn-border-color: var(--c-main); --bs-btn-bg: #fff;
  --bs-btn-hover-bg: var(--c-sub); --bs-btn-hover-color: var(--c-main-hover); --bs-btn-hover-border-color: var(--c-main-hover);
  --bs-btn-active-bg: var(--c-sub); --bs-btn-active-color: var(--c-main-hover); --bs-btn-active-border-color: var(--c-main-hover);
}
.btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: var(--c-border); --bs-btn-hover-bg: var(--c-bg); --bs-btn-hover-border-color: #CBD5CF; }
.btn-outline-danger { --bs-btn-color: #B91C1C; --bs-btn-border-color: #E5A4A4; --bs-btn-bg: #fff; --bs-btn-hover-bg: #FEF2F2; --bs-btn-hover-color: #991B1B; --bs-btn-hover-border-color: #DC2626; }

.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.quick-btn {
  display: flex; align-items: center; gap: 12px; min-height: 84px; padding: 16px;
  background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius);
  color: var(--c-text); font-size: 1.12rem; font-weight: 700; text-decoration: none; line-height: 1.4;
}
.quick-btn:hover { border-color: var(--c-main); background: var(--c-sub); color: var(--c-main-hover); }
.quick-btn .ico { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--c-sub); color: var(--c-main); flex-shrink: 0; }
.quick-btn .ico svg { width: 26px; height: 26px; }
.quick-btn.primary { background: var(--c-main); border-color: var(--c-main); color: #fff; }
.quick-btn.primary:hover { background: var(--c-main-hover); color: #fff; }
.quick-btn.primary .ico { background: rgba(255, 255, 255, .16); color: #fff; }
.quick-grid.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1199.98px) { .quick-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 767.98px) { .quick-grid.three { grid-template-columns: 1fr; } }
@media (max-width: 575.98px) { .quick-grid { grid-template-columns: 1fr; gap: 10px; } .quick-btn { min-height: 68px; } }

/* ---------- 数値カード ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 22px; }
.kpi-grid.four { grid-template-columns: repeat(4, 1fr); }
.kpi { background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius); padding: 20px 22px; display: block; color: inherit; text-decoration: none; }
a.kpi:hover { border-color: var(--c-main); color: inherit; }
.kpi-label { display: flex; align-items: center; gap: 8px; color: var(--c-muted); font-size: .98rem; font-weight: 500; }
.kpi-value { font-size: 2.2rem; font-weight: 700; line-height: 1.3; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi-value .unit { font-size: 1.05rem; font-weight: 500; margin-left: 4px; color: var(--c-muted); }
.kpi-sub { font-size: .9rem; color: var(--c-muted); margin-top: 2px; }
.kpi.attention { border: 2px solid #F0C36D; background: #FFFCF4; }
.kpi.attention .kpi-value { color: var(--c-warn-text); }
.trend { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; }
.trend.up { color: var(--c-success); }
.trend.down { color: #B91C1C; }
@media (max-width: 1199.98px) { .kpi-grid.four { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 991.98px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 575.98px) { .kpi-grid, .kpi-grid.four { gap: 10px; } .kpi { padding: 14px 16px; } .kpi-value { font-size: 1.7rem; } }

/* ---------- 状態ラベル（色＋アイコン＋文字） ---------- */
.status {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px;
  font-size: .9rem; font-weight: 700; white-space: nowrap; border: 1px solid transparent; line-height: 1.6;
}
.status svg { width: 16px; height: 16px; }
.status-success { background: #E6F4EC; color: #1C6B49; border-color: #BFE0CE; }
.status-info { background: var(--c-sub); color: var(--c-main); border-color: #C9DAD3; }
.status-warn { background: #FEF3C7; color: var(--c-warn-text); border-color: #F5D48A; }
.status-danger { background: #FEE9E9; color: #B01E1E; border-color: #F5BDBD; }
.status-muted { background: #F1F5F3; color: #55635D; border-color: #DDE4E0; }

/* ---------- 確認が必要な業務 ---------- */
.task-list { list-style: none; margin: 0; padding: 0; }
.task-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 10px;
  background: #fff; border: 1px solid var(--c-border); border-left: 6px solid var(--c-warn); border-radius: 12px;
  color: inherit; text-decoration: none;
}
a.task-item:hover { background: #FFF8E8; color: inherit; }
.task-item.urgent { border-left-color: var(--c-danger); }
.task-item .ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: #FEF3C7; color: var(--c-warn-text); flex-shrink: 0; }
.task-item.urgent .ico { background: #FEE9E9; color: #B01E1E; }
.task-title { font-weight: 700; line-height: 1.5; }
.task-text { color: var(--c-muted); font-size: .93rem; line-height: 1.5; }
.task-go { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; color: var(--c-main); font-weight: 700; white-space: nowrap; }
.empty { text-align: center; padding: 28px 12px; color: var(--c-muted); }
.empty svg { width: 40px; height: 40px; color: var(--c-success); display: block; margin: 0 auto 8px; }

/* ---------- 本日の自動処理 ---------- */
.auto-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.auto-item span:not(.n) { white-space: nowrap; }
.auto-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--c-border); border-radius: 12px; background: var(--c-bg); }
.auto-item svg { color: var(--c-main); width: 24px; height: 24px; }
.auto-item .n { margin-left: auto; font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.auto-item .n small { font-size: .85rem; font-weight: 500; color: var(--c-muted); margin-left: 2px; }
@media (max-width: 419.98px) { .auto-grid { grid-template-columns: 1fr; } }

/* ---------- 表 ---------- */
.table-n { width: 100%; margin: 0; border-collapse: collapse; }
.table-n th { background: #F8FAF9; color: var(--c-muted); font-size: .9rem; font-weight: 700; padding: 12px 16px; border-bottom: 1px solid var(--c-border); white-space: nowrap; text-align: left; }
.table-n td { padding: 14px 16px; border-bottom: 1px solid var(--c-border); vertical-align: middle; }
.table-n tbody tr:last-child td { border-bottom: 0; }
.table-n tbody tr.row-link { cursor: pointer; }
.table-n tbody tr.row-link:hover { background: #F6FAF8; }
.table-n .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-n .main-cell { font-weight: 700; }
.table-n .sub-cell { color: var(--c-muted); font-size: .9rem; }
.table-n .nowrap { white-space: nowrap; }
.desktop-only { display: block; }
.mobile-only { display: none; }
@media (max-width: 991.98px) { .desktop-only { display: none; } .mobile-only { display: block; } }

.m-card { display: block; background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; color: inherit; text-decoration: none; }
a.m-card:hover { border-color: var(--c-main); color: inherit; }
.m-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 6px; }
.m-card-title { font-weight: 700; font-size: 1.08rem; line-height: 1.5; }
.m-card dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; margin: 0; font-size: .95rem; }
.m-card dt { color: var(--c-muted); font-weight: 500; }
.m-card dd { margin: 0; }

/* ---------- 検索・絞り込み ---------- */
.search-bar { display: flex; gap: 10px; margin-bottom: 14px; }
.search-bar .form-control { max-width: 520px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 16px; border-radius: 999px;
  background: #fff; border: 1px solid var(--c-border); color: var(--c-text); font-weight: 500; text-decoration: none; font-size: .98rem;
}
.chip:hover { border-color: var(--c-main); color: var(--c-main-hover); }
.chip.active { background: var(--c-main); border-color: var(--c-main); color: #fff; font-weight: 700; }
.chip .n { font-size: .85rem; opacity: .8; }
.result-count { color: var(--c-muted); margin-bottom: 10px; }

/* ---------- 入力フォーム ---------- */
.form-label { font-weight: 700; margin-bottom: 6px; }
.form-control, .form-select { min-height: 50px; font-size: 1.05rem; border-color: #C9D3CE; border-radius: 10px; padding: 10px 14px; }
.form-control:focus, .form-select:focus { border-color: var(--c-main); box-shadow: 0 0 0 4px rgba(35, 75, 66, .15); }
textarea.form-control { min-height: 96px; }
.form-check-input { width: 1.6em; height: 1.6em; margin-top: .1em; border-color: #9AA9A2; }
.form-check-input:checked { background-color: var(--c-main); border-color: var(--c-main); }
.form-check-label { padding-left: 8px; font-weight: 500; }
.form-check { min-height: 44px; display: flex; align-items: center; padding-left: 0; }
.form-check .form-check-input { float: none; margin-left: 0; flex-shrink: 0; }
.form-hint { color: var(--c-muted); font-size: .9rem; margin-top: 4px; }
.req, .opt { display: inline-block; margin-left: 8px; padding: 0 8px; border-radius: 6px; font-size: .78rem; font-weight: 700; line-height: 1.7; vertical-align: 2px; }
.req { background: var(--c-danger); color: #fff; }
.opt { background: #EEF2F0; color: var(--c-muted); }
.field-error { color: #B01E1E; font-weight: 700; font-size: .93rem; margin-top: 4px; display: flex; gap: 6px; align-items: flex-start; }
.is-invalid { border-color: var(--c-danger) !important; }

.form-section { background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius); margin-bottom: 18px; overflow: hidden; }
.form-section > summary, .form-section-head {
  display: flex; align-items: center; gap: 12px; padding: 18px 24px; font-size: 1.2rem; font-weight: 700; list-style: none;
}
.form-section > summary { cursor: pointer; }
.form-section > summary::-webkit-details-marker { display: none; }
.form-section .step-no { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--c-main); color: #fff; font-size: 1rem; flex-shrink: 0; }
.form-section .fold { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--c-muted); font-size: .92rem; font-weight: 500; }
.form-section[open] .fold .closed, .form-section:not([open]) .fold .opened { display: none; }
.form-section[open] .fold svg { transform: rotate(180deg); }
.form-section-body { padding: 4px 24px 24px; }
.form-actions { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 16px 20px; background: rgba(255, 255, 255, .97); border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: 0 -4px 16px rgba(37, 51, 46, .06); }
@media (max-width: 575.98px) { .form-section > summary, .form-section-head { padding: 16px; font-size: 1.1rem; } .form-section-body { padding: 4px 16px 18px; } }

.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.mode-switch label { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 18px; background: #fff; border: 2px solid var(--c-border); border-radius: var(--radius); font-weight: 700; cursor: pointer; }
.mode-switch input { position: absolute; opacity: 0; }
.mode-switch input:checked + label { border-color: var(--c-main); background: var(--c-sub); color: var(--c-main-hover); }
.mode-switch input:focus-visible + label { outline: 3px solid rgba(35, 75, 66, .45); }
@media (max-width: 575.98px) { .mode-switch { grid-template-columns: 1fr; } }

/* 候補から選ぶ入力（法人・店舗） */
.picker { position: relative; }
.picker-list { list-style: none; margin: 6px 0 0; padding: 6px; max-height: 320px; overflow-y: auto; background: #fff; border: 1px solid #C9D3CE; border-radius: 12px; }
.picker-list button { display: block; width: 100%; text-align: left; padding: 10px 14px; border: 0; border-radius: 9px; background: transparent; min-height: 52px; }
.picker-list button:hover, .picker-list button:focus { background: var(--c-sub); }
.picker-list .l { font-weight: 700; display: block; }
.picker-list .s { color: var(--c-muted); font-size: .88rem; display: block; }
.picker-list .none { padding: 12px 14px; color: var(--c-muted); }
.picked { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border: 2px solid var(--c-main); border-radius: 12px; background: var(--c-sub); }
.picked .l { font-weight: 700; font-size: 1.1rem; }
.picked .s { color: var(--c-muted); font-size: .9rem; }

/* ---------- 詳細表示 ---------- */
.dl-n { display: grid; grid-template-columns: 190px 1fr; gap: 0; margin: 0; }
.dl-n dt { padding: 11px 0; color: var(--c-muted); font-weight: 500; border-bottom: 1px solid var(--c-border); }
.dl-n dd { padding: 11px 0; margin: 0; border-bottom: 1px solid var(--c-border); word-break: break-word; }
.dl-n dt:last-of-type, .dl-n dd:last-of-type { border-bottom: 0; }
@media (max-width: 575.98px) { .dl-n { grid-template-columns: 1fr; } .dl-n dt { border-bottom: 0; padding-bottom: 0; font-size: .9rem; } .dl-n dd { padding-top: 2px; } }

.tabs-n { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 18px; padding-bottom: 4px; border: 0; flex-wrap: nowrap; }
.tabs-n .nav-link {
  display: inline-flex; align-items: center; gap: 8px; min-height: 50px; padding: 8px 18px; border-radius: 12px; white-space: nowrap;
  border: 1px solid var(--c-border); background: #fff; color: var(--c-text); font-weight: 500;
}
.tabs-n .nav-link:hover { border-color: var(--c-main); }
.tabs-n .nav-link.active { background: var(--c-main); border-color: var(--c-main); color: #fff; font-weight: 700; }

/* ---------- 注文の進み具合 ---------- */
.stepper { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; margin: 0; padding: 0; list-style: none; }
.stepper li { position: relative; text-align: center; padding: 0 6px; }
.stepper li::before { content: ""; position: absolute; top: 27px; left: -50%; width: 100%; height: 4px; background: var(--c-border); }
.stepper li:first-child::before { display: none; }
.stepper li.done::before, .stepper li.current::before { background: var(--c-main); }
.stepper .circle { position: relative; z-index: 1; display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 8px; border-radius: 50%; background: #fff; border: 3px solid var(--c-border); color: #9AA9A2; }
.stepper .circle svg { width: 26px; height: 26px; }
.stepper li.done .circle { background: var(--c-main); border-color: var(--c-main); color: #fff; }
.stepper li.current .circle { border-color: var(--c-main); color: var(--c-main); box-shadow: 0 0 0 5px var(--c-sub); }
.stepper .name { font-weight: 700; font-size: 1.05rem; }
.stepper .state { font-size: .88rem; color: var(--c-muted); }
.stepper li.done .state { color: var(--c-success); font-weight: 700; }
.stepper .at { font-size: .85rem; color: var(--c-muted); line-height: 1.4; }
@media (max-width: 767.98px) {
  .stepper { grid-template-columns: 1fr; gap: 4px; }
  .stepper li { display: grid; grid-template-columns: 58px 1fr; column-gap: 14px; text-align: left; align-items: center; padding: 6px 0; }
  .stepper li::before { top: -50%; left: 27px; width: 4px; height: 100%; }
  .stepper .circle { margin: 0; grid-row: span 3; }
}

/* 自動処理の結果（1行ずつ表示） */
.run-block { border: 1px solid var(--c-border); border-radius: 12px; margin-bottom: 14px; overflow: hidden; }
.run-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; background: #F8FAF9; border-bottom: 1px solid var(--c-border); font-weight: 700; }
.run-head .time { margin-left: auto; color: var(--c-muted); font-weight: 500; font-size: .9rem; }
.run-steps { list-style: none; margin: 0; padding: 6px 16px; }
.run-steps li { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px dashed var(--c-border); }
.run-steps li:last-child { border-bottom: 0; }
.run-steps .mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; margin-top: 2px; }
.run-steps .mark svg { width: 17px; height: 17px; }
.run-steps .done .mark, .run-steps .demo .mark { background: #E6F4EC; color: #1C6B49; }
.run-steps .pending .mark { background: #FEF3C7; color: var(--c-warn-text); }
.run-steps .error .mark { background: #FEE9E9; color: #B01E1E; }
.run-steps .label { font-weight: 700; }
.run-steps .detail { color: var(--c-muted); font-size: .93rem; line-height: 1.55; }
.reveal .run-steps li, .reveal .result-list li { opacity: 0; transform: translateY(4px); transition: opacity .25s ease, transform .25s ease; }
.reveal .run-steps li.show, .reveal .result-list li.show { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal .run-steps li, .reveal .result-list li { opacity: 1; transform: none; transition: none; } }
@media (max-width: 575.98px) { .run-steps li { grid-template-columns: 30px 1fr; } .run-steps li .status { grid-column: 2; justify-self: start; } }

/* 登録完了画面 */
.done-hero { text-align: center; padding: 32px 20px 26px; }
.done-hero .big { display: grid; place-items: center; width: 84px; height: 84px; margin: 0 auto 14px; border-radius: 50%; background: #E6F4EC; color: var(--c-success); }
.done-hero .big svg { width: 46px; height: 46px; }
.done-hero h1 { font-size: 1.75rem; }
.result-list { list-style: none; margin: 0; padding: 0; }
.result-list li { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 14px 4px; border-bottom: 1px solid var(--c-border); }
.result-list li:last-child { border-bottom: 0; }
.result-list .mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #E6F4EC; color: #1C6B49; }
.result-list .pending .mark { background: #FEF3C7; color: var(--c-warn-text); }
.result-list .label { font-weight: 700; font-size: 1.08rem; }
.result-list .detail { color: var(--c-muted); font-size: .93rem; line-height: 1.5; }
@media (max-width: 575.98px) { .result-list li { grid-template-columns: 34px 1fr; } .result-list li .status { grid-column: 2; justify-self: start; } }

/* 営業の段階 */
.stage-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 10px; margin-bottom: 18px; }
.stage { display: block; padding: 12px 10px; text-align: center; background: #fff; border: 1px solid var(--c-border); border-radius: 12px; color: inherit; text-decoration: none; }
.stage:hover { border-color: var(--c-main); color: inherit; }
.stage.active { background: var(--c-sub); border: 2px solid var(--c-main); }
.stage .no { font-size: .8rem; color: var(--c-muted); }
.stage .name { font-weight: 700; font-size: .95rem; line-height: 1.4; min-height: 2.8em; display: grid; place-items: center; }
.stage .n { font-size: 1.7rem; font-weight: 700; line-height: 1.2; }
.stage .n small { font-size: .8rem; font-weight: 500; color: var(--c-muted); }
@media (max-width: 1199.98px) { .stage-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 575.98px) { .stage-grid { grid-template-columns: repeat(2, 1fr); } }

/* 注文明細の入力 */
.line-row { display: grid; grid-template-columns: minmax(220px, 3fr) 110px 150px 150px 52px; gap: 10px; align-items: end; padding: 12px 0; border-bottom: 1px solid var(--c-border); }
.line-row .line-amount { min-height: 50px; display: flex; align-items: center; justify-content: flex-end; font-weight: 700; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.line-row label { font-size: .88rem; color: var(--c-muted); font-weight: 500; margin-bottom: 2px; display: block; }
.line-row .price-kind { font-size: .82rem; color: var(--c-success); font-weight: 700; min-height: 1.4em; }
@media (max-width: 991.98px) { .line-row { grid-template-columns: 1fr 1fr; } .line-row .line-product { grid-column: 1 / -1; } .line-row .line-amount { justify-content: flex-start; } }
.totals { margin-left: auto; max-width: 380px; }
.totals div { display: flex; justify-content: space-between; padding: 6px 0; font-variant-numeric: tabular-nums; }
.totals .grand { border-top: 2px solid var(--c-text); margin-top: 6px; padding-top: 10px; font-size: 1.5rem; font-weight: 700; }

/* お知らせ */
.alert { border-radius: 12px; font-weight: 500; display: flex; gap: 10px; align-items: flex-start; padding: 14px 18px; border-width: 1px; }
.alert svg { margin-top: 5px; }
.alert-success { background: #E6F4EC; border-color: #BFE0CE; color: #17573C; }
.alert-warning { background: #FEF3C7; border-color: #F5D48A; color: #7A4307; }
.alert-danger { background: #FEE9E9; border-color: #F5BDBD; color: #931A1A; }
.alert-info { background: var(--c-sub); border-color: #C9DAD3; color: var(--c-main-hover); }
.note-box { display: flex; gap: 10px; padding: 12px 16px; border-radius: 12px; background: var(--c-bg); border: 1px solid var(--c-border); color: var(--c-muted); font-size: .93rem; line-height: 1.6; }
.note-box svg { margin-top: 4px; }

.pagination { --bs-pagination-color: var(--c-main); --bs-pagination-hover-color: var(--c-main-hover); --bs-pagination-active-bg: var(--c-main); --bs-pagination-active-border-color: var(--c-main); --bs-pagination-border-radius: 10px; --bs-pagination-padding-x: 16px; --bs-pagination-padding-y: 10px; --bs-pagination-font-size: 1rem; gap: 6px; flex-wrap: wrap; }
.pagination .page-link { border-radius: 10px !important; min-width: 46px; text-align: center; }
.chart-box { position: relative; height: 300px; }
.chart-box.small { height: 260px; }
.switch-form { display: inline; }

/* ログイン */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 460px; background: #fff; border: 1px solid var(--c-border); border-radius: 18px; padding: 34px 32px; }
.login-card img { display: block; width: 210px; margin: 0 auto 6px; }
