/* Food Sensor Provisions-Tool – Shared Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;600;700&display=swap');

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

body {
  font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: #f0f4f8;
  color: #222;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Topbar ── */
.topbar {
  background: #fff;
  padding: 0 28px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid #e0e8ee;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}
.topbar .brand { display: flex; align-items: center; gap: 14px; }
.topbar .brand img.logo { height: 36px; width: auto; }
.topbar .brand .brand-title {
  font-weight: 700; font-size: 15px; color: #1a2e3b;
  border-left: 2px solid #0C75A4; padding-left: 14px;
}
.topbar nav { display: flex; gap: 4px; }
.topbar nav a {
  font-size: 14px; font-weight: 500; color: #555; text-decoration: none;
  padding: 6px 14px; border-radius: 6px; transition: background 0.15s, color 0.15s;
}
.topbar nav a:hover { background: #f0f4f8; color: #0C75A4; }
.topbar nav a.active { background: #e8f4fb; color: #0C75A4; font-weight: 600; }
.topbar .nav-right { display: flex; align-items: center; gap: 12px; }

/* ── DB Badge ── */
.db-badge {
  font-size: 12px; padding: 3px 10px; border-radius: 20px; font-weight: 600;
}
.db-badge.ok   { background: #e0f3ea; color: #1c6c30; border: 1px solid #c3e6cb; }
.db-badge.fail { background: #fde8e8; color: #9b2626; border: 1px solid #f5c6c6; }

/* ── Logout ── */
.btn-logout {
  font-size: 12px; color: #888; text-decoration: none;
  padding: 4px 8px; border-radius: 4px; transition: color 0.15s;
}
.btn-logout:hover { color: #0C75A4; }

/* ── Main ── */
main { flex: 1; }
.container { max-width: 1200px; margin: 0 auto; padding: 28px 20px 60px; }

/* ── Footer ── */
.site-footer {
  background: #fff; border-top: 1px solid #e0e8ee;
  text-align: center; padding: 14px 20px;
  font-size: 12px; color: #aaa;
}

/* ── Cards ── */
.card {
  background: #fff; border-radius: 10px;
  box-shadow: 0 1px 4px rgba(12,117,164,0.08), 0 2px 12px rgba(0,0,0,0.05);
  padding: 24px 28px; margin-bottom: 20px;
}
.card-title {
  font-size: 11px; font-weight: 700; color: #0C75A4;
  text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 16px;
}

/* ── Stat Cards ── */
.stats-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.stat-card {
  background: #fff; border-radius: 10px;
  box-shadow: 0 1px 4px rgba(12,117,164,0.08), 0 2px 12px rgba(0,0,0,0.05);
  padding: 18px 22px; flex: 1 1 200px; min-width: 160px;
  border-left: 4px solid #0C75A4;
}
.stat-label {
  font-size: 10px; font-weight: 700; color: #0C75A4;
  text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 6px;
}
.stat-value { font-size: 24px; font-weight: 700; color: #1a2e3b; }
.stat-value.blue { color: #0C75A4; }
.stat-sub { font-size: 11px; color: #888; margin-top: 4px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 18px; border: none; border-radius: 8px;
  font-size: 14px; font-family: inherit; font-weight: 600;
  cursor: pointer; transition: background 0.15s, box-shadow 0.15s;
  text-decoration: none;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: #0C75A4; color: #fff; }
.btn-primary:hover:not(:disabled) { background: #0a618a; box-shadow: 0 2px 8px rgba(12,117,164,0.35); }
.btn-outline { background: transparent; border: 1.5px solid #0C75A4; color: #0C75A4; }
.btn-outline:hover:not(:disabled) { background: #e8f4fb; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-danger:hover:not(:disabled) { background: #c0392b; }
.btn-sm { padding: 5px 12px; font-size: 12px; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data-table thead th {
  background: #0C75A4; color: #fff; text-align: left;
  padding: 10px 12px; font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.6px; white-space: nowrap;
}
table.data-table thead th.num { text-align: right; }
table.data-table tbody tr { border-bottom: 1px solid #eef0f5; transition: background 0.1s; }
table.data-table tbody tr:hover { background: #f0f7fb; }
table.data-table tbody tr.alt { background: #fafbfe; }
table.data-table tbody tr.alt:hover { background: #e8f4fb; }
table.data-table tbody td { padding: 10px 12px; vertical-align: middle; }
table.data-table tbody td.num {
  text-align: right; font-variant-numeric: tabular-nums;
  font-family: "SF Mono", Consolas, monospace; font-size: 13px;
}

/* ── Forms ── */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; font-size: 11px; font-weight: 600;
  color: #888; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px;
}
.form-control {
  width: 100%; padding: 9px 14px; border: 1.5px solid #d8e4ec;
  border-radius: 8px; font-size: 14px; font-family: inherit;
  color: #222; background: #fff; outline: none; transition: border-color 0.15s;
}
.form-control:focus { border-color: #0C75A4; box-shadow: 0 0 0 3px rgba(12,117,164,0.12); }
.form-control[readonly] { background: #f8fafc; color: #888; cursor: default; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row .form-group { flex: 1 1 200px; }

/* ── Filter bar ── */
.filter-bar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; align-items: flex-end; }
.filter-bar .form-group { margin-bottom: 0; }
.filter-bar input { width: 220px; }

/* ── Badges ── */
.badge {
  display: inline-block; font-size: 11px; padding: 2px 8px;
  border-radius: 20px; font-weight: 600;
}
.badge-success { background: #d5f0da; color: #1a6b2c; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-danger  { background: #fde8e8; color: #9b2626; }
.badge-info    { background: #d1ecf1; color: #0c5460; }

/* ── Alerts ── */
.alert {
  padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 16px;
}
.alert-warning { background: #fffbf0; border-left: 4px solid #f39c12; color: #7d5900; }
.alert-danger  { background: #fff0f0; border: 1px solid #ffc5c5; color: #c0392b; }
.alert-success { background: #f0fff4; border: 1px solid #c3e6cb; color: #1c6c30; }

/* ── Empty state ── */
.empty-state { text-align: center; padding: 48px 20px; color: #aaa; }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 15px; }

/* ── Spinner ── */
.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 3px solid rgba(255,255,255,0.3); border-radius: 50%;
  border-top-color: #fff; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Task hints ── */
.task-list { list-style: none; }
.task-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 6px; margin-bottom: 6px;
  background: #fffbf0; border-left: 3px solid #f39c12;
  font-size: 13px; color: #7d5900;
}
.task-list li .task-icon { font-size: 16px; }

/* ── Quick action link ── */
.quick-action {
  display: inline-flex; align-items: center; gap: 8px;
  background: #0C75A4; color: #fff; padding: 12px 22px;
  border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 14px;
  transition: background 0.15s, box-shadow 0.15s;
}
.quick-action:hover { background: #0a618a; box-shadow: 0 2px 8px rgba(12,117,164,0.35); }

/* ── Page title ── */
.page-title { font-size: 20px; font-weight: 700; color: #1a2e3b; margin-bottom: 20px; }
.page-title span { color: #0C75A4; }

/* ── KP-Tool additions ── */
.login-page { background: #f0f4f8; display:flex; align-items:center; justify-content:center; min-height:100vh; }
.login-wrap { width:100%; max-width:400px; padding:20px; }
.login-card {
  background:#fff; border-radius:14px; padding:36px 32px;
  box-shadow: 0 4px 24px rgba(12,117,164,0.13);
}
.login-logo { height:48px; display:block; margin:0 auto 20px; }
.login-title { font-size:20px; font-weight:700; color:#1a2e3b; text-align:center; margin-bottom:4px; }
.login-sub   { font-size:13px; color:#888; text-align:center; margin-bottom:24px; }

.user-info { font-size:12px; color:#888; }

tfoot tr td { border-top: 2px solid #0C75A4; }
