/* ============================================================
   検査結果配信システム - カスタムスタイル
   ============================================================ */

/* --- カラー変数 --- */
:root {
  --sidebar-bg: #1e293b;
  --sidebar-text: #94a3b8;
  --sidebar-hover-bg: #334155;
  --sidebar-active-bg: #2563eb;
  --sidebar-active-text: #ffffff;
  --navbar-bg: #0f172a;
  --body-bg: #f1f5f9;
  --card-radius: 0.75rem;
  --color-danger: #ef4444;
  --color-warning: #f59e0b;
  --color-success: #10b981;
  --color-info: #3b82f6;
  --color-muted: #64748b;
}

/* --- 全体 --- */
body {
  background-color: var(--body-bg);
  font-family: "Helvetica Neue", "Hiragino Sans", "Meiryo", sans-serif;
  font-size: 0.9rem;
}

/* --- ナビバー --- */
.navbar {
  background: linear-gradient(135deg, var(--navbar-bg) 0%, #1e3a5f 100%) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  padding: 0.6rem 1.25rem;
}
.navbar-brand {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}
.navbar-brand i {
  color: #60a5fa;
}

/* --- サイドバー --- */
aside .sidebar-nav {
  background-color: var(--sidebar-bg);
  border-radius: var(--card-radius);
  padding: 0.5rem 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  overflow: hidden;
}
.sidebar-nav .sidebar-header {
  padding: 0.75rem 1rem 0.5rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #475569;
  font-weight: 600;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.855rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
}
.sidebar-nav a:hover {
  background-color: var(--sidebar-hover-bg);
  color: #e2e8f0;
}
.sidebar-nav a.active {
  background-color: rgba(37, 99, 235, 0.2);
  color: #93c5fd;
  border-left-color: var(--sidebar-active-bg);
}
.sidebar-nav a i {
  font-size: 1rem;
  width: 1.2rem;
  text-align: center;
  flex-shrink: 0;
}
.sidebar-divider {
  border-color: #334155;
  margin: 0.35rem 0.75rem;
}

/* --- カード全体 --- */
.card {
  border: none;
  border-radius: var(--card-radius);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.card-header {
  border-bottom: 1px solid #e2e8f0;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.75rem 1rem;
}

/* --- ダッシュボード ステータスカード --- */
.stat-card {
  border-radius: var(--card-radius);
  padding: 1.25rem 1.25rem 1rem;
  color: white;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
  transition: transform 0.15s, box-shadow 0.15s;
  text-decoration: none;
  display: block;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.18);
  color: white;
}
.stat-card .stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.85;
  margin-bottom: 0.4rem;
}
.stat-card .stat-number {
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.5rem;
}
.stat-card .stat-desc {
  font-size: 0.75rem;
  opacity: 0.7;
  margin-bottom: 0.75rem;
}
.stat-card .stat-icon {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3.5rem;
  opacity: 0.15;
}
.stat-card .btn-stat {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.35);
  color: white;
  font-size: 0.78rem;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  transition: background 0.15s;
}
.stat-card .btn-stat:hover {
  background: rgba(255,255,255,0.35);
}
.stat-card-danger  { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.stat-card-warning { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-card-info    { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.stat-card-success { background: linear-gradient(135deg, #10b981, #059669); }
.stat-card-muted   { background: linear-gradient(135deg, #64748b, #475569); }

/* --- テーブル --- */
.table thead th {
  background-color: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-muted);
  padding: 0.65rem 0.9rem;
  white-space: nowrap;
}
.table tbody td {
  padding: 0.65rem 0.9rem;
  vertical-align: middle;
  border-color: #f1f5f9;
  color: #334155;
}
.table-hover tbody tr:hover {
  background-color: #f0f7ff;
}
.table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: #fafbfd;
}

/* --- バッジ --- */
.badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3em 0.65em;
  border-radius: 0.4rem;
}

/* --- ページタイトル --- */
.page-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.page-title i {
  color: var(--color-info);
}

/* --- ボタン --- */
.btn {
  border-radius: 0.5rem;
  font-weight: 500;
}
.btn-sm {
  font-size: 0.78rem;
}
.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border: none;
  box-shadow: 0 2px 6px rgba(37,99,235,0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  box-shadow: 0 4px 10px rgba(37,99,235,0.4);
}

/* --- フォーム --- */
.form-control, .form-select {
  border-radius: 0.5rem;
  border-color: #e2e8f0;
  font-size: 0.875rem;
}
.form-control:focus, .form-select:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 0.2rem rgba(37,99,235,0.15);
}

/* --- ログインページ --- */
.login-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: white;
  border-radius: 1rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  padding: 2.5rem 2rem;
}
.login-logo {
  font-size: 2.5rem;
  color: #2563eb;
  margin-bottom: 0.5rem;
}
.login-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
}
.login-subtitle {
  font-size: 0.8rem;
  color: #64748b;
}

/* --- アラート --- */
.alert {
  border: none;
  border-radius: var(--card-radius);
  font-size: 0.875rem;
}

/* --- ページネーション --- */
.page-link {
  border-radius: 0.4rem !important;
  margin: 0 2px;
  border-color: #e2e8f0;
  color: #2563eb;
  font-size: 0.82rem;
}
.page-item.active .page-link {
  background-color: #2563eb;
  border-color: #2563eb;
}

/* --- ファイルアップロードエリア --- */
.upload-area {
  border: 2px dashed #cbd5e1;
  border-radius: var(--card-radius);
  padding: 2rem;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}
.upload-area:hover {
  border-color: #2563eb;
  background: #f0f7ff;
}
.upload-area i {
  font-size: 2.5rem;
  color: #94a3b8;
}

/* --- フッター --- */
footer {
  background: #f8fafc !important;
  border-top: 1px solid #e2e8f0;
  font-size: 0.78rem;
}
