/* =============================================================================
   com.css - 共通スタイル
   設計準拠: 02_mockup_22.html （オリジナル admin デザイン）
   - サイドバー: ダークネイビー #1a1a2e
   - 背景: クリーム #f5f4f0
   - フォント: Hiragino Kaku Gothic ProN / Yu Gothic
   追加対応:
   - Mobile-first 響應式（480/768/1024/1280px）
   - safe-area 全方向対応
   ============================================================================= */

:root {
  /* オリジナル color palette (02_mockup_22) */
  --c-navy:    #1a1a2e;
  --c-navy-2:  #2a2a48;
  --c-blue:    #378add;
  --c-purple:  #534ab7;
  --c-green:   #1d9e75;
  --c-red:     #d94f4f;
  --c-amber:   #e0943a;

  --c-bg:        #f5f4f0;
  --c-surface:   #ffffff;
  --c-surface-2: #fafaf8;
  --c-border:    #e8e7e2;

  --c-text:    #1a1a1a;
  --c-muted:   #777;
  --c-label:   #555;
  --c-faint:   #aaa;

  /* primary は navy（btn-primary がネイビー） */
  --c-primary:        #1a1a2e;
  --c-primary-hover:  #2a2a48;
  --c-primary-soft:   #eeedfe;
  --c-primary-text:   #3c3489;

  /* ステータス badge カラー (オリジナルそのまま) */
  --s-waiting:    #854f0b;  --s-waiting-bg:    #faeeda;
  --s-confirmed:  #0c447c;  --s-confirmed-bg:  #e6f1fb;
  --s-assigned:   #085041;  --s-assigned-bg:   #e1f5ee;
  --s-driving:    #3c3489;  --s-driving-bg:    #eeedfe;
  --s-result:     #712b13;  --s-result-bg:     #faece7;
  --s-billed:     #27500a;  --s-billed-bg:     #eaf3de;
  --s-done:       #444;     --s-done-bg:       #f1efe8;
  --s-cancel:     #791f1f;  --s-cancel-bg:     #fcebeb;

  --c-success:      #1d9e75;
  --c-success-soft: #e1f5ee;
  --c-warning:      #e0943a;
  --c-warning-soft: #faeeda;
  --c-danger:       #d94f4f;
  --c-danger-soft:  #fcebeb;
  --c-info:         #378add;
  --c-info-soft:    #e6f1fb;

  --nav-w:    200px;
  --hd-h:     52px;
  --radius:    8px;
  --radius-sm: 6px;
  --radius-lg: 12px;

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.12);

  /* safe-area */
  --sa-top:    env(safe-area-inset-top);
  --sa-right:  env(safe-area-inset-right);
  --sa-bottom: env(safe-area-inset-bottom);
  --sa-left:   env(safe-area-inset-left);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Yu Gothic UI', 'Meiryo', sans-serif;
  font-size: 13px;
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-left:  var(--sa-left);
  padding-right: var(--sa-right);
  padding-top:    var(--sa-top);
  padding-bottom: var(--sa-bottom);
  min-height: 100vh;
  min-height: -webkit-fill-available;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
img { max-width: 100%; height: auto; vertical-align: middle; }

/* ============================================================================
   App layout（Mobile: 縦並び→ PC: 横並びサイドバー）
   ============================================================================ */
.app { display: flex; flex-direction: column; min-height: 100vh; }
.sidebar {
  display: none;
  background: var(--c-navy);
  flex-direction: column;
}
#cw-menu-toggle { display: none; }
#cw-menu-toggle:checked ~ .app .sidebar { display: flex; }

@media (min-width: 1024px) {
  .app { flex-direction: row; height: 100vh; overflow: hidden; }
  .sidebar {
    display: flex;
    width: var(--nav-w);
    position: sticky; top: 0;
    height: 100vh;
    flex-shrink: 0;
  }
  .main { overflow: hidden; }
}

/* ============================================================================
   Sidebar（02_mockup_22.html ベース）
   ============================================================================ */
.sb-logo { padding: 16px 16px 12px; border-bottom: 1px solid rgba(255,255,255,0.08); display: flex; align-items: center; gap: 10px; }
.sb-logo-mark {
  width: 28px; height: 28px; border-radius: 4px;
  background: rgba(255,255,255,0.1); color: #fff;
  font-weight: 700; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
}
.sb-logo-text { display: flex; flex-direction: column; line-height: 1.4; }
.sb-logo-title { font-size: 12px; font-weight: 600; color: #fff; letter-spacing: 0.04em; }
.sb-logo-sub { font-size: 10px; color: rgba(255,255,255,0.4); margin-top: 2px; }

.sb-nav { padding: 8px 0; flex: 1; overflow-y: auto; }
.sb-section { padding: 8px 0 4px; }
.sb-label {
  font-size: 9px; font-weight: 600; letter-spacing: 0.1em;
  color: rgba(255,255,255,0.3);
  padding: 0 16px 6px;
  text-transform: uppercase;
}
.sb-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 16px;
  font-size: 12px; color: rgba(255,255,255,0.65);
  cursor: pointer;
  transition: all 0.15s;
  border-left: 2px solid transparent;
}
.sb-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sb-item.active { background: rgba(255,255,255,0.1); color: #fff; border-left-color: #7f77dd; }
.sb-item .ic { font-size: 14px; flex-shrink: 0; }
.sb-badge {
  margin-left: auto;
  background: var(--c-red); color: #fff;
  font-size: 10px; font-weight: 600;
  padding: 1px 6px; border-radius: 99px; min-width: 18px; text-align: center;
}
.sb-pub-badge {
  margin-left: auto;
  font-size: 9px;
  background: rgba(29,158,117,0.2);
  color: #5dcaa5;
  padding: 1px 5px;
  border-radius: 3px;
}

.sb-footer { border-top: 1px solid rgba(255,255,255,0.08); padding: 10px 12px; display: flex; align-items: center; gap: 10px; }
.sb-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--c-purple);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 11px; font-weight: 600;
}
.sb-user { display: flex; flex-direction: column; line-height: 1.2; flex: 1; min-width: 0; }
.sb-user-name { font-size: 12px; font-weight: 600; color: #fff; }
.sb-user-role { font-size: 11px; color: rgba(255,255,255,0.5); }
.sb-logout { color: rgba(255,255,255,0.4); font-size: 16px; padding: 4px 8px; text-decoration: none; }
.sb-logout:hover { color: #fff; }

/* ============================================================================
   Main / Header
   ============================================================================ */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.header {
  height: var(--hd-h);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center;
  padding: 0 16px; gap: 12px;
  position: sticky; top: 0; z-index: 10;
  flex-shrink: 0;
}
@media (min-width: 768px) { .header { padding: 0 24px; gap: 12px; } }
.hd-crumb { font-size: 12px; color: var(--c-muted); flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; }
.hd-crumb .sep { color: var(--c-faint); }
.hd-crumb strong { color: var(--c-text); font-weight: 600; }
.hd-burger {
  width: 32px; height: 32px;
  border: 1px solid var(--c-border); background: var(--c-surface);
  border-radius: var(--radius); font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
}
@media (min-width: 1024px) { .hd-burger { display: none; } }
.hd-search {
  display: none;
  height: 32px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 0 12px;
  font-size: 12px;
}
@media (min-width: 768px) { .hd-search { display: block; width: 220px; } }
.hd-search:focus { outline: none; border-color: var(--c-blue); }
.hd-actions { display: flex; align-items: center; gap: 8px; }
.hd-icon-btn { width: 32px; height: 32px; border: 1px solid transparent; background: transparent; color: var(--c-muted); border-radius: var(--radius); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.hd-icon-btn:hover { background: var(--c-surface-2); }

/* ============================================================================
   Page area
   ============================================================================ */
.main > .body, .main > .page { flex: 1; overflow-y: auto; padding: 16px; }
@media (min-width: 768px) { .main > .body, .main > .page { padding: 24px; } }

.page-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
@media (min-width: 768px) {
  .page-head { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
}
.page-title { font-size: 18px; font-weight: 600; color: var(--c-text); }
@media (min-width: 768px) { .page-title { font-size: 20px; } }
.page-sub { font-size: 12px; color: var(--c-muted); margin-top: 4px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ============================================================================
   Buttons (オリジナル準拠)
   ============================================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 12px; font-weight: 500;
  border: 1px solid var(--c-border);
  cursor: pointer; transition: all 0.15s;
  white-space: nowrap;
  background: var(--c-surface); color: var(--c-text);
  text-decoration: none;
}
.btn:hover { border-color: #aaa; background: var(--c-surface-2); }
.btn-primary { background: var(--c-navy); color: #fff; border-color: var(--c-navy); }
.btn-primary:hover { background: var(--c-navy-2); border-color: var(--c-navy-2); }
.btn-success { background: var(--c-green); color: #fff; border-color: var(--c-green); }
.btn-success:hover { background: #168b66; border-color: #168b66; }
.btn-danger { background: var(--c-red); color: #fff; border-color: var(--c-red); }
.btn-danger:hover { background: #c43a3a; border-color: #c43a3a; }
.btn-sm { padding: 5px 10px; font-size: 11px; }
.btn-lg { padding: 10px 20px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn:disabled, .btn[disabled] { opacity: 0.5; pointer-events: none; }

/* ============================================================================
   Cards
   ============================================================================ */
.card { background: var(--c-surface); border-radius: var(--radius); border: 1px solid var(--c-border); margin-bottom: 16px; }
.card-head, .card-header { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--c-border); flex-wrap: wrap; }
@media (min-width: 768px) { .card-head, .card-header { padding: 16px 20px; } }
.card-title { font-size: 14px; font-weight: 600; }
.card-sub { font-size: 11px; color: var(--c-muted); margin-left: auto; }
.card-body { padding: 16px; }
@media (min-width: 768px) { .card-body { padding: 20px; } }
.card-body.compact { padding: 0; }
.card-foot, .card-footer { padding: 12px 16px; border-top: 1px solid var(--c-border); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
@media (min-width: 768px) { .card-foot, .card-footer { padding: 14px 20px; } }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
@media (min-width: 768px) { .stats { grid-template-columns: repeat(3, 1fr); gap: 12px; } }
@media (min-width: 1280px) { .stats { grid-template-columns: repeat(5, 1fr); } }
.stat { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.stat-label { font-size: 11px; color: var(--c-muted); font-weight: 500; }
.stat-value { font-size: 22px; font-weight: 600; color: var(--c-text); line-height: 1.1; }
.stat-meta { font-size: 11px; color: var(--c-muted); }
.stat.alert .stat-value { color: var(--c-red); }
.stat.primary .stat-value { color: var(--c-navy); }
.stat.success .stat-value { color: var(--c-green); }
.stat.warning .stat-value { color: var(--c-amber); }

/* ============================================================================
   Tables (オリジナルの .data-table)
   ============================================================================ */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl, .data-table { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 640px; }
.tbl thead th, .data-table thead th {
  font-size: 11px; font-weight: 600; color: var(--c-muted);
  text-align: left; padding: 10px 14px;
  background: var(--c-surface-2);
  border-bottom: 2px solid var(--c-border);
  white-space: nowrap;
}
.tbl tbody td, .data-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--c-border);
  font-size: 12px; vertical-align: middle;
}
.tbl tbody tr, .data-table tbody tr { transition: background 0.1s; cursor: pointer; }
.tbl tbody tr:hover, .data-table tbody tr:hover { background: #f8f8f5; }
.tbl tbody tr:last-child td, .data-table tbody tr:last-child td { border-bottom: none; }
.tbl .num, .data-table .num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.tbl .id, .data-table .id { font-family: 'Courier New', monospace; font-size: 11px; color: var(--c-muted); white-space: nowrap; }
.tbl .muted, .data-table .muted { color: var(--c-muted); }

/* Filter row / Table tools */
.filter-row, .tbl-tools {
  display: flex; flex-direction: column;
  gap: 8px; padding: 12px 16px;
  border-bottom: 1px solid var(--c-border);
}
@media (min-width: 768px) {
  .filter-row, .tbl-tools { flex-direction: row; align-items: center; gap: 8px; flex-wrap: wrap; padding: 14px 20px; }
}
.filter-row input, .filter-row select {
  padding: 7px 10px; border: 1px solid var(--c-border); border-radius: var(--radius);
  font-size: 12px; background: var(--c-surface); color: var(--c-text); outline: none;
}
.filter-row input:focus, .filter-row select:focus { border-color: var(--c-blue); }
.filter-spacer, .grow { flex: 1; }

/* Chips（フィルター） */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  font-size: 11px; font-weight: 500;
  border: 1px solid var(--c-border);
  background: var(--c-surface); color: var(--c-muted);
  border-radius: 99px; cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.chip:hover { border-color: var(--c-blue); color: var(--c-blue); }
.chip.active { background: var(--c-navy); color: #fff; border-color: var(--c-navy); }
.chip .ct { font-size: 10px; background: rgba(0,0,0,0.08); padding: 0 6px; border-radius: 99px; }
.chip.active .ct { background: rgba(255,255,255,0.2); }

/* ============================================================================
   Status badges（オリジナル .status / .s-* ）
   ============================================================================ */
.status, .st {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 500;
  padding: 3px 9px;
  border-radius: 99px;
  white-space: nowrap;
}
.status .dot, .st::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}
.st::before { display: inline-block; }
.s-waiting,   .st-waiting   { background: var(--s-waiting-bg);   color: var(--s-waiting); }
.s-confirmed, .st-confirmed { background: var(--s-confirmed-bg); color: var(--s-confirmed); }
.s-assigned,  .st-assigned  { background: var(--s-assigned-bg);  color: var(--s-assigned); }
.s-driving,   .st-driving   { background: var(--s-driving-bg);   color: var(--s-driving); }
.s-result,    .st-result    { background: var(--s-result-bg);    color: var(--s-result); }
.s-billed,    .st-billed    { background: var(--s-billed-bg);    color: var(--s-billed); }
.s-done,      .st-done      { background: var(--s-done-bg);      color: var(--s-done); }
.s-cancel,    .st-cancel    { background: var(--s-cancel-bg);    color: var(--s-cancel); }

/* Source badge */
.source, .tag {
  display: inline-block; font-size: 10px;
  padding: 2px 6px; border-radius: 3px;
}
.src-web,  .tag-web   { background: #eeedfe; color: #534ab7; }
.src-tel,  .tag-phone { background: #f1efe8; color: #5f5e5a; }

/* ============================================================================
   Forms（オリジナル .form-grid / .form-group / .form-input）
   ============================================================================ */
.form-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.form-full { grid-column: 1 / -1; }
@media (min-width: 768px) { .form-grid { grid-template-columns: 1fr 1fr; gap: 16px; } }

.form-group, .field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 8px; }
.form-label, .field-label {
  font-size: 12px; font-weight: 500; color: var(--c-label);
  display: flex; align-items: center; gap: 6px;
}
.req { font-size: 10px; background: var(--s-cancel-bg); color: var(--s-cancel); padding: 1px 5px; border-radius: 99px; }
.opt { font-size: 10px; background: #f1efe8; color: #666; padding: 1px 5px; border-radius: 99px; }
.field-hint { font-size: 11px; color: var(--c-muted); }
.field-error { font-size: 11px; color: var(--c-red); }

.form-input, .form-textarea, .form-select, .input, .select, .textarea {
  padding: 9px 12px; border: 1px solid var(--c-border); border-radius: var(--radius);
  font-size: 13px; outline: none;
  font-family: inherit;
  background: var(--c-surface); color: var(--c-text);
  width: 100%; -webkit-appearance: none;
}
.form-input:focus, .form-textarea:focus, .form-select:focus,
.input:focus, .select:focus, .textarea:focus { border-color: var(--c-blue); }
.form-textarea, .textarea { resize: vertical; min-height: 80px; }
.form-select, .select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 36px; cursor: pointer;
}
.input { height: auto; }

.grid-1 { display: grid; grid-template-columns: 1fr; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 12px; }
.grid-4 { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 768px) {
  .grid-2 { grid-template-columns: 1fr 1fr; gap: 16px; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}
@media (min-width: 1024px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } }

/* Fieldset (元 mockup には無いが、便宜上 card と類似に) */
.fieldset {
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--c-surface);
  margin-bottom: 14px;
}
@media (min-width: 768px) { .fieldset { padding: 18px 20px; } }
.fieldset-title {
  font-size: 13px; font-weight: 600; color: var(--c-text);
  display: flex; align-items: center; gap: 8px;
  margin: -2px 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--c-border);
}
.fieldset-title .num {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--c-navy); color: #fff;
  font-size: 11px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}

.section-divider { grid-column: 1 / -1; padding: 8px 0 4px; border-bottom: 1px solid var(--c-border); margin-top: 8px; }
.section-divider span { font-size: 11px; font-weight: 600; color: var(--c-muted); letter-spacing: 0.05em; text-transform: uppercase; }

.chk { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.chk input { accent-color: var(--c-navy); width: 15px; height: 15px; }

/* ============================================================================
   Detail layout（field-row）
   ============================================================================ */
.detail-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 768px) { .detail-grid { grid-template-columns: 1fr 1fr; } }
.detail-full { grid-column: 1 / -1; }
.field-row, .info-row { display: flex; padding: 9px 0; border-bottom: 1px solid var(--c-border); }
.field-row:last-child, .info-row:last-child { border-bottom: none; }
.field-row .field-label, .info-row .lbl { width: 120px; min-width: 120px; font-size: 11px; color: var(--c-muted); padding-top: 1px; }
.field-row .field-value, .info-row .val { flex: 1; font-size: 13px; }
.info-row { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 9px 0; }

.action-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; padding: 14px 16px; background: var(--c-surface); border-radius: var(--radius); border: 1px solid var(--c-border); }

/* ============================================================================
   Stage / Progress (予約ステージ)
   ============================================================================ */
.stage-bar { display: flex; align-items: center; gap: 0; margin-bottom: 18px; background: var(--c-surface); padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--c-border); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.stage { display: flex; align-items: center; gap: 6px; padding: 4px 10px; font-size: 11px; color: var(--c-muted); flex-shrink: 0; white-space: nowrap; }
.stage + .stage::before { content: '›'; color: var(--c-faint); padding-right: 4px; margin-left: -4px; }
.stage .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-border); }
.stage.done { color: var(--c-green); font-weight: 500; }
.stage.done .dot { background: var(--c-green); }
.stage.active { color: #fff; background: var(--c-navy); border-radius: 99px; font-weight: 600; padding: 4px 12px; }
.stage.active .dot { background: #fff; }

/* ============================================================================
   Pagination (7-button rule)
   ============================================================================ */
.pager { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.pg-btn {
  min-width: 30px; height: 30px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--c-text);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  border-radius: var(--radius);
  text-decoration: none;
  transition: all 0.15s;
}
.pg-btn:hover { border-color: var(--c-blue); color: var(--c-blue); }
.pg-btn.pg-current { background: var(--c-navy); color: #fff; border-color: var(--c-navy); font-weight: 600; }
.pg-btn.pg-disabled { opacity: 0.4; pointer-events: none; }
.pg-gap { font-size: 12px; color: var(--c-muted); padding: 0 4px; }

/* ============================================================================
   Alerts / Notices
   ============================================================================ */
.alert { display: flex; gap: 8px; padding: 12px 16px; border-radius: var(--radius); font-size: 12px; line-height: 1.6; margin-bottom: 14px; background: var(--c-surface-2); border: 1px solid var(--c-border); }
.alert .ic { width: 16px; height: 16px; flex-shrink: 0; }
.alert-warning { background: #fff8e6; border-color: #f0d090; color: #7a5c00; }
.alert-info    { background: #e6f1fb; border-color: #b8d4ef; color: #0c447c; }
.alert-success { background: #e1f5ee; border-color: #a8dec9; color: #085041; }
.alert-danger  { background: #fcebeb; border-color: #f0b0b0; color: #791f1f; }

/* オリジナル confirm-notice 互換 */
.confirm-notice { background: #e6f1fb; border-radius: var(--radius); padding: 12px 16px; font-size: 12px; color: #0c447c; margin-bottom: 16px; display: flex; gap: 8px; }

/* diff-badge */
.diff-badge { display: inline-block; font-size: 10px; padding: 1px 5px; border-radius: 3px; background: #faeeda; color: #633806; margin-left: 6px; }

/* Screen label badge */
.screen-label { display: inline-block; font-size: 10px; padding: 2px 8px; border-radius: 99px; background: var(--c-navy); color: rgba(255,255,255,0.7); letter-spacing: 0.04em; }

/* ============================================================================
   Fare / Billing
   ============================================================================ */
.fare-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.fare-table td { padding: 8px 12px; border-bottom: 1px solid var(--c-border); }
.fare-table .fare-total { background: var(--c-surface-2); font-weight: 600; font-size: 14px; }
.fare-table .label { color: var(--c-muted); }
.fare-table .amount { text-align: right; font-variant-numeric: tabular-nums; }
.fare-total-row { display: flex; justify-content: flex-end; align-items: baseline; gap: 12px; padding: 14px 0 0; }
.fare-total-label { font-size: 12px; color: var(--c-muted); }
.fare-total-value { font-size: 24px; font-weight: 700; color: var(--c-navy); }

/* ============================================================================
   Calendar / Gantt
   ============================================================================ */
.view-toggle { display: flex; gap: 4px; }
.vt-btn { padding: 5px 14px; font-size: 12px; font-weight: 500; border: 1px solid var(--c-border); border-radius: var(--radius); cursor: pointer; background: var(--c-surface); color: var(--c-muted); }
.vt-btn.active { background: var(--c-navy); color: #fff; border-color: var(--c-navy); }
.gantt-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--c-border); border-radius: var(--radius); background: var(--c-surface); }
.gantt { display: grid; min-width: 900px; }
.gantt-header { display: flex; background: var(--c-surface-2); border-bottom: 2px solid var(--c-border); position: sticky; top: 0; z-index: 2; }
.gantt-row-label-hd { width: 130px; min-width: 130px; padding: 8px 12px; font-size: 11px; font-weight: 600; color: var(--c-muted); border-right: 1px solid var(--c-border); }
.gantt-time-cols { flex: 1; display: flex; }
.gantt-time-cell { flex: 1; text-align: center; font-size: 10px; color: var(--c-muted); padding: 8px 0; border-right: 1px solid #f0efeb; white-space: nowrap; }
.gantt-body-row { display: flex; border-bottom: 1px solid var(--c-border); min-height: 56px; }
.gantt-body-row:last-child { border-bottom: none; }
.gantt-row-label { width: 130px; min-width: 130px; padding: 10px 12px; font-size: 12px; font-weight: 500; border-right: 1px solid var(--c-border); background: var(--c-surface-2); display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.gantt-row-label .sub { font-size: 10px; color: var(--c-muted); font-weight: 400; }
.gantt-row-cells { flex: 1; position: relative; }
.gantt-grid-lines { position: absolute; inset: 0; display: flex; pointer-events: none; }
.gantt-grid-line { flex: 1; border-right: 1px solid #f0efeb; }
.gantt-block { position: absolute; top: 6px; bottom: 6px; border-radius: 4px; padding: 3px 7px; font-size: 11px; font-weight: 500; display: flex; align-items: center; overflow: hidden; cursor: pointer; white-space: nowrap; box-shadow: 0 1px 3px rgba(0,0,0,0.12); transition: opacity 0.15s, box-shadow 0.15s; text-decoration: none; }
.gantt-block:hover { opacity: 0.85; box-shadow: 0 2px 8px rgba(0,0,0,0.2); }
.gb-assigned  { background: #d1f0e6; color: #085041; border-left: 3px solid var(--c-green); }
.gb-confirmed { background: #daeeff; color: #0c447c; border-left: 3px solid var(--c-blue); }
.gb-driving   { background: #e5e2fe; color: #3c3489; border-left: 3px solid var(--c-purple); }
.gb-waiting,
.gb-pending   { background: #fde8cb; color: #633806; border-left: 3px solid var(--c-amber); }
.gb-result    { background: #fce0da; color: #712b13; border-left: 3px solid var(--c-red); }
.now-line { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--c-red); opacity: 0.6; z-index: 1; }

/* ============================================================================
   Route block（乗降地入力ブロック）
   ============================================================================ */
.route-block { border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; }
.route-row { display: flex; align-items: flex-start; gap: 8px; padding: 9px 12px; }
.route-row + .route-row { border-top: 1px solid var(--c-border); }
.route-icon { font-size: 14px; color: var(--c-muted); margin-top: 2px; flex-shrink: 0; }
.route-lbl { font-size: 11px; color: var(--c-muted); width: 50px; flex-shrink: 0; margin-top: 3px; }
.route-col { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.route-input { width: 100%; border: none; outline: none; font-size: 13px; font-family: inherit; background: transparent; color: var(--c-text); padding: 0; }
.route-detail { width: 100%; border: none; border-top: 1px dashed var(--c-border); outline: none; font-size: 11px; font-family: inherit; background: transparent; color: var(--c-muted); resize: none; padding-top: 5px; line-height: 1.5; min-height: 0; }
.route-detail::placeholder { color: #bbb; }

/* ============================================================================
   CSV 出力 (.export-card / .export-grid)
   ============================================================================ */
.export-group-label {
  font-size: 11px; font-weight: 600;
  color: var(--c-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 20px 0 10px;
}
.export-grid {
  display: grid; grid-template-columns: 1fr; gap: 10px;
}
@media (min-width: 768px) {
  .export-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
}
@media (min-width: 1280px) {
  .export-grid { grid-template-columns: repeat(4, 1fr); }
}
.export-card {
  display: flex;
  flex-direction: column;
  background: var(--c-surface);
  border: 2px solid var(--c-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.export-card:hover { border-color: var(--c-blue); }
.export-card.selected { border-color: var(--c-navy); background: var(--c-primary-soft); }
.export-card input[type="radio"] {
  position: absolute; top: 12px; right: 12px;
  width: 16px; height: 16px;
  accent-color: var(--c-navy);
  margin: 0;
}
.export-card.primary { border-left-width: 4px; border-left-color: #5dcaa5; }
.export-card.master  { border-left-width: 4px; border-left-color: #afa9ec; }
.export-card.primary.selected { border-left-color: #5dcaa5; }
.export-card.master.selected  { border-left-color: #afa9ec; }
.export-card-title {
  font-size: 13px; font-weight: 600;
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 8px;
  padding-right: 28px;
}
.export-card-desc {
  font-size: 11px;
  color: var(--c-muted);
  line-height: 1.6;
}

/* ============================================================================
   Utility
   ============================================================================ */
.flex { display: flex; } .flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; } .items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; } .justify-end { justify-content: flex-end; } .justify-center { justify-content: center; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.text-muted { color: var(--c-muted); } .text-faint { color: var(--c-faint); }
.text-primary { color: var(--c-navy); }
.text-danger { color: var(--c-red); }
.text-success { color: var(--c-green); }
.text-warning { color: var(--c-amber); }
.text-right { text-align: right; } .text-center { text-align: center; }
.text-sm { font-size: 11px; } .text-xs { font-size: 10px; }
.fw-600 { font-weight: 600; } .fw-500 { font-weight: 500; }
.mono { font-family: 'Courier New', monospace; }
.tnum { font-variant-numeric: tabular-nums; }
.divider { height: 1px; background: var(--c-border); margin: 12px 0; }
