/* ==========================================================
   運送会社業務システム 共通スタイル(モダンブルー)
   ========================================================== */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff6ff;
  --ink: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f1f5f9;
  --card: #ffffff;
  --danger: #dc2626;
  --success: #16a34a;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 4px 12px rgba(15, 23, 42, .05);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- ヘッダー ---------- */
.site-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; flex-wrap: wrap; gap: 8px;
}
.site-header .app-name {
  font-size: 17px; font-weight: 700; letter-spacing: .02em;
}
.site-header .app-name::before {
  content: "🚚"; margin-right: 8px;
}
.site-header .user-info { font-size: 13px; opacity: .95; }
.site-header .user-info a {
  color: #fff; margin-left: 12px; padding: 5px 12px;
  border: 1px solid rgba(255,255,255,.4); border-radius: 999px;
  font-size: 12px; transition: background .15s;
}
.site-header .user-info a:hover { background: rgba(255,255,255,.15); text-decoration: none; }

/* ---------- ナビ ---------- */
.nav {
  background: #fff;
  padding: 10px 20px;
  display: flex; gap: 6px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  position: sticky; top: 0; z-index: 10;
}
.nav a {
  color: var(--muted); text-decoration: none;
  padding: 8px 16px; border-radius: 999px;
  font-size: 14px; font-weight: 600;
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--primary-soft); color: var(--primary); text-decoration: none; }
.nav a.active { background: var(--primary); color: #fff; }

/* ---------- コンテンツ ---------- */
.container { max-width: 1140px; margin: 28px auto; padding: 0 20px; }
h1.page-title {
  font-size: 21px; font-weight: 700; margin-bottom: 20px; color: var(--ink);
  display: flex; align-items: center; gap: 10px;
}
h1.page-title::before {
  content: ""; display: inline-block; width: 5px; height: 24px;
  background: var(--primary); border-radius: 3px;
}

/* ---------- カード ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

/* ---------- テーブル ---------- */
table.list {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
table.list th, table.list td {
  padding: 11px 14px; text-align: left; font-size: 14px;
  border-bottom: 1px solid var(--line);
}
table.list th {
  background: #f8fafc; color: var(--muted);
  font-size: 12px; font-weight: 700; letter-spacing: .03em;
  white-space: nowrap;
}
table.list tr:last-child td { border-bottom: none; }
table.list tbody tr:hover td, table.list tr:hover td { background: var(--primary-soft); }

/* ---------- フォーム ---------- */
.form-row { margin-bottom: 16px; }
.form-row label {
  display: block; font-weight: 600; margin-bottom: 6px;
  font-size: 13px; color: var(--ink);
}
.form-row .required {
  color: var(--danger); font-size: 11px; margin-left: 6px;
  background: #fef2f2; padding: 2px 8px; border-radius: 999px;
}
input[type=text], input[type=password], input[type=date], input[type=number],
select, textarea {
  width: 100%; max-width: 480px; padding: 10px 12px;
  border: 1px solid #cbd5e1; border-radius: 8px; font-size: 15px;
  background: #fff; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
textarea { height: 100px; }
.form-inline { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.form-inline .form-row { margin-bottom: 0; }
.form-inline input, .form-inline select { width: auto; }

/* ---------- ボタン ---------- */
.btn {
  display: inline-block; padding: 9px 20px;
  border: none; border-radius: 8px;
  background: var(--primary); color: #fff;
  font-size: 14px; font-weight: 600; cursor: pointer;
  text-decoration: none; font-family: inherit;
  box-shadow: 0 1px 2px rgba(37, 99, 235, .3);
  transition: background .15s, transform .05s;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-sub { background: #fff; color: var(--ink); border: 1px solid #cbd5e1; box-shadow: none; }
.btn-sub:hover { background: #f8fafc; border-color: #94a3b8; }
.btn-danger { background: #fff; color: var(--danger); border: 1px solid #fca5a5; box-shadow: none; }
.btn-danger:hover { background: #fef2f2; border-color: var(--danger); }
.btn-sm { padding: 5px 12px; font-size: 13px; border-radius: 6px; }
button:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- フラッシュメッセージ ---------- */
.flash {
  padding: 12px 16px; border-radius: 10px; margin-bottom: 18px;
  font-size: 14px; font-weight: 500;
  display: flex; align-items: center; gap: 8px;
}
.flash-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.flash-success::before { content: "✓"; font-weight: 700; }
.flash-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.flash-error::before { content: "!"; font-weight: 700; }

/* ---------- ステータスバッジ ---------- */
.badge {
  display: inline-block; padding: 3px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.badge-received   { background: #f1f5f9; color: #475569; }
.badge-assigned   { background: #eff6ff; color: #1d4ed8; }
.badge-delivering { background: #fff7ed; color: #c2410c; }
.badge-done       { background: #f0fdf4; color: #15803d; }
.badge-canceled   { background: #f8fafc; color: #94a3b8; text-decoration: line-through; }

/* ---------- ダッシュボード ---------- */
.stats { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.stat-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 24px; min-width: 150px; flex: 1;
  text-align: center;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--primary);
}
.stat-box .num { font-size: 30px; font-weight: 800; color: var(--ink); line-height: 1.2; }
.stat-box .label { font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 4px; }

/* ---------- ログイン画面 ---------- */
.login-wrap { max-width: 400px; margin: 80px auto; padding: 0 16px; }
.login-wrap .card { padding: 36px 32px; }
.login-wrap h1 {
  text-align: center; font-size: 20px; font-weight: 700;
  color: var(--ink); margin-bottom: 26px;
}
.login-wrap h1::before {
  content: "🚚"; display: block; font-size: 38px; margin-bottom: 10px;
}
.login-wrap input { max-width: none; }
.login-wrap .btn { width: 100%; padding: 12px; font-size: 15px; margin-top: 4px; }

/* ---------- ホームの大ボタン ---------- */
.big-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.big-btn {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform .08s, border-color .15s, box-shadow .15s;
}
.big-btn:hover {
  text-decoration: none;
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(37, 99, 235, .15);
  transform: translateY(-2px);
}
.big-btn .icon { font-size: 30px; display: block; margin-bottom: 8px; }
.big-btn .title { font-size: 16px; font-weight: 700; display: block; margin-bottom: 4px; }
.big-btn .desc { font-size: 12px; color: var(--muted); display: block; line-height: 1.5; }

/* ---------- 業務の流れガイド ---------- */
.flow-guide {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  background: var(--primary-soft);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 13px; font-weight: 600; color: #1e40af;
}
.flow-guide .step {
  background: #fff; border-radius: 999px; padding: 5px 14px;
  border: 1px solid #bfdbfe;
}
.flow-guide .arrow { color: #93c5fd; font-weight: 700; }

/* ---------- 使い方ヒント ---------- */
details.hint {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 10px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #78350f;
}
details.hint summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}
details.hint summary::before { content: "💡 "; }
details.hint[open] summary { margin-bottom: 8px; }
details.hint p { margin: 4px 0; line-height: 1.7; }

/* ---------- スマホ対応 ---------- */
@media (max-width: 600px) {
  .container { padding: 0 10px; margin-top: 16px; }
  .site-header { padding: 12px 14px; }
  .nav { padding: 8px 10px; gap: 4px; overflow-x: auto; flex-wrap: nowrap; white-space: nowrap; }
  .nav a { padding: 7px 12px; font-size: 13px; }
  table.list { font-size: 12px; display: block; overflow-x: auto; }
  table.list th, table.list td { padding: 8px 8px; }
  .stats { gap: 8px; }
  .stat-box { min-width: 100px; padding: 12px 10px; }
  .stat-box .num { font-size: 24px; }
}
