/* ── Heirloom EBP Theme Overlay ──────────────────────────────────────────────
 * Matches EBP design tokens (from src/ebp/js/src/const.js + theme.css).
 *
 * Blue:       #428bca  — table headers, inputs, active states, links
 * Yellow:     #d3d465  — action buttons (submit, filter, save)
 * Nav bg:     #ffffff  — white top navbar (EBP headerBackground)
 * Success:    #27ae60   Danger:  #c5545c
 * Body bg:    #ffffff   (EBP: contentBCG / mainPaddingBCG)
 * Font:       Helvetica Neue (body), Inconsolata (data/mono)
 * ──────────────────────────────────────────────────────────────────────────── */

/* ── Base ─────────────────────────────────────────────────────────────────── */
body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: #ffffff;
  color: #282c32;
}

/* ── CSS custom properties ────────────────────────────────────────────────── */
:root {
  --hrl-blue:             #428bca;
  --hrl-blue-hover:       #3071a9;
  --hrl-yellow:           #d3d465;
  --hrl-yellow-hover:     #e1e36d;
  --hrl-disabled:         #6c7387;
  --hrl-success:          #27ae60;
  --hrl-danger:           #c5545c;
  --bs-primary:           #428bca;
  --bs-primary-rgb:       66, 139, 202;
  --bs-link-color:        #428bca;
  --bs-link-hover-color:  #3071a9;
}

/* ── Monospace / Inconsolata for data cells ───────────────────────────────── */
.font-monospace,
.monospace,
.mono,
.instance-id,
.cell-job,
.cell-ref,
.grant-id-cell,
code {
  font-family: Inconsolata, "Courier New", Courier, monospace !important;
}

/* ── Table headers → #428bca blue, white text, Inconsolata ───────────────── */
.table > thead.hrl-dark > tr > th,
.table > thead.table-dark > tr > th,
.table > thead > tr.table-dark > th,
.audit-table thead th {
  background-color: var(--hrl-blue) !important;
  color: #fff !important;
  border-color: #3071a9 !important;
  font-family: Inconsolata, monospace;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: .6rem .75rem;
}

/* inner / modal tables keep light styling */
.table > thead.table-light > tr > th,
.table > thead > tr.table-light > th {
  background-color: #f1f3f5 !important;
  color: #343a40 !important;
  border-color: #dee2e6 !important;
}

/* ── Table hover rows ─────────────────────────────────────────────────────── */
.table-hover > tbody > tr:hover > td,
.table-hover > tbody > tr:hover > th {
  background-color: #edf3f9;
}

/* ── btn-primary → EBP yellow-green ──────────────────────────────────────── */
.btn-primary {
  background-color: var(--hrl-yellow);
  border-color: var(--hrl-yellow);
  color: #fff;
}
.btn-primary:hover,
.btn-primary:focus-visible,
.btn-primary:active,
.btn-primary.active,
.show > .btn-primary.dropdown-toggle {
  background-color: var(--hrl-yellow-hover);
  border-color: var(--hrl-yellow-hover);
  color: #fff;
}
.btn-primary:disabled,
.btn-primary.disabled {
  background-color: var(--hrl-disabled);
  border-color: var(--hrl-disabled);
  color: #bcc0c9;
}

/* ── btn-outline-primary → #428bca ───────────────────────────────────────── */
.btn-outline-primary {
  color: var(--hrl-blue);
  border-color: var(--hrl-blue);
}
.btn-outline-primary:hover,
.btn-outline-primary:active {
  background-color: var(--hrl-blue);
  border-color: var(--hrl-blue);
  color: #fff;
}

/* ── text / bg utilities ──────────────────────────────────────────────────── */
.text-primary { color: var(--hrl-blue) !important; }
.bg-primary   { background-color: var(--hrl-blue) !important; }
.text-success { color: var(--hrl-success) !important; }
.bg-success   { background-color: var(--hrl-success) !important; }
.text-danger  { color: var(--hrl-danger) !important; }
.bg-danger    { background-color: var(--hrl-danger) !important; }

/* ── badge colours ────────────────────────────────────────────────────────── */
.badge.bg-primary { background-color: var(--hrl-blue) !important; }
.badge.bg-success { background-color: var(--hrl-success) !important; }
.badge.bg-danger  { background-color: var(--hrl-danger) !important; }

/* ── progress bars ────────────────────────────────────────────────────────── */
.progress-bar.bg-primary { background-color: var(--hrl-blue) !important; }
.progress-bar.bg-success { background-color: var(--hrl-success) !important; }
.progress-bar.bg-danger  { background-color: var(--hrl-danger) !important; }
.progress-bar.bg-warning { background-color: var(--hrl-yellow) !important; }

/* ── EBP-style page layout ────────────────────────────────────────────────── */

/* Top header bar (matches EBP headerHeight: 64px) */
.hrl-header {
  background: #ffffff;
  border-bottom: 2px solid #5d6370;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  flex-shrink: 0;
}
.hrl-header .brand-text {
  font-family: Inconsolata, monospace;
  font-size: .9rem;
  color: var(--hrl-blue);
}

/* Two-column layout: sidebar + scrollable main */
.hrl-layout {
  display: flex;
  height: calc(100vh - 64px);
  overflow: hidden;
}

/* Left sidebar (matches EBP menuWidth: 222px) */
.hrl-sidebar {
  width: 222px;
  flex-shrink: 0;
  background: #ffffff;
  border-right: 2px solid #5d6370;
  overflow-y: auto;
}

/* Sidebar nav links — EBP menu item style */
.sidebar-link {
  display: block;
  font-family: 'Open Sans', sans-serif;
  font-size: 15px;
  line-height: 55px;
  padding: 0 0 0 25px;
  color: var(--hrl-blue);
  text-decoration: none;
  border-bottom: 1px solid #5d6370;
  white-space: nowrap;
  transition: background .12s, color .12s;
}
.sidebar-link:hover {
  background-color: var(--hrl-blue);
  color: #ffffff;
}
.sidebar-link.active {
  background-color: var(--hrl-blue);
  color: #ffffff;
  font-weight: 700;
}

/* Scrollable content area */
.hrl-main {
  flex: 1;
  overflow-y: auto;
}

/* ── Card section accent border ───────────────────────────────────────────── */
.section-card { border-left-color: var(--hrl-blue) !important; }

/* ── Stat card top borders ────────────────────────────────────────────────── */
.stat-card.c-total,
.stat-card.c-grants   { border-top-color: #6c757d; }
.stat-card.c-active,
.stat-card.c-remaining{ border-top-color: var(--hrl-success); }
.stat-card.c-overdue,
.stat-card.c-stale    { border-top-color: var(--hrl-danger); }
.stat-card.c-revoked  { border-top-color: #adb5bd; }
.stat-card.c-quota,
.stat-card.c-cores,
.stat-card.c-procs    { border-top-color: var(--hrl-blue); }
.stat-card.c-used     { border-top-color: #e67e22; }

/* ── Grant cards ──────────────────────────────────────────────────────────── */
.grant-card.pool-card    { border-left-color: var(--hrl-blue) !important; }
.grant-card.bound-card   { border-left-color: var(--hrl-success) !important; }
.grant-card.expired-card { border-left-color: var(--hrl-danger) !important; }

/* ── Audit page: tab active state ─────────────────────────────────────────── */
.audit-tabs .nav-link        { color: #495057; }
.audit-tabs .nav-link.active { color: var(--hrl-blue) !important; font-weight: 600; }
.audit-tabs .nav-link.active .cnt { background: #cce3f5; color: #2e6da4; }

/* ── Client sidebar: active item → blue fill like EBP active menu ─────────── */
.client-item.active {
  background: var(--hrl-blue) !important;
  border-left-color: var(--hrl-blue) !important;
}
.client-item.active .client-name { color: #fff !important; font-weight: 600; }
.client-item.active .client-sub  { color: rgba(255,255,255,.75) !important; }
.client-item.active .client-cnt  { background: rgba(255,255,255,.25); color: #fff; }

/* ── Filter / paging bars ─────────────────────────────────────────────────── */
.filter-bar {
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  padding: .6rem 1rem;
}
.paging-bar {
  border-top: 1px solid #dee2e6;
  background: #f8f9fa;
  padding: .5rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.paging-bar.d-none { display: none !important; }

/* ── Form inputs → blue background, white text (EBP inputBackground) ─────── */
.form-control,
.form-select {
  background-color: var(--hrl-blue);
  color: #fff;
  border-color: #3071a9;
}
.form-control::placeholder { color: rgba(255,255,255,.6); }
.form-control:focus,
.form-select:focus {
  background-color: var(--hrl-blue);
  color: #fff;
  border-color: #4d90fe;
  box-shadow: 0 0 0 .2rem rgba(66,139,202,.35);
}
.form-control:disabled,
.form-control[readonly] {
  background-color: var(--hrl-disabled);
  color: #bcc0c9;
  border-color: #5a6070;
}

/* Keep small filter selects/inputs readable */
.filter-bar .form-control,
.filter-bar .form-select,
.filter-bar .form-control-sm,
.filter-bar .form-select-sm {
  font-size: .82rem;
}

/* Labels above blue inputs need to be visible */
.form-label,
.form-check-label { color: #282c32; }
.text-muted { color: #6c757d !important; }

/* Card and modal headers on white bg */
.card-header.bg-white { background-color: #fff !important; }
