:root {
  --hse-navy:        #1F3A5F;
  --hse-navy-dark:   #142A47;
  --hse-navy-light:  #2A4E7A;
  --hse-blue:        #4A82BA;
  --hse-red:         #E8657F;
  --hse-green:       #7CC49A;
  --hse-orange:      #D6976B;
  --hse-gray:        #58595B;
  --hse-bg:          #F4F6F9;
  --hse-border:      #E3E8EF;
  --hse-text:        #1a202c;
  --hse-text-muted:  #6B7280;
  --hse-sidebar-w:   250px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--hse-bg);
  color: var(--hse-text);
  font-size: 14px;
}

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--hse-sidebar-w);
  background: var(--hse-navy);
  color: #fff;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  z-index: 100;
}
.sidebar-brand {
  padding: 20px 18px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-brand img, .sidebar-brand svg {
  height: 42px; width: auto;
}
.sidebar-brand .brand-name {
  font-size: 18px; font-weight: 800; letter-spacing: 0.3px;
}
.sidebar-brand .brand-name span:last-child {
  font-weight: 300; color: #cbd5e1;
}
.sidebar-nav { flex: 1; padding: 12px 0; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 20px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}
.sidebar-nav a i { font-size: 17px; width: 20px; text-align: center; }
.sidebar-nav a:hover { background: rgba(255,255,255,0.05); color: #fff; }
.sidebar-nav a.active {
  background: var(--hse-navy-light);
  color: #fff;
  border-left-color: var(--hse-blue);
}
.sidebar-nav .nav-group {
  padding: 14px 20px 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 1.2px;
  color: #7a90aa; text-transform: uppercase;
}
.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-footer a {
  display: flex; align-items: center; gap: 10px;
  color: #cbd5e1; text-decoration: none; font-size: 13px;
}
.sidebar-footer a:hover { color: #fff; }

/* ---------- Main area ---------- */
.main {
  margin-left: var(--hse-sidebar-w);
  flex: 1;
  min-width: 0;
}
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--hse-border);
  padding: 14px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.page-title-h { font-size: 22px; font-weight: 700; margin: 0; color: var(--hse-text); }
.topbar-user { display: flex; align-items: center; gap: 20px; font-size: 13px; }
.topbar-user .user-item { display: flex; align-items: center; gap: 6px; color: var(--hse-text-muted); }
.topbar-user .user-item i { color: var(--hse-navy); }
.content { padding: 22px 26px 40px; }

/* ---------- Cards ---------- */
.card-hse {
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--hse-border);
  padding: 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.card-hse.h-100 { height: 100%; }
.card-hse .card-title-h {
  font-size: 15px; font-weight: 700; margin: 0 0 14px 0;
  display: flex; align-items: center; justify-content: space-between;
}
.card-hse .card-title-h .see-all {
  font-size: 12px; font-weight: 500; color: var(--hse-blue); text-decoration: none;
}

/* ---------- Stat cards ---------- */
.stat-card-h {
  display: flex; align-items: center; gap: 14px;
  padding: 18px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--hse-border);
}
.stat-icon-h {
  width: 46px; height: 46px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.stat-icon-h.navy   { background: rgba(31,58,95,0.10);  color: var(--hse-navy); }
.stat-icon-h.blue   { background: rgba(74,130,186,0.12); color: var(--hse-blue); }
.stat-icon-h.red    { background: rgba(232,101,127,0.12); color: var(--hse-red); }
.stat-icon-h.green  { background: rgba(124,196,154,0.15); color: #4a9c6e; }
.stat-icon-h.orange { background: rgba(214,151,107,0.15); color: #b67640; }
.stat-meta .stat-num { font-size: 22px; font-weight: 700; color: var(--hse-text); line-height: 1.1; }
.stat-meta .stat-lbl { font-size: 11.5px; color: var(--hse-text-muted); text-transform: uppercase; letter-spacing: 0.6px; margin-top: 2px; }

/* ---------- Buttons ---------- */
.btn-hse {
  background: var(--hse-navy); color: #fff; border: none;
  padding: 9px 18px; border-radius: 8px;
  font-size: 13.5px; font-weight: 500; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none; transition: background 0.15s;
}
.btn-hse:hover { background: var(--hse-navy-dark); color: #fff; }
.btn-hse-outline {
  background: #fff; color: var(--hse-navy);
  border: 1px solid var(--hse-border);
  padding: 8px 16px; border-radius: 8px;
  font-size: 13px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-hse-outline:hover { background: var(--hse-bg); border-color: var(--hse-navy); color: var(--hse-navy); }

/* ---------- Table ---------- */
.table-hse { width: 100%; border-collapse: separate; border-spacing: 0; }
.table-hse th {
  background: #F9FAFB;
  padding: 11px 14px;
  text-align: left;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase; color: var(--hse-text-muted);
  border-bottom: 1px solid var(--hse-border);
}
.table-hse td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--hse-border);
  font-size: 13.5px;
}
.table-hse tbody tr:hover { background: #FAFBFC; }
.table-hse tbody tr:last-child td { border-bottom: none; }

/* ---------- Alerts ---------- */
.alert-hse {
  padding: 11px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 12px;
  border-left: 4px solid;
}
.alert-hse.success { background: #ECFDF5; border-color: var(--hse-green); color: #065f46; }
.alert-hse.error   { background: #FEF2F2; border-color: var(--hse-red);   color: #991b1b; }
.alert-hse.warn    { background: #FFF7ED; border-color: var(--hse-orange); color: #7c2d12; }
.alert-hse.info    { background: #EFF6FF; border-color: var(--hse-blue);   color: #1e40af; }

/* ---------- Badges ---------- */
.badge-hse {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}
.badge-hse.active  { background: #ECFDF5; color: #065f46; }
.badge-hse.warn    { background: #FFF7ED; color: #7c2d12; }
.badge-hse.info    { background: #EFF6FF; color: #1e40af; }
.badge-hse.neutral { background: #F3F4F6; color: #4B5563; }
.badge-hse.danger  { background: #FEF2F2; color: #991b1b; }

/* ---------- Calendar ---------- */
.cal-wrap { padding: 8px 4px; }
.cal-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.cal-title { font-size: 17px; font-weight: 700; color: var(--hse-text); }
.cal-nav {
  background: transparent; border: 1px solid var(--hse-border);
  width: 34px; height: 34px; border-radius: 8px;
  cursor: pointer; color: var(--hse-navy);
  display: flex; align-items: center; justify-content: center;
}
.cal-nav:hover { background: var(--hse-bg); }
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  background: var(--hse-border);
  border: 1px solid var(--hse-border);
  border-radius: 10px;
  overflow: hidden;
}
.cal-dow {
  background: #F9FAFB; padding: 10px;
  text-align: center;
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
  color: var(--hse-text-muted); text-transform: uppercase;
}
.cal-day {
  background: #fff; min-height: 90px;
  padding: 8px 10px;
  position: relative;
}
.cal-day.other { background: #FAFBFC; color: #cbd5e1; }
.cal-day.today { background: #EFF6FF; }
.cal-day-num { font-size: 13px; font-weight: 600; color: var(--hse-text); }
.cal-day.today .cal-day-num { color: var(--hse-blue); }
.cal-day.other .cal-day-num { color: #cbd5e1; }
.cal-dots { position: absolute; bottom: 8px; left: 10px; display: flex; gap: 4px; }
.cal-dot { width: 7px; height: 7px; border-radius: 50%; }
.cal-dot.training { background: var(--hse-blue); }
.cal-dot.exam     { background: var(--hse-orange); }
.cal-dot.both     { background: var(--hse-navy); }
.cal-legend {
  margin-top: 14px; display: flex; gap: 24px; justify-content: center;
  font-size: 12px; color: var(--hse-text-muted);
}
.cal-legend span { display: flex; align-items: center; gap: 6px; }

/* ---------- Upcoming list ---------- */
.upcoming-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--hse-border);
}
.upcoming-item:last-child { border-bottom: none; }
.upcoming-item .item-name { font-size: 13.5px; font-weight: 500; color: var(--hse-text); }
.upcoming-item .item-date { font-size: 12.5px; color: var(--hse-text-muted); display: flex; align-items: center; gap: 8px; }

/* ---------- Login page ---------- */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--hse-navy-dark) 0%, var(--hse-navy) 60%, var(--hse-navy-light) 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.login-card {
  background: #fff;
  border-radius: 20px;
  padding: 40px 36px;
  width: 100%; max-width: 420px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.4);
}
.login-logo {
  text-align: center; margin-bottom: 24px;
}
.login-logo img, .login-logo svg { height: 70px; width: auto; }
.login-title { font-size: 22px; font-weight: 700; text-align: center; margin: 0 0 4px; color: var(--hse-navy); }
.login-sub { text-align: center; color: var(--hse-text-muted); font-size: 13px; margin-bottom: 26px; }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 12.5px; font-weight: 600; color: var(--hse-text); margin-bottom: 6px; }
.form-row input {
  width: 100%; padding: 11px 14px;
  border: 1px solid var(--hse-border); border-radius: 10px;
  font-size: 14px; font-family: inherit;
  transition: border 0.15s, box-shadow 0.15s;
}
.form-row input:focus {
  outline: none;
  border-color: var(--hse-navy);
  box-shadow: 0 0 0 3px rgba(31,58,95,0.12);
}
.btn-login {
  width: 100%; padding: 12px;
  background: var(--hse-navy); color: #fff;
  border: none; border-radius: 10px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  margin-top: 8px;
}
.btn-login:hover { background: var(--hse-navy-dark); }
.btn-login:disabled { opacity: 0.7; cursor: wait; }
.login-foot { text-align: center; margin-top: 18px; font-size: 12px; color: var(--hse-text-muted); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.2s; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
}


/* --- Modal + forms (moved from maintenance.html) --- */
.tab-btn:hover { color: var(--hse-navy); }
.tab-panel { display: none; }
  .tab-panel.active { display: block; }

  .data-table { width: 100%; border-collapse: separate; border-spacing: 0; }
  .data-table th {
    background: #F9FAFB; padding: 12px 16px; text-align: left;
    font-size: 11.5px; font-weight: 700; letter-spacing: 0.5px;
    text-transform: uppercase; color: var(--hse-text-muted);
    border-bottom: 1px solid var(--hse-border);
  }
  .data-table td {
    padding: 12px 16px; border-bottom: 1px solid var(--hse-border); font-size: 13.5px;
  }
  .data-table tbody tr:hover { background: #FAFBFC; }

  .icon-btn {
    width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--hse-border);
    background: #fff; cursor: pointer; display: inline-flex; align-items: center;
    justify-content: center; color: var(--hse-navy); font-size: 14px; margin-left: 4px;
  }
  .icon-btn:hover { background: var(--hse-navy); color: #fff; border-color: var(--hse-navy); }
  .icon-btn.danger:hover { background: #dc3545; border-color: #dc3545; color: #fff; }

  /* Modal */
  .modal-bg {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    display: none; align-items: center; justify-content: center; z-index: 1000;
    padding: 20px;
  }
  .modal-bg.open { display: flex; }
  .modal-bg.l2 { z-index: 2000; }
  .modal-bg.l3 { z-index: 3000; }
  .modal-hse {
    background: #fff; border-radius: 14px; max-width: 720px; width: 100%;
    max-height: 90vh; overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  }
  .modal-hse-head {
    padding: 20px 24px; border-bottom: 1px solid var(--hse-border);
    display: flex; justify-content: space-between; align-items: center;
  }
  .modal-hse-head h3 { font-size: 16px; font-weight: 700; margin: 0; }
  .modal-close {
    background: none; border: none; font-size: 22px; cursor: pointer;
    color: var(--hse-text-muted); line-height: 1;
  }
  .modal-hse-body { padding: 24px; }
  .modal-hse-foot {
    padding: 16px 24px; border-top: 1px solid var(--hse-border);
    display: flex; justify-content: flex-end; gap: 10px;
  }

  .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .form-grid.full { grid-template-columns: 1fr; }
  .field-label {
    display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px;
    color: var(--hse-text); letter-spacing: 0.2px;
  }
  .field-input, .field-select, .field-textarea {
    width: 100%; padding: 10px 14px;
    border: 1px solid var(--hse-border); border-radius: 10px;
    font-size: 13.5px; font-family: inherit;
  }
  .field-input:focus, .field-select:focus, .field-textarea:focus {
    outline: none; border-color: var(--hse-navy);
    box-shadow: 0 0 0 3px rgba(31,58,95,0.1);
  }
  .field-textarea { resize: vertical; min-height: 100px; }

  .empty-row { text-align: center; padding: 40px; color: var(--hse-text-muted); }

  .search-bar {
    display: flex; gap: 10px; margin-bottom: 12px;
  }
  .search-bar input {
    flex: 1; padding: 10px 14px; border: 1px solid var(--hse-border);
    border-radius: 10px; font-size: 13.5px;
  }
  .contact-row .field-input { font-size: 13px; }
  .contact-row .icon-btn { width: 30px; height: 30px; }


/* Search row inside the toolbar */
.search-row {
  display: flex; gap: 10px; align-items: center;
  margin-top: 12px;
}
.search-row input[type="text"],
.search-row input[type="search"] {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--hse-border);
  border-radius: 10px;
  font-size: 13.5px;
  font-family: inherit;
  background: #fff;
}
.search-row input:focus {
  outline: none;
  border-color: var(--hse-navy);
  box-shadow: 0 0 0 3px rgba(31,58,95,0.1);
}

/* Tabs inside the toolbar */
/* Page meta */
.page-meta { font-size: 13px; color: var(--hse-text-muted); }


/* =========================================================================
   Unified sticky toolbar — used on all list pages
   ========================================================================= */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}
.page-title-h {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  color: var(--hse-text);
  line-height: 1.2;
}
.page-meta {
  font-size: 12.5px;
  color: var(--hse-text-muted);
  margin-top: 3px;
}
.page-meta strong { color: var(--hse-navy); font-weight: 600; }

.search-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin: 0;
}
.search-input-wrap {
  position: relative;
  flex: 1;
}
.search-input-wrap > i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--hse-text-muted);
  font-size: 15px;
  pointer-events: none;
}
.search-input-wrap input[type="text"] {
  width: 100%;
  padding: 11px 14px 11px 42px;
  border: 1px solid var(--hse-border);
  border-radius: 10px;
  font-size: 13.5px;
  font-family: inherit;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-input-wrap input[type="text"]:focus {
  outline: none;
  border-color: var(--hse-navy);
  box-shadow: 0 0 0 3px rgba(31, 58, 95, 0.08);
}

/* Maintenance page: restyle its existing search-bar to match */
.toolbar-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 10px;
}
.toolbar-search {
  flex: 1;
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin: 0;
}
.toolbar-search .search-input-wrap {
  position: relative;
  flex: 1;
}
.toolbar-search .search-input-wrap > i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--hse-text-muted);
  font-size: 15px;
  pointer-events: none;
}
.toolbar-search input[type="text"] {
  width: 100%;
  padding: 11px 14px 11px 42px;
  border: 1px solid var(--hse-border);
  border-radius: 10px;
  font-size: 13.5px;
  font-family: inherit;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.toolbar-search input[type="text"]:focus {
  outline: none;
  border-color: var(--hse-navy);
  box-shadow: 0 0 0 3px rgba(31, 58, 95, 0.08);
}

.page-meta {
  font-size: 12.5px;
  color: var(--hse-text-muted);
}
.page-meta strong {
  color: var(--hse-navy);
  font-weight: 700;
}

/* Maintenance-page search bars — same visual language */
/* List pages */
.toolbar-row {
  display: flex; gap: 10px; align-items: stretch; margin-bottom: 10px;
}
.toolbar-search {
  flex: 1; display: flex; gap: 10px; align-items: stretch; margin: 0;
}
.search-input-wrap { position: relative; flex: 1; }
.search-input-wrap > i {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--hse-text-muted); font-size: 15px; pointer-events: none;
}
.search-input-wrap input[type="text"] {
  width: 100%; padding: 11px 14px 11px 42px;
  border: 1px solid var(--hse-border); border-radius: 10px;
  font-size: 13.5px; font-family: inherit; background: #fff;
}
.search-input-wrap input[type="text"]:focus {
  outline: none; border-color: var(--hse-navy);
  box-shadow: 0 0 0 3px rgba(31,58,95,0.08);
}
.page-meta { font-size: 12.5px; color: var(--hse-text-muted); }
.page-meta strong { color: var(--hse-navy); font-weight: 700; }

/* Maintenance page */
/* =========================================================================
   TOOLBARS — canonical definitions (single source of truth)
   ========================================================================= */

/* ---- List-page toolbar ---- */
.toolbar-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 8px;
}
.toolbar-search {
  flex: 1;
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin: 0;
}
.search-input-wrap {
  position: relative;
  flex: 1;
}
.search-input-wrap > i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--hse-text-muted);
  font-size: 15px;
  pointer-events: none;
}
.search-input-wrap input[type="text"] {
  width: 100%;
  padding: 10px 14px 10px 42px;
  border: 1px solid var(--hse-border);
  border-radius: 10px;
  font-size: 13.5px;
  font-family: inherit;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-input-wrap input[type="text"]:focus {
  outline: none;
  border-color: var(--hse-navy);
  box-shadow: 0 0 0 3px rgba(31,58,95,0.08);
}

.page-meta {
  font-size: 12.5px;
  color: var(--hse-text-muted);
}
.page-meta strong {
  color: var(--hse-navy);
  font-weight: 700;
}

/* ---- Maintenance page tabs ---- */
/* ---- Maintenance page per-tab search bar ---- */

/* =========================================================================
   TOOLBARS & TABS — canonical (single source of truth)
   ========================================================================= */
:root { --topbar-h: 52px; }

/* ---- List-page sticky toolbar ---- */
.sticky-toolbar {
  position: sticky;
  top: var(--topbar-h);
  z-index: 30;
  background: var(--hse-bg);
  padding: 6px 26px 10px;
  margin: 0 -26px 12px -26px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.sticky-toolbar.scrolled {
  border-bottom-color: var(--hse-border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

.toolbar-row {
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 8px;
}
.toolbar-search {
  flex: 1;
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: stretch;
  margin: 0;
}
.search-input-wrap {
  position: relative;
  flex: 1;
}
.search-input-wrap > i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--hse-text-muted);
  font-size: 15px;
  pointer-events: none;
}
.search-input-wrap input[type="text"] {
  width: 100%;
  padding: 10px 14px 10px 42px;
  border: 1px solid var(--hse-border);
  border-radius: 10px;
  font-size: 13.5px;
  font-family: inherit;
  background: #fff;
}
.search-input-wrap input[type="text"]:focus {
  outline: none;
  border-color: var(--hse-navy);
  box-shadow: 0 0 0 3px rgba(31,58,95,0.08);
}
.page-meta { font-size: 12.5px; color: var(--hse-text-muted); }
.page-meta strong { color: var(--hse-navy); font-weight: 700; }

/* ---- Maintenance page tabs (HORIZONTAL) ---- */
.tabs {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 4px;
  align-items: flex-end;
  background: var(--hse-bg);
  border-bottom: 1px solid var(--hse-border);
  padding: 6px 0 0;
  margin: 0 0 16px 0;
}
.tab-btn {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 11px 18px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  color: var(--hse-text-muted);
  white-space: nowrap;
  width: auto;
  transition: all 0.15s;
}
.tab-btn:hover { color: var(--hse-navy); }
.tab-btn.active {
  color: var(--hse-navy);
  border-bottom-color: var(--hse-blue);
  font-weight: 600;
}

/* ---- Maintenance per-tab search bar ---- */
.tab-panel .search-bar {
  display: flex;
  flex-direction: row;
  gap: 10px;
  margin: 0 0 12px 0;
}
.tab-panel .search-bar input[type="text"] {
  flex: 1;
  padding: 10px 14px 10px 42px;
  border: 1px solid var(--hse-border);
  border-radius: 10px;
  font-size: 13.5px;
  font-family: inherit;
  background: #fff;
}
.tab-panel .search-bar input[type="text"]:focus {
  outline: none;
  border-color: var(--hse-navy);
  box-shadow: 0 0 0 3px rgba(31,58,95,0.08);
}

/* =========================================================================
   Maintenance page — sticky tabs + search bar (restored)
   ========================================================================= */
.tabs {
  position: sticky;
  top: var(--topbar-h, 52px);
  z-index: 40;
  background: var(--hse-bg);
  transition: box-shadow 0.15s, border-color 0.15s;
}
.tabs.scrolled {
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  border-bottom-color: var(--hse-border);
}

.tab-panel .search-bar {
  position: sticky;
  top: calc(var(--topbar-h, 52px) + 50px);
  z-index: 39;
  background: var(--hse-bg);
  padding: 8px 0;
  margin: 0 0 12px 0;
  transition: box-shadow 0.15s;
}
.tab-panel .search-bar.scrolled {
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* =========================================================================
   FINAL — kill gap between tabs and search bar
   ========================================================================= */

/* Tabs sit flush against their top + slight gap below */
.tabs {
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
  border-bottom: 1px solid var(--hse-border) !important;
}

/* Search bar: kill top gap, keep bottom space */
.tab-panel .search-bar {
  padding-top: 6px !important;
  padding-bottom: 10px !important;
  margin-top: 0 !important;
}

/* When scrolled, keep tabs + search visually attached */
.tabs.scrolled {
  border-bottom-color: var(--hse-border) !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.03) !important;
}
.tab-panel .search-bar.scrolled {
  box-shadow: 0 4px 8px rgba(0,0,0,0.04) !important;
}

/* Adjust sticky top for the search bar — was 102, now 100 (tabs shorter) */
.tab-panel .search-bar {
  top: calc(var(--topbar-h, 52px) + 48px) !important;
}

/* Same tightening for list-page sticky toolbars */
.sticky-toolbar {
  padding-top: 4px !important;
  padding-bottom: 8px !important;
  margin-bottom: 10px !important;
}
.sticky-toolbar .toolbar-row {
  margin-bottom: 6px !important;
}
.sticky-toolbar .page-meta {
  margin-top: 0 !important;
}

/* =========================================================================
   [REF: CAT-v1.2] Combined sticky block — tabs + toolbar stay pinned together
   ========================================================================= */
.page-top-sticky {
  position: sticky;
  top: var(--topbar-h, 52px);
  z-index: 40;
  background: var(--hse-bg);
  margin: 0 -26px 12px -26px;
  padding: 0 26px;
  transition: box-shadow 0.15s, border-color 0.15s;
  border-bottom: 1px solid transparent;
}
.page-top-sticky.scrolled {
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  border-bottom-color: var(--hse-border);
}
.page-top-sticky .tabs {
  position: static !important;
  top: auto !important;
  margin: 0 !important;
  z-index: auto !important;
}
.page-top-sticky .sticky-toolbar {
  position: static !important;
  top: auto !important;
  margin: 0 !important;
  padding: 6px 0 10px !important;
  z-index: auto !important;
}
