﻿/**
 * Kynvera Dashboard Styles
 * Clean, minimal design with subtle animations
 */

/* ===========================================
 CSS Variables / Design Tokens
 =========================================== */
:root {
  --primary: var(--color-brand, #ff8e68);
  --primary-light: var(--color-brand-light, #f97e54);
  --primary-dark: var(--color-brand-dark, #e05f36);
  --secondary: #d9d9d9;
  --text-dark: #191b23;
  --text-mid: #5c616e;
  --text-light: #6b7280;
  --text-muted: #9498a3;
  --logo-brand-color: #6b7280;
  --bg-light: #fafafb;
  --white: #ffffff;
  --bg-body: #f7f7f9;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --border-color: #e9eaee;
  --border-light: #f3f4f6;
  /* Main nav + module toolbars — neutral hairline (Kynvera) */
  --nav-hairline: #e9eaee;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md:
    0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg:
    0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  /* iOS / system UI (SF on Apple devices) */
  --font-sans:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "SF Pro", ui-sans-serif, system-ui, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

/* ===========================================
 Base Styles
 =========================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-body, #f7f7f9);
  color: var(--text-dark);
  overflow-x: hidden;
  line-height: 1.6;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

html {
  scroll-behavior: smooth;
  /* PWA / iOS WKWebView: unpainted bands (esp. between sections) show black if html has no fill */
  background-color: var(--bg-body, #f7f7f9);
  color-scheme: light;
}

/* Dashboard routes: one continuous whitish Kynvera surface (mobile_responsive sets body white).
 design-tokens.css uses :root:not([data-theme="light"]) under prefers-color-scheme:dark,
 which beats this file's :root and sets --bg-body to ~black — modules/footer then read "black block". */
html:not([data-theme="dark"]) body.page-dashboard,
html:not([data-theme="dark"]) body.hr-dashboard,
html:not([data-theme="dark"]) body.inspection-dashboard,
html:not([data-theme="dark"]) body.inspection-form,
html:not([data-theme="dark"]) body.operations-dashboard,
html:not([data-theme="dark"]) body.review-dashboard {
  --bg-body: #f7f7f9;
  --bg-light: #fafafb;
  --text-dark: #191b23;
  --text-mid: #5c616e;
  --text-light: #6b7280;
  --text-muted: #9498a3;
  --white: #ffffff;
  --border-color: #e9eaee;
}

body.page-dashboard,
body.hr-dashboard,
body.inspection-dashboard,
body.operations-dashboard,
body.review-dashboard {
  background: var(--bg-body, #f7f7f9) !important;
}

/* ===========================================
 Navigation
 =========================================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  /* Solid bar: same on localhost, Render, and behind Cloudflare (no backdrop-filter compositing drift) */
  background: #ffffff;
  border-bottom: 1px solid var(--nav-hairline);
  transition:
    box-shadow 0.3s ease,
    background 0.3s ease;
}

.nav.scrolled {
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(255, 142, 104, 0.08);
}

.nav-container {
  width: 100%;
  max-width: 100%;
  min-width: 320px;
  margin: 0;
  padding: 0.75rem 2rem 0.75rem 2.5rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem;
  min-height: 72px;
  box-sizing: border-box;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
  min-width: 0;
  grid-column: 1;
  justify-self: start;
  margin-right: 1.5rem;
}

a.logo,
a.logo:visited,
a.logo:hover,
a.logo:active {
  color: inherit;
}

.nav-center {
  grid-column: 2;
  justify-self: end;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  /* Allow mega-menu / dropdown panels to paint below the bar (overflow:hidden clips them on hover). */
  overflow: visible;
}

.logo:hover {
  opacity: 0.85;
}

.logo img {
  height: 36px;
  width: auto;
  max-width: min(260px, 52vw);
  flex-shrink: 0;
  object-fit: contain;
  object-position: left center;
  filter: none;
}

/* Official nav mark — emblem-only crop fills its box */
.logo img.logo-img-official {
  height: 36px !important;
  width: 36px !important;
  margin-left: 0;
  margin-right: 0;
  border-radius: 8px;
  object-fit: cover;
}

.logo-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.2rem;
  min-width: 0;
  text-align: left;
  margin-left: 0;
}

.logo-brand {
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.01em;
  color: var(--logo-brand-color) !important;
  line-height: 1;
}

/* Welcome text - shows full name (e.g. Welcome, System Administrator!) */
.nav-welcome,
#welcome-text {
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.2;
  white-space: nowrap;
  text-align: left;
  max-width: min(60vw, 520px);
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mobile menu toggle (hidden by default) */
.mobile-menu-toggle {
  display: none;
}

/* Mobile drawer and overlay - hidden on desktop (shown when nav gets tight) */
.mobile-menu-drawer {
  display: none;
}

.mobile-overlay {
  display: none;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  min-width: 0;
  grid-column: 3;
  justify-self: end;
}

.nav-menu {
  display: flex;
  gap: 1rem;
  list-style: none;
  align-items: center;
  margin: 0;
  padding: 0;
  flex-wrap: nowrap;
  justify-content: flex-end;
  max-width: 100%;
  overflow: visible;
  scrollbar-width: thin;
}

.nav-menu li {
  display: flex;
  align-items: center;
  position: relative;
}

.nav-menu a {
  color: #000;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    color 0.2s ease,
    background 0.2s ease;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-menu a:hover {
  color: var(--primary);
  background: rgba(255, 142, 104, 0.05);
}

/* Current route — beats Bootstrap link colour and drawer `!important` text colour */
.nav-menu a.nav-current {
  color: var(--primary) !important;
  font-weight: 600;
}

.nav-submenu {
  list-style: none;
  margin: 0;
  padding: 0.4rem;
  position: absolute;
  /* Flush to parent <li> bottom so :hover isn’t lost crossing a gap. */
  top: 100%;
  right: 0;
  min-width: 220px;
  border: 1px solid rgba(255, 142, 104, 0.16);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
  opacity: 0;
  transform: translateY(-6px);
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0.2s ease;
  z-index: 1205;
}

/* Bridge pointer gap between trigger row and submenu (keeps hover path continuous). */
.nav-menu li.has-submenu.has-submitted-dropdown .nav-submenu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 0.45rem;
}

.nav-submenu li {
  display: block;
}

.nav-submenu a {
  display: block;
  width: 100%;
  padding: 0.6rem 0.7rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dark);
  text-decoration: none;
  white-space: nowrap;
}

.nav-menu li.has-submenu.has-submitted-dropdown:hover .nav-submenu,
.nav-menu li.has-submenu.has-submitted-dropdown:focus-within .nav-submenu,
.nav-menu li.has-submenu.has-submitted-dropdown.open .nav-submenu {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
}

.nav-menu li.has-submenu.has-submitted-dropdown > a::after {
  content: "▾";
  display: inline-flex;
  margin-left: 0.42rem;
  font-size: 0.72rem;
  color: var(--text-light);
  transition:
    transform 0.2s ease,
    color 0.2s ease;
}

.nav-menu li.has-submenu.has-submitted-dropdown > a.nav-current::after {
  color: var(--primary);
}

.nav-menu li.has-submenu.has-submitted-dropdown:hover > a::after,
.nav-menu li.has-submenu.has-submitted-dropdown:focus-within > a::after,
.nav-menu li.has-submenu.has-submitted-dropdown.open > a::after {
  transform: rotate(180deg);
  color: var(--primary);
}

/* ===========================================
 Save Draft (inspection form - in main nav)
 =========================================== */
.nav-save-draft-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(255, 142, 104, 0.08);
  border: 1px solid rgba(255, 142, 104, 0.25);
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  transition: all 0.2s ease;
  margin-right: 0.5rem;
}
.nav-save-draft-btn:hover {
  background: rgba(255, 142, 104, 0.12);
  border-color: var(--primary);
  color: var(--primary);
}
.nav-save-draft-btn svg {
  flex-shrink: 0;
}

/* ===========================================
 Logout Button
 =========================================== */
.logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(255, 142, 104, 0.2);
}

.logout-btn::before {
  display: none;
}

.logout-btn:hover {
  color: #fff;
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: none;
  box-shadow: 0 2px 6px rgba(255, 142, 104, 0.28);
}

.logout-btn:active {
  transform: scale(0.97);
  background: var(--primary-dark);
}

.logout-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

/* ===========================================
 Dashboard hero — split: left copy, right widget
 =========================================== */
.hero {
  padding: 7.5rem 0 4rem;
  background:
    radial-gradient(
      ellipse 70% 60% at 0% 50%,
      rgba(255, 142, 104, 0.1) 0%,
      transparent 70%
    ),
    radial-gradient(
      ellipse 40% 40% at 100% 10%,
      rgba(255, 142, 104, 0.05) 0%,
      transparent 60%
    ),
    linear-gradient(160deg, #fafafb 0%, #fafafb 50%, #f7f7f9 100%);
  position: relative;
  z-index: 1;
  overflow: hidden;
}

/* Subtle decorative grid - fades gradually to merge with content below (no hard line) */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 142, 104, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 142, 104, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black 0%, black 45%, transparent 95%);
  -webkit-mask-image: linear-gradient(
    to bottom,
    black 0%,
    black 45%,
    transparent 95%
  );
  pointer-events: none;
  z-index: 0;
  animation: gridDrift 12s linear infinite;
}

/* Inspection: gradient only (no grid), full width & height */
.inspection-page-content {
  position: relative;
  flex: 1;
  min-height: 0;
  background:
    radial-gradient(
      ellipse 70% 60% at 0% 50%,
      rgba(255, 142, 104, 0.1) 0%,
      transparent 70%
    ),
    radial-gradient(
      ellipse 40% 40% at 100% 10%,
      rgba(255, 142, 104, 0.05) 0%,
      transparent 60%
    ),
    linear-gradient(160deg, #fafafb 0%, #fafafb 50%, #f7f7f9 100%);
  overflow: hidden;
}
.inspection-page-content .hero,
.inspection-page-content .modules-section {
  background: transparent !important;
  position: relative;
  z-index: 1;
}
.inspection-page-content .hero::before {
  display: none; /* No grid - gradient only */
}

/* Module hero pages (HR, Inspection, Procurement, Review History) - green grid + main dashboard colors */
/* Background extends to merge seamlessly with content below - no hard line */
.hero.hr-hero,
.hero.inspection-hero,
.hero.proc-hero,
.hero.review-hero {
  background:
    radial-gradient(
      ellipse 70% 60% at 0% 50%,
      rgba(255, 142, 104, 0.1) 0%,
      transparent 70%
    ),
    radial-gradient(
      ellipse 40% 40% at 100% 10%,
      rgba(255, 142, 104, 0.05) 0%,
      transparent 60%
    ),
    linear-gradient(160deg, #fafafb 0%, #fafafb 50%, #f7f7f9 100%);
  padding-bottom: 6rem;
}

/* HR: comfortable gap under title before Workflows (not the shared 6rem) */
.hero.hr-hero {
  background: linear-gradient(180deg, #f0f0f2 0%, #f4f4f5 45%, #f7f7f9 100%);
  padding-bottom: 1.15rem;
}
.hero.hr-hero::after {
  display: none;
}
/* Canonical "Back to Dashboard" link — shared by every module hero
 (HR, Inspection, Procurement, Operations, Review History, …).
 Define once here so all modules render an identical nav link. */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  margin-bottom: 1.25rem;
  transition: color 0.2s;
}
.back-btn:hover {
  color: var(--primary-light);
}

/* Inspection hero: same green gradient at top as HR module, no grid */
.hero.inspection-hero {
  background: linear-gradient(180deg, #f0f0f2 0%, #f4f4f5 45%, #f7f7f9 100%);
}
.hero.inspection-hero::before,
.hero.inspection-hero::after {
  display: none;
}

/* Submitted Forms (workflow history) hero — tighter bottom so stats sit closer to the list */
.hero.review-hero {
  background: linear-gradient(180deg, #f0f0f2 0%, #f4f4f5 45%, #f7f7f9 100%);
  padding-bottom: 1.25rem;
}
.hero.review-hero::before,
.hero.review-hero::after {
  display: none;
}

/* Procurement hero: match Inspection - gradient at top, no grid */
.hero.proc-hero {
  background: linear-gradient(180deg, #f0f0f2 0%, #f4f4f5 45%, #f7f7f9 100%);
}
.hero.proc-hero::before,
.hero.proc-hero::after {
  display: none;
}
/* .back-btn styling is now global (see canonical rule above) */

/* Review History dashboard: match HR/Inspection background */
.review-dashboard {
  background: #f7f7f9;
}

/* Grid fades gradually to bottom - no sharp cutoff (HR only; Procurement/Inspection use gradient only) */
.hero.hr-hero::before {
  mask-image: linear-gradient(to bottom, black 0%, black 45%, transparent 95%);
  -webkit-mask-image: linear-gradient(
    to bottom,
    black 0%,
    black 45%,
    transparent 95%
  );
}

/* Glow orb behind text */
.hero::after {
  content: "";
  position: absolute;
  top: 20%;
  left: -8%;
  width: 420px;
  height: 420px;
  background: radial-gradient(
    circle,
    rgba(255, 142, 104, 0.12) 0%,
    transparent 65%
  );
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  animation: heroOrbFloat 7s ease-in-out infinite;
}

.hero-split .hero-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 3rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 3rem;
  position: relative;
  z-index: 1;
}

.hero-left {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
}

.hero-tagline {
  font-size: 0.68rem;
  font-weight: 700;

  letter-spacing: 0.16em;
  color: var(--primary);
  margin: 0 0 1.25rem 0;
  padding: 0.4rem 0.875rem;
  background: rgba(255, 142, 104, 0.08);
  border: 1px solid rgba(255, 142, 104, 0.2);
  border-radius: 100px;
  width: fit-content;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  animation: heroBadgeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both 0.1s;
  opacity: 0;
}

.hero-tagline::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
}

.hero-title {
  font-family: var(--font-sans);
  font-size: clamp(2.4rem, 5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.12;
  margin: 0;
  color: var(--text-dark);
  letter-spacing: -0.04em;
  text-rendering: optimizeLegibility;
  animation: heroFadeUp 0.75s cubic-bezier(0.16, 1, 0.3, 1) both 0.25s;
  opacity: 0;
}

.hero-title .hero-title-accent {
  display: inline-block;
  background: linear-gradient(
    125deg,
    var(--primary) 0%,
    #f97e54 30%,
    var(--primary-light) 60%,
    var(--primary) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  animation: heroTextShimmer 4s linear infinite 1.2s;
}

.hero-title .hero-title-accent::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 4px;
  opacity: 0.5;
}

.hero-subtitle {
  font-size: clamp(1rem, 1.2vw, 1.1rem);
  color: var(--text-light);
  font-weight: 400;
  line-height: 1.7;
  margin: 1.5rem 0 0;
  max-width: 520px;
  animation: heroFadeUp 0.75s cubic-bezier(0.16, 1, 0.3, 1) both 0.45s;
  opacity: 0;
}

.hero-cta-row {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: heroFadeIn 0.8s ease both 0.65s;
  opacity: 0;
}

.hero-cta-stat {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-light);
}

.hero-cta-stat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff8e68;
  box-shadow: 0 0 0 3px rgba(255, 142, 104, 0.2);
  animation: liveDotPulse 2s ease-out infinite;
}

.hero-cta-divider {
  width: 1px;
  height: 14px;
  background: var(--border-color);
}

/* Right: dashboard widget — wide, compact height */
.hero-right {
  flex: 0 0 auto;
  width: 640px;
  animation: heroWidgetIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) both 0.35s;
  opacity: 0;
}

/* HR workflow strip on /hr/ dashboard (label + card grid) */
.hr-workflow-cards #quickActionsRow {
  display: block !important;
}

.hr-workflow-cards #quickActionsRow > .modules-grid {
  width: 100%;
}

.dashboard-widget-link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  opacity: 1;
  transition: transform 0.2s ease;
}
.dashboard-widget-link:hover .dashboard-widget {
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
  border-color: rgba(255, 142, 104, 0.14);
}
.dashboard-widget {
  background: #ffffff;
  background-color: #ffffff;
  opacity: 1;
  border-radius: 14px;
  box-shadow: none;
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition:
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.dashboard-widget-header {
  padding: 10px 14px 8px;
  background: #ffffff;
  background-color: #ffffff;
  opacity: 1;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.dashboard-widget-dots {
  display: flex;
  gap: 6px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.dashboard-widget-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d1d5db;
}

.dashboard-widget-bar {
  flex: 1;
  height: 28px;
  background: var(--border-light);
  border-radius: 8px;
}

.dashboard-widget-body {
  padding: 1.25rem;
}

.dashboard-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 1rem;
}

.dashboard-stat-card {
  background: #ffffff;
  background-color: #ffffff;
  opacity: 1;
  border-radius: 12px;
  padding: 1rem;
  border: 1px solid var(--border-light);
}

.dashboard-stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--border-light);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.dashboard-stat-icon svg {
  width: 18px;
  height: 18px;
}

.dashboard-stat-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;

  letter-spacing: 0.05em;
  color: var(--text-light);
  margin-bottom: 0.3rem;
  line-height: 1.3;
}

.dashboard-stat-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.2;
  white-space: nowrap;
}

.dashboard-activity {
  border-top: 1px solid var(--border-light);
  padding-top: 0.75rem;
}

.dashboard-activity-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-mid);
}

.dashboard-activity-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 142, 104, 0.12);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.dashboard-activity-text {
  flex: 1;
  min-width: 0;
}

.dashboard-activity-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.dashboard-activity-list .dashboard-activity-item {
  margin-top: 0.5rem;
}

/* Hero split + widget responsive */
@media (max-width: 1024px) {
  .hero-split .hero-content {
    flex-direction: column;
    gap: 2rem;
  }
  .hero-right {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
  }
  .hero::before,
  .hero::after {
    display: none;
  }
}

@media (max-width: 768px) {
  .hero-split .hero-content {
    flex-direction: column;
    gap: 1.25rem;
  }
  .hero-cta-row {
    display: flex;
    margin-top: 1.25rem;
  }
  .hero-right {
    width: 100%;
    max-width: 100%;
  }
  .dashboard-widget-body {
    padding: 0.875rem;
  }
  .dashboard-stats-grid {
    gap: 8px;
    margin-bottom: 0.75rem;
  }
  .dashboard-stat-card {
    padding: 0.75rem;
  }
  .dashboard-stat-value {
    font-size: 1.4rem;
  }
  .dashboard-stat-label {
    font-size: 0.65rem;
  }
}

@media (max-width: 480px) {
  .hero-cta-row {
    display: none;
  }
  .dashboard-activity {
    display: none;
  }
  .dashboard-stats-grid {
    gap: 6px !important;
  }
  .dashboard-stat-card {
    padding: 0.6rem 0.5rem !important;
  }
  .dashboard-stat-value {
    font-size: 1.2rem !important;
  }
  .dashboard-stat-icon {
    width: 26px !important;
    height: 26px !important;
    margin-bottom: 0.35rem !important;
  }
  .dashboard-stat-icon svg {
    width: 14px !important;
    height: 14px !important;
  }
}

/* ===========================================
 Module Cards — Simple + Modern
 =========================================== */

@keyframes dashboardModuleIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes heroReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.module-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #ef4444;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.45rem;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
  border: 2px solid white;
}

/* ---- Section ---- */
.modules-section {
  background: var(--bg-body, #f7f7f9);
  padding: 3rem 0 7rem;
  width: 100%;
  display: block !important;
  opacity: 0;
  margin-top: -3rem; /* Overlap hero for seamless gradient merge */
  transform: translateY(12px);
  animation: heroReveal 0.6s var(--ease-out) forwards 0.35s;
  position: relative;
}

/* Main dashboard: no hard seam where hero meets modules — transparent section
 sits above the hero so the gradient/grid continues under MODULES. */
body.page-dashboard .modules-section {
  background: transparent;
  z-index: 2;
}

.modules-section::before {
  display: none;
}

.modules-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 3rem;
}

.modules-section-label {
  font-size: 0.68rem;
  font-weight: 700;

  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.modules-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  width: 100%;
}

/* ---- Card ---- */
.module-card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  display: block !important;
  transition:
    transform 0.28s var(--ease-out),
    box-shadow 0.28s ease,
    border-color 0.28s ease;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.05),
    0 4px 12px rgba(0, 0, 0, 0.04);
  width: 100%;
  box-sizing: border-box;
  opacity: 1;
  transform: translateY(0);
}

.page-dashboard
  #modulesGrid.modules-grid--boot
  > .module-card:not([style*="display: none"]) {
  opacity: 0;
  transform: translateY(16px) scale(0.985);
}

.page-dashboard
  #modulesGrid.modules-grid--entrance-active
  > .module-card:not([style*="display: none"]) {
  animation: dashboardModuleIn 0.52s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--dd-stagger, 0ms);
}

@media (prefers-reduced-motion: reduce) {
  .page-dashboard
    #modulesGrid.modules-grid--boot
    > .module-card:not([style*="display: none"]),
  .page-dashboard
    #modulesGrid.modules-grid--entrance-active
    > .module-card:not([style*="display: none"]) {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
}

.module-card[style*="display: none"] {
  display: none !important;
}
.module-card:not([style*="display: none"]) {
  display: block !important;
}

/* Review History is revealed after load (visibility JS). */
.page-dashboard .modules-grid #module-review-history.module-card {
  background: var(--white);
  opacity: 1;
  transform: translateY(0);
  animation: none;
}

.module-card:hover {
  border-color: rgba(255, 142, 104, 0.32);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.07),
    0 12px 32px rgba(255, 142, 104, 0.09),
    0 0 0 1.5px rgba(255, 142, 104, 0.1);
  transform: translateY(-3px);
}

/* HR “Recent Submissions” — same surface as footer (no white floating slab) */
.hr-dashboard .submissions-panel.module-card {
  background: var(--bg-body) !important;
  box-shadow: none !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 12px;
}

.hr-dashboard .submissions-panel.module-card:hover {
  transform: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
  border-color: rgba(255, 142, 104, 0.14) !important;
}

.hr-dashboard .submissions-panel.module-card::before {
  display: none;
}

/* ---- Card Body ---- */
.card-body {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* ---- Icon (match hero stat tiles: neutral well + muted glyph; green on hover) ---- */
.module-icon {
  width: 48px;
  height: 48px;
  background: var(--border-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.1rem;
  transition:
    background 0.25s ease,
    transform 0.25s var(--ease-out);
  position: relative;
  flex-shrink: 0;
}

.module-icon svg {
  width: 22px;
  height: 22px;
  stroke: var(--text-muted);
  transition: stroke 0.2s ease;
}

.module-card:hover .module-icon {
  background: rgba(255, 142, 104, 0.1);
  transform: scale(1.06);
}

.module-card:hover .module-icon svg {
  stroke: var(--primary);
}

/* ---- Text ---- */
.module-number {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.1em;
  margin-bottom: 0.45rem;
  display: block;
}

.module-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
  color: var(--text-dark);
  letter-spacing: -0.02em;
  line-height: 1.3;
  transition: color 0.2s ease;
}

.module-card:hover .module-title {
  color: var(--primary);
}

.module-description {
  color: var(--text-light);
  font-size: 0.865rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
  flex: 1;
}

/* ---- CTA link ---- */
.module-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.8rem;
  transition: gap 0.22s var(--ease-out);
  margin-top: auto;
}

.module-arrow svg {
  width: 14px;
  height: 14px;
  transition: transform 0.22s var(--ease-out);
}

.module-card:hover .module-arrow {
  gap: 0.55rem;
}

.module-card:hover .module-arrow svg {
  transform: translateX(3px);
}

/* ===========================================
 Footer
 =========================================== */
.footer {
  background: var(--bg-body, #f7f7f9);
  margin-top: auto;
  flex-shrink: 0;
  position: relative;
  z-index: 5;
  border-top: none;
  box-shadow: none;
}

.footer::before {
  display: none;
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 2.5rem 1.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.footer-brand {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0;
}

.footer-tagline {
  display: none;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 2.25rem;
  margin-bottom: 0;
}

.footer-links a {
  font-family: var(--font-sans);
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--primary);
}

/* Copyright line — clean sans (~14px; reference: small muted gray) */
.footer-copy {
  font-family: var(--font-sans);
  font-size: 0.8125rem; /* 13px */
  font-weight: 400;
  color: #6b7280;
  letter-spacing: 0.01em;
  line-height: 1.5;
  margin: 0;
  padding: 0;
  border: none;
}

/* “Built by” name — Caveat (see --font-footer-author in design-tokens) */
.footer-built-by-name {
  display: inline-block;
  vertical-align: middle;
  font-family: var(--font-footer-author);
  font-size: 1.15em; /* scales with .footer-copy — Caveat reads large */
  font-weight: 600;
  color: var(--text-footer-author);
  margin-left: 0.35rem;
  letter-spacing: 0.02em;
  line-height: 1.15;
}

/* ===========================================
 Contact Modal
 =========================================== */
.contact-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 2000;
  align-items: flex-start;
  justify-content: center;
  padding: 20rem 2rem 2rem 2rem;
  overflow-y: auto;
  opacity: 0;
  animation: modalFadeIn 0.2s ease forwards;
}

.contact-modal.active {
  display: flex;
  opacity: 1;
}

.contact-modal.active .contact-modal-content {
  opacity: 1 !important;
  transform: translateY(0) !important;
  visibility: visible !important;
  animation: none !important;
  background: #ffffff !important;
}

@keyframes modalFadeIn {
  to {
    opacity: 1;
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.contact-modal-content {
  background: white;
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
  transform: translateY(16px);
  animation: modalSlideUp 0.3s var(--ease-out) forwards;
}

/* Contact modal — starts below top bar */
#contactModal.contact-modal {
  align-items: flex-start !important;
  justify-content: center !important;
  padding: 5rem 2rem 2rem !important;
}

/* Profile sheet — centered, with modest clearance below the nav */
#profileModal.contact-modal {
  align-items: center !important;
  justify-content: center !important;
  padding-top: max(
    4.5rem,
    calc(env(safe-area-inset-top, 0px) + 4.25rem + 0.75rem)
  ) !important;
  padding-right: 1.25rem !important;
  padding-bottom: max(
    2rem,
    calc(env(safe-area-inset-bottom, 0px) + 1.5rem)
  ) !important;
  padding-left: 1.25rem !important;
}

#profileModal .contact-modal-content {
  max-width: 500px;
  width: auto;
  padding: 1.75rem;
}

#profileModal .contact-modal-header {
  padding-bottom: 1.25rem;
  margin-bottom: 1rem;
}

#profileModal .contact-modal-header h2 {
  font-size: 1.5rem;
}

@keyframes modalSlideUp {
  to {
    transform: translateY(0);
  }
}

.contact-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.contact-modal-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
}

.contact-modal-close {
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  font-size: 1.25rem;
  color: var(--text-light);
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.contact-modal-close:hover {
  background: var(--border-color);
  color: var(--text-dark);
}

.contact-modal-info {
  display: grid;
  gap: 1rem;
}

.contact-modal-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--bg-light);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  transition: border-color 0.2s ease;
}

.contact-modal-item:hover {
  border-color: var(--border-color);
}

.contact-modal-icon {
  font-size: 1.75rem;
  flex-shrink: 0;
}

.contact-modal-details h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0 0 0.35rem 0;
}

.contact-modal-details p,
.contact-modal-details a {
  font-size: 0.9rem;
  color: var(--text-mid);
  text-decoration: none;
  margin: 0.15rem 0;
  display: block;
  line-height: 1.5;
}

.contact-modal-details a {
  color: var(--primary);
  font-weight: 500;
}

.contact-modal-details a:hover {
  text-decoration: underline;
}

.contact-modal-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* Contact Modal - compact spacing */
#contactModal .contact-modal-info {
  gap: 0.6rem;
}
#contactModal .contact-modal-item {
  padding: 0.75rem 1rem;
  gap: 0.75rem;
}
#contactModal .contact-modal-details h4 {
  margin: 0 0 0.2rem 0;
}
#contactModal .contact-modal-details p {
  margin: 0.05rem 0;
  line-height: 1.4;
}
#contactModal .contact-modal-details a {
  margin: 0.05rem 0;
  line-height: 1.4;
  display: inline;
}

/* ===========================================
 Form Styles
 =========================================== */
.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-dark);
  font-size: 0.9rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  background: white;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 142, 104, 0.08);
}

/* ===========================================
 Alerts
 =========================================== */
.alert {
  padding: 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.alert-danger {
  background-color: #fef2f2;
  color: #991b1b;
  border: 1px solid #fee2e2;
}

.alert-success {
  background-color: #f0fdf4;
  color: #166534;
  border: 1px solid #dcfce7;
}

/* ===========================================
 Buttons
 =========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1.5px solid transparent;
  font-size: 0.9rem;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-light);
  box-shadow: var(--shadow-md);
}

.btn-outline-primary {
  border-color: var(--primary);
  color: var(--primary);
  background: transparent;
}

.btn-outline-primary:hover:not(:disabled) {
  background: var(--primary);
  color: white;
}

.btn-outline-secondary {
  border-color: var(--border-color);
  color: var(--text-light);
  background: transparent;
}

.btn-outline-secondary:hover:not(:disabled) {
  background: var(--bg-light);
  border-color: #d1d5db;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===========================================
 Utility Classes
 =========================================== */
.mb-3 {
  margin-bottom: 1.5rem;
}

/* ===========================================
 Responsive - Nav collapse (show hamburger when nav would overlap welcome)
 =========================================== */
@media (max-width: 2500px) {
  .nav-container {
    padding: 0 1.5rem;
  }

  .nav-center {
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  /* Show hamburger as soon as resolution shrinks - nav goes to menu */
  .mobile-menu-toggle {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    border: none !important;
    background: transparent !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    padding: 0 !important;
    color: #374151 !important;
    box-shadow: none !important;
    transition:
      background 0.15s ease,
      color 0.15s ease !important;
  }

  .mobile-menu-toggle:hover {
    background: rgba(0, 0, 0, 0.04) !important;
    border: none !important;
    color: var(--primary) !important;
    box-shadow: none !important;
  }

  .mobile-menu-toggle:active,
  .mobile-menu-toggle.active {
    background: rgba(255, 142, 104, 0.08) !important;
    border: none !important;
    color: var(--primary) !important;
    box-shadow: none !important;
  }

  /* Hide nav-center menu in collapsed mode (links shown in drawer) */
  .nav-center .nav-menu {
    display: none !important;
  }

  /* Show drawer when collapsed (overlay shown via .active in its own rule) */
  .mobile-menu-drawer {
    display: block !important;
  }

  /* Slide-out menu drawer - right side, outside nav to avoid backdrop-filter containing block */
  .mobile-menu-drawer {
    position: fixed !important;
    top: 72px !important;
    right: 0 !important;
    left: auto !important;
    width: min(320px, 88vw) !important;
    max-width: 320px !important;
    height: calc(100vh - 72px) !important;
    height: calc(100dvh - 72px) !important;
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%) !important;
    box-shadow: none !important;
    padding: 0 !important;
    transform: translateX(105%) !important;
    transition:
      transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
      box-shadow 0.3s ease !important;
    z-index: 1200 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    border-left: 1px solid var(--border-color) !important;
    visibility: hidden !important;
  }

  .mobile-menu-drawer.active {
    transform: translateX(0) !important;
    box-shadow:
      -12px 0 40px rgba(0, 0, 0, 0.15),
      0 0 1px rgba(0, 0, 0, 0.08) !important;
    visibility: visible !important;
  }

  .mobile-menu-drawer-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0.5rem 0 !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .mobile-menu-drawer-list li {
    width: 100% !important;
    padding: 0 0.75rem !important;
    display: block !important;
    margin: 0.1rem 0 !important;
  }

  .mobile-menu-drawer-list .nav-submenu {
    position: static !important;
    min-width: 0 !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 10px !important;
    background: rgba(255, 142, 104, 0.04) !important;
    margin: 0.2rem 0 0.35rem 0 !important;
    padding: 0.25rem !important;
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
    pointer-events: auto !important;
    display: none !important;
  }

  .mobile-menu-drawer-list
    li.has-submenu.has-submitted-dropdown.open
    .nav-submenu {
    display: block !important;
  }

  .mobile-menu-drawer-list .nav-submenu li {
    padding: 0 !important;
    margin: 0 !important;
  }

  .mobile-menu-drawer-list .nav-submenu a {
    min-height: 42px !important;
    padding: 0.62rem 0.75rem !important;
    font-size: 0.86rem !important;
    border-radius: 8px !important;
    border-bottom: none !important;
    color: #0f5132 !important;
    background: #fff !important;
  }

  .mobile-menu-drawer-list li a,
  .mobile-menu-drawer-list a {
    display: flex !important;
    align-items: center !important;
    padding: 0.75rem 0.875rem !important;
    font-size: 0.925rem !important;
    font-weight: 500 !important;
    color: var(--text-dark) !important;
    border-bottom: none !important;
    border-radius: 10px !important;
    text-decoration: none !important;
    min-height: 48px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    transition:
      background 0.15s ease,
      color 0.15s ease !important;
  }

  .mobile-menu-drawer-list li a:hover,
  .mobile-menu-drawer-list a:hover {
    background: rgba(255, 142, 104, 0.06) !important;
    color: var(--primary) !important;
  }

  .mobile-menu-drawer-list li a:active,
  .mobile-menu-drawer-list a:active {
    background: rgba(255, 142, 104, 0.1) !important;
    color: var(--primary) !important;
  }

  .mobile-menu-drawer-list a.nav-current {
    color: var(--primary) !important;
    font-weight: 600 !important;
  }

  .mobile-menu-drawer-list li:first-child a {
    border-top: none !important;
  }

  /* Compact logo when hamburger is shown */
  .logo {
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }

  .logo img {
    height: 60px !important;
  }

  .logo-brand {
    font-size: 0.8rem !important;
  }

  /* Keep welcome text full size - do not shrink */
  .nav-welcome,
  #welcome-text {
    font-size: 1.08rem !important;
    font-weight: 600 !important;
    max-width: min(60vw, 520px) !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  /* Hamburger — three equal-weight bars (no ::before/::after subpixel skew) */
  .mobile-menu-toggle .mobile-menu-bars {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    gap: 5px !important;
    width: 18px !important;
  }
  .mobile-menu-toggle .mobile-menu-bars > span {
    display: block !important;
    width: 18px !important;
    height: 2px !important;
    min-height: 2px !important;
    max-height: 2px !important;
    border: 0 !important;
    border-radius: 1px !important;
    background: currentColor !important;
    box-shadow: none !important;
    transition:
      transform 0.25s ease,
      opacity 0.2s ease !important;
    transform-origin: center !important;
  }
  .mobile-menu-toggle .mobile-menu-bars > span::before,
  .mobile-menu-toggle .mobile-menu-bars > span::after {
    content: none !important;
    display: none !important;
  }
  .mobile-menu-toggle.active .mobile-menu-bars > span:nth-child(1) {
    transform: translateY(7px) rotate(45deg) !important;
  }
  .mobile-menu-toggle.active .mobile-menu-bars > span:nth-child(2) {
    opacity: 0 !important;
  }
  .mobile-menu-toggle.active .mobile-menu-bars > span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg) !important;
  }

  /* Backdrop overlay when menu is open (below drawer 1200, above page / steppers) */
  .mobile-overlay {
    display: none;
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1150;
    opacity: 0;
    transition: opacity 0.3s ease;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    pointer-events: none;
  }

  .mobile-overlay.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }
}

/* ===========================================
 Responsive - Tablet
 =========================================== */
@media (max-width: 1024px) {
  .nav-container {
    padding: 0 2rem;
  }

  .hero-split .hero-content {
    padding: 0 2rem;
  }

  .modules-inner {
    padding: 0 2rem;
  }

  .modules-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
  }

  .footer-inner {
    padding: 1.4rem 2rem;
  }
}

/* ===========================================
 Responsive - Mobile
 =========================================== */
@media (max-width: 768px) {
  .hero {
    padding: 7rem 0 4.5rem !important;
  }

  .hero-split .hero-content {
    padding: 0 1.25rem !important;
  }

  .hero-left {
    width: 100% !important;
    max-width: 100% !important;
  }

  .page-dashboard .hero-title {
    font-size: clamp(1.7rem, 6.5vw, 2.25rem) !important;
    letter-spacing: -0.03em !important;
  }

  .hero-subtitle {
    font-size: 0.9rem !important;
    margin-top: 1rem !important;
    line-height: 1.65 !important;
    max-width: 100% !important;
  }

  .hero-tagline {
    font-size: 0.65rem !important;
    padding: 0.35rem 0.75rem !important;
    margin-bottom: 0.875rem !important;
  }

  .contact-modal {
    padding: 6rem 1.25rem 1.5rem !important;
  }
  /* Profile fullscreen rules override this at ≤479px via later block */
  /* Profile: keep sheet shifted up on tablet/small laptop (≤768px) */
  #profileModal.contact-modal {
    align-items: flex-start !important;
    padding-top: max(
      0.35rem,
      calc(env(safe-area-inset-top, 0px) + 4.25rem + 6px)
    ) !important;
    padding-right: 1rem !important;
    padding-bottom: max(
      1rem,
      calc(env(safe-area-inset-bottom, 0px) + 0.75rem)
    ) !important;
    padding-left: 1rem !important;
    justify-content: center !important;
  }
  /* Clear fixed nav + notch (matches profile sheet inset) */
  #contactModal.contact-modal {
    padding: calc(env(safe-area-inset-top, 0px) + 4.5rem + 12px) 1rem 1.5rem !important;
    z-index: 10050 !important;
  }
  #contactModal.contact-modal.active {
    z-index: 10050 !important;
  }

  .modules-section {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    padding: 1.75rem 0 4.5rem !important;
    width: 100% !important;
    animation: none !important;
    transform: none !important;
  }

  .modules-inner {
    padding: 0 1.25rem !important;
  }

  .modules-grid {
    grid-template-columns: 1fr !important;
    gap: 0.625rem !important;
    display: grid !important;
    width: 100% !important;
  }

  /* Footer - mobile */
  .footer {
    margin-top: 0 !important;
  }

  .footer-inner {
    flex-direction: column !important;
    text-align: center !important;
    padding: 1.25rem 1.5rem max(1rem, env(safe-area-inset-bottom, 0px)) !important;
    gap: 0.85rem !important;
  }

  .footer-links {
    gap: 1.75rem !important;
  }

  /* Nav - mobile */
  .nav-container {
    padding: 0 1rem !important;
    gap: 0.5rem !important;
    height: 56px !important;
  }

  .nav-center {
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    overflow: visible !important;
    pointer-events: none !important;
  }

  .nav-center .nav-menu {
    pointer-events: auto !important;
  }

  .logo {
    flex: 1 1 auto !important;
    gap: 0.85rem !important;
    min-width: 0 !important;
  }

  .logo img {
    height: 48px !important;
    width: auto !important;
  }

  .logo img.logo-img-official {
    height: 32px !important;
    width: 32px !important;
    border-radius: 7px;
  }

  .logo-brand {
    font-size: 0.65rem !important;
  }

  .nav-welcome,
  #welcome-text {
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: var(--text-dark) !important;
    white-space: nowrap !important;
    max-width: min(38vw, 260px) !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .nav-right {
    flex: 0 0 auto !important;
    gap: 0.3rem !important;
  }

  /* Save Draft: icon-only on tablet/mobile to save space */
  .nav-save-draft-btn span {
    display: none !important;
  }
  .nav-save-draft-btn {
    padding: 0 !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    justify-content: center !important;
    margin-right: 0 !important;
    border-radius: 8px !important;
    background: #fff !important;
    border: 1px solid rgba(55, 65, 81, 0.18) !important;
    color: var(--text-dark) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
  }

  .notification-btn {
    width: 34px !important;
    height: 34px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    background: #fff !important;
    color: var(--text-dark) !important;
    border: 1px solid rgba(55, 65, 81, 0.18) !important;
    min-width: 34px !important;
    min-height: 34px !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
  }

  .notification-btn svg {
    width: 18px !important;
    height: 18px !important;
  }

  .notification-btn:hover {
    background: var(--border-light) !important;
  }

  #pwa-install-btn.pwa-nav-icon {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    padding: 0 !important;
    background: #fff !important;
    border: 1px solid rgba(55, 65, 81, 0.18) !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
  }

  #pwa-install-btn.pwa-nav-icon:hover {
    background: var(--border-light) !important;
  }

  /* Drawer position at 768px (nav height 56px) */
  .mobile-menu-drawer {
    top: 56px !important;
    height: calc(100vh - 56px) !important;
    height: calc(100dvh - 56px) !important;
  }

  .mobile-overlay {
    top: 56px !important;
  }

  .nav-menu li a,
  .nav-menu a {
    display: flex !important;
    align-items: center !important;
    padding: 0.9rem 1.25rem !important;
    border-radius: 0 !important;
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    color: var(--text-dark) !important;
    border-bottom: 1px solid var(--border-light) !important;
    text-decoration: none !important;
    min-height: 48px !important;
    white-space: normal !important;
    width: 100% !important;
    box-sizing: border-box !important;
    transition:
      background 0.15s ease,
      color 0.15s ease !important;
  }

  /* Keep current-route green when responsive rules force default link colours */
  .nav-menu a.nav-current {
    color: var(--primary) !important;
    font-weight: 600 !important;
  }

  .nav-menu li a:active,
  .nav-menu a:active {
    background: rgba(255, 142, 104, 0.08) !important;
  }

  .nav-menu a:hover {
    background: var(--bg-light) !important;
  }

  .nav-menu li[style*="display: none"] {
    display: none !important;
  }

  /* Hamburger — plain icon, no card chrome */
  .mobile-menu-toggle {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    border: none !important;
    background: transparent !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    cursor: pointer !important;
    padding: 0 !important;
    color: #374151 !important;
    transition:
      background 0.15s ease,
      color 0.15s ease !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .mobile-menu-toggle:hover {
    background: rgba(0, 0, 0, 0.04) !important;
    color: var(--primary) !important;
    box-shadow: none !important;
  }

  .mobile-menu-toggle:active {
    background: rgba(255, 142, 104, 0.08) !important;
    color: var(--primary) !important;
    box-shadow: none !important;
  }

  .mobile-menu-toggle .mobile-menu-bars {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    gap: 5px !important;
    width: 18px !important;
  }
  .mobile-menu-toggle .mobile-menu-bars > span {
    display: block !important;
    width: 18px !important;
    height: 2px !important;
    min-height: 2px !important;
    max-height: 2px !important;
    border: 0 !important;
    border-radius: 1px !important;
    background: currentColor !important;
    box-shadow: none !important;
    transition:
      transform 0.25s ease,
      opacity 0.2s ease !important;
    transform-origin: center !important;
  }
  .mobile-menu-toggle .mobile-menu-bars > span::before,
  .mobile-menu-toggle .mobile-menu-bars > span::after {
    content: none !important;
    display: none !important;
  }
  .mobile-menu-toggle.active .mobile-menu-bars > span:nth-child(1) {
    transform: translateY(7px) rotate(45deg) !important;
  }
  .mobile-menu-toggle.active .mobile-menu-bars > span:nth-child(2) {
    opacity: 0 !important;
  }
  .mobile-menu-toggle.active .mobile-menu-bars > span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg) !important;
  }

  /* Mobile overlay — same stack as collapsed-nav overlay (below drawer 1200) */
  .mobile-overlay {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1150;
    opacity: 0;
    transition: opacity 0.3s ease;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
  }

  .mobile-overlay.active {
    display: block;
    opacity: 1;
  }

  /* Logout - compact on mobile */
  .logout-btn {
    font-size: 0.8rem !important;
    padding: 0 !important;
    min-height: 34px !important;
    min-width: 34px !important;
    width: 34px !important;
    height: 34px !important;
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    background: var(--primary) !important;
    border: 1px solid var(--primary) !important;
    color: #fff !important;
    box-shadow: 0 1px 2px rgba(255, 142, 104, 0.2) !important;
  }

  .logout-btn svg {
    width: 18px !important;
    height: 18px !important;
  }

  .logout-btn span {
    display: none !important;
  }

  /* Module cards - compact grid on mobile.
 card-body is display:contents so its children become direct grid items.
 Must match specificity of base .module-card:not([style*="display: none"]) rule. */
  .module-card:not([style*="display: none"]) {
    display: grid !important;
  }

  .module-card {
    padding: 0.875rem 1rem !important;
    margin-bottom: 0 !important;
    min-height: 72px !important;
    grid-template-columns: 46px 1fr 34px !important;
    grid-template-rows: auto auto !important;
    gap: 0.1rem 0.75rem !important;
    align-items: center !important;
    border-radius: var(--radius-md) !important;
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    transition:
      background 0.15s ease,
      box-shadow 0.15s ease !important;
  }

  .module-card .card-body {
    display: contents !important;
  }

  .module-card:active {
    transform: scale(0.985) !important;
    transition: transform 0.1s ease !important;
    background: rgba(255, 142, 104, 0.02) !important;
  }

  .module-card .module-number {
    display: none !important;
  }

  .module-card .module-icon {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    font-size: 1.15rem !important;
    margin-bottom: 0 !important;
    grid-column: 1 !important;
    grid-row: 1 / -1 !important;
    align-self: center !important;
    justify-self: center !important;
    border-radius: 12px !important;
    background: var(--border-light) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .module-card .module-title {
    font-size: 0.88rem !important;
    font-weight: 600 !important;
    margin-bottom: 0 !important;
    line-height: 1.25 !important;
    grid-column: 2 !important;
    grid-row: 1 !important;
    align-self: end !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    color: var(--text-dark) !important;
  }

  .module-card .module-arrow {
    font-size: 0 !important;
    margin-top: 0 !important;
    grid-column: 3 !important;
    grid-row: 1 / -1 !important;
    align-self: center !important;
    justify-self: center !important;
    padding: 0 !important;
    color: var(--primary) !important;
    background: var(--border-light) !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    flex-shrink: 0 !important;
  }

  .module-card .module-arrow svg {
    width: 16px !important;
    height: 16px !important;
  }

  .module-card .module-description {
    font-size: 0.76rem !important;
    line-height: 1.4 !important;
    margin-bottom: 0 !important;
    grid-column: 2 !important;
    grid-row: 2 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 1 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    color: var(--text-light) !important;
    align-self: start !important;
  }

  /* Notification dropdown full width on mobile */
  .notification-dropdown {
    left: 1rem !important;
    right: 1rem !important;
    width: auto !important;
    max-width: none !important;
  }
}

/* ===========================================
 Responsive - Phone (logo-only navbar zone)
 =========================================== */
@media (max-width: 600px) {
  /* Hide welcome text + brand label — logo image alone at phone widths */
  .nav-welcome,
  #welcome-text,
  .logo-brand,
  .logo-text {
    display: none !important;
  }

  .nav-container {
    height: 64px !important;
    padding: 0 1rem !important;
  }

  .logo img {
    height: 60px !important;
    width: auto !important;
    border-radius: 0 !important;
  }

  .mobile-menu-drawer {
    top: 64px !important;
    height: calc(100vh - 64px) !important;
    height: calc(100dvh - 64px) !important;
  }

  .mobile-overlay {
    top: 64px !important;
  }

  /* Logout: icon-only, compact */
  .logout-btn span {
    display: none !important;
  }
  .logout-btn {
    padding: 0 !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    justify-content: center !important;
    border-radius: 7px !important;
  }
  .logout-btn svg {
    width: 16px !important;
    height: 16px !important;
  }
}

/* ===========================================
 Responsive - Small Mobile
 =========================================== */
@media (max-width: 480px) {
  .hero {
    padding: 6.5rem 0 4rem !important;
  }

  .hero-split .hero-content {
    padding: 0 1rem !important;
    gap: 1rem !important;
  }

  .page-dashboard .hero-title {
    font-size: clamp(1.55rem, 7vw, 1.85rem) !important;
    line-height: 1.15 !important;
    letter-spacing: -0.03em !important;
  }

  .hero-subtitle {
    font-size: 0.855rem !important;
    margin-top: 0.75rem !important;
    line-height: 1.6 !important;
    max-width: none !important;
  }

  .hero-tagline {
    font-size: 0.6rem !important;
    padding: 0.3rem 0.65rem !important;
    margin-bottom: 0.75rem !important;
  }

  .modules-grid {
    gap: 0.5rem !important;
  }

  .modules-section-label {
    font-size: 0.62rem !important;
    margin-bottom: 1rem !important;
  }

  .footer-inner {
    padding: 1.2rem 1.25rem max(1rem, env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Keep flush with modules — spacing comes from .modules-section padding; margin here
 left a strip that on hosted iOS/PWA often read as solid black (unpainted html canvas). */
  .footer {
    margin-top: 0 !important;
  }

  .nav-container {
    padding: 0 0.875rem !important;
    height: 64px !important;
  }

  .logo {
    gap: 0.5rem !important;
  }

  .logo img {
    height: 56px !important;
    width: auto !important;
  }

  /* Hide welcome text + brand label — logo image alone identifies the app on small phones */
  .nav-welcome,
  #welcome-text,
  .logo-brand,
  .logo-text {
    display: none !important;
  }

  /* Logout: icon-only to save space */
  .logout-btn span {
    display: none !important;
  }
  .logout-btn {
    padding: 0 !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    justify-content: center !important;
    border-radius: 7px !important;
  }
  .logout-btn svg {
    width: 16px !important;
    height: 16px !important;
  }

  .mobile-menu-drawer {
    top: 64px !important;
    height: calc(100vh - 64px) !important;
    height: calc(100dvh - 64px) !important;
  }

  .mobile-overlay {
    top: 64px !important;
  }

  .module-card {
    padding: 0.875rem 1rem !important;
    border-radius: 12px !important;
    grid-template-columns: 40px 1fr auto !important;
    gap: 0.15rem 0.75rem !important;
  }

  .module-card .module-icon {
    width: 40px !important;
    height: 40px !important;
    font-size: 1.1rem !important;
    border-radius: 10px !important;
  }

  .module-card .module-title {
    font-size: 0.9rem !important;
    font-weight: 600 !important;
  }

  /* Allow 2 lines of description on small phones — 1 line is too little context */
  .module-card .module-description {
    font-size: 0.775rem !important;
    -webkit-line-clamp: 2 !important;
  }

  .module-card .module-arrow {
    width: 30px !important;
    height: 30px !important;
  }

  .module-card .module-arrow svg {
    width: 14px !important;
    height: 14px !important;
  }

  .module-card:active {
    transform: scale(0.975) !important;
    transition: transform 0.1s ease !important;
  }
}

/* ===========================================
 Responsive - Very Small Mobile (≤375px)
 =========================================== */
@media (max-width: 375px) {
  .hero {
    padding: 4.75rem 0 1rem !important;
  }

  .hero-split .hero-content {
    padding: 0 0.875rem !important;
    gap: 0.875rem !important;
  }

  .page-dashboard .hero-title {
    font-size: clamp(1.45rem, 8vw, 1.7rem) !important;
  }

  .hero-subtitle {
    font-size: 0.825rem !important;
  }

  .modules-inner {
    padding: 0 0.875rem !important;
  }

  .module-card {
    grid-template-columns: 36px 1fr auto !important;
    gap: 0.1rem 0.55rem !important;
    padding: 0.7rem 0.8rem !important;
  }

  .module-card .module-icon {
    width: 36px !important;
    height: 36px !important;
    border-radius: 8px !important;
  }

  .module-card .module-title {
    font-size: 0.85rem !important;
  }

  .module-card .module-arrow {
    width: 26px !important;
    height: 26px !important;
  }

  .dashboard-stats-grid {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* ===========================================
 Profile Modal Enhancements
 =========================================== */

#profileModal .contact-modal-content {
  padding: 0 !important;
  max-width: min(720px, calc(100vw - 1.5rem));
  border-radius: var(--radius-xl);
  /* Scroll lives in .pro-tab-panels; shell clips to radius */
  overflow: hidden;
  background: white;
  min-height: 0;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
}

#profileModal .contact-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 20;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

#profileModal .contact-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

#profileModal #profileContent {
  padding: 0;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
  font-family: var(--font-sans);
}

/* Keep profile fields / chips / buttons on the same radius + typeface */
#profileModal .pro-container,
#profileModal .pro-container input,
#profileModal .pro-container select,
#profileModal .pro-container textarea,
#profileModal .pro-container button {
  font-family: var(--font-sans) !important;
}

#profileModal .pro-info-item,
#profileModal .pro-profile-edit,
#profileModal .pro-modules-wrap,
#profileModal .pro-module-badge,
#profileModal .pro-btn,
#profileModal .pro-tab,
#profileModal .pro-profile-edit input[type="text"],
#profileModal .pro-profile-edit input[type="date"] {
  border-radius: 10px !important;
}

/* Profile Modal Container - shared across all modules */
.contact-modal-content.profile-modal-container {
  max-width: min(720px, calc(100vw - 1.5rem)) !important;
  width: min(720px, calc(100vw - 1.5rem)) !important;
  min-width: min(300px, 100%);
  padding: 0 !important;
  border-radius: 20px !important;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
  /* Fill space below fixed nav + overlay padding; tab body scrolls inside */
  max-height: min(
    92vh,
    calc(
      100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) -
        6rem
    )
  );
  min-height: 0;
  display: flex;
  flex-direction: column;
  -webkit-overflow-scrolling: touch;
  margin-top: 0;
}

@media (max-width: 479px) {
  /* Above .nav (1000), .mobile-menu-drawer / overlays (≤1200); keeps profile sheet off the nav bar */
  #profileModal.contact-modal {
    padding: 0 !important;
    z-index: 10050 !important;
  }
  #profileModal.contact-modal.active {
    z-index: 10050 !important;
  }
  .contact-modal-content.profile-modal-container {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: calc(env(safe-area-inset-top, 0px) + 4.25rem + 4px) !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    -webkit-overflow-scrolling: touch;
  }
  #profileModal #profileContent {
    flex: 1 !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }
  #profileModal .contact-modal-close {
    top: 0.5rem !important;
    right: 0.75rem !important;
    width: 36px !important;
    height: 36px !important;
    font-size: 1.25rem !important;
  }
}

/* Profile Modal Responsive (non-fullscreen card widths only; fullscreen profile uses .profile-modal-container rules above) */
@media (max-width: 520px) {
  #profileModal .contact-modal-content:not(.profile-modal-container) {
    max-width: 100%;
    margin: 0.5rem;
    border-radius: var(--radius-lg);
    max-height: 95vh;
    overflow-y: auto;
  }
}

/* ===========================================
 Notification Bell & Dropdown
 =========================================== */

.pwa-install-slot {
  display: contents;
}

#pwa-install-btn.pwa-nav-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-mid);
  transition: all 0.15s ease;
  position: static;
  box-shadow: none;
  animation: none;
}

#pwa-install-btn.pwa-nav-icon:hover {
  background: var(--bg-light);
  color: var(--primary);
}

#pwa-install-btn.pwa-nav-icon svg {
  width: 22px;
  height: 22px;
}

.notification-wrapper {
  position: relative;
  flex-shrink: 0;
}

.notification-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.15s ease;
  color: var(--text-mid);
}

.notification-btn:hover {
  background: var(--bg-light);
}

.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #ef4444;
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 2px solid white;
}

.notification-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-height: 480px;
  background: white;
  border-radius: var(--radius-md);
  box-shadow:
    var(--shadow-lg),
    0 0 0 1px rgba(0, 0, 0, 0.05);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.98);
  transition: all 0.2s var(--ease-out);
  z-index: 1001;
  overflow: hidden;
}

.notification-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.notification-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notification-header h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0;
}

.mark-all-read {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: background 0.15s;
}

.mark-all-read:hover {
  background: rgba(255, 142, 104, 0.06);
}

.notification-list {
  max-height: 380px;
  overflow-y: auto;
}

.notification-item {
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  gap: 0.75rem;
}

.notification-item:hover {
  background: var(--bg-light);
}

.notification-item.unread {
  background: #fef2f2;
}

.notification-item.unread:hover {
  background: #fee2e2;
}

.notification-item.priority {
  border-left: 3px solid #dc2626;
}

.notification-priority-badge {
  display: inline-block;
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fca5a5;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 0.65rem;
  font-weight: 700;

  letter-spacing: 0.03em;
  margin-right: 6px;
  vertical-align: middle;
}

.notification-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
}

.notification-icon.approved {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.notification-icon.rejected {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

.notification-icon.priority {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: white;
}

.notification-icon.info {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-dark);
  margin-bottom: 0.15rem;
}

.notification-message {
  font-size: 0.75rem;
  color: var(--text-light);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notification-time {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.notification-empty {
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.notification-empty::before {
  content: "🔔";
  display: block;
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.4;
}

/* Mobile notifications */
@media (max-width: 480px) {
  .notification-dropdown {
    position: fixed;
    top: 60px;
    right: 10px;
    left: 10px;
    width: auto;
  }
}

/* ===========================================
 Global nav — To-do floating panel (main_navbar, no overlay)
 =========================================== */
.todo-nav-wrapper {
  position: relative;
  flex-shrink: 0;
}

.todo-nav-btn .todo-nav-badge {
  background: var(--primary, #ff8e68);
  border-color: #fff;
}

.todo-panel-pop {
  --todo-accent: #ff8e68;
  --todo-accent-hover: #0f402a;
  --todo-surface: #f8fafc;
  --todo-border: #e2e8f0;
  --todo-border-soft: #f1f5f9;

  position: fixed;
  top: calc(5.5rem + 10px);
  right: max(16px, env(safe-area-inset-right));
  width: min(384px, calc(100vw - 24px));
  z-index: 1005;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease,
    visibility 0.22s;
}

.todo-panel-pop.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.todo-panel-inner {
  background: #fff;
  border-radius: 14px;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.06),
    0 20px 40px -12px rgba(15, 23, 42, 0.14),
    0 0 0 1px rgba(15, 23, 42, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: min(70vh, 520px);
}

.todo-panel-head {
  padding: 0.875rem 1.125rem;
  border-bottom: 1px solid var(--todo-border-soft);
  flex-shrink: 0;
  background: linear-gradient(180deg, #fafbfc 0%, #f4f6f8 100%);
}

.todo-panel-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.todo-panel-sub {
  font-size: 0.72rem;
  color: #64748b;
  margin: 0.35rem 0 0;
  display: block;
  letter-spacing: 0.01em;
}

.todo-panel-body {
  padding: 1rem 1.125rem 1rem;
  overflow-y: auto;
  min-height: 0;
  flex: 1;
}

.todo-composer {
  margin-bottom: 0.875rem;
}

.todo-input-row {
  display: flex;
  align-items: stretch;
  gap: 0.625rem;
  margin-bottom: 0;
}

.todo-remind-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-top: 0.875rem;
  padding-top: 0.875rem;
  border-top: 1px solid var(--todo-border-soft);
}

.todo-remind-label {
  flex: 0 0 auto;
  font-size: 0.6875rem;
  font-weight: 700;

  letter-spacing: 0.06em;
  color: #64748b;
  white-space: nowrap;
}

.todo-remind-input {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.6rem;
  font-size: 0.8125rem;
  border: 1px solid var(--todo-border);
  border-radius: 8px;
  font-family: inherit;
  color: #334155;
  background: #fff;
  color-scheme: light;
}

.todo-remind-input:focus {
  outline: none;
  border-color: var(--todo-accent);
  box-shadow: 0 0 0 3px rgba(255, 142, 104, 0.12);
}

.todo-new-input {
  flex: 1;
  min-width: 0;
  padding: 0.625rem 0.875rem;
  font-size: 0.9rem;
  border: 1px solid var(--todo-border);
  border-radius: 10px;
  font-family: inherit;
  background: #fff;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.todo-new-input::placeholder {
  color: #94a3b8;
}

.todo-new-input:focus {
  outline: none;
  border-color: var(--todo-accent);
  box-shadow: 0 0 0 3px rgba(255, 142, 104, 0.1);
}

.todo-add-btn {
  padding: 0.625rem 1.125rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: var(--todo-accent);
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background 0.15s ease,
    transform 0.1s ease;
}

.todo-add-btn:hover {
  background: var(--todo-accent-hover);
}

.todo-add-btn:active {
  transform: scale(0.98);
}

.todo-list {
  list-style: none;
  margin: 0;
  padding: 0.25rem;
  border: 1px solid var(--todo-border-soft);
  border-radius: 10px;
  background: var(--todo-surface);
}

.todo-item {
  padding: 0.5rem 0.45rem;
  border-bottom: 1px solid #e8edf2;
  font-size: 0.875rem;
}

.todo-item:last-child {
  border-bottom: none;
}

.todo-item-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-width: 0;
}

.todo-item-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
  cursor: pointer;
  margin: 0;
}

.todo-item-remind {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--todo-accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  max-width: 38%;
}

@media (max-width: 380px) {
  .todo-item-remind {
    max-width: 32%;
    font-size: 0.65rem;
  }
}

.todo-item-remind--overdue {
  color: #dc2626;
}

.todo-item--done .todo-item-remind {
  color: #94a3b8;
  text-decoration: line-through;
}

.todo-item-check {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  accent-color: var(--todo-accent);
  cursor: pointer;
}

.todo-item-text {
  flex: 1;
  min-width: 0;
  line-height: 1.4;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.todo-item--done .todo-item-text {
  text-decoration: line-through;
  color: #94a3b8;
}

.todo-item-delete {
  flex-shrink: 0;
  align-self: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
  transition:
    color 0.15s,
    background 0.15s;
}

.todo-item-delete:hover {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.07);
}

.todo-empty-li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.todo-empty {
  display: block;
  padding: 1.35rem 0.75rem;
  text-align: center;
  font-size: 0.8125rem;
  color: #94a3b8;
}

.todo-modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.625rem;
  padding-top: 0.625rem;
  border-top: 1px solid var(--todo-border-soft);
}

.todo-clear-done {
  background: none;
  border: none;
  color: var(--todo-accent);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  transition:
    background 0.15s,
    color 0.15s;
}

.todo-clear-done:hover {
  background: rgba(255, 142, 104, 0.09);
  color: var(--todo-accent-hover);
}

@media (max-width: 640px) {
  .todo-panel-pop {
    top: calc(5.5rem + 8px);
    right: 10px;
    left: 10px;
    width: auto;
  }
}

/* HR submitted-request banner (?edit=) — Download PDF */
.submission-view-pdf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.52rem 1.1rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff !important;
  text-decoration: none !important;
  border: none;
  background: var(--primary, #ff8e68);
  box-shadow: 0 2px 8px rgba(255, 142, 104, 0.22);
  transition:
    background 0.18s ease,
    box-shadow 0.18s ease;
}
.submission-view-pdf-btn:hover {
  background: var(--primary-dark, #e05f36);
  box-shadow: 0 3px 12px rgba(255, 142, 104, 0.28);
  color: #fff !important;
}

/* Password policy banners (temp remind / 65-day expiry warn) */
.password-policy-banner {
  max-width: 1120px;
  margin: 0 auto 1rem;
  padding: 0.85rem 1.15rem;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.password-policy-banner[hidden] {
  display: none !important;
}
.password-policy-banner.warn {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fdba74;
}
.password-policy-banner.remind {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #93c5fd;
}
.password-policy-banner .ppb-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}
.password-policy-banner .ppb-btn {
  appearance: none;
  border: none;
  border-radius: 8px;
  padding: 0.4rem 0.85rem;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  background: #ff8e68;
  color: #fff;
}
.password-policy-banner .ppb-btn:hover {
  background: #e05f36;
}
