/* ─────────────────────────────────────────────────────────────────────────────
   app.css — SCI application stylesheet
   Loaded after msc.css. Override msc.css variables here.
   ───────────────────────────────────────────────────────────────────────────── */

/* ── SCI brand tokens ──────────────────────────────────────────────────────── */
:root {
  --sci-brand:          #E85D04;   /* Suncor orange */
  --sci-brand-dark:     #C04D00;
  --sci-brand-muted:    rgba(232, 93, 4, 0.12);

  --sci-sidebar-bg:     #0f1117;   /* near-black */
  --sci-sidebar-text:   #a8b0c0;   /* muted slate */
  --sci-sidebar-heading:#5a6478;   /* section label */
  --sci-sidebar-hover:  rgba(255, 255, 255, 0.06);
  --sci-sidebar-active: rgba(232, 93, 4, 0.18);
  --sci-sidebar-active-text: #ff7f3e;
  --sci-sidebar-border: rgba(255, 255, 255, 0.07);
  --sci-sidebar-width:  240px;

  --sci-topbar-bg:      rgba(255,255,255,0.03);
  --sci-topbar-border:  rgba(255,255,255,0.08);

  --sci-card-bg:        var(--bs-body-bg);
  --sci-card-border:    var(--bs-border-color);

  --sci-stat-height:    88px;
}

/* ── Override msc sidebar width ────────────────────────────────────────────── */
:root {
  --msc-sidebar-width: var(--sci-sidebar-width);
}

/* ── Dark sidebar ───────────────────────────────────────────────────────────── */
.sci-sidebar {
  width: var(--sci-sidebar-width);
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  flex-shrink: 0;
  background-color: var(--sci-sidebar-bg) !important;
  border-right: 1px solid var(--sci-sidebar-border) !important;
  display: flex;
  flex-direction: column;
  padding: 0;
}

/* Sidebar inner padding container */
.sci-sidebar-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem 0.75rem;
  overflow-y: auto;
}

/* Brand / logo row */
.sci-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.25rem 0.5rem 1rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--sci-sidebar-border);
  text-decoration: none;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.sci-sidebar-brand:hover { color: #fff; }

.sci-sidebar-brand-icon {
  width: 28px;
  height: 28px;
  background: var(--sci-brand);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.9rem;
  flex-shrink: 0;
}

/* Section labels */
.sci-nav-section {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sci-sidebar-heading);
  padding: 0.75rem 0.5rem 0.25rem;
  pointer-events: none;
  user-select: none;
}

/* Nav links */
.sci-sidebar .nav-link {
  color: var(--sci-sidebar-text);
  border-radius: 6px;
  padding: 0.4rem 0.5rem;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 1px;
}

.sci-sidebar .nav-link:hover {
  background: var(--sci-sidebar-hover);
  color: #e0e6f0;
}

.sci-sidebar .nav-link.active,
.sci-sidebar .nav-link[aria-current="page"] {
  background: var(--sci-sidebar-active);
  color: var(--sci-sidebar-active-text);
}

.sci-sidebar .nav-link i {
  font-size: 0.9rem;
  opacity: 0.75;
  width: 1rem;
  text-align: center;
  flex-shrink: 0;
}

.sci-sidebar .nav-link:hover i,
.sci-sidebar .nav-link.active i {
  opacity: 1;
}

/* ── Top navbar ─────────────────────────────────────────────────────────────── */
.sci-topbar {
  background: var(--sci-topbar-bg);
  border-bottom: 1px solid var(--sci-topbar-border);
  padding: 0.5rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  backdrop-filter: blur(4px);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* ── Stat tiles ─────────────────────────────────────────────────────────────── */
.sci-stat {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 10px;
  padding: 1rem 1.125rem;
  min-height: var(--sci-stat-height);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: box-shadow 0.15s;
}

.sci-stat:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

[data-bs-theme="dark"] .sci-stat:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.sci-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.sci-stat-icon-primary   { background: rgba(13, 110, 253, 0.12); color: #0d6efd; }
.sci-stat-icon-success   { background: rgba(25, 135, 84,  0.12); color: #198754; }
.sci-stat-icon-warning   { background: rgba(255, 193, 7,  0.15); color: #cc8c00; }
.sci-stat-icon-danger    { background: rgba(220, 53, 69,  0.12); color: #dc3545; }
.sci-stat-icon-info      { background: rgba(13, 202, 240, 0.12); color: #0dcaf0; }
.sci-stat-icon-secondary { background: rgba(108, 117, 125,0.12); color: #6c757d; }
.sci-stat-icon-orange    { background: rgba(232, 93, 4,   0.12); color: var(--sci-brand); }

[data-bs-theme="dark"] .sci-stat-icon-warning { color: #ffc107; }

.sci-stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.15rem;
}

.sci-stat-label {
  font-size: 0.75rem;
  color: var(--bs-secondary-color);
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* ── Quick-action cards (home page) ─────────────────────────────────────────── */
.sci-action-card {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  height: 100%;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.sci-action-card:hover {
  border-color: var(--sci-brand);
  box-shadow: 0 2px 16px rgba(232, 93, 4, 0.08);
}

.sci-action-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.sci-action-card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0;
  color: var(--bs-body-color);
}

.sci-action-card-text {
  font-size: 0.8125rem;
  color: var(--bs-secondary-color);
  margin: 0;
  flex: 1;
}

/* ── Panel cards (reports) ─────────────────────────────────────────────────── */
.sci-panel {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 10px;
  overflow: hidden;
}

.sci-panel-header {
  padding: 0.875rem 1.125rem 0.625rem;
  border-bottom: 1px solid var(--bs-border-color);
}

.sci-panel-title {
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0 0 0.125rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.sci-panel-subtitle {
  font-size: 0.75rem;
  color: var(--bs-secondary-color);
}

.sci-panel-body {
  padding: 0.875rem 1.125rem;
}

/* ── Offcanvas sidebar (mobile) — dark theme ────────────────────────────────── */
.sci-offcanvas {
  background-color: var(--sci-sidebar-bg) !important;
  color: var(--sci-sidebar-text);
  border-right: 1px solid var(--sci-sidebar-border) !important;
}

.sci-offcanvas .offcanvas-header {
  border-bottom: 1px solid var(--sci-sidebar-border) !important;
}

/* ── Mobile toggle bar ──────────────────────────────────────────────────────── */
.sci-mobile-bar {
  background: var(--sci-sidebar-bg);
  border-bottom: 1px solid var(--sci-sidebar-border);
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
}

/* ── Hazard progress bars ───────────────────────────────────────────────────── */
.sci-hbar {
  height: 5px;
  border-radius: 3px;
  background: var(--bs-border-color);
  overflow: hidden;
  margin-top: 4px;
}

.sci-hbar-fill {
  height: 100%;
  border-radius: 3px;
  background: #dc3545;
  min-width: 3px;
}

/* ── Mini bar chart (daily trend) ───────────────────────────────────────────── */
.sci-barchart {
  height: 72px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  overflow-x: auto;
  padding-bottom: 0;
}

.sci-barchart-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  min-width: 26px;
}

.sci-barchart-count {
  font-size: 0.55rem;
  color: var(--bs-secondary-color);
  line-height: 1;
  margin-bottom: 2px;
}

.sci-barchart-bar {
  width: 100%;
  background: var(--sci-brand);
  border-radius: 3px 3px 0 0;
  min-height: 4px;
  opacity: 0.85;
}

.sci-barchart-label {
  font-size: 0.5rem;
  color: var(--bs-secondary-color);
  line-height: 1;
  margin-top: 3px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
}

/* ── Utility ────────────────────────────────────────────────────────────────── */
.sci-empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--bs-secondary-color);
  font-size: 0.85rem;
}
