/*
  全画面で使う共通UIコンポーネント。
  画面固有の余白・高さ・列数などは styles/pages/*.css で調整する。
*/

/* ステータス表示用ピル */
.status-pill {
  min-width: 96px;
  min-height: 30px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 900;
}
.status-pill--live {
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--ink);
}
.status-pill--warn {
  color: #fff;
  background: var(--amber);
}
.status-pill--ok {
  color: #fff;
  background: var(--green);
}
.status-pill--bad {
  color: #fff;
  background: var(--red);
}
.status-pill--done {
  color: #fff;
  background: var(--ink);
}
.status-pill--dot {
  min-width: 20px;
  min-height: 20px;
  border-radius: 50%;
  padding: 0;
}

/* 共通レイアウトグリッド */
.filter-pills,
.chip-grid,
.slot-grid,
.button-grid {
  display: grid;
  gap: 10px;
}
.filter-pills {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.chip-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.chip-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.slot-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.button-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.button-grid > .button:only-child {
  grid-column: 1 / -1;
}

/* カードと基本テキスト */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 16px;
}
.card__eyebrow {
  margin: 0 0 0px;
  color: var(--label);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.card__eyebrow--flush {
  margin: 0;
}
.card__eyebrow--spaced {
  margin-top: 12px;
}
.card__title {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
}
.card__text,
.card__meta {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.5;
}
.card__muted {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.5;
}
.card__divider {
  height: 1px;
  margin: 12px 0;
  background: var(--line-soft);
}

/* ドライバー情報用の共通ピル */
.driver-pill {
  min-height: 30px;
  padding: 5px 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-pill);
}
.driver-pill__tag {
  min-width: 70px;
  min-height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 18, 32, 0.07);
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
}
.driver-pill__name {
  font-size: 12px;
  font-weight: 900;
}

/* フォーム面・行コンテナ・分析カードの共通面 */
.field,
.row,
.metric,
.route-item,
.funnel-item,
.insight-item {
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-row);
}
.field {
  min-height: 54px;
  padding: 12px 16px;
}
.field__label {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.09em;
}
.field__input {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 900;
  color: var(--ink);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
.field__value,
.field__action {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  font-weight: 900;
  min-width: 30px;
}
.field__line,
.row__line,
.route-item {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.temperature-switch {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.temperature-switch__group {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.temperature-switch__option {
  position: relative;
}

.temperature-switch__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.temperature-switch__label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  min-height: 35px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.temperature-switch__input:checked + .temperature-switch__label {
  background: var(--ink);
  color: var(--white);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* チップ・時間帯・フィルターなどの選択UI */
.chip,
.slot,
.filter-pill {
  min-height: 44px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  border: 1px solid var(--line-soft);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}
.chip--active,
.slot--active,
.filter-pill--active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}
.chip--double {
  min-height: 56px;
  flex-direction: column;
  gap: 4px;
}
.chip__sub {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
}
.slot--wide {
  grid-column: span 2;
}

/* 主要CTAと副次ボタン */
.button {
  width: 100%;
  min-height: 54px;
  padding: 0 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-btn);
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}
.button--primary {
  min-height: 56px;
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.button--blue {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

/* カメラ・スキャン領域 */
.camera {
  padding: 14px;
  background: rgba(11, 18, 32, 0.06);
  border-radius: 20px;
}
.camera__frame {
  min-height: 210px;
  border-radius: 22px;
  border: 2px dashed #cbd5e1;
}
.camera__frame--tall {
  min-height: 250px;
}
.camera__frame--scan {
  min-height: 280px;
}
.camera__hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-align: center;
}

/* 一覧行・コード表示 */
.row {
  padding: 12px 14px;
}
.code {
  font-size: 14px;
  font-weight: 900;
}
.row__meta {
  color: #334155;
  font-size: 12px;
  font-weight: 900;
}
.section-heading {
  margin: 0 0 8px;
  color: var(--label);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ダッシュボード用KPI */
.metric {
  padding: 12px 14px;
}
.metric__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.metric__label {
  color: var(--label);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
}
.metric__value {
  margin-top: 8px;
  font-size: 18px;
  font-weight: 900;
}
.metric__delta {
  font-size: 12px;
  font-weight: 900;
}
.metric__delta--good {
  color: var(--green);
}
.metric__delta--warn {
  color: var(--amber);
}
.metric__delta--bad {
  color: var(--red);
}

/* 疑似グラフ。静的モック用なので現時点では実データ連動は想定しない */
.sparkline {
  height: 12px;
  margin-top: 10px;
  background: linear-gradient(
    135deg,
    transparent 10%,
    rgba(11, 18, 32, 0.18) 10%,
    rgba(11, 18, 32, 0.18) 22%,
    transparent 22%,
    transparent 33%,
    rgba(11, 18, 32, 0.28) 33%,
    rgba(11, 18, 32, 0.28) 45%,
    transparent 45%,
    transparent 56%,
    rgba(11, 18, 32, 0.24) 56%,
    rgba(11, 18, 32, 0.24) 68%,
    transparent 68%,
    transparent 79%,
    rgba(11, 18, 32, 0.35) 79%,
    rgba(11, 18, 32, 0.35) 91%,
    transparent 91%
  );
  border-radius: 999px;
  opacity: 0.75;
}

/* 配送一覧カード。左端の帯で案件の状態感を補助する */
.list-card {
  position: relative;
  overflow: hidden;
  padding: 16px 18px 16px 18px;
}
.list-card__stripe {
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: linear-gradient(
    180deg,
    #38bdf8 0 33.33%,
    #94a3b8 33.33% 66.66%,
    #1e3a8a 66.66% 100%
  );
}
.list-card__header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.list-card__name {
  margin: 10px 0 0;
  font-size: 14px;
  font-weight: 900;
}
.list-card__meta {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
}
.list-card__packages,
.summary,
.route-list,
.funnel-list,
.insight-list {
  display: grid;
  gap: 8px;
}
.list-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}
.list-card__link {
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
}

/* 確認画面やダッシュボードで使う情報リスト */
.summary__item {
  display: grid;
  gap: 4px;
}
.summary__label {
  font-size: 11px;
  font-weight: 850;
  color: var(--label);
}
.summary__value {
  font-size: 12px;
  font-weight: 850;
  color: var(--text);
}
.route-item,
.funnel-item,
.insight-item {
  padding: 12px 14px;
}
.route-item__title,
.funnel-item__title,
.insight-item__title {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
}
.route-item__value,
.funnel-item__value,
.insight-item__value {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

/* 棒グラフ表現。Redelivery系の静的チャート用 */
.bar-chart {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  padding-top: 12px;
}
.bar-chart__item {
  text-align: center;
}
.bar-chart__bar {
  width: 100%;
  border-radius: 10px 10px 0 0;
  background: rgba(11, 18, 32, 0.14);
}
.bar-chart__label {
  margin-top: 10px;
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
}
.bar-chart__value {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 900;
}
.bar-chart__value--good {
  color: var(--green);
}
.bar-chart__value--warn {
  color: var(--amber);
}
.bar-chart__value--bad {
  color: var(--red);
}

/* 完了画面のアイコン・一覧検索入力 */
.checkmark {
  width: 76px;
  height: 76px;
  margin: 14px auto 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green);
  color: #fff;
  font-size: 34px;
  font-weight: 900;
}
.search {
  min-width: 170px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  background: rgba(248, 250, 252, 0.94);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
