* { box-sizing: border-box; }
html {
  background: #e4e7eb;
}
body {
  margin: 0 auto;
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  background: #f4f6f8;
  color: #222;
  /* 超ワイド画面で画面全体が左端に張り付かないよう、ページ全体を中央寄せ */
  max-width: 1800px;
}
.topbar {
  background: linear-gradient(135deg, #1f2d3d 0%, #253b52 100%);
  color: #fff;
  padding: 16px 24px;
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}
.topbar h1 { margin: 0; font-size: 14px; color: #93acc9; font-weight: 500; }
.topbar .product-icon {
  flex: none;
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, #4f46e5, #ec4899);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 14px rgba(109,40,217,0.4);
}
.topbar .product-icon svg { width: 18px; height: 18px; }
.topbar .store-name {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.01em;
  background: linear-gradient(100deg, #818cf8 0%, #f0abfc 45%, #fbbf24 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.topbar .company-code {
  font-size: 14px;
  font-weight: 600;
  color: #93acc9;
  background: rgba(147, 172, 201, 0.15);
  border-radius: 999px;
  padding: 3px 10px;
}

.app-layout { display: flex; align-items: flex-start; }

.sidebar {
  width: 216px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid #e6e9ee;
  min-height: 100vh;
  padding: 18px 12px;
  position: sticky;
  top: 0;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #4b5666;
  font-size: 15.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}
.nav-item:hover { background: #f4f6f8; }
.nav-item.active { background: #eaf0ff; color: #2d6cdf; }
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; }
.nav-item.nav-danger { color: #b8443c; }
.nav-item.nav-danger:hover { background: #fbe9e7; }
.nav-divider { height: 1px; background: #eef0f3; margin: 10px 4px; }

.main-content { flex: 1; min-width: 0; }

@media (max-width: 640px) {
  .app-layout { flex-direction: column; }
  .sidebar {
    width: 100%;
    min-height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid #e6e9ee;
    padding: 10px 12px;
  }
  .sidebar-nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .nav-item { width: auto; }
}
.topbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn-primary, .btn-secondary {
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  padding: 9px 16px;
  transition: transform 0.08s ease, box-shadow 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}
.btn-primary:active, .btn-secondary:active { transform: scale(0.96); }

.btn-primary {
  background: #2d6cdf;
  color: #fff;
  border: none;
  box-shadow: 0 2px 6px rgba(45,108,223,0.4);
}
.btn-primary:hover { background: #2559b8; box-shadow: 0 3px 10px rgba(45,108,223,0.5); }

.btn-secondary {
  background: rgba(255,255,255,0.06);
  color: #fff;
  border: 1px solid #5a728f;
}
.btn-secondary:hover { background: rgba(255,255,255,0.14); }

.btn-outline {
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  padding: 9px 16px;
  border: 1px solid #ccc;
  background: #fff;
  color: #334;
  transition: transform 0.08s ease, background 0.15s ease;
  white-space: nowrap;
}
.btn-outline:hover { background: #f4f6f8; }
.btn-outline:active { transform: scale(0.96); }

@media (max-width: 640px) {
  .topbar { padding: 12px 16px; }
  .topbar h1 { font-size: 16px; }
  .topbar .store-name { font-size: 13px; }
  .topbar .company-code { font-size: 12px; padding: 2px 8px; }
  .topbar-actions { width: 100%; justify-content: flex-start; }
  .btn-primary, .btn-secondary { font-size: 14px; padding: 8px 12px; flex: 1 1 auto; text-align: center; }
}

.tabs {
  display: flex;
  gap: 8px;
  padding: 16px 24px 0;
  flex-wrap: wrap;
}
.tab {
  border: 1px solid #d5d9e0;
  background: #fff;
  color: #333;
  padding: 8px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.12s ease;
}
.tab:hover { border-color: #aab; }
.tab.active {
  background: #1a2436;
  color: #fff;
  border-color: #1a2436;
}
.selected-date {
  padding: 4px 24px 16px;
  font-size: 19px;
  font-weight: 700;
  color: #1a2436;
}

.custom-range, .month-range {
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.month-range button {
  padding: 6px 14px;
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
}
.month-range #month-label {
  font-weight: 600;
  min-width: 100px;
  text-align: center;
}
.custom-range input[type="date"] { padding: 6px; }
.custom-range button {
  padding: 6px 14px;
  border: none;
  background: #2d6cdf;
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
}

.interim-panel {
  background: linear-gradient(135deg, #f3f0ff 0%, #fdf0f7 100%);
  margin: 0 24px 16px;
  border-radius: 12px;
  border: 1px solid #e7defc;
  padding: 16px 22px 20px;
}
.interim-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.interim-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #ec4899;
  box-shadow: 0 0 0 rgba(236,72,153,0.5);
  animation: interim-pulse 2s infinite;
}
@keyframes interim-pulse {
  0% { box-shadow: 0 0 0 0 rgba(236,72,153,0.5); }
  70% { box-shadow: 0 0 0 6px rgba(236,72,153,0); }
  100% { box-shadow: 0 0 0 0 rgba(236,72,153,0); }
}
@media (prefers-reduced-motion: reduce) { .interim-dot { animation: none; } }
.interim-title { font-size: 15px; font-weight: 700; color: #4f46e5; }
.interim-updated { font-size: 13.5px; color: #8a94a3; font-weight: 600; }
.interim-updated::before { content: "・"; color: #c7b8f0; margin-right: 2px; }
.interim-updated:empty::before { content: ""; }
.interim-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}
.interim-card { min-width: 0; }
.interim-label { font-size: 14px; color: #7a8699; font-weight: 600; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.interim-value { font-size: 22px; font-weight: 800; color: #1a2436; letter-spacing: -0.01em; }
.interim-sub { font-size: 15px; line-height: 1.6; color: #56606f; margin-top: 6px; }
.interim-sub span { font-weight: 700; color: #1a2436; }
.interim-sub-breakdown { font-size: 13.5px; color: #8a94a3; margin-top: 2px; }
.interim-sub-breakdown span { font-weight: 600; color: #56606f; }
.interim-time-range { font-weight: 500; color: #a99fd6; font-size: 13px; }

.interim-swatch { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.accent-total .interim-swatch { background: #4f46e5; }
.accent-lunch .interim-swatch { background: #f59e0b; }
.accent-dinner .interim-swatch { background: #6d28d9; }

.interim-settings-btn {
  margin-top: 14px;
  background: none;
  border: 1px solid #ddd3fb;
  color: #6d28d9;
  font-size: 13.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.interim-settings-btn:hover { background: #f3effe; }

/* KPIカードの識別アクセント（数値本体の色は変えず、ラベル横のドットのみ） */
.kpi-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.accent-sales .kpi-dot { background: #4f46e5; }
.accent-avg .kpi-dot { background: #7c3aed; }
.accent-customers .kpi-dot { background: #ec4899; }
.accent-checks .kpi-dot { background: #f59e0b; }
.kpi-value.is-empty { color: #c3cad6; }

.kpi-panel {
  background: #fff;
  margin: 0 24px 16px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(20,30,50,0.06), 0 1px 2px rgba(20,30,50,0.08);
  border: 1px solid #eef0f3;
  overflow: hidden;
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  padding: 22px 24px;
}
.kpi-grid + .kpi-grid {
  border-top: 1px solid #eef0f3;
}
.kpi-card { min-width: 0; }
.kpi-label {
  font-size: 14.5px;
  color: #7a8699;
  margin-bottom: 8px;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 4px;
}
.kpi-label .info-icon {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 1px solid #c3cad6;
  color: #9aa5b5;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
}
.kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.kpi-value {
  font-size: 28px;
  font-weight: 800;
  color: #1a2436;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.kpi-trend {
  font-size: 14px;
  font-weight: 600;
  min-height: 16px;
}
.kpi-trend.trend-up { color: #1a9c5b; }
.kpi-trend.trend-down { color: #d4453a; }
.kpi-trend.trend-flat { color: #8a94a3; }

.kpi-yoy {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  background: #eef1f5;
  color: #8a94a3;
}
.kpi-yoy.yoy-up { background: #e6f7ee; color: #1a9c5b; }
.kpi-yoy.yoy-down { background: #fdeceb; color: #d4453a; }
.kpi-yoy.yoy-flat { background: #eef1f5; color: #8a94a3; }

.chart-card {
  background: #fff;
  border-radius: 10px;
  padding: 18px;
  margin: 0 24px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.chart-card h2 { margin: 0 0 12px; font-size: 15px; color: #445; }

.insights-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.insights-header h2 { margin: 0; }
.insights-date { font-size: 15px; font-weight: 700; color: #445; margin-top: 2px; }
.btn-ai {
  background: linear-gradient(135deg, #7b4fa6 0%, #d4453a 100%);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(123,79,166,0.35);
}
.btn-ai:hover { filter: brightness(1.08); }
.btn-ai:disabled { opacity: 0.6; cursor: default; }
.insights-list {
  margin: 0;
  padding-left: 20px;
  font-size: 16px;
  color: #333;
  line-height: 1.8;
}

.target-gauge { margin-bottom: 16px; }
.target-gauge-labels {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 15px;
  color: #4b5666;
  font-weight: 600;
  margin-bottom: 6px;
}
.target-gauge-labels #target-gauge-pct { font-size: 16px; color: #1a2436; font-weight: 800; }
.target-gauge-track {
  height: 10px;
  background: #eef0f3;
  border-radius: 6px;
  overflow: hidden;
}
.target-gauge-fill {
  height: 100%;
  background: linear-gradient(90deg, #2d6cdf, #5a8ef0);
  border-radius: 6px;
  transition: width 0.4s ease;
}
.target-gauge-fill.achieved { background: linear-gradient(90deg, #1a9c5b, #2fbf72); }
.target-gauge-profit { margin-top: 8px; font-size: 15px; color: #7a8699; font-weight: 600; }
.ai-insight {
  margin-top: 12px;
  padding: 14px 16px;
  background: #f7f2fb;
  border: 1px solid #e6d9f0;
  border-radius: 8px;
  font-size: 16px;
  color: #3a2d47;
  white-space: pre-wrap;
  line-height: 1.7;
}
.ai-insight.ai-insight-error {
  background: #fbe9e7;
  border-color: #f0c4bd;
  color: #c0392b;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 0 24px 24px;
}
.grid-2 .chart-card { margin: 0; }

@media (max-width: 720px) {
  .grid-2 { grid-template-columns: 1fr; margin: 0 24px 24px; }
}

table { width: 100%; border-collapse: collapse; font-size: 16px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid #eee; }
th { color: #667; font-weight: 600; }

.daily-table {
  margin-top: 16px;
  max-height: 320px;
  overflow-y: auto;
  display: block;
}
.daily-table thead, .daily-table tbody, .daily-table tfoot { display: table; width: 100%; table-layout: fixed; }
.daily-table tfoot th {
  border-top: 2px solid #ccc;
  border-bottom: none;
  color: #222;
  font-weight: 700;
}

#crm-stores-table, #crm-companies-table {
  display: table;
  max-height: none;
  overflow: visible;
  table-layout: auto;
}
#crm-stores-table thead, #crm-companies-table thead { display: table-header-group; }
#crm-stores-table tbody, #crm-companies-table tbody { display: table-row-group; }
#crm-stores-table th, #crm-stores-table td { white-space: nowrap; }

.sortable-th {
  cursor: pointer;
  user-select: none;
  position: relative;
}
.sortable-th:hover { color: #2d6cdf; }
.sortable-th .sort-arrow { display: inline-block; margin-left: 4px; font-size: 12px; color: #2d6cdf; }
#crm-stores-table th:nth-child(2), #crm-stores-table td:nth-child(2) {
  white-space: normal;
  min-width: 160px;
}
#crm-stores-table th:last-child, #crm-stores-table td:last-child,
#crm-stores-table th:nth-last-child(2), #crm-stores-table td:nth-last-child(2),
#crm-stores-table th:nth-last-child(3), #crm-stores-table td:nth-last-child(3),
#crm-stores-table th:nth-last-child(4), #crm-stores-table td:nth-last-child(4),
#crm-stores-table th:nth-last-child(5), #crm-stores-table td:nth-last-child(5) {
  width: 1%;
}
#crm-stores-table th:nth-child(4), #crm-stores-table td:nth-child(4) {
  white-space: normal;
  min-width: 200px;
}
#crm-stores-table th:last-child, #crm-stores-table td:last-child { text-align: right; }

.row-menu { position: relative; display: inline-block; }
.row-menu > summary {
  list-style: none;
  cursor: pointer;
  padding: 7px 14px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
  color: #334;
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
}
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu > summary::after { content: " \25BE"; }
.row-menu[open] > summary { border-color: #2d6cdf; color: #2d6cdf; }
.row-menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid #e0e4ea;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(20,30,50,0.18);
  padding: 6px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 170px;
}
.row-menu-list button {
  text-align: left;
  white-space: nowrap;
  border: none;
  background: none;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 14.5px;
  font-weight: 600;
  color: #334;
  cursor: pointer;
}
.row-menu-list button:hover { background: #f4f6f8; }
.row-menu-list button.danger { color: #b8443c; }
.row-menu-list button.danger:hover { background: #fbe9e7; }
.row-menu-list .row-menu-divider { height: 1px; background: #eef0f3; margin: 4px 2px; }

.journal-search {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 12px;
  margin-bottom: 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 16px;
}
.journal-list {
  max-height: 480px;
  overflow-y: auto;
}
.journal-card {
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 8px;
}
.journal-head {
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 16px;
  color: #445;
}
.journal-head .journal-amount {
  margin-left: auto;
  font-weight: 700;
  color: #222;
}
.journal-items {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #eee;
}
.journal-item {
  display: flex;
  gap: 12px;
  font-size: 15px;
  color: #667;
  padding: 2px 0;
}
.journal-item span:first-child { flex: 1; }

.journal-tenders {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #eee;
}
.journal-tender {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  color: #2d6cdf;
  font-weight: 600;
  padding: 2px 0;
}
.no-tender { font-size: 14px; color: #aab; }

.admin-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px 24px 24px;
}
.admin-page .chart-card { margin: 0 0 16px; }

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  padding: 32px;
  width: 100%;
  max-width: 360px;
}
.login-card h1 { margin: 0 0 4px; font-size: 20px; color: #1f2d3d; text-align: center; }
.login-sub { margin: 0 0 20px; font-size: 15px; color: #778; text-align: center; }
.login-card label { font-size: 15px; color: #667; margin-top: 10px; display: block; }
.login-card input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  margin-top: 4px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 15px;
}

.login-submit-btn {
  display: block;
  margin: 20px auto 0;
  padding: 10px 32px;
  background: #2d6cdf;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(45,108,223,0.4);
}
.login-submit-btn:active { transform: scale(0.97); }

.admin-message {
  padding: 8px 0;
  font-size: 16px;
  font-weight: 600;
  min-height: 20px;
}
.admin-delete-btn,
.btn-secondary-dark {
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14.5px;
  font-weight: 600;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.admin-delete-btn:active,
.btn-secondary-dark:active { transform: scale(0.96); }

.admin-delete-btn {
  border: 1px solid #c0392b;
  background: #fff;
  color: #c0392b;
}
.admin-delete-btn:hover { background: #fbe9e7; }

.btn-secondary-dark {
  border: 1px solid #2d6cdf;
  background: #fff;
  color: #2d6cdf;
  margin-left: 6px;
}
.btn-secondary-dark:hover { background: #eaf0ff; }

.journal-search-view {
  padding: 0 24px 24px;
}
.yoy-view {
  padding: 0 24px 24px;
}
.yoy-view .chart-card { margin: 0 0 16px; }
.yoy-chart-wrap { position: relative; height: 340px; }
@media (max-width: 720px) {
  .yoy-chart-wrap { height: 260px; }
}
.yoy-table-wrap {
  background: #fff;
  border-radius: 10px;
  padding: 16px 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.yoy-table th:not(:first-child), .yoy-table td:not(:first-child) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.yoy-table th, .yoy-table td { padding: 6px 6px; }
.yoy-table tbody tr:nth-child(even) { background: #fafbfc; }
.yoy-table tbody tr:hover { background: #f0f4f9; }
.yoy-table tbody tr.yoy-row-nodata { color: #aab2bf; }
.yoy-table tbody tr.yoy-row-nodata td:first-child { color: #667; }
.yoy-table .kpi-yoy { margin-top: 0; }
.search-panel {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  margin: 16px 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.search-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.search-panel-header h2 { margin: 0; font-size: 16px; color: #445; }
.company-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: #f4f6f8;
  border-radius: 8px;
  font-size: 16px;
  color: #334;
}
.company-summary-row span { flex: 1; }
.btn-back {
  padding: 6px 14px;
  border: 1px solid #ccc;
  background: #fff;
  color: #334;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14.5px;
  font-weight: 600;
  transition: transform 0.08s ease, background 0.15s ease;
  white-space: nowrap;
}
.btn-back:hover { background: #f4f6f8; }
.btn-back:active { transform: scale(0.96); }
.search-summary {
  padding: 8px 0;
  font-size: 16px;
  font-weight: 600;
  color: #445;
}

.js-pagination {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.js-pagination button {
  padding: 6px 14px;
  border: 1px solid #ccc;
  background: #fff;
  color: #334;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14.5px;
  font-weight: 600;
  transition: transform 0.08s ease, background 0.15s ease;
  white-space: nowrap;
}
.js-pagination button:hover { background: #f4f6f8; }
.js-pagination button:active { transform: scale(0.96); }
.js-pagination #js-page-counter {
  font-weight: 600;
  color: #445;
  min-width: 70px;
  text-align: center;
}

.receipt-detail {
  max-width: 360px;
  margin: 0 auto;
  background: #fffdf5;
  border: 1px solid #e6ddb8;
  border-radius: 8px;
  padding: 16px 20px;
  font-family: "Courier New", monospace;
}
.receipt-detail-head {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  color: #445;
  border-bottom: 1px dashed #ccc;
  padding-bottom: 8px;
  margin-bottom: 6px;
}
.receipt-detail-sub {
  font-size: 14px;
  color: #778;
  margin-bottom: 10px;
}
.receipt-items {
  border-bottom: 1px dashed #ccc;
  padding-bottom: 8px;
  margin-bottom: 8px;
}
.receipt-item {
  display: flex;
  gap: 10px;
  font-size: 15px;
  padding: 3px 0;
}
.receipt-item span:first-child { flex: 1; }
.receipt-detail-total {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 700;
}
.search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.search-row label { font-size: 15px; color: #667; min-width: 70px; }
.required-mark {
  display: inline-block;
  font-size: 0;
  margin-left: 6px;
  vertical-align: middle;
}
.required-mark::before {
  content: "必須";
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: #e0507a;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.search-row .radio-label { min-width: auto; display: flex; align-items: center; gap: 4px; }
.search-row input[type="text"],
.search-row input[type="date"],
.search-row input[type="time"],
.search-row input[type="number"] {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 16px;
}
.search-row input[readonly] { background: #f0f2f5; }
.search-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.search-actions button {
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid #ccc;
  background: #fff;
  color: #334;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.08s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.search-actions button:hover { background: #f4f6f8; }
.search-actions button:active { transform: scale(0.96); }
.search-actions .btn-primary { border: none; background: #2d6cdf; color: #fff; }
.search-actions .btn-primary:hover { background: #2559b8; }

.crm-modal {
  position: fixed;
  inset: 0;
  background: rgba(20,30,50,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.crm-modal-inner {
  background: #fff;
  border-radius: 12px;
  padding: 24px 28px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}
.crm-modal-inner h2 { margin: 0 0 8px; font-size: 17px; color: #1a2436; }
.crm-modal-inner p { margin: 0 0 16px; font-size: 15px; color: #c0392b; }
.crm-modal-inner table { margin-bottom: 16px; }
.crm-modal-inner th { width: 140px; color: #667; font-weight: 600; }
.crm-modal-inner.wide { max-width: 900px; }
.crm-modal-inner.wide p { color: #667; }
.excel-preview-table-wrap { max-width: 100%; max-height: 360px; overflow: auto; margin-bottom: 16px; border: 1px solid #e5e9ef; border-radius: 8px; }
#excel-preview-table { border-collapse: collapse; width: 100%; }
#excel-preview-table th, #excel-preview-table td { white-space: nowrap; padding: 6px 10px; font-size: 15px; text-align: right; border-bottom: 1px solid #eef1f5; }
#excel-preview-table th:nth-child(1), #excel-preview-table td:nth-child(1),
#excel-preview-table th:nth-child(2), #excel-preview-table td:nth-child(2) { text-align: left; }
#excel-preview-table thead th { background: #f4f6f8; position: sticky; top: 0; color: #445; font-weight: 600; }
#excel-preview-table tfoot th { border-top: 2px solid #ccc; background: #f9fafb; }
