:root {
  --primary: #C8121C;
  --primary-dark: #9e0d15;
  --primary-light: #f9e5e6;
  --secondary: #1a2a4a;
  --secondary-light: #253b6a;
  --accent: #FF6B35;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --purple: #8b5cf6;
  --teal: #14b8a6;
  --bg: #f0f2f7;
  --surface: #ffffff;
  --sidebar-w: 240px;
  --sidebar-w-collapsed: 68px;
  --header-h: 62px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.12);
  --border: #e5e7eb;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --sidebar-bg: #1a2a4a;
  --sidebar-text: rgba(255,255,255,0.75);
  --sidebar-active: #ffffff;
  --transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
}

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

body {
  font-family: 'Noto Sans JP', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
}

/* ========== ログイン画面 ========== */
.login-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: linear-gradient(135deg, #1a2a4a 0%, #C8121C 100%);
  display: flex; align-items: center; justify-content: center;
}

.login-card {
  background: #fff;
  border-radius: 20px;
  padding: 48px 56px;
  width: 420px;
  max-width: 90vw;
  box-shadow: 0 24px 64px rgba(0,0,0,0.3);
  text-align: center;
  animation: slideUp 0.4s ease;
}

@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 8px;
}

.login-logo-icon {
  width: 52px;
  height: 52px;
  background: var(--primary);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 24px;
  flex-shrink: 0;
}

.login-brand {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.brand-main {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.1;
}

.brand-sub {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 2px;
}

.login-desc {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 24px;
}

.login-form .form-group {
  margin-bottom: 18px;
  text-align: left;
}

.login-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.login-form label i { margin-right: 6px; color: var(--primary); }

.login-form input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  transition: var(--transition);
  background: #f8f9fa;
}

.login-form input:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px var(--primary-light);
}

.login-btn {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 8px;
}

.login-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(200,18,28,0.35);
}

.login-note {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 28px;
}

/* ========== レイアウト ========== */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.hidden { display: none !important; }

/* ========== サイドバー ========== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  flex-shrink: 0;
  position: relative;
  z-index: 100;
  overflow: hidden;
}

.sidebar.collapsed {
  width: var(--sidebar-w-collapsed);
}

.sidebar-header {
  padding: 20px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  min-height: 70px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  white-space: nowrap;
  transition: var(--transition);
}

.sidebar.collapsed .logo-text { opacity: 0; width: 0; }

.logo-main {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.logo-sub {
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 1px;
}

.sidebar-toggle {
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}

.sidebar-toggle:hover { background: rgba(255,255,255,0.2); }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  padding: 12px 20px 6px;
  white-space: nowrap;
  overflow: hidden;
  transition: var(--transition);
}

.sidebar.collapsed .nav-section-label { opacity: 0; }

.nav-list { list-style: none; padding: 0 8px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  overflow: hidden;
  margin-bottom: 2px;
}

.nav-item i {
  width: 20px;
  text-align: center;
  font-size: 16px;
  flex-shrink: 0;
}

.nav-item span {
  transition: var(--transition);
  font-size: 14px;
  font-weight: 500;
}

.sidebar.collapsed .nav-item span { opacity: 0; width: 0; overflow: hidden; }

.nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.nav-item.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(200,18,28,0.4);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.user-detail {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: var(--transition);
}

.sidebar.collapsed .user-detail { opacity: 0; width: 0; }

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}

.user-role {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
}

/* ========== メインコンテンツ ========== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ========== ヘッダー ========== */
.top-header {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.header-left {
  display: flex;
  flex-direction: column;
}

.page-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-title i { color: var(--primary); }

.breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-display {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg);
  padding: 6px 12px;
  border-radius: 20px;
  margin-right: 8px;
}

.date-display i { color: var(--primary); }

.header-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  position: relative;
  transition: var(--transition);
}

.header-btn:hover { background: var(--bg); color: var(--primary); border-color: var(--primary); }

.badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

/* ========== ページコンテンツ ========== */
.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.page { display: none; }
.page.active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== KPIカード ========== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 1400px) { .kpi-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }

.kpi-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 1px solid transparent;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border);
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.kpi-blue { background: #eff6ff; color: var(--info); }
.kpi-orange { background: #fff7ed; color: var(--accent); }
.kpi-green { background: #f0fdf4; color: var(--success); }
.kpi-red { background: #fef2f2; color: var(--danger); }
.kpi-purple { background: #faf5ff; color: var(--purple); }
.kpi-teal { background: #f0fdfa; color: var(--teal); }

.kpi-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.kpi-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.kpi-change {
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 3px;
}

.kpi-change.positive { color: var(--success); }
.kpi-change.negative { color: var(--danger); }
.kpi-change.neutral { color: var(--text-muted); }

/* ========== チャートカード ========== */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.chart-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.chart-card:hover {
  box-shadow: var(--shadow-md);
}

.chart-card.chart-large {
  grid-column: span 2;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-header h3 i { color: var(--primary); font-size: 14px; }

.card-actions {
  display: flex;
  gap: 4px;
}

.tab-btn {
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-secondary);
  font-family: inherit;
  transition: var(--transition);
}

.tab-btn.active, .tab-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.donut-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.legend-item strong { color: var(--text-primary); margin-left: auto; }

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot.green { background: var(--success); }
.dot.orange { background: var(--accent); }
.dot.blue { background: var(--info); }
.dot.red { background: var(--danger); }

/* ========== テーブル ========== */
.table-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.table-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table.full { min-width: 900px; }

.data-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg);
  border-bottom: 1.5px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }

.data-table tr:hover td { background: #fafbff; }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge.delivery { background: #fff7ed; color: var(--accent); }
.status-badge.complete { background: #f0fdf4; color: var(--success); }
.status-badge.pending { background: #eff6ff; color: var(--info); }
.status-badge.delay { background: #fef2f2; color: var(--danger); }
.status-badge.cancel { background: #f3f4f6; color: var(--text-muted); }

.view-all-btn {
  font-size: 12px;
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
}

.view-all-btn:hover { color: var(--primary-dark); }

.action-btn {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
  color: var(--text-secondary);
  white-space: nowrap;
}

.action-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ========== 受注管理 ========== */
.page-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  flex: 1;
  min-width: 200px;
  max-width: 360px;
  transition: var(--transition);
}

.search-bar:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.search-bar i { color: var(--text-muted); }

.search-bar input {
  border: none;
  outline: none;
  font-size: 14px;
  font-family: inherit;
  width: 100%;
  background: transparent;
}

.filter-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-select, .filter-date {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
}

.filter-select:focus, .filter-date:focus {
  outline: none;
  border-color: var(--primary);
}

.primary-btn {
  padding: 9px 18px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  white-space: nowrap;
}

.primary-btn:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(200,18,28,0.3); }

.secondary-btn {
  padding: 9px 18px;
  background: var(--surface);
  color: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}

.secondary-btn:hover { background: var(--primary-light); }

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 0;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

.table-info { font-size: 13px; color: var(--text-secondary); }

.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  color: var(--text-secondary);
}

.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn:hover:not(.active):not(.disabled) { border-color: var(--primary); color: var(--primary); }
.page-btn.disabled { opacity: 0.4; cursor: default; }

/* ========== 配送管理 ========== */
.delivery-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 16px;
  height: calc(100vh - 130px);
}

.delivery-list-panel {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  padding: 16px 16px 0;
  border-bottom: 1px solid var(--border);
}

.panel-header h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
}

.status-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 12px;
}

.stab {
  padding: 5px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
  color: var(--text-secondary);
}

.stab.active { background: var(--secondary); color: #fff; border-color: var(--secondary); }
.stab:hover:not(.active) { border-color: var(--secondary); color: var(--secondary); }

.cnt {
  background: rgba(255,255,255,0.2);
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 11px;
}

.stab:not(.active) .cnt {
  background: var(--bg);
  color: var(--text-muted);
}

#delivery-cards-container {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.delivery-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: var(--transition);
  background: #fff;
}

.delivery-card:hover, .delivery-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.dc-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.dc-id {
  font-size: 12px;
  font-weight: 700;
  color: var(--secondary);
}

.dc-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.dc-route {
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.dc-route i { color: var(--primary); }

.dc-meta {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.dc-meta i { color: var(--primary); }

.dc-progress {
  margin-top: 10px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.dc-progress-bar {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.6s ease;
}

.delivery-map-panel {
  background: var(--secondary);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #1a2a4a 0%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.map-overlay {
  text-align: center;
  color: rgba(255,255,255,0.6);
}

.map-overlay i {
  font-size: 64px;
  color: var(--primary);
  opacity: 0.7;
  display: block;
  margin-bottom: 16px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.05); opacity: 1; }
}

.map-overlay p {
  font-size: 22px;
  font-weight: 700;
  color: rgba(255,255,255,0.8);
  margin-bottom: 8px;
}

.map-overlay span {
  font-size: 14px;
  color: rgba(255,255,255,0.4);
}

.map-stats {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 24px;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
  padding: 14px 28px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
}

.map-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255,255,255,0.7);
}

.map-stat i { font-size: 16px; }
.map-stat i.green { color: var(--success); }
.map-stat i.orange { color: var(--accent); }
.map-stat i.red { color: var(--danger); }
.map-stat strong { color: #fff; }

/* ========== 車両・ドライバー ========== */
.vehicles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.vehicle-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 1.5px solid transparent;
}

.vehicle-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border); }

.vc-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.vc-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.vc-info h4 { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.vc-info span { font-size: 12px; color: var(--text-secondary); }

.vc-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.vc-stat {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 8px;
  text-align: center;
}

.vc-stat .val { font-size: 18px; font-weight: 700; color: var(--text-primary); display: block; }
.vc-stat .lbl { font-size: 10px; color: var(--text-muted); }

.vc-progress {
  margin-top: 8px;
}

.vc-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

/* ========== 倉庫 ========== */
.warehouse-layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 16px;
}

.warehouse-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  align-content: start;
}

.warehouse-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.wc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.wc-name { font-size: 15px; font-weight: 700; }
.wc-location { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.wc-capacity {
  text-align: right;
}

.wc-pct { font-size: 22px; font-weight: 700; color: var(--text-primary); display: block; }
.wc-label { font-size: 10px; color: var(--text-muted); }

.wc-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 14px;
}

.wc-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s ease;
}

.wc-bar-fill.green { background: linear-gradient(90deg, var(--success), #4ade80); }
.wc-bar-fill.orange { background: linear-gradient(90deg, var(--warning), #fbbf24); }
.wc-bar-fill.red { background: linear-gradient(90deg, var(--danger), #f87171); }

.wc-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
}

.inventory-panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

/* ========== 顧客管理 ========== */
.customers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.customer-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 1.5px solid transparent;
}

.customer-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border); }

.cc-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.cc-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--secondary);
  font-weight: 700;
  flex-shrink: 0;
}

.cc-name { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.cc-industry { font-size: 12px; color: var(--text-secondary); }

.cc-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.cc-stat {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 8px;
  text-align: center;
}

.cc-stat .val { font-size: 16px; font-weight: 700; display: block; }
.cc-stat .lbl { font-size: 10px; color: var(--text-muted); }

.cc-tier {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

.cc-tier.gold { background: #fef9e7; color: #b8860b; }
.cc-tier.silver { background: #f8f8f8; color: #778899; }
.cc-tier.platinum { background: #f0f0ff; color: #6600cc; }

/* ========== レポート ========== */
.report-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.report-kpi {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rk-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.rk-value { font-size: 28px; font-weight: 700; color: var(--text-primary); }
.rk-sub { font-size: 12px; color: var(--text-muted); }

/* ========== 設定 ========== */
.settings-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
  min-height: 400px;
}

.settings-menu {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
  align-self: start;
}

.settings-menu ul { list-style: none; }

.settings-menu li {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.settings-menu li.active, .settings-menu li:hover { background: var(--primary-light); color: var(--primary); }

.settings-content {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.settings-section h3 { font-size: 16px; font-weight: 700; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group input, .form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: var(--bg);
  transition: var(--transition);
}

.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
}

/* ========== ヘルプ ========== */
.help-layout {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.help-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px 24px;
  box-shadow: var(--shadow);
  text-align: center;
  transition: var(--transition);
}

.help-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.help-card i {
  font-size: 40px;
  color: var(--primary);
  margin-bottom: 16px;
  display: block;
}

.help-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.help-card p { font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; line-height: 1.6; }

/* ========== 通知パネル ========== */
.notification-panel {
  position: fixed;
  top: var(--header-h);
  right: 0;
  width: 360px;
  background: var(--surface);
  border-radius: var(--radius) 0 0 var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 500;
  animation: slideFromRight 0.25s ease;
  border-left: 1px solid var(--border);
  max-height: 80vh;
  overflow-y: auto;
}

@keyframes slideFromRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.notif-header h3 { font-size: 15px; font-weight: 700; }

.notif-header button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.notif-header button:hover { background: var(--bg); color: var(--text-primary); }

.notif-list { list-style: none; }

.notif-item {
  display: flex;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
  cursor: pointer;
}

.notif-item:hover { background: var(--bg); }

.notif-item i {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}

.notif-item.urgent i { color: var(--danger); }
.notif-item.warning i { color: var(--warning); }
.notif-item.info i { color: var(--info); }

.notif-item div strong { font-size: 13px; display: block; margin-bottom: 3px; }
.notif-item div p { font-size: 12px; color: var(--text-secondary); line-height: 1.4; margin-bottom: 4px; }
.notif-item div span { font-size: 11px; color: var(--text-muted); }

/* ========== スクロールバー ========== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
