/* ============================================================
   Getfive CRM — Design System v2
   Palette: Navy #1a2e52 · Steel #2d4f7c · Orange #e07b2e · Bg #f0f4f9
   ============================================================ */
:root {
  --gf-navy:      #1a2e52;
  --gf-steel:     #2d4f7c;
  --gf-orange:    #e07b2e;
  --gf-orange-dk: #c4671f;
  --gf-bg:        #f0f4f9;
  --gf-surface:   #ffffff;
  --gf-border:    #dce3ee;
  --gf-text:      #1e2b3c;
  --gf-muted:     #6b7a96;
  --gf-sidebar-w: 236px;
  --gf-radius:    12px;
  --gf-shadow:    0 2px 12px rgba(26,46,82,.10);
  --gf-shadow-lg: 0 8px 32px rgba(26,46,82,.14);
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  height: 100%;
  overflow: hidden;
}
body {
  background: var(--gf-bg);
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  font-size: .92rem;
  color: var(--gf-text);
  line-height: 1.55;
}

/* ---- Topbar ---- */
.gf-topbar {
  background: var(--gf-navy);
  min-height: 60px;
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  padding: 0 20px;
}
.navbar-brand { padding: 0; }

/* ---- Layout ---- */
/* Fixed, not just a fixed height: with the layout still in flow the document
   reported a scrollable range even though html/body are overflow:hidden, so
   anything that scrolls an element into view (focusing a radio, an anchor)
   slid the whole shell up and left a dead band the wheel could not undo.
   Taking it out of flow removes that phantom range entirely. */
/* overflow:clip, not hidden. A hidden box is still a scroll container, so
   focusing a control near the bottom let the browser scroll the shell
   itself and push .gf-main off-screen. clip creates no scroll container
   at all, so nothing can move it. */
.gf-layout { display: flex; position: fixed; top: 60px; left: 0; right: 0; bottom: 0; overflow: clip; }
.gf-main {
  flex: 1;
  padding: 28px 30px;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  height: 100%;
}
.gf-footer {
  background: var(--gf-surface);
  border-top: 1px solid var(--gf-border);
  padding: 10px 20px;
  font-size: .8rem;
  color: var(--gf-muted);
  display: none;
}
/* Floating scroll buttons no longer needed — hide globally */
#gfScrollTop, #gfScrollLeft { display: none !important; }

/* ---- Sidebar ---- */
.gf-sidebar {
  width: var(--gf-sidebar-w);
  background: var(--gf-surface);
  border-right: 1px solid var(--gf-border);
  flex-shrink: 0;
  padding: 18px 10px;
  display: flex;
  flex-direction: column;
  /* Make sidebar scrollable when menu is taller than the viewport */
  height: calc(100vh - 60px);
  position: sticky;
  top: 60px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--gf-border) transparent;
}
.gf-sidebar::-webkit-scrollbar { width: 4px; }
.gf-sidebar::-webkit-scrollbar-track { background: transparent; }
.gf-sidebar::-webkit-scrollbar-thumb { background: var(--gf-border); border-radius: 4px; }
.gf-sidebar::-webkit-scrollbar-thumb:hover { background: var(--gf-muted); }
.gf-sidebar .nav-link {
  color: var(--gf-muted);
  font-weight: 600;
  font-size: .85rem;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 1px;
  display: flex;
  align-items: center;
  gap: 11px;
  letter-spacing: .005em;
  position: relative;
  transition: background .15s, color .15s;
}
/* Icons sit in a fixed column so every label starts on the same line.
   The active marker is a pseudo-element, so text never shifts sideways
   the way a real left border made it. */
.gf-sidebar .nav-link i {
  font-size: 1.02rem;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
  opacity: .85;
}
.gf-sidebar .nav-link::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 0;
  border-radius: 0 3px 3px 0;
  background: var(--gf-orange);
  transition: height .16s ease;
}
.gf-sidebar .nav-link:hover {
  background: var(--gf-bg);
  color: var(--gf-navy);
}
.gf-sidebar .nav-link:hover i { opacity: 1; }
.gf-sidebar .nav-link.active {
  background: rgba(26,46,82,.06);
  color: var(--gf-navy);
  font-weight: 700;
}
.gf-sidebar .nav-link.active::before { height: 18px; }
.gf-sidebar .nav-link.active i { color: var(--gf-orange); opacity: 1; }
.gf-sidebar-footer { padding: 0 0 8px; }

/* ---- Collapsed sidebar (icon rail) ------------------------------
   Toggled by the hamburger in the top bar. The choice is remembered
   in localStorage, so it survives page loads.
------------------------------------------------------------------ */
.gf-sidebar .nav-link .nav-txt { white-space: nowrap; }
.gf-sidebar .nav-lead { display: flex; align-items: center; gap: 10px; min-width: 0; }

body.gf-rail .gf-sidebar { width: 62px; padding-left: 7px; padding-right: 7px; }
body.gf-rail .gf-sidebar .nav-link {
  justify-content: center;
  padding: 10px 0;
  gap: 0;
  position: relative;
}
body.gf-rail .gf-sidebar .nav-lead { justify-content: center; gap: 0; }
body.gf-rail .gf-sidebar .nav-txt { display: none; }
body.gf-rail .gf-sidebar .nav-link i { font-size: 1.1rem; }
body.gf-rail .gf-nav-section {
  font-size: 0;
  height: 1px;
  background: var(--gf-border);
  margin: 10px 8px;
  padding: 0;
  overflow: hidden;
}
/* badge shrinks to a small counter pinned to the icon */
body.gf-rail .gf-sidebar .nav-badge {
  position: absolute;
  top: 4px;
  right: 6px;
  min-width: 16px;
  padding: 1px 4px !important;
  font-size: .55rem !important;
  line-height: 1.25;
  max-width: none !important;
}
.gf-sidebar, .gf-sidebar .nav-link { transition: width .18s ease, padding .18s ease; }

/* the toggle itself */
#sidebarToggle { opacity: .85; transition: opacity .15s; }
#sidebarToggle:hover { opacity: 1; }
.gf-nav-divider { border-top: 1px solid var(--gf-border); margin: 8px 6px; }

/* ---- Page title ---- */
.page-title {
  color: var(--gf-navy);
  font-weight: 800;
  font-size: 1.25rem;
  margin-bottom: 22px;
  letter-spacing: -.01em;
}
.page-title i { margin-right: 6px; opacity: .75; }

/* ---- Cards ---- */
.card {
  border: 0;
  border-radius: var(--gf-radius);
  box-shadow: var(--gf-shadow);
  background: var(--gf-surface);
}
.card-header {
  background: var(--gf-navy);
  color: #fff;
  font-weight: 700;
  font-size: .84rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-radius: var(--gf-radius) var(--gf-radius) 0 0 !important;
  padding: 11px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-header i { opacity: .85; font-size: .95rem; }
.card-body { padding: 18px; }

/* ---- KPI Cards ---- */
.kpi-card {
  border: 0;
  border-radius: var(--gf-radius);
  box-shadow: var(--gf-shadow);
  background: var(--gf-surface);
  transition: box-shadow .2s, transform .2s;
}
.kpi-card:hover {
  box-shadow: var(--gf-shadow-lg);
  transform: translateY(-2px);
}
.kpi-card .kpi-value {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--gf-navy);
  line-height: 1.1;
}
.kpi-card .kpi-label {
  font-size: .72rem;
  color: var(--gf-muted);
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  margin-top: 2px;
}
.kpi-card .kpi-icon {
  font-size: 1.8rem;
  opacity: .8;
}
a:has(.kpi-card):hover { text-decoration: none; }
.kpi-card .kpi-sub {
  font-size: .68rem;
  color: var(--gf-muted);
  margin-top: 2px;
}
.kpi-icon-wrap { flex-shrink: 0; }

/* ---- Tables ---- */
.table { margin-bottom: 0; font-size: .845rem; }
.table thead th {
  background: var(--gf-steel);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 10px 14px;
  border: 0;
}
.table tbody td {
  vertical-align: middle;
  padding: 10px 14px;
  border-color: var(--gf-border);
  color: var(--gf-text);
}
.table tbody tr:hover { background: rgba(240,244,249,.7); }
.table-sm thead th { padding: 8px 12px; }
.table-sm tbody td { padding: 8px 12px; }
.table td .btn + .btn { margin-left: 3px; }
.table .progress { height: 8px; min-width: 80px; }

/* ---- Empty State ---- */
.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--gf-muted);
}
.empty-state i {
  font-size: 3rem;
  opacity: .35;
  display: block;
  margin-bottom: 12px;
}
.empty-state h6 {
  font-weight: 700;
  color: var(--gf-navy);
  margin-bottom: 4px;
  font-size: .95rem;
}
.empty-state p { font-size: .83rem; margin: 0; }

/* ---- Progress ---- */
.progress {
  height: 8px;
  border-radius: 99px;
  background: var(--gf-border);
  overflow: hidden;
}
.progress-bar {
  background: var(--gf-orange);
  font-size: .68rem;
  font-weight: 700;
  transition: width .4s ease;
}
.progress-lg { height: 14px; }
.progress-lg .progress-bar { font-size: .72rem; }

/* ---- Badges ---- */
.badge { font-weight: 600; font-size: .72rem; letter-spacing: .03em; padding: .35em .65em; }

/* ---- Buttons ---- */
.btn-gf {
  background: var(--gf-navy);
  color: #fff;
  font-weight: 600;
  letter-spacing: .02em;
  border: 0;
  transition: background .15s, box-shadow .15s;
}
.btn-gf:hover, .btn-gf:focus {
  background: var(--gf-steel);
  color: #fff;
  box-shadow: 0 3px 10px rgba(26,46,82,.25);
}
.btn-gf-orange {
  background: var(--gf-orange);
  color: #fff;
  font-weight: 600;
  border: 0;
  transition: background .15s, box-shadow .15s;
}
.btn-gf-orange:hover, .btn-gf-orange:focus {
  background: var(--gf-orange-dk);
  color: #fff;
  box-shadow: 0 3px 10px rgba(224,123,46,.3);
}
.btn { border-radius: 7px; font-size: .875rem; }
.btn-sm { font-size: .8rem; }

/* ---- Forms ---- */
.form-control, .form-select {
  border-color: var(--gf-border);
  border-radius: 8px;
  font-size: .875rem;
  padding: 7px 12px;
  color: var(--gf-text);
  background-color: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--gf-steel);
  box-shadow: 0 0 0 3px rgba(45,79,124,.15);
  outline: 0;
}
.form-label {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--gf-muted);
  margin-bottom: 5px;
}
.form-text { font-size: .78rem; color: var(--gf-muted); }

/* ---- Modal ---- */
.modal-header {
  background: var(--gf-navy);
  color: #fff;
  border-radius: calc(var(--gf-radius) - 1px) calc(var(--gf-radius) - 1px) 0 0;
  padding: 14px 20px;
}
.modal-title { font-weight: 700; font-size: .95rem; letter-spacing: .02em; }
.modal-content { border: 0; border-radius: var(--gf-radius); box-shadow: var(--gf-shadow-lg); }
.modal-body { padding: 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--gf-border); }

/* ---- Nav tabs ---- */
.nav-tabs {
  border-bottom: 2px solid var(--gf-border);
  gap: 4px;
}
.nav-tabs .nav-link {
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  color: var(--gf-muted);
  font-weight: 600;
  font-size: .875rem;
  padding: 8px 16px;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
}
.nav-tabs .nav-link:hover { color: var(--gf-navy); border-bottom-color: var(--gf-steel); background: transparent; }
.nav-tabs .nav-link.active { color: var(--gf-navy); border-bottom-color: var(--gf-orange); background: transparent; font-weight: 700; }

/* ---- List groups ---- */
.list-group-item { border-color: var(--gf-border); }
.list-group-flush .list-group-item:first-child { border-top: 0; }

/* ---- Alerts ---- */
.alert { border-radius: var(--gf-radius); border: 0; font-size: .875rem; font-weight: 500; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-danger  { background: #fee2e2; color: #991b1b; }
.alert-warning { background: #fef3c7; color: #92400e; }
.alert-info    { background: #dbeafe; color: #1e40af; }

/* ---- Login page ---- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, var(--gf-navy) 0%, var(--gf-steel) 100%);
  padding: 20px;
}
.login-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  width: 100%;
  max-width: 410px;
  padding: 38px 34px;
}
.login-card .form-label {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #4a5568;
  margin-bottom: 6px;
}
.login-card .input-group-text {
  background: #f7f9fc;
  border-color: var(--gf-border);
  color: var(--gf-muted);
}
.login-card .form-control { border-left: 0; }
.login-card .form-control:focus {
  border-color: var(--gf-steel);
  box-shadow: 0 0 0 3px rgba(45,79,124,.12);
}
.login-card .input-group:focus-within .input-group-text { border-color: var(--gf-steel); }
.login-card .btn-gf { border-radius: 8px; font-size: .95rem; letter-spacing: .03em; }

/* ---- Avatar ---- */
.avatar-sm { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gf-border); }
.avatar-md { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gf-border); }
.avatar-lg { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 3px solid var(--gf-border); }
/* Initials-based avatar — same size slots */
.gf-avatar-sm {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--gf-steel); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .8rem; flex-shrink: 0;
}

/* ---- Utility ---- */
.text-navy { color: var(--gf-navy) !important; }
.text-muted { color: var(--gf-muted) !important; }
.rounded-gf { border-radius: var(--gf-radius); }

/* ---- Scrollbar (Webkit) ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c5cdd9; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #9aa4b4; }

/* ---- Responsive sidebar (tablets + mobile) ---- */
@media (max-width: 992px) {
  .gf-sidebar {
    position: fixed;
    left: -260px;
    top: 60px;
    height: calc(100vh - 60px);
    z-index: 1029;
    transition: left .25s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,.12);
  }
  .gf-sidebar.open { left: 0; }
  .gf-main { padding: 18px 16px; }
  .page-title { font-size: 1.1rem; margin-bottom: 16px; }
  .gf-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 60px 0 0 0;
    background: rgba(0,0,0,.35);
    z-index: 1028;
  }
  .gf-sidebar-overlay.show { display: block; }
}
@media (max-width: 576px) {
  .gf-main { padding: 12px 10px; }
  .page-title { font-size: 1rem; margin-bottom: 12px; }
  .gf-topbar { padding: 0 12px; }
  /* Table horizontal scroll on mobile */
  .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* Cards full width on xs */
  .card { border-radius: 10px; }
  .card-body { padding: 14px; }
  /* Badges smaller */
  .badge { font-size: .65rem; }
}

/* ---- Print ---- */
@media print {
  .gf-topbar, .gf-sidebar, .gf-footer { display: none !important; }
  .gf-main { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}

/* ---- Notification bell ---- */
/* Bell needs a real tap target - the icon alone is only ~18px wide,
   well under the 44px a fingertip needs. */
.gf-bell {
  transition: opacity .15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
}
.gf-bell:hover { opacity: .8; }

@keyframes pulse-badge {
  0%, 100% { transform: translate(-50%,-50%) scale(1); }
  50%       { transform: translate(-50%,-50%) scale(1.25); }
}
.gf-badge-pulse {
  animation: pulse-badge 1.8s ease-in-out infinite;
}

/* ---- Dropdown refinements ---- */
.dropdown-menu {
  border-radius: var(--gf-radius);
  font-size: .875rem;
}
.dropdown-item { padding: 7px 16px; color: var(--gf-text); }
.dropdown-item:hover { background: var(--gf-bg); color: var(--gf-navy); }
.dropdown-item.text-danger:hover { background: #fee2e2; }

/* ---- Spotlight card ---- */
.gf-spotlight {
  border-left: 4px solid var(--gf-orange);
  border-radius: var(--gf-radius);
  background: var(--gf-surface);
}
.gf-spotlight-danger  { border-left-color: #dc3545; background: #fff5f5; }
.gf-spotlight-warning { border-left-color: #e07b2e; background: #fffbf5; }
.gf-spotlight-item    { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }

/* ---- Quick Action Cards ---- */
.gf-qaction-card {
  transition: transform .15s, box-shadow .15s;
  cursor: pointer;
  border-radius: var(--gf-radius);
}
.gf-qaction-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,.10);
}

/* ---- Delta indicators on KPI cards ---- */
.delta-up   { font-size: .68rem; color: #198754; font-weight: 700; }
.delta-down { font-size: .68rem; color: #dc3545; font-weight: 700; }
.delta-flat { font-size: .68rem; color: var(--gf-muted); }

/* ---- Skeleton loader pulse ---- */
@keyframes gf-skeleton-pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: .4; }
}
.gf-skeleton-pulse { animation: gf-skeleton-pulse 1.4s ease-in-out infinite; }

/* ---- Dashboard alignment helpers ---- */
/* Card header with action buttons */
.card-header.d-flex { gap: 0; }
.card-header .d-flex.gap-2 { gap: .4rem !important; }

/* Outline-light buttons in dark card headers */
.card-header .btn-outline-light {
  color: rgba(255,255,255,.85);
  border-color: rgba(255,255,255,.35);
  font-size: .75rem;
  padding: 4px 10px;
}
.card-header .btn-outline-light:hover {
  background: rgba(255,255,255,.18);
  color: #fff;
  border-color: rgba(255,255,255,.65);
}

/* ============================================================
   Visual Upgrade — Dashboard Polish v3
   ============================================================ */

/* ---- Card header gradient (more depth) ---- */
.card-header {
  background: linear-gradient(135deg, var(--gf-navy) 0%, var(--gf-steel) 100%) !important;
}

/* ---- KPI card colored accent stripe ---- */
.kpi-card {
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--kpi-accent, var(--gf-navy));
  border-radius: var(--gf-radius) var(--gf-radius) 0 0;
}
.kpi-card .kpi-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gf-navy);
  line-height: 1.1;
}
.kpi-icon-wrap {
  border-radius: 12px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Overall progress mini ring ---- */
.kpi-ring-wrap {
  position: relative;
  flex-shrink: 0;
  width: 58px;
  height: 58px;
}
.kpi-ring-label {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: .62rem;
  font-weight: 800;
  color: var(--gf-navy);
  pointer-events: none;
  white-space: nowrap;
}

/* ---- Micro action buttons in project table ---- */
.btn-xs-gf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: .82rem;
  border-radius: 6px;
  border: 1px solid var(--gf-border);
  color: var(--gf-muted);
  background: transparent;
  transition: background .12s, color .12s, border-color .12s;
  line-height: 1;
}
.btn-xs-gf:hover {
  background: var(--gf-bg);
  color: var(--gf-navy);
  border-color: var(--gf-steel);
}
.btn-xs-success { color: #198754; border-color: #c3e6cb; }
.btn-xs-success:hover { background: #d1fae5; border-color: #198754; color: #198754; }

/* ---- Legend dot ---- */
.dash-legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

/* ---- Dashboard project table ---- */
.dash-proj-table tbody tr { transition: background .12s; }
.dash-proj-table tbody tr:hover { background: rgba(26,46,82,.04) !important; }
.dash-proj-table .progress-stacked { border-radius: 6px; overflow: hidden; background: #e9ecef; }

/* ---- Spotlight bar upgrade ---- */
.gf-spotlight {
  border-left: 4px solid var(--gf-orange);
  background: linear-gradient(90deg, #fffbf5 0%, #fff 100%);
  box-shadow: var(--gf-shadow);
}
.gf-spotlight-danger {
  border-left-color: #dc3545;
  background: linear-gradient(90deg, #fff5f5 0%, #fff 100%);
}

/* ---- Upcoming deadlines list rows ---- */
.list-group-item { transition: background .1s; }
.list-group-item:hover { background: var(--gf-bg); }

/* ---- Leaderboard row medal colors ---- */
.gf-medal-1 { color: #d4a017; }
.gf-medal-2 { color: #a8a9ad; }
.gf-medal-3 { color: #b08850; }

/* ---- Page header wrapper ---- */
.gf-dash-header {
  background: linear-gradient(135deg, var(--gf-navy) 0%, var(--gf-steel) 100%);
  border-radius: var(--gf-radius);
  padding: 16px 22px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(26,46,82,.2);
}
.gf-dash-header .page-title {
  color: #fff;
  margin-bottom: 0;
}
.gf-dash-header .text-muted { color: rgba(255,255,255,.55) !important; }

/* ---- KPI section label ---- */
.gf-section-label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gf-muted);
  margin-bottom: 8px;
  padding-left: 2px;
}

/* ---- Animated progress bar ---- */
@keyframes gf-bar-grow {
  from { width: 0; }
}
.progress-bar { animation: gf-bar-grow .6s ease-out; }

/* ---- Card hover lift (non-KPI) ---- */
.card { transition: box-shadow .2s; }

/* ---- Overall progress kpi hover ring glow ---- */
.kpi-card:hover .kpi-ring-wrap canvas {
  filter: drop-shadow(0 0 4px rgba(26,46,82,.25));
}

/* ---- Responsive adjustments ---- */
@media (max-width: 576px) {
  .kpi-card .kpi-value { font-size: 1.6rem; }
  .gf-dash-header { padding: 12px 16px; }
}

/* ============================================================
   Alignment fixes — Dashboard v3.1
   ============================================================ */

/* Dash header always has bottom margin */
.gf-dash-header { margin-bottom: 1.5rem !important; }

/* Section labels between rows */
.gf-section-label {
  font-size: .69rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gf-muted);
  padding-left: 2px;
  margin-bottom: .5rem;
  margin-top: .25rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Charts column — equal-height cards fill the column */
.flex-fill { flex: 1 1 0% !important; }

/* Chart card bodies — center canvas vertically */
.flex-fill .card-body {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* KPI row uniform card height */
.kpi-card .d-flex { min-height: 56px; }

/* Spotlight spacing */
.gf-spotlight.card { margin-top: 0; }

/* Row gap consistency */
.row.g-3 { --bs-gutter-x: 1rem; --bs-gutter-y: 1rem; }

/* Project table last col buttons don't wrap */
.dash-proj-table td:last-child { white-space: nowrap; }

/* Leaderboard + deadlines section equal height */
#leaderboard-panel,
.list-group.list-group-flush { display: flex; flex-direction: column; }

/* ============================================================
   UI Polish v4 — All rating suggestions
   ============================================================ */

/* ── Better table row padding ── */
.table tbody td { padding: 12px 14px; }
.table-sm tbody td { padding: 9px 12px; }
.table thead th { padding: 11px 14px; }

/* ── Font hierarchy improvements ── */
.kpi-value { font-size: 2.1rem; letter-spacing: -.03em; }
.kpi-label { font-size: .71rem; letter-spacing: .09em; }
.card-header { font-size: .8rem; letter-spacing: .07em; }
.page-title { font-size: 1.3rem; letter-spacing: -.015em; }

/* ── KPI delta tooltip ── */
[title] { cursor: help; }
.delta-up, .delta-down, .delta-flat { cursor: help; }

/* ── Better empty states ── */
.empty-state {
  padding: 56px 24px;
  text-align: center;
  color: var(--gf-muted);
}
.empty-state i {
  font-size: 3.4rem;
  opacity: .22;
  display: block;
  margin-bottom: 14px;
  color: var(--gf-navy);
}
.empty-state h6 {
  font-weight: 700;
  color: var(--gf-navy);
  margin-bottom: 6px;
  font-size: 1rem;
}
.empty-state p { font-size: .84rem; margin: 0 0 14px; }
.empty-state .btn { margin-top: 4px; }

/* ── Loading spinner state ── */
.gf-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px;
  color: var(--gf-muted);
  font-size: .88rem;
}
.gf-loading .spinner-border { width: 1.2rem; height: 1.2rem; border-width: 2px; color: var(--gf-steel); }

/* ── Table hover highlight stronger ── */
.table tbody tr { transition: background .12s; }
.table-hover tbody tr:hover { background: rgba(26,46,82,.05) !important; }

/* ── Report preview card ── */
#reportPreview {
  min-height: 80px;
  transition: opacity .2s;
}
#reportPreview.loading { opacity: .5; pointer-events: none; }

/* ── Spotlight card stronger left border ── */
.gf-spotlight { border-left-width: 5px; }

/* ── Card hover with shadow ── */
.card:not(.kpi-card):hover { box-shadow: 0 4px 20px rgba(26,46,82,.12); }

/* ── Better badge spacing ── */
.badge { padding: .38em .72em; }

/* ── Sidebar section group labels ── */
.gf-nav-section {
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gf-muted);
  padding: 12px 14px 4px;
  opacity: .7;
}

/* ── Form focus ring improvement ── */
.form-control:focus, .form-select:focus {
  box-shadow: 0 0 0 3px rgba(45,79,124,.18);
}

/* ── Reports filter card header ── */
#reportFilterForm .form-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gf-muted);
}

/* ── Tab active underline ── */
.nav-tabs .nav-link.active {
  border-bottom-color: var(--gf-orange);
  color: var(--gf-navy);
}

/* ── Progress bar pulse animation ── */
@keyframes gf-progress-pulse {
  0%,100% { opacity: 1; }
  50% { opacity: .7; }
}
.progress-bar.active { animation: gf-progress-pulse 1.5s ease-in-out infinite; }

/* ── Scrollable table with sticky header ── */
.table-scroll-300 { max-height: 300px; overflow-y: auto; }
.table-scroll-300 thead th { position: sticky; top: 0; z-index: 1; }

/* ── Responsive: compress KPI on small screens ── */
@media (max-width: 576px) {
  .kpi-value { font-size: 1.7rem; }
  .kpi-icon-wrap { display: none; }
  .gf-dash-header { padding: 14px 16px; }
  .gf-main { padding: 16px 14px; }
  .table tbody td, .table thead th { padding: 9px 10px; font-size: .8rem; }
}

/* ============================================================
   Final polish — v4.1
   ============================================================ */

/* ── Sidebar section labels ── */
.gf-nav-section {
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gf-muted);
  padding: 16px 12px 5px;
  opacity: .6;
  pointer-events: none;
}

/* ── Mobile: table horizontal scroll with fade ── */
.table-responsive {
  -webkit-overflow-scrolling: touch;
  position: relative;
}
.table-responsive::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 32px;
  background: linear-gradient(to right, transparent, rgba(255,255,255,.85));
  pointer-events: none;
  display: none;
}
@media (max-width: 768px) {
  .table-responsive::after { display: block; }
}

/* ── Tooltip via title attr ──
   Previously every element carrying a title got a dotted underline, which
   showed up under stat numbers, buttons and icons across the app. The
   tooltip still works on hover — it just no longer marks the text. */
[title]:not([title=""]) {
  text-decoration-line: none;
}
/* Keep the hint only where it reads as a definition */
abbr[title] {
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-color: currentColor;
  text-underline-offset: 2px;
  cursor: help;
}

/* ── Skeleton rows with avatar look ── */
.gf-skeleton-pulse > .d-flex { opacity: .7; }

/* ── Better list-group item padding ── */
.list-group-item { padding: 10px 16px; }

/* ── Sidebar nav section first label spacing ── */
.gf-sidebar .nav .gf-nav-section:first-child { padding-top: 4px; }

/* ── Card header icon spacing ── */
.card-header i { margin-right: 5px; }

/* ── Topbar nav brand spacing ── */
.gf-topbar .navbar-brand img { height: 32px; }

/* ── Overdue row highlight ── */
tr.table-danger td { color: #842029 !important; }

/* ── Form helper text ── */
.form-text { font-size: .76rem; color: var(--gf-muted); }

/* ── Chart no-data placeholder ── */
.chart-no-data {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  color: var(--gf-muted);
  font-size: .8rem;
  gap: 6px;
}
.chart-no-data i { font-size: 2rem; opacity: .25; }

/* ── Scrollbar in list panels ── */
.list-group-flush[style*="overflow-y"] { scrollbar-width: thin; scrollbar-color: #c5cdd9 transparent; }

/* ── Brand orange badge (replaces Bootstrap warning yellow) ── */
.bg-gf-orange { background-color: #e07b2e !important; color: #fff !important; }

/* KPI rows now declare their own column widths (col-md-3 / col-xl-2), so the
   old blanket `.col-xl { max-width:20% }` is gone — it was written for a
   5-card row and left a gap once a card was removed. */
@media (max-width: 991px) {
  .gf-dash-header { flex-direction: column; align-items: flex-start; gap: 10px; }
}
@media (max-width: 576px) {
  .gf-sidebar { width: 210px; left: -220px; }
  .card-header .btn-outline-light { padding: 3px 8px; font-size: .72rem; }
  .card-header .d-flex.gap-2 { gap: 4px !important; }
}

/* ── Notification dropdown — mobile ── */
@media (max-width: 767px) {
  /* Break out of Popper positioning: full-width sheet under the navbar */
  #gfNotifMenu.dropdown-menu {
    position: fixed !important;
    inset: auto !important;
    top: 58px !important;
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    max-width: none !important;
    transform: none !important;
    margin: 0 !important;
    max-height: calc(100vh - 74px) !important;
    display: none;
    flex-direction: column;
    overflow: hidden !important;
    border-radius: 12px !important;
    box-shadow: 0 12px 40px rgba(16, 28, 51, .28) !important;
    z-index: 1085 !important;
  }
  #gfNotifMenu.dropdown-menu.show { display: flex !important; }

  /* Inner scroll area fills the sheet instead of a fixed 360px */
  #gfNotifScroll { max-height: none !important; flex: 1 1 auto; overflow-y: auto !important; -webkit-overflow-scrolling: touch; }

  /* Sticky header / footer inside the sheet */
  #gfNotifMenu > div:first-child { flex: 0 0 auto; border-radius: 12px 12px 0 0 !important; }
  #gfNotifMenu > div:last-child   { flex: 0 0 auto; }

  /* Roomier tap targets, no text clipping */
  #gfNotifMenu .dropdown-item { white-space: normal !important; padding-top: .55rem !important; padding-bottom: .55rem !important; }
  #gfNotifMenu .dropdown-item > div { min-width: 0; }
  #gfNotifMenu .dropdown-item .fw-semibold,
  #gfNotifMenu .dropdown-item .fw-bold { word-break: break-word; }

  /* Dim the page behind the sheet.
     MUST stay below .gf-topbar's z-index (1030). The navbar is
     position:sticky, so it forms its own stacking context — the sheet
     inside it cannot rise above a root-level overlay. At 1080 this
     backdrop covered the navbar and swallowed every tap on the
     notification list and the Clear button. */
  body.gf-notif-open::after {
    content: ""; position: fixed; inset: 0;
    background: rgba(10, 20, 40, .35); z-index: 1020;
  }
}

/* ══════════════════════════════════════════════════════════════════
   MOBILE UX PASS  (≤ 767px)
   ══════════════════════════════════════════════════════════════════ */
@media (max-width: 767px) {

  /* ── 1. Page headers ──────────────────────────────────────────
     "title left / buttons right" doesn't fit a phone: the heading
     shrank and its text wrapped BELOW the buttons. Stack instead. */
  .gf-main .d-flex.justify-content-between:has(> .page-title) {
    flex-direction: column;
    align-items: stretch !important;
    gap: 10px;
  }
  .page-title { white-space: nowrap; }
  /* Action buttons in a stacked header share the row evenly */
  .gf-main .d-flex.justify-content-between:has(> .page-title) > .d-flex { width: 100%; }
  .gf-main .d-flex.justify-content-between:has(> .page-title) > .d-flex > .btn { flex: 1 1 auto; }
  .gf-main .d-flex.justify-content-between:has(> .page-title) > .btn { width: 100%; }

  /* ── 2. Tap targets ───────────────────────────────────────────
     Row action icons were 30×29. Apple/Google both recommend ~44px;
     38 keeps rows compact while staying reliably tappable. */
  .table td .btn, .table td .btn-sm,
  .btn-group-sm > .btn, .btn-sm {
    min-height: 38px;
    min-width: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .table td .btn + .btn { margin-left: 4px; }
  /* Checkboxes in tables */
  .table input[type="checkbox"] { width: 20px; height: 20px; }

  /* ── 3. Legibility ────────────────────────────────────────────
     Sidebar section labels were 9.6px, below comfortable reading. */
  .gf-nav-section { font-size: .72rem !important; letter-spacing: .08em; }
  .gf-topbar .badge { font-size: .7rem; }

  /* ── 4. Wide tables ───────────────────────────────────────────
     Tables run 780–1020px inside a 390px screen. They scroll, but the
     scroll isn't obvious — make the affordance visible and give rows
     room to breathe. */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .table-responsive > .table { margin-bottom: 0; }
  .table-responsive > .table th,
  .table-responsive > .table td { white-space: nowrap; padding: 10px 12px; }

  /* ── 5. Stacked rows where the markup provides labels ─────────
     Cells carrying data-label become "Label: value" rows, so the
     table reads top-to-bottom with no sideways scrolling at all. */
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr {
    border: 1px solid #e4eaf3; border-radius: 10px;
    margin-bottom: 10px; padding: 6px 4px; background: #fff;
  }
  .table-stack td {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; border: none !important; padding: 7px 12px !important;
    white-space: normal !important; text-align: right;
  }
  .table-stack td::before {
    content: attr(data-label);
    font-size: .68rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .04em; color: #8898aa; text-align: left; flex-shrink: 0;
  }
  .table-stack td:not([data-label]) { justify-content: flex-end; }
  .table-stack td[data-label="Actions"] { justify-content: space-between; }
  /* Row number carries no meaning once rows are cards */
  .table-stack td[data-label="#"] { display: none; }
  /* Name reads as the card heading */
  .table-stack td[data-label="Name"] { padding-top: 10px !important; }
  .table-stack td[data-label="Name"] b { font-size: .95rem; }
  /* Empty-state row must not become a card */
  .table-stack tr:has(td[colspan]) { border: none; padding: 0; }
  .table-stack td[colspan] { display: block; text-align: center; }
  .table-stack td[colspan]::before { content: none; }
}
