/* ============================================================
   ZPPF Portal — Custom Stylesheet
   Design: Teal (#0f9b8e) primary, Inter font, Bootstrap 5.3
   ============================================================ */

/* ---- CSS Custom Properties -------------------------------- */
:root {
  --teal-primary:           #0f9b8e;
  --teal-dark:              #0a6e65;
  --teal-light:             #e0f5f3;
  --teal-xlight:            #f0faf9;
  --sidebar-width:          260px;
  --sidebar-collapsed-width:70px;
  --header-height:          60px;
  --card-radius:            8px;
  --card-shadow:            0 2px 8px rgba(0,0,0,0.08);
  --transition-speed:       0.28s;
  --font-family:            'Inter', system-ui, -apple-system, sans-serif;
}

/* ---- Base ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: var(--font-family);
  background-color: #f4f6f9;
  color: #212529;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

a { color: var(--teal-primary); text-decoration: none; }
a:hover { color: var(--teal-dark); }

/* ---- Bootstrap Overrides ---------------------------------- */
.btn-primary {
  background-color: var(--teal-primary) !important;
  border-color: var(--teal-primary) !important;
  color: #fff !important;
}
.btn-primary:hover, .btn-primary:focus {
  background-color: var(--teal-dark) !important;
  border-color: var(--teal-dark) !important;
}
.btn-outline-primary {
  color: var(--teal-primary) !important;
  border-color: var(--teal-primary) !important;
}
.btn-outline-primary:hover {
  background-color: var(--teal-primary) !important;
  color: #fff !important;
}
.bg-primary   { background-color: var(--teal-primary) !important; }
.text-primary  { color: var(--teal-primary) !important; }
.border-primary{ border-color: var(--teal-primary) !important; }
.form-control:focus, .form-select:focus {
  border-color: var(--teal-primary);
  box-shadow: 0 0 0 0.2rem rgba(15,155,142,0.2);
}
.nav-pills .nav-link.active {
  background-color: var(--teal-primary) !important;
}
.nav-tabs .nav-link.active {
  color: var(--teal-primary) !important;
  border-bottom-color: var(--teal-primary) !important;
  border-bottom-width: 2px;
}
.nav-tabs .nav-link:hover { color: var(--teal-primary); }

/* ---- Top Header ------------------------------------------- */
.top-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  background-color: var(--teal-primary);
  z-index: 1040;
  display: flex;
  align-items: center;
  padding: 0 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  gap: 12px;
}
.top-header .portal-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}
.top-header .portal-brand:hover { color: rgba(255,255,255,0.85); }
.top-header .portal-brand .brand-icon {
  width: 34px; height: 34px;
  background: rgba(255,255,255,0.2);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.top-header .header-right {
  margin-left: auto;
  display: flex; align-items: center; gap: 12px;
}
.header-toggle-btn {
  background: none; border: none;
  color: #fff; font-size: 1.3rem;
  cursor: pointer; padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.2s;
  line-height: 1;
}
.header-toggle-btn:hover { background: rgba(255,255,255,0.15); }

/* Notification bell */
.notif-btn {
  background: none; border: none;
  color: #fff; font-size: 1.3rem;
  cursor: pointer; position: relative;
  padding: 4px 8px; border-radius: 6px;
  transition: background 0.2s;
  line-height: 1;
}
.notif-btn:hover { background: rgba(255,255,255,0.15); }
.notif-badge {
  position: absolute; top: 0; right: 0;
  background: #dc3545; color: #fff;
  font-size: 0.65rem; font-weight: 700;
  border-radius: 50%; width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.notif-dropdown {
  width: 340px;
  max-height: 400px;
  overflow-y: auto;
}
.notif-item {
  padding: 10px 14px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.85rem;
  display: block; color: #212529;
}
.notif-item:hover { background: var(--teal-xlight); }
.notif-item.unread { background: #f0faf9; font-weight: 500; }
.notif-item small { color: #6c757d; display: block; margin-top: 2px; }

/* User avatar / dropdown */
.user-menu-btn {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.15);
  border: none; border-radius: 8px;
  color: #fff; padding: 4px 10px;
  cursor: pointer; font-size: 0.88rem;
  font-family: var(--font-family);
  transition: background 0.2s;
}
.user-menu-btn:hover { background: rgba(255,255,255,0.25); }
.avatar-circle {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.75rem; color: #fff;
  flex-shrink: 0;
  text-transform: uppercase;
}
.avatar-circle.lg {
  width: 52px; height: 52px;
  font-size: 1.1rem;
  background-color: var(--teal-primary);
}
.avatar-circle.teal { background-color: var(--teal-primary); }

/* ---- Sidebar ---------------------------------------------- */
.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: #fff;
  border-right: 1px solid #e9ecef;
  z-index: 1030;
  overflow-x: hidden;
  overflow-y: auto;
  transition: width var(--transition-speed) ease, transform var(--transition-speed) ease;
  display: flex; flex-direction: column;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

.sidebar-nav { padding: 14px 0; flex: 1; }

.sidebar-section-label {
  font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: #adb5bd; padding: 10px 20px 4px;
  white-space: nowrap; overflow: hidden;
}

.sidebar-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px;
  color: #495057;
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: 0;
  transition: background 0.18s, color 0.18s;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
}
.sidebar-link i { font-size: 1.1rem; flex-shrink: 0; min-width: 20px; }
.sidebar-link span { flex: 1; transition: opacity var(--transition-speed); }
.sidebar-link:hover {
  background: var(--teal-light);
  color: var(--teal-primary);
  text-decoration: none;
}
.sidebar-link.active {
  background: var(--teal-primary);
  color: #fff !important;
  font-weight: 600;
}
.sidebar-link.active::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--teal-dark);
}
.sidebar-link .badge-count {
  margin-left: auto;
  background: #dc3545;
  color: #fff;
  border-radius: 10px;
  padding: 2px 7px;
  font-size: 0.7rem;
}

/* Sidebar footer user card */
.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid #e9ecef;
  display: flex; align-items: center; gap: 10px;
  min-height: 70px;
  background: var(--teal-xlight);
}
.sidebar-footer .user-info { overflow: hidden; }
.sidebar-footer .user-name {
  font-weight: 600; font-size: 0.85rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-footer .role-badge {
  font-size: 0.68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  background: var(--teal-primary); color: #fff;
  border-radius: 4px; padding: 1px 6px;
  display: inline-block; margin-top: 2px;
}

/* ---- Collapsed Sidebar ------------------------------------ */
body.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-width);
}
body.sidebar-collapsed .sidebar-link span,
body.sidebar-collapsed .sidebar-section-label,
body.sidebar-collapsed .sidebar-footer .user-info,
body.sidebar-collapsed .sidebar-footer .role-badge,
body.sidebar-collapsed .sidebar-link .badge-count {
  opacity: 0; pointer-events: none; width: 0; overflow: hidden;
}
body.sidebar-collapsed .sidebar-link {
  justify-content: center; padding: 10px;
}
body.sidebar-collapsed .sidebar-link i { min-width: unset; }
body.sidebar-collapsed .sidebar-footer { justify-content: center; padding: 14px 8px; }

/* ---- Main Content ----------------------------------------- */
.main-content {
  margin-left: var(--sidebar-width);
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
  padding: 24px;
  transition: margin-left var(--transition-speed) ease;
}
body.sidebar-collapsed .main-content {
  margin-left: var(--sidebar-collapsed-width);
}

/* ---- Page Header / Breadcrumb ----------------------------- */
.page-header {
  margin-bottom: 20px;
}
.page-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 4px;
}
.breadcrumb {
  background: none; padding: 0; margin: 0; font-size: 0.82rem;
}
.breadcrumb-item + .breadcrumb-item::before { color: #adb5bd; }

/* ---- Cards ------------------------------------------------ */
.card {
  border: none;
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  margin-bottom: 20px;
}
.card-header {
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  border-radius: var(--card-radius) var(--card-radius) 0 0 !important;
  padding: 14px 20px;
  font-weight: 600; font-size: 0.95rem;
}
.card-body { padding: 20px; }

/* Stat cards */
.stat-card {
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  border: none;
  background: #fff;
  padding: 20px;
  display: flex; flex-direction: row; align-items: flex-start; gap: 16px;
  transition: transform 0.2s, box-shadow 0.2s;
  height: 100%;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.1); }
.stat-card .stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; flex-shrink: 0;
}
.stat-card .stat-icon.teal    { background: var(--teal-light); color: var(--teal-primary); }
.stat-card .stat-icon.warning { background: #fff8e1; color: #e65100; }
.stat-card .stat-icon.success { background: #e8f5e9; color: #2e7d32; }
.stat-card .stat-icon.danger  { background: #fce4ec; color: #c62828; }
.stat-card .stat-icon.info    { background: #e3f2fd; color: #1565c0; }
.stat-card .stat-value {
  font-size: 1.75rem; font-weight: 700; line-height: 1;
  color: #1a1a2e; margin-bottom: 4px;
}
.stat-card .stat-label {
  font-size: 0.8rem; color: #6c757d; font-weight: 500;
}
.stat-card .stat-trend {
  font-size: 0.75rem; margin-top: 4px;
}

/* Action cards */
.action-card {
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  border: none; background: #fff;
  padding: 24px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
  height: 100%;
  display: flex; flex-direction: column; align-items: center;
}
.action-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
.action-card .action-icon {
  width: 64px; height: 64px;
  border-radius: 16px;
  background: var(--teal-light);
  color: var(--teal-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; margin-bottom: 14px;
}
.action-card h5 { font-weight: 600; font-size: 1rem; margin-bottom: 8px; }
.action-card p  { font-size: 0.83rem; color: #6c757d; flex: 1; }

/* ---- DataTables ------------------------------------------- */
.dataTables_wrapper .dataTables_filter input {
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.85rem;
}
.dataTables_wrapper .dataTables_length select {
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 4px 8px;
}
.dataTables_wrapper .dt-buttons {
  margin-bottom: 10px;
}
.dt-buttons .btn { font-size: 0.8rem; }

/* Ensure DataTables controls have breathing room inside zero-padding card bodies */
.card .dataTables_wrapper > .dt-buttons {
  margin: 10px 14px 6px;
}
.card .dataTables_wrapper > .dataTables_filter {
  padding: 8px 14px 4px;
}
.card .dataTables_wrapper > .dataTables_length {
  padding: 8px 14px 4px;
}
.card .dataTables_wrapper > .dataTables_info {
  padding: 4px 14px 10px;
}
.card .dataTables_wrapper > .dataTables_paginate {
  padding: 4px 14px 10px;
}
.table thead th {
  background: #f8f9fa;
  font-weight: 600; font-size: 0.82rem;
  text-transform: uppercase; letter-spacing: 0.03em;
  border-bottom: 2px solid #dee2e6;
  color: #495057;
}
.table tbody tr:hover { background: var(--teal-xlight); }

/* ---- Status Badges --------------------------------------- */
.badge.rounded-pill { font-size: 0.75rem; padding: 4px 10px; }
.badge-pending   { background: #fff3cd; color: #856404; }
.badge-approved  { background: #d1e7dd; color: #0f5132; }
.badge-returned  { background: #f8d7da; color: #842029; }
.badge-on_hold   { background: #e2e3e5; color: #383d41; }
.badge-forwarded { background: #cff4fc; color: #0a3a4a; }

/* Days pending coloring */
.days-green  { color: #198754; font-weight: 600; }
.days-amber  { color: #fd7e14; font-weight: 600; }
.days-red    { color: #dc3545; font-weight: 600; }

/* ---- Forms ----------------------------------------------- */
.form-label { font-size: 0.85rem; font-weight: 600; color: #374151; margin-bottom: 4px; }
.form-control, .form-select { border-radius: 6px; font-size: 0.9rem; }
.form-control:disabled, .form-control[readonly] { background-color: #f8f9fa; }
.form-text { font-size: 0.78rem; }
.input-group-text { border-radius: 6px 0 0 6px; }
.required-star { color: #dc3545; }
fieldset.form-section {
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 20px;
}
fieldset.form-section legend {
  font-size: 0.85rem; font-weight: 700;
  color: var(--teal-primary); padding: 0 8px;
  width: auto; float: none;
}

/* ---- Wizard Steps --------------------------------------- */
.wizard-steps {
  display: flex; align-items: center;
  margin-bottom: 28px; gap: 0;
}
.wizard-step {
  display: flex; flex-direction: column; align-items: center;
  flex: 1; position: relative;
}
.wizard-step:not(:last-child)::after {
  content: '';
  position: absolute; top: 18px; left: 60%; right: -40%;
  height: 2px; background: #dee2e6; z-index: 0;
}
.wizard-step.done:not(:last-child)::after { background: var(--teal-primary); }
.wizard-step-num {
  width: 36px; height: 36px;
  border-radius: 50%; border: 2px solid #dee2e6;
  background: #fff; color: #adb5bd;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem;
  z-index: 1; position: relative;
  transition: all 0.3s;
}
.wizard-step.active .wizard-step-num {
  border-color: var(--teal-primary);
  background: var(--teal-primary); color: #fff;
}
.wizard-step.done .wizard-step-num {
  border-color: var(--teal-primary);
  background: var(--teal-primary); color: #fff;
}
.wizard-step-label {
  margin-top: 6px; font-size: 0.75rem;
  font-weight: 500; color: #6c757d;
  text-align: center;
}
.wizard-step.active .wizard-step-label { color: var(--teal-primary); font-weight: 600; }
.wizard-step.done .wizard-step-label   { color: var(--teal-primary); }

/* Wizard panes */
.wizard-pane { display: none; }
.wizard-pane.active { display: block; }

/* ---- File Drop Zone ------------------------------------- */
.file-drop-zone {
  border: 2px dashed var(--teal-primary);
  border-radius: 10px;
  padding: 36px 24px;
  text-align: center;
  background: var(--teal-xlight);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.file-drop-zone:hover, .file-drop-zone.drag-over {
  background: var(--teal-light); border-color: var(--teal-dark);
}
.file-drop-zone .drop-icon {
  font-size: 2.5rem; color: var(--teal-primary); margin-bottom: 10px;
}
.file-drop-zone p { margin: 0; color: #6c757d; font-size: 0.88rem; }
.file-drop-zone .file-info {
  margin-top: 10px; font-size: 0.82rem;
  color: var(--teal-dark); font-weight: 600;
}

/* ---- Timeline (Audit Trail) ----------------------------- */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: '';
  position: absolute; left: 10px; top: 0; bottom: 0;
  width: 2px; background: #e9ecef;
}
.timeline-item {
  position: relative; margin-bottom: 20px;
}
.timeline-item::before {
  content: '';
  position: absolute; left: -22px; top: 6px;
  width: 12px; height: 12px;
  border-radius: 50%; border: 2px solid var(--teal-primary);
  background: #fff; z-index: 1;
}
.timeline-item.done::before { background: var(--teal-primary); }
.timeline-header {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-bottom: 4px;
}
.timeline-role { font-weight: 700; font-size: 0.82rem; color: var(--teal-dark); }
.timeline-action { font-size: 0.8rem; }
.timeline-date { font-size: 0.75rem; color: #adb5bd; margin-left: auto; }
.timeline-remarks {
  font-size: 0.82rem; color: #6c757d;
  background: #f8f9fa; border-radius: 6px;
  padding: 6px 10px; margin-top: 4px;
  font-style: italic;
}

/* ---- Approval Step Tracker ------------------------------ */
.step-tracker {
  display: flex; justify-content: space-between;
  position: relative; margin-bottom: 24px; padding: 0 10px;
}
.step-tracker::before {
  content: '';
  position: absolute; top: 16px; left: 20px; right: 20px;
  height: 2px; background: #dee2e6; z-index: 0;
}
.step-item {
  display: flex; flex-direction: column; align-items: center;
  z-index: 1; flex: 1;
}
.step-dot {
  width: 32px; height: 32px;
  border-radius: 50%; border: 2px solid #dee2e6;
  background: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; color: #adb5bd;
  transition: all 0.3s;
}
.step-dot.completed { background: var(--teal-primary); border-color: var(--teal-primary); color: #fff; }
.step-dot.current   { border-color: var(--teal-primary); color: var(--teal-primary); }
.step-label { font-size: 0.72rem; font-weight: 500; color: #6c757d; margin-top: 5px; text-align: center; }
.step-dot.completed + .step-label,
.step-dot.current   + .step-label { color: var(--teal-primary); font-weight: 600; }

/* ---- Employee Profile Header ---------------------------- */
.emp-header-card {
  background: linear-gradient(135deg, var(--teal-primary), var(--teal-dark));
  color: #fff; border-radius: var(--card-radius);
  padding: 24px; display: flex; align-items: center; gap: 20px;
  margin-bottom: 20px;
}
.emp-header-card .emp-name { font-size: 1.3rem; font-weight: 700; margin-bottom: 4px; }
.emp-header-card .emp-meta { font-size: 0.85rem; opacity: 0.85; }
.emp-header-card .emp-zppf {
  font-size: 0.8rem; background: rgba(255,255,255,0.2);
  border-radius: 20px; padding: 2px 12px; display: inline-block;
  margin-top: 6px;
}

/* ---- Login Page ----------------------------------------- */
.login-page {
  min-height: 100vh;
  width: 100%;
  background: linear-gradient(135deg, var(--teal-primary) 0%, var(--teal-dark) 100%) !important;
  display: flex !important;
  align-items: center; justify-content: center;
  padding: 20px;
}
.login-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  padding: 40px;
  width: 100%; max-width: 420px;
}
.login-logo {
  width: 64px; height: 64px;
  background: var(--teal-primary);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; color: #fff; margin: 0 auto 30px;
}

.login-logo img{
  max-width: 100px;
}

.login-title   { font-size: 1.3rem; font-weight: 700; color: #1a1a2e; text-align: center; }
.login-subtitle{ font-size: 0.8rem; color: #6c757d; text-align: center; margin-bottom: 20px; }

/* CAPTCHA box */
.captcha-box {
  background: var(--teal-xlight);
  border: 1px solid var(--teal-primary);
  border-radius: 8px; padding: 10px 14px;
  font-size: 1.1rem; font-weight: 700;
  color: var(--teal-dark); text-align: center; letter-spacing: 4px;
  margin-bottom: 8px;
}

/* ---- Toast Notifications -------------------------------- */
.toast-container-custom {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
}
.toast-custom {
  min-width: 280px; border-radius: 10px;
  border: none; box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  padding: 14px 18px; margin-bottom: 10px;
  display: flex; align-items: center; gap: 10px;
  animation: slideInRight 0.3s ease;
}
@keyframes slideInRight {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
.toast-custom.success { background: #d1e7dd; color: #0f5132; }
.toast-custom.error   { background: #f8d7da; color: #842029; }
.toast-custom.info    { background: #cff4fc; color: #055160; }
.toast-custom.warning { background: #fff3cd; color: #664d03; }
.toast-custom i { font-size: 1.2rem; }

/* ---- Settlement Summary Card ---------------------------- */
.settlement-summary {
  border-radius: 10px; overflow: hidden;
}
.settle-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px; border-bottom: 1px solid #f0f0f0;
}
.settle-row:last-child { border-bottom: none; }
.settle-label { font-size: 0.85rem; color: #6c757d; font-weight: 500; }
.settle-value { font-size: 1.05rem; font-weight: 700; }
.settle-value.teal   { color: var(--teal-primary); }
.settle-value.danger { color: #dc3545; }
.settle-value.success{ color: #198754; font-size: 1.3rem; }

/* ---- PDF Viewer ----------------------------------------- */
.pdf-viewer-frame {
  width: 100%; height: 500px;
  border: 1px solid #dee2e6; border-radius: 8px;
}
.no-doc-placeholder {
  height: 200px; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: #f8f9fa; border-radius: 8px;
  border: 2px dashed #dee2e6; color: #adb5bd;
}
.no-doc-placeholder i { font-size: 2.5rem; margin-bottom: 8px; }

/* ---- Risk Flag Badge ------------------------------------ */
.badge-risk-high {
  background: #fff3e0; color: #e65100;
  border: 1px solid #ffcc80;
  font-size: 0.72rem; padding: 3px 8px;
  border-radius: 20px; font-weight: 600;
}

/* ---- Proceeding Page ------------------------------------ */
.proceeding-success-icon {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--teal-light);
  color: var(--teal-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; margin: 0 auto 16px;
}
.proceeding-table td:first-child { font-weight: 600; color: #495057; width: 40%; }

/* ---- Mobile Sidebar (offcanvas) ------------------------- */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1025;
}

@media (max-width: 767.98px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width) !important;
    z-index: 1045;
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-overlay { display: block; }
  .main-content { margin-left: 0 !important; }
  body.sidebar-collapsed .sidebar { transform: translateX(-100%); }
  .top-header .portal-brand .brand-name { display: none; }
}

@media (max-width: 575.98px) {
  .stat-card { padding: 14px; }
  .stat-card .stat-value { font-size: 1.35rem; }
  .login-card { padding: 24px 20px; }
  .main-content { padding: 16px; }
}

/* ---- Print Styles --------------------------------------- */
@media print {
  .sidebar, .top-header, .btn, .breadcrumb,
  .dataTables_wrapper .dt-buttons,
  .dataTables_wrapper .dataTables_filter,
  .dataTables_wrapper .dataTables_info,
  .dataTables_wrapper .dataTables_paginate,
  .no-print { display: none !important; }
  .main-content { margin: 0 !important; padding: 0 !important; }
  .print-area { display: block !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #dee2e6; }
  .proceeding-print-header {
    text-align: center; margin-bottom: 20px;
    border-bottom: 2px solid #000; padding-bottom: 12px;
  }
}
.print-area { display: none; }

/* ---- Misc Utilities ------------------------------------- */
.cursor-pointer { cursor: pointer; }
.text-teal { color: var(--teal-primary) !important; }
.bg-teal-light { background-color: var(--teal-light) !important; }
.rounded-10 { border-radius: 10px !important; }
.fs-11 { font-size: 0.75rem !important; }
.fs-12 { font-size: 0.82rem !important; }
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }
.gap-8  { gap: 8px !important; }

/* Select2 Bootstrap 5 fix */
.select2-container--bootstrap-5 .select2-selection {
  min-height: calc(1.5em + 0.75rem + 2px) !important;
}
.select2-container { width: 100% !important; }

/* DataTables column visibility */
table.dataTable thead .sorting::before,
table.dataTable thead .sorting::after,
table.dataTable thead .sorting_asc::before,
table.dataTable thead .sorting_desc::after { opacity: 0.4; }

/* ============================================================
   v2 ADDITIONS
   ============================================================ */

/* ---- Page Loader Overlay --------------------------------- */
.page-loader {
  position: fixed;
  inset: 0;
  background: rgba(15, 155, 142, 0.82);
  z-index: 9999;
  display: flex !important;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  backdrop-filter: blur(2px);
}
.page-loader.d-none { display: none !important; }
.page-loader-inner  { text-align: center; }

/* ---- KPI Tile (Clickable Stat Cards) --------------------- */
.kpi-tile {
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.kpi-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12) !important;
  color: inherit;
  text-decoration: none;
}
.kpi-tile .card { height: 100%; }

/* ---- Reconciliation Mismatch ----------------------------- */
.mismatch-row td { background: #fff3f3 !important; }
.mismatch-row td:first-child { border-left: 3px solid #dc3545; }
.match-row td    { background: #f0faf9 !important; }

/* ---- Role Badges (new roles) ----------------------------- */
.badge.bg-sto    { background-color: #6f42c1 !important; color: #fff; }
.badge.bg-ceo    { background-color: #c82333 !important; color: #fff; }
.badge.bg-admin  { background-color: #343a40 !important; color: #fff; }
.badge.bg-purple { background-color: #6f42c1 !important; color: #fff; }

/* ---- Subscription Entry Table ---------------------------- */
.sub-entry-table input[type="number"] {
  width: 120px;
  min-width: 80px;
  text-align: right;
}
.sub-entry-table .locked-row { opacity: 0.6; background: #f8f9fa; }

/* ---- OTP Steps ------------------------------------------- */
.otp-step {
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  background: #fff;
}
.otp-step.completed {
  border-color: #28a745;
  background: #f0faf3;
}
.otp-step.active {
  border-color: var(--teal-primary);
  box-shadow: 0 0 0 3px rgba(15,155,142,0.12);
}
.otp-step-number {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #dee2e6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  margin-right: 0.5rem;
}
.otp-step.active   .otp-step-number { background: var(--teal-primary); color: #fff; }
.otp-step.completed .otp-step-number { background: #28a745; color: #fff; }

/* ---- Collapsible Sidebar Groups -------------------------- */
.sidebar-group { border-bottom: 1px solid #f0f0f0; }

.sidebar-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9px 18px 9px 16px;
  background: none;
  border: none;
  cursor: pointer;
  color: #6c757d;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  transition: background var(--transition-speed), color var(--transition-speed);
  user-select: none;
}
.sidebar-group-toggle:hover {
  background: var(--teal-xlight);
  color: var(--teal-dark);
}
.sidebar-group-toggle.open {
  color: var(--teal-primary);
  background: var(--teal-light);
}
.sgt-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sgt-left i { font-size: 0.95rem; }
.sgt-chevron {
  font-size: 0.7rem;
  transition: transform 0.22s ease;
  flex-shrink: 0;
}
.sidebar-group-toggle.open .sgt-chevron {
  transform: rotate(90deg);
}

.sidebar-group-body {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.28s ease;
}
.sidebar-group-body.open {
  max-height: 600px;
}

/* collapsed sidebar — hide toggle text, show only icon */
body.sidebar-collapsed .sidebar-group-toggle span,
body.sidebar-collapsed .sgt-chevron {
  opacity: 0;
  pointer-events: none;
  width: 0;
  overflow: hidden;
}
body.sidebar-collapsed .sidebar-group-toggle {
  justify-content: center;
  padding: 10px;
}
body.sidebar-collapsed .sgt-left { gap: 0; }
body.sidebar-collapsed .sidebar-group-toggle.open {
  background: var(--teal-light);
}
body.sidebar-collapsed .sidebar-group-body.open {
  max-height: 600px;
}

/* always-visible account row */
.sidebar-group-account {
  padding: 6px 0 4px;
}

/* Legacy label (kept for any non-group uses) */
.sidebar-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #adb5bd;
  padding: 1rem 1rem 0.25rem;
  margin-top: 0.25rem;
}

/* ---- Diff View (Employee Edit Requests) ------------------ */
.diff-old { background: #fff5f5; color: #c0392b; padding: 2px 6px; border-radius: 3px; }
.diff-new { background: #f0faf3; color: #1a7a4a; padding: 2px 6px; border-radius: 3px; }

/* ---- Audit Trail ----------------------------------------- */
.audit-action-badge {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
}

/* ---- Period Closed Banner -------------------------------- */
.period-closed-banner {
  background: linear-gradient(90deg, #fff3cd, #ffeeba);
  border: 1px solid #ffc107;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: #856404;
}

/* ---- Subscriber Slip -------------------------------------- */
.subscriber-slip-table th { background: #0f9b8e !important; color: #fff !important; }
.subscriber-slip-table td { font-family: 'Courier New', monospace; }

/* ---- Loan Ledger ----------------------------------------- */
.loan-cap-warning {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
  color: #856404;
}
