/* ============================================================
   Marine Recruitment CRM — Global Design System v2
   "Deep Sea" — Ocean Green / Teal / Aqua — Glassmorphism
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Manrope:wght@600;700;800&display=swap');

/* ─── CSS Custom Properties ─────────────────────────────────── */
:root {
  /* Colors — Dark Mode (default) : "Deep Sea" */
  --bg-primary: #06141F;
  --bg-secondary: #0A1F30;
  --bg-card: #0D2436;
  --bg-card-hover: #123049;
  --bg-sidebar: #051220;
  --bg-input: #0A1F30;
  --bg-elevated: #112240;
  --bg-subtle: rgba(255, 255, 255, 0.03);

  --border-color: rgba(94, 234, 212, 0.10);
  --border-focus: rgba(45, 212, 191, 0.55);

  --text-primary: #E7F6F2;
  --text-secondary: #8FB4B0;
  --text-muted: #4C6B6E;
  --text-inverse: #06141F;

  /* Brand Accent — Teal / Aqua */
  --accent-primary: #14B8A6;
  --accent-hover: #0D9488;
  --accent-light: rgba(20, 184, 166, 0.12);
  --accent-glow: 0 0 22px rgba(45, 212, 191, 0.35);
  --accent-aqua: #22D3EE;
  --accent-aqua-light: rgba(34, 211, 238, 0.12);
  --accent-gold: #F2C572;

  /* Status Colors (ocean-shifted) */
  --green: #34D399;
  --green-light: rgba(52, 211, 153, 0.12);
  --yellow: #F2C572;
  --yellow-light: rgba(242, 197, 114, 0.12);
  --red: #F87171;
  --red-light: rgba(248, 113, 113, 0.14);
  --blue: #22D3EE;
  --blue-light: rgba(34, 211, 238, 0.12);
  --purple: #A78BFA;
  --purple-light: rgba(167, 139, 250, 0.12);

  /* Sidebar */
  --sidebar-width: 260px;
  --sidebar-collapsed: 76px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 10, 20, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 34px rgba(0, 10, 20, 0.55), 0 4px 14px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 0 0 1px rgba(94, 234, 212, 0.06), 0 4px 24px rgba(0, 8, 16, 0.45);
  --shadow-glow-teal: 0 8px 30px rgba(20, 184, 166, 0.18);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 26px;

  /* Transitions */
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-sidebar: 300ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Glass */
  --glass-bg: rgba(13, 36, 54, 0.55);
  --glass-border: rgba(148, 226, 213, 0.14);
  --glass-blur: 18px;
}

/* Light Mode — "Sunlit Shallows" */
[data-theme="light"] {
  --bg-primary: #EAF7F5;
  --bg-secondary: #F5FCFB;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F2FBFA;
  --bg-sidebar: #062B2A;
  --bg-input: #F4FAF9;
  --bg-elevated: #F2FBFA;
  --bg-subtle: rgba(6, 60, 56, 0.04);

  --border-color: rgba(6, 60, 56, 0.10);
  --border-focus: rgba(13, 148, 136, 0.5);

  --text-primary: #0B2B2A;
  --text-secondary: #4B6E6B;
  --text-muted: #8AA6A3;
  --text-inverse: #FFFFFF;

  --accent-primary: #0D9488;
  --accent-hover: #0F766E;
  --accent-light: rgba(13, 148, 136, 0.10);
  --accent-aqua: #0891B2;
  --accent-aqua-light: rgba(8, 145, 178, 0.10);

  --green-light: rgba(16, 150, 105, 0.10);
  --yellow-light: rgba(217, 155, 24, 0.12);
  --red-light: rgba(220, 68, 68, 0.10);
  --blue-light: rgba(8, 145, 178, 0.10);
  --purple-light: rgba(124, 58, 237, 0.10);

  --shadow-card: 0 0 0 1px rgba(6, 60, 56, 0.06), 0 4px 20px rgba(6, 60, 56, 0.08);
  --glass-bg: rgba(255, 255, 255, 0.6);
  --glass-border: rgba(6, 60, 56, 0.10);
}

/* ─── Reset & Base ───────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
  min-height: 100vh;
  transition: background-color var(--transition-slow), color var(--transition-slow);
}

/* Every element gets a smooth theme-swap transition, without fighting hover transforms */
body, .card, .stat-card, .chart-card, .sidebar, .navbar, .table, .modal,
.form-control, .btn, .badge, .quick-action-card, .followup-item,
.card-glass, .login-card {
  transition: background-color var(--transition-slow), border-color var(--transition-slow), color var(--transition-slow), box-shadow var(--transition-slow), transform var(--transition), width var(--transition-sidebar), margin-left var(--transition-sidebar);
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-aqua);
}

img {
  max-width: 100%;
}

button {
  cursor: pointer;
  font-family: inherit;
}

input,
select,
textarea {
  font-family: inherit;
}

/* ─── Typography ─────────────────────────────────────────────── */
h1 {
  font-family: 'Manrope', 'Inter', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

h2 {
  font-family: 'Manrope', 'Inter', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.35;
}

h3 {
  font-size: 1.15rem;
  font-weight: 600;
}

h4 {
  font-size: 1rem;
  font-weight: 600;
}

p {
  color: var(--text-secondary);
}

/* ─── Layout Shell ───────────────────────────────────────────── */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* prevent body scroll when mobile drawer open */
body.no-scroll {
  overflow: hidden;
}

/* ================================================================
   OCEAN AMBIENT BACKGROUND
   Fixed, decorative, behind all content (z-index 0), pointer-events none.
   Populated by /public/js/components/ocean-bg.js
   ================================================================ */
#ocean-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 60% at 15% 90%, rgba(20, 184, 166, 0.10) 0%, transparent 60%),
    radial-gradient(ellipse 70% 55% at 85% 10%, rgba(34, 211, 238, 0.08) 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

[data-theme="light"] #ocean-bg {
  background:
    radial-gradient(ellipse 90% 60% at 15% 90%, rgba(13, 148, 136, 0.10) 0%, transparent 60%),
    radial-gradient(ellipse 70% 55% at 85% 10%, rgba(8, 145, 178, 0.08) 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

#ocean-bg canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ocean-wave-layer {
  position: absolute;
  left: -10%;
  width: 120%;
  height: 180px;
  bottom: -60px;
  background-repeat: repeat-x;
  background-size: 1200px 180px;
  opacity: 0.5;
  will-change: transform;
}

.ocean-wave-layer.wave-1 {
  bottom: -70px;
  opacity: 0.35;
  animation: waveDrift 26s linear infinite;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='180' viewBox='0 0 1200 180'%3E%3Cpath d='M0 90 C 150 30, 350 30, 600 90 C 850 150, 1050 150, 1200 90 L1200 180 L0 180 Z' fill='%2314B8A6' fill-opacity='0.25'/%3E%3C/svg%3E");
}

.ocean-wave-layer.wave-2 {
  bottom: -50px;
  opacity: 0.28;
  animation: waveDrift 18s linear infinite reverse;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='180' viewBox='0 0 1200 180'%3E%3Cpath d='M0 100 C 200 40, 400 150, 600 100 C 800 50, 1000 150, 1200 100 L1200 180 L0 180 Z' fill='%2322D3EE' fill-opacity='0.18'/%3E%3C/svg%3E");
}

.ocean-wave-layer.wave-3 {
  bottom: -30px;
  opacity: 0.2;
  animation: waveDrift 34s linear infinite;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='180' viewBox='0 0 1200 180'%3E%3Cpath d='M0 110 C 250 60, 450 160, 700 110 C 900 70, 1050 140, 1200 110 L1200 180 L0 180 Z' fill='%230D9488' fill-opacity='0.2'/%3E%3C/svg%3E");
}

@keyframes waveDrift {
  from { background-position-x: 0; }
  to   { background-position-x: -1200px; }
}

.ocean-boat {
  position: absolute;
  bottom: 68px;
  left: -8%;
  font-size: 34px;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.35));
  animation: boatSail 48s linear infinite, boatBob 4s ease-in-out infinite;
  opacity: 0.85;
}

@keyframes boatSail {
  from { left: -8%; }
  to   { left: 108%; }
}

@keyframes boatBob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%      { transform: translateY(-6px) rotate(2deg); }
}

@media (prefers-reduced-motion: reduce) {
  .ocean-wave-layer, .ocean-boat, .skeleton, .pipeline-dot, .sidebar-logo .logo-icon,
  .stat-card::after {
    animation: none !important;
  }
}

@media (max-width: 768px) {
  .ocean-boat { display: none; }
}

/* ================================================================
   CUSTOM CURSOR
   Applied by /public/js/components/cursor.js on non-touch desktop only.
   ================================================================ */
body.custom-cursor-active,
body.custom-cursor-active * {
  cursor: none !important;
}

.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 10050;   /* was 9999 — now above .wsd-overlay/.emf-overlay's 10000 */
  border-radius: 50%;
  will-change: transform;
  transform: translate(-50%, -50%);
}

.cursor-dot {
  width: 7px;
  height: 7px;
  background: var(--accent-aqua);
  box-shadow: 0 0 8px 2px rgba(34, 211, 238, 0.7);
}

.cursor-ring {
  width: 34px;
  height: 34px;
  border: 1.5px solid rgba(45, 212, 191, 0.55);
  background: rgba(20, 184, 166, 0.06);
  backdrop-filter: blur(1px);
  transition: width 0.18s ease, height 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
 
body.custom-cursor-active .cursor-ring.is-hover {
  width: 52px;
  height: 52px;
  border-color: var(--accent-aqua);
  background: rgba(34, 211, 238, 0.1);
}

body.custom-cursor-active .cursor-ring.is-down {
  width: 26px;
  height: 26px;
}

/* ============================================================
   SIDEBAR ACCORDION — Marine BDM CRM
   Append to styles1.css. No existing color tokens are changed.
   ============================================================ */

.sidebar-nav {
  padding: 10px 8px 16px;
}

/* ── Group wrapper ─────────────────────────────────────────── */
.nav-group {
  margin-bottom: 3px;
  border-radius: var(--radius-sm);
  position: relative;
}

.nav-group.has-active {
  background: linear-gradient(90deg, rgba(20, 184, 166, 0.07), transparent 70%);
}

/* ── Group header (acts like a nav-item) ──────────────────────── */
.nav-group-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text, var(--text-secondary));
  cursor: pointer;
  font-family: inherit;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  transition: background-color 0.2s ease, color 0.2s ease, padding-left 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease;
  position: relative;
}

.nav-group-header:hover {
  background: rgba(45, 212, 191, 0.08);
  color: var(--sidebar-text-hover, var(--text-primary));
  padding-left: 14px;
  box-shadow: inset 0 0 0 1px rgba(45, 212, 191, 0.14);
}

.nav-group.has-active > .nav-group-header {
  color: var(--sidebar-text-active, var(--accent-aqua));
  font-weight: 600;
}

.nav-group.open > .nav-group-header {
  background: rgba(45, 212, 191, 0.06);
}

.nav-group-header .nav-icon {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-group-header:hover .nav-icon,
.nav-group.open > .nav-group-header .nav-icon {
  transform: scale(1.14);
}

.nav-group-label {
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Rotating chevron ──────────────────────────────────────── */
.nav-chevron {
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease;
  color: var(--text-muted);
}

.nav-group.open > .nav-group-header .nav-chevron {
  transform: rotate(90deg);
  color: var(--accent-aqua);
}

/* ── Submenu (accordion height + opacity animation) ───────────── */
.nav-submenu {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.28s ease;
}

.nav-submenu-inner {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0 6px 14px;
  position: relative;
}

/* Vertical guide line, in the accent gradient, oceanic touch */
.nav-submenu-inner::before {
  content: '';
  position: absolute;
  left: 21px;
  top: 4px;
  bottom: 10px;
  width: 1.5px;
  background: linear-gradient(180deg, rgba(45, 212, 191, 0.35), rgba(45, 212, 191, 0.03));
}

/* ── Submenu items ─────────────────────────────────────────── */
.nav-subitem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 14px;
  margin-left: 10px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text, var(--text-secondary));
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  position: relative;

  opacity: 0;
  transform: translateX(-8px);
  animation: subitemSlideIn 0.32s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.25s ease, padding-left 0.2s ease;
}

.nav-group.open .nav-subitem:nth-child(1) { animation-delay: 0.03s; }
.nav-group.open .nav-subitem:nth-child(2) { animation-delay: 0.07s; }
.nav-group.open .nav-subitem:nth-child(3) { animation-delay: 0.11s; }
.nav-group.open .nav-subitem:nth-child(4) { animation-delay: 0.15s; }
.nav-group.open .nav-subitem:nth-child(5) { animation-delay: 0.19s; }

@keyframes subitemSlideIn {
  to { opacity: 1; transform: translateX(0); }
}

.nav-subitem-icon {
  font-size: 0.95rem;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.nav-subitem:hover {
  background: rgba(45, 212, 191, 0.1);
  color: var(--sidebar-text-hover, var(--text-primary));
  padding-left: 18px;
  box-shadow: 0 0 14px -4px rgba(45, 212, 191, 0.45);
}

/* Floating active indicator — a soft pill that glows behind the
   active submenu item, oceanic accent, no color palette change */
.nav-subitem.active {
  color: var(--accent-aqua);
  font-weight: 600;
  background: linear-gradient(90deg, rgba(20, 184, 166, 0.16), rgba(34, 211, 238, 0.03));
  box-shadow: inset 0 0 0 1px rgba(45, 212, 191, 0.22), 0 0 16px -4px rgba(45, 212, 191, 0.5);
}

.nav-subitem.active::before {
  content: '';
  position: absolute;
  left: -14px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 16px;
  background: linear-gradient(180deg, var(--accent-primary), var(--accent-aqua));
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.65);
}

.nav-subitem .nav-badge {
  margin-left: auto;
}

/* ── Collapsed sidebar rail: hide labels & submenus, keep icons ── */
.sidebar.collapsed .nav-group-label,
.sidebar.collapsed .nav-chevron {
  opacity: 0;
  width: 0;
}

.sidebar.collapsed .nav-submenu {
  max-height: 0 !important;
  opacity: 0 !important;
}

.sidebar.collapsed .nav-group-header {
  justify-content: center;
  gap: 0;
}



@media (prefers-reduced-motion: reduce) {
  .nav-subitem { animation: none !important; opacity: 1; transform: none; }
  .nav-submenu { transition: none !important; }
}

/* ─── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--bg-sidebar) 0%, #051018 100%);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: width var(--transition-sidebar);
  overflow: hidden;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--glass-border);
  min-height: 70px;
}

.sidebar-logo .logo-icon,
.sidebar-logo img.login-logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-aqua));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  box-shadow: var(--accent-glow);
  object-fit: cover;
}

.logo-text {
  margin-top: -15px;
}

.sidebar-logo .logo-text {
  overflow: hidden;
  transition: opacity var(--transition), width var(--transition);
  white-space: nowrap;
}

.sidebar.collapsed .logo-text {
  opacity: 0;
  width: 0;
}

.logo-title {
  font-weight: 800;
  font-size: 0.92rem;
  color: #fff;
  white-space: nowrap;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, #E7F6F2, var(--accent-aqua));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-subtitle {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 16px 10px 6px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--transition);
}

.sidebar.collapsed .nav-section-label {
  opacity: 0;
  height: 0;
  padding: 4px 0 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease, padding-left 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  margin-bottom: 3px;
  position: relative;
  text-decoration: none;
}

.nav-item:hover {
  background: rgba(45, 212, 191, 0.08);
  color: var(--text-primary);
  padding-left: 14px;
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(20, 184, 166, 0.18), rgba(34, 211, 238, 0.05));
  color: var(--accent-aqua);
  font-weight: 600;
  padding-left: 14px;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: linear-gradient(180deg, var(--accent-primary), var(--accent-aqua));
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.6);
}

.nav-icon {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.nav-item:hover .nav-icon {
  transform: scale(1.18) translateY(-1px);
}

/* ============================================================
   Marine BDM CRM — Fix Pack v1
   ============================================================ */

:root {
  --sidebar-text: #8FB4B0;
  --sidebar-text-hover: #E7F6F2;
  --sidebar-text-muted: #4C6B6E;
  --sidebar-text-active: var(--accent-aqua);
}
[data-theme="light"] {
  --sidebar-text: #8FB4B0;
  --sidebar-text-hover: #E7F6F2;
  --sidebar-text-muted: #6B8C89;
  --sidebar-text-active: var(--accent-aqua);
}

.sidebar .nav-item {
  color: var(--sidebar-text);
}
.sidebar .nav-item:hover {
  color: var(--sidebar-text-hover);
}
.sidebar .nav-item.active {
  color: var(--sidebar-text-active);
}
.sidebar .nav-section-label {
  color: var(--sidebar-text-muted);
}
.sidebar .logo-subtitle {
  color: var(--sidebar-text-muted);
}
.sidebar #sidebar-user-name {
  color: var(--sidebar-text-hover) !important;
}
.sidebar #sidebar-user-role {
  color: var(--sidebar-text-muted) !important;
}
.sidebar .collapsed .nav-item:hover::after,
.sidebar.collapsed .nav-item:hover::after {
  color: var(--sidebar-text-hover);
}

.sidebar.collapsed .nav-label {
  opacity: 0;
  width: 0;
  max-width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  flex: 0 0 0;
}
.sidebar.collapsed .nav-item {
  gap: 0;
  justify-content: center;
}
.sidebar.collapsed .nav-icon {
  opacity: 1 !important;
  width: 22px;
  margin: 0 auto;
}
.sidebar.collapsed .sidebar-logo {
  justify-content: center;
  padding: 20px 0;
}
.sidebar.collapsed .sidebar-logo img.login-logo-icon,
.sidebar.collapsed .sidebar-logo .logo-icon {
  margin: 0;
}
.sidebar.collapsed .nav-badge[style*="inline-block"] {
  position: absolute;
  right: 6px;
  top: 6px;
  opacity: 1;
  transform: scale(0.72);
}

[data-theme="light"] .login-page-body,
[data-theme="light"] .login-gradient-bg {
  background: linear-gradient(180deg, #EAF7F5 0%, #F5FCFB 100%);
}
[data-theme="light"] .login-card {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(13, 148, 136, 0.18);
}
[data-theme="light"] .login-title { color: #0B2B2A; }
[data-theme="light"] .login-input {
  background: rgba(6, 60, 56, 0.04);
  border-color: rgba(6, 60, 56, 0.14);
  color: #0B2B2A;
}
[data-theme="light"] .login-input::placeholder { color: rgba(75, 110, 107, 0.6); }

.cursor-dot,
.cursor-ring {
  opacity: 0;
  transition: opacity 0.25s ease, width 0.18s ease, height 0.18s ease,
    border-color 0.18s ease, background 0.18s ease;
}
.cursor-dot {
  box-shadow: 0 0 10px 3px rgba(34, 211, 238, 0.65), 0 0 22px 6px rgba(20, 184, 166, 0.25);
}
[data-theme="light"] .cursor-ring {
  border-color: rgba(13, 148, 136, 0.55);
  background: rgba(13, 148, 136, 0.08);
}

.navbar-toggle .hbg-line {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--text-secondary);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    background-color 0.3s ease;
}
.navbar-toggle:hover .hbg-line { background: var(--accent-primary); }

button, .btn, a.nav-item, .navbar-btn, .theme-toggle, .user-menu,
.dropdown, .dropdown-menu, select.form-control, input.form-control,
textarea.form-control, .page-btn, .badge, .chart-card, .stat-card,
.checklist-item, .ryg-btn, .outcome-btn, .outcome-action-btn,
.quick-action-card, .followup-item, .modal, .toast, .table,
.sidebar, .navbar, .card, .stat-icon, .nav-icon, .app-footer {
  transition: background-color 0.3s ease, border-color 0.3s ease,
    color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease,
    opacity 0.25s ease;
}

.app-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 24px;
  margin-top: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  text-align: center;
}
.app-footer .footer-sep {
  opacity: 0.5;
}
.app-footer a {
  color: var(--accent-primary);
}
@media (max-width: 576px) {
  .app-footer {
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
  }
  .app-footer .footer-sep { display: none; }
}

.main-content {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}
.page-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 70px - 54px);
}

.filter-bar,
.card,
.card-body,
.table-container {
  position: relative;
  z-index: 1;
}

.orgchart-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
}
.orgchart-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--glass-border);
  padding: 1rem 1.5rem;
  text-align: center;
}
.orgchart-header h1 {
  color: var(--text-primary);
  font-size: 1.3rem;
  letter-spacing: 0.02em;
}
.orgchart-header p {
  margin-top: 0.3rem;
  color: var(--accent-aqua);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.orgchart-fit-wrap {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.5rem;
}
.oc-tree, .oc-tree ul, .oc-tree li {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}
.oc-tree {
  display: flex;
  justify-content: center;
  padding-top: 8px;
  width: max-content;
  margin: 0 auto;
  transition: transform 0.25s ease;
}
.oc-tree ul {
  display: flex;
  padding-top: 30px;
  position: relative;
}
.oc-tree li {
  flex: 1;
  text-align: center;
  padding: 30px 10px 0 10px;
  position: relative;
}
.oc-tree li::before,
.oc-tree li::after {
  content: '';
  position: absolute;
  top: 0;
  right: 50%;
  width: 50%;
  height: 30px;
  border-top: 2px solid var(--accent-primary);
  opacity: 0.4;
  animation: ocLinePulse 2.6s ease-in-out infinite;
}
.oc-tree li::after {
  right: auto;
  left: 50%;
  border-left: 2px solid var(--accent-primary);
  border-top: none;
}
.oc-tree li:only-child::after,
.oc-tree li:only-child::before { display: none; }
.oc-tree li:only-child { padding-top: 0; }
.oc-tree li:first-child::before,
.oc-tree li:last-child::after { border: 0 none; }
.oc-tree li:last-child::before {
  border-right: 2px solid var(--accent-primary);
  border-radius: 0 8px 0 0;
}
.oc-tree li:first-child::after { border-radius: 8px 0 0 0; }
.oc-tree ul ul::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 0;
  height: 30px;
  border-left: 2px solid var(--accent-primary);
  opacity: 0.4;
  animation: ocLinePulse 2.6s ease-in-out infinite;
}
@keyframes ocLinePulse {
  0%, 100% { opacity: 0.28; }
  50%      { opacity: 0.75; }
}

.oc-node {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.9rem;
  min-width: 132px;
  box-shadow: var(--shadow-card);
  opacity: 0;
  transform: translateY(12px);
  animation: ocRise 0.5s ease forwards;
}
.oc-node:hover {
  transform: translateY(-4px) scale(1.04);
  border-color: rgba(45, 212, 191, 0.4);
  box-shadow: var(--shadow-glow-teal);
}
@keyframes ocRise {
  to { opacity: 1; transform: translateY(0); }
}
.oc-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: #04140f;
  box-shadow: 0 0 0 3px var(--accent-light);
}
.oc-name {
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-primary);
}
.oc-node.small .oc-name { font-size: 0.72rem; }
.oc-role {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
}
.oc-dept-header {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  display: inline-block;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateY(12px);
  animation: ocRise 0.5s ease forwards;
}

@media (max-width: 768px) {
  .orgchart-fit-wrap { padding: 0.75rem; }
  .oc-tree { padding-top: 4px; }
}

.nav-badge {
  margin-left: auto;
  background: linear-gradient(135deg, var(--red), #EF4444);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
  transition: opacity var(--transition);
}

.sidebar.collapsed .nav-badge {
  opacity: 0;
  position: absolute;
  right: 6px;
  top: 6px;
}

.sidebar.collapsed .nav-badge[style*="inline-block"] {
  opacity: 1;
  transform: scale(0.75);
}

/* Collapsed-mode tooltip on hover */
.sidebar.collapsed .nav-item {
  position: relative;
}

.sidebar.collapsed .nav-item:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--glass-border);
  z-index: 200;
  pointer-events: none;
  animation: fadeIn 0.15s ease forwards;
}
/* ─── Top Navbar ─────────────────────────────────────────────── */
.navbar {
  height: 70px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.navbar-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.navbar-toggle:hover {
  background: var(--accent-light);
  color: var(--accent-primary);
  transform: scale(1.06);
}

.navbar-search {
  flex: 1;
  max-width: 360px;
  position: relative;
}

.navbar-search input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 9px 16px 9px 40px;
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: all var(--transition);
}

.navbar-search input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.navbar-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.navbar-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.1rem;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  position: relative;
}

.navbar-btn:hover {
  background: var(--accent-light);
  color: var(--accent-primary);
}

.notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--red);
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}

.theme-toggle {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 7px 14px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
}

.theme-toggle:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 6px 14px 6px 6px;
  cursor: pointer;
  transition: all var(--transition);
}

.user-menu:hover {
  border-color: var(--accent-primary);
  transform: translateY(-1px);
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-aqua));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}

.user-info .user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

.user-info .user-role {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ─── Page Content ───────────────────────────────────────────── */
.page-content {
  flex: 1;
  padding: 28px 32px;
  overflow-y: auto;
  animation: pageEnter 0.45s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}

.page-title-group .page-title {
  color: var(--text-primary);
  margin-bottom: 4px;
}

.page-title-group .page-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.page-title {
  color: var(--text-primary) !important;
}

.page-subtitle,
.subtitle {
  color: var(--text-secondary) !important;
}

/* ─── Cards (glass) ──────────────────────────────────────────── */
.card,
.card-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.card {
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  animation: cardRise 0.45s ease both;
}

.card:hover {
  border-color: rgba(45, 212, 191, 0.28);
  box-shadow: var(--shadow-glow-teal);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.card-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.card-body {
  padding: 24px;
  flex: 1;
}

@keyframes cardRise {
  from { opacity: 0; transform: translateY(14px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── Stat Cards ─────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  box-shadow: var(--shadow-card);
  cursor: default;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.14) 0%, transparent 70%);
  pointer-events: none;
  animation: dotPulse 5s ease-in-out infinite;
}

.stat-card:hover {
  transform: translateY(-5px) scale(1.015);
  box-shadow: var(--shadow-glow-teal);
  border-color: rgba(45, 212, 191, 0.32);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.stat-icon.teal   { background: var(--accent-light); color: var(--accent-primary); }
.stat-icon.green  { background: var(--green-light);  color: var(--green); }
.stat-icon.yellow { background: var(--yellow-light); color: var(--yellow); }
.stat-icon.red    { background: var(--red-light);    color: var(--red); }
.stat-icon.purple { background: var(--purple-light); color: var(--purple); }

.stat-info {}

.stat-value {
  font-family: 'Manrope', 'Inter', sans-serif;
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  transition: color 0.3s ease;
}

.stat-title {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 10px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.stat-change {
  font-size: 0.75rem;
  margin-top: 6px;
  font-weight: 600;
}

.stat-change.up   { color: var(--green); }
.stat-change.down { color: var(--red); }

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
}

.btn:active { transform: translateY(0) scale(0.98); }

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

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-aqua));
  color: #fff;
  box-shadow: 0 2px 10px rgba(20, 184, 166, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(34, 211, 238, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.btn-danger {
  background: var(--red-light);
  color: var(--red);
  border: 1px solid rgba(248, 113, 113, 0.25);
}

.btn-danger:hover {
  background: var(--red);
  color: #fff;
}

.btn-success {
  background: var(--green-light);
  color: var(--green);
  border: 1px solid rgba(52, 211, 153, 0.25);
}

.btn-success:hover {
  background: var(--green);
  color: #fff;
}

.btn-warning {
  background: var(--yellow-light);
  color: var(--yellow);
  border: 1px solid rgba(242, 197, 114, 0.25);
}

.btn-warning:hover {
  background: var(--yellow);
  color: #1a1300;
}

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }

.btn-icon {
  padding: 8px;
  width: 36px;
  height: 36px;
  justify-content: center;
}

/* ─── Form Controls ──────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-label.required::after {
  content: ' *';
  color: var(--red);
}

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: all var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.form-control::placeholder { color: var(--text-muted); }
.form-control:disabled { opacity: 0.5; cursor: not-allowed; }

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238FB4B0' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

textarea.form-control { resize: vertical; min-height: 100px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

.form-error { font-size: 0.78rem; color: var(--red); margin-top: 4px; }
.form-hint  { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }

/* ─── Field-level validation (Issue 2 fix) ───────────────────── */
.form-control.field-invalid {
  border-color: var(--red) !important;
  box-shadow: 0 0 0 3px var(--red-light) !important;
  animation: fieldShake 0.4s ease;
}

.field-error-msg {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 6px;
  animation: slideUp 0.2s ease;
}

.field-error-msg::before {
  content: '⚠';
  font-size: 0.85rem;
}

@keyframes fieldShake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  75%      { transform: translateX(4px); }
}

/* ─── Tables & Top Scrollbar ─────────────────────────────────── */
.table-container {
  overflow-x: auto;
  position: relative;
}

.table-top-scrollbar {
  overflow-x: auto;
  overflow-y: hidden;
  height: 12px;
  width: 100%;
  margin-bottom: 2px;
  background: transparent;
  display: none;
  border-radius: 4px;
}

.table-top-scrollbar-content {
  height: 12px;
  visibility: hidden;
}

/* Custom modern scrollbar for table container & top scrollbar */
.table-container::-webkit-scrollbar,
.table-top-scrollbar::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}

.table-container::-webkit-scrollbar-track,
.table-top-scrollbar::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.05);
  border-radius: 4px;
}

.dark-theme .table-container::-webkit-scrollbar-track,
.dark-theme .table-top-scrollbar::-webkit-scrollbar-track,
[data-theme="dark"] .table-container::-webkit-scrollbar-track,
[data-theme="dark"] .table-top-scrollbar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.table-container::-webkit-scrollbar-thumb,
.table-top-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(14, 165, 233, 0.45);
  border-radius: 4px;
  transition: background 0.2s ease;
}

.table-container::-webkit-scrollbar-thumb:hover,
.table-top-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(14, 165, 233, 0.8);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table thead th {
  background: rgba(20, 184, 166, 0.06);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: middle;
}

.table tbody tr { transition: background 0.15s ease; }

.table tbody tr:hover { background: var(--accent-light); }
.table tbody tr:hover td:first-child { border-left: 2px solid var(--accent-primary); }

.table tbody tr:last-child td { border-bottom: none; }

.table-actions { display: flex; gap: 8px; }

.table tbody tr .row-actions {
  opacity: 1;
  display: flex;
  gap: 8px;
}


/* ─── Badges & Status Pills ──────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-green  { background: var(--green-light);  color: var(--green);  border: 1px solid rgba(52, 211, 153, 0.22); }
.badge-yellow { background: var(--yellow-light); color: var(--yellow); border: 1px solid rgba(242, 197, 114, 0.22); }
.badge-red    { background: var(--red-light);    color: var(--red);    border: 1px solid rgba(248, 113, 113, 0.22); }
.badge-blue   { background: var(--blue-light);   color: var(--blue);   border: 1px solid rgba(34, 211, 238, 0.22); }
.badge-purple { background: var(--purple-light); color: var(--purple); border: 1px solid rgba(167, 139, 250, 0.22); }
.badge-gray   { background: rgba(143, 180, 176, 0.14); color: var(--text-secondary); border: 1px solid rgba(143, 180, 176, 0.2); }
.badge-teal   { background: var(--accent-light); color: var(--accent-primary); border: 1px solid rgba(20, 184, 166, 0.22); }

.badge::before { content: '●'; font-size: 0.5rem; }

/* RYG Status Bar (Calling Report) */
.status-ryg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}

.status-ryg.red    { background: var(--red-light);    color: var(--red);    border: 1px solid rgba(248, 113, 113, 0.25); }
.status-ryg.yellow { background: var(--yellow-light); color: var(--yellow); border: 1px solid rgba(242, 197, 114, 0.25); }
.status-ryg.green  { background: var(--green-light);  color: var(--green);  border: 1px solid rgba(52, 211, 153, 0.25); }

/* ─── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 10, 16, 0.72);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  animation: fadeIn 0.2s ease forwards;
}

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

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Issue 2 fix: once the entrance animation finishes, JS adds this
   class to strip the leftover transform (fill-mode:forwards keeps
   `transform: translateY(0)` applied indefinitely otherwise, which
   creates a containing block that can clip/mis-position native
   validation bubbles and other fixed-position content anchored to
   fields inside the modal). */
.modal.settled {
  animation: none !important;
  transform: none !important;
}

.modal-lg { max-width: 720px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px;
  border-bottom: 1px solid var(--border-color);
}

.modal-title { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); }

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  padding: 4px;
  border-radius: 6px;
  transition: all var(--transition);
}

.modal-close:hover { background: var(--red-light); color: var(--red); }

.modal-body { padding: 28px; }

.modal-footer {
  padding: 18px 28px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ─── Outcome Decision Panel ─────────────────────────────────── */
.outcome-panel {
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-top: 20px;
}

.outcome-buttons { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }

.outcome-btn {
  flex: 1;
  min-width: 120px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.outcome-btn.yes { background: var(--green-light); color: var(--green); border-color: rgba(52, 211, 153, 0.3); }
.outcome-btn.yes.active, .outcome-btn.yes:hover { background: var(--green); color: #06251A; border-color: var(--green); }

.outcome-btn.no { background: var(--red-light); color: var(--red); border-color: rgba(248, 113, 113, 0.3); }
.outcome-btn.no.active, .outcome-btn.no:hover { background: var(--red); color: #fff; border-color: var(--red); }

.outcome-btn.pending { background: var(--yellow-light); color: var(--yellow); border-color: rgba(242, 197, 114, 0.3); }
.outcome-btn.pending.active, .outcome-btn.pending:hover { background: var(--yellow); color: #1a1300; border-color: var(--yellow); }

.reason-panel {
  background: var(--bg-primary);
  border: 1px solid var(--red-light);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 4px;
  display: none;
}

.reason-panel.visible { display: block; animation: slideUp 0.2s ease; }

.reason-panel .reason-title {
  font-size: 0.8rem; font-weight: 700; color: var(--red); margin-bottom: 10px;
  text-transform: uppercase; letter-spacing: 0.05em;
}

.details-panel {
  background: var(--green-light);
  border: 1px solid rgba(52, 211, 153, 0.2);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 4px;
  display: none;
}

.details-panel.visible { display: block; animation: slideUp 0.2s ease; }

.details-panel .details-title {
  font-size: 0.8rem; font-weight: 700; color: var(--green); margin-bottom: 10px;
  text-transform: uppercase; letter-spacing: 0.05em;
}

.outcome-action-btn {
  padding: 8px 15px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; font-weight: 700;
  display: inline-flex; align-items: center; gap: 5px; transition: all 0.2s ease; font-family: inherit;
}

.outcome-action-btn.yes-btn { background: var(--green-light); color: var(--green); border-color: rgba(52,211,153,0.3); }
.outcome-action-btn.yes-btn:hover, .outcome-action-btn.yes-btn.active { background: var(--green); color: #06251A; border-color: var(--green); }

.outcome-action-btn.no-btn { background: var(--red-light); color: var(--red); border-color: rgba(248,113,113,0.3); }
.outcome-action-btn.no-btn:hover, .outcome-action-btn.no-btn.active { background: var(--red); color: #fff; border-color: var(--red); }

.outcome-action-btn.pending-btn { background: var(--yellow-light); color: var(--yellow); border-color: rgba(242,197,114,0.3); }
.outcome-action-btn.pending-btn:hover, .outcome-action-btn.pending-btn.active { background: var(--yellow); color: #1a1300; border-color: var(--yellow); }

.outcome-actions-container { display: flex; gap: 10px; }

/* ─── Toast Notifications ────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 999999 !important;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
  pointer-events: all;
  font-size: 0.875rem;
  color: var(--text-primary);
  z-index: 999999 !important;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut { to { transform: translateX(120%); opacity: 0; } }

.toast.success { border-left: 4px solid var(--green); }
.toast.error   { border-left: 4px solid var(--red); }
.toast.warning { border-left: 4px solid var(--yellow); }
.toast.info    { border-left: 4px solid var(--accent-primary); }

.toast-icon { font-size: 1.1rem; flex-shrink: 0; }
.toast.success .toast-icon { color: var(--green); }
.toast.error .toast-icon   { color: var(--red); }
.toast.warning .toast-icon { color: var(--yellow); }
.toast.info .toast-icon    { color: var(--accent-primary); }

/* ─── Loading Spinner ────────────────────────────────────────── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner.dark { border-color: rgba(0, 0, 0, 0.1); border-top-color: var(--accent-primary); }

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 20, 31, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  z-index: 10;
}

/* ─── Empty State ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 40px;
  color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 0.875rem; margin-bottom: 20px; }

/* ─── Pagination ─────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 16px 0;
  justify-content: center;
}

.page-btn {
  width: 36px;
  height: 36px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-btn:hover, .page-btn.active {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-aqua));
  border-color: var(--accent-primary);
  color: #fff;
}

/* ─── Charts Container ───────────────────────────────────────── */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}

.chart-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-slow);
  position: relative;
}

.chart-card:hover {
  border-color: rgba(45, 212, 191, 0.3);
  box-shadow: var(--shadow-glow-teal);
  transform: translateY(-3px);
}

.chart-title { font-size: 0.875rem; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.chart-subtitle { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 20px; }

.chart-canvas-container { position: relative; height: 220px; animation: fadeIn 0.6s ease; }

/* ─── Search & Filter Bar ────────────────────────────────────── */
.filter-bar { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.filter-bar .search-wrapper { flex: 1; min-width: 200px; position: relative; }
.filter-bar .search-wrapper input { padding-left: 38px; }
.filter-bar .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

/* ─── Checklist (Doc Verification) ──────────────────────────── */
.checklist { display: flex; flex-direction: column; gap: 12px; }

.checklist-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
}

.checklist-item.checked { border-color: rgba(52, 211, 153, 0.3); background: var(--green-light); }

.check-box {
  width: 22px;
  height: 22px;
  border: 2px solid var(--text-muted);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}

.checklist-item.checked .check-box { background: var(--green); border-color: var(--green); color: #06251A; }

.checklist-label { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); }
.checklist-desc { font-size: 0.75rem; color: var(--text-muted); }

/* ─── Employee ID Badge ──────────────────────────────────────── */
.employee-id-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--accent-light), var(--purple-light));
  border: 1px solid rgba(45, 212, 191, 0.3);
  border-radius: var(--radius-md);
  padding: 8px 16px;
  font-family: 'Courier New', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-primary);
  letter-spacing: 0.1em;
}

/* ─── Activity Feed ──────────────────────────────────────────── */
.activity-feed { display: flex; flex-direction: column; gap: 0; }

.activity-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

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

.activity-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
  background: var(--accent-aqua);
  box-shadow: 0 0 6px rgba(34, 211, 238, 0.6);
}

.activity-content { flex: 1; }
.activity-text { font-size: 0.875rem; color: var(--text-primary); }
.activity-text strong { color: var(--accent-primary); }
.activity-time { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* ─── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(45, 212, 191, 0.25); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(45, 212, 191, 0.45); }

/* ─── Sidebar Overlay for Mobile Drawer ────────────────────── */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 10, 16, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

/* ================================================================
   ORG CHART (scaffold — connect once org-chart markup is supplied)
   ================================================================ */
.orgchart-page {
  height: calc(100vh - 70px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.orgchart-container {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  position: relative;
}

.orgchart-tree {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 34px;
}

.orgchart-level {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
}

.orgchart-node {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  min-width: 160px;
  text-align: center;
  box-shadow: var(--shadow-card);
  transition: all var(--transition);
  animation: cardRise 0.5s ease both;
}

.orgchart-node:hover {
  transform: translateY(-4px) scale(1.03);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow-teal);
}

.orgchart-node .node-name { font-weight: 700; color: var(--text-primary); font-size: 0.9rem; }
.orgchart-node .node-role { font-size: 0.75rem; color: var(--accent-primary); margin-top: 2px; }

.orgchart-connector {
  stroke: var(--accent-primary);
  stroke-width: 1.5;
  fill: none;
  stroke-dasharray: 6 4;
  animation: dashFlow 2.4s linear infinite;
  opacity: 0.55;
}

@keyframes dashFlow { to { stroke-dashoffset: -20; } }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .dashboard-content-grid { grid-template-columns: 1fr !important; }
  .charts-grid { grid-template-columns: 1fr !important; }
  .form-row, .form-row-3 { grid-template-columns: 1fr !important; }
}

@media (max-width: 991.98px) {
  html, body { max-width: 100vw; overflow-x: hidden; }
  .app-wrapper, .app-layout { max-width: 100vw; overflow-x: hidden; }

  .app-wrapper,
  .app-layout { display: block; overflow: visible; }

  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100vw;
  }

  .main-content.sidebar-collapsed { margin-left: 0 !important; }

  .navbar {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 130;
    width: 100%;
    min-height: 70px;
    max-height: 70px;
    padding: 0 16px;
    gap: 10px;
    background: var(--glass-bg);
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: blur(var(--glass-blur));
  }

  .navbar .navbar-search { display: flex; flex: 1 1 auto; max-width: 420px; }
  .navbar .navbar-right { margin-left: auto; }
  .navbar .user-info { display: none; }

  .sidebar {
    position: fixed;
    top: 70px;
    left: 0;
    bottom: 0;
    width: min(280px, 88vw) !important;
    z-index: 100;
    transform: translateX(-105%);
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.6);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  }




  .page-content {
    padding: 18px 14px;
    padding-top: 92px;
  }

  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .page-header > div:first-child { width: 100%; }
  .page-header .btn { width: 100%; justify-content: center; }

  .header-badges { width: 100%; flex-wrap: wrap; }

  .stats-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px; }

  .filter-bar { flex-direction: column; align-items: stretch; gap: 10px; }
  .filter-bar .form-group, .filter-bar .search-wrapper, .filter-bar select,
  .filter-bar input, .filter-bar .btn { width: 100% !important; flex: none !important; }

  .table-container { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table { min-width: 600px; }

  .tabs, .ops-tabs, .reception-tabs {
    overflow-x: auto;
    white-space: nowrap;
    flex-wrap: nowrap;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }
  .tab-btn, .ops-tab, .reception-tab { flex-shrink: 0; }

  .orgchart-page { height: auto; }
  .orgchart-container { overflow: auto; }
}

@media (max-width: 768px) {
  .navbar .navbar-search { display: flex; }
  .navbar .navbar-right { width: auto; }

  .sidebar {
    top: 70px;
    width: min(280px, 92vw) !important;
  }

  /* NOTE: do not redeclare .page-content padding here. The
     991.98px block above already sets padding-top: 92px to clear
     the fixed navbar; a shorthand `padding: 18px 14px` here would
     silently reset padding-top back to 18px (same specificity,
     later in source = wins), pulling the page title back underneath
     the fixed navbar on every phone, since ≤768px always also
     matches ≤991.98px. If a narrower-specific top/bottom/left/right
     padding is ever needed at this breakpoint, set padding-top
     explicitly alongside it — never with the shorthand alone. */
}

@media (max-width: 576px) {
  h1, .page-title { font-size: 1.35rem !important; }
  h2 { font-size: 1.2rem !important; }

  .user-info { display: none; }
  .user-menu { padding: 4px; }

  /* ── Icon-only navbar actions ─────────────────────────────────
     Below 576px, theme toggle + Org Chart + avatar + Logout no
     longer fit as labeled buttons in one row (this is what clipped
     the Logout button on Galaxy S8+ / similar widths). Collapse
     each action to icon-only; the icon and title/aria-label stay,
     so every action remains visible and reachable, just compact.
     Desktop markup/styling is untouched — .navbar-label only exists
     inside this media query. */
  .navbar { padding: 0 10px; gap: 6px; }
  .navbar-right { gap: 4px; }

  .navbar-label { display: none; }

  .navbar-icon {
    font-size: 1rem;
    line-height: 1;
    display: inline-flex;
  }

  .theme-toggle {
    padding: 7px 9px;
    gap: 0;
  }

  .navbar-orgchart-btn {
    padding: 7px 9px !important;
    gap: 0 !important;
  }

  #logout-btn {
    padding: 7px 9px;
    margin-left: 0 !important;
  }

  .user-menu {
    gap: 0;
    padding: 3px;
  }

  .modal-overlay { padding: 10px; }
  .modal { max-height: 92vh; border-radius: var(--radius-lg); width: 100%; }
  .modal-header { padding: 14px 16px; }
  .modal-body { padding: 16px; }
  .modal-footer { padding: 12px 16px; flex-direction: column-reverse; gap: 8px; }
  .modal-footer .btn { width: 100%; justify-content: center; }

  .quick-actions-grid { grid-template-columns: 1fr !important; }

  .followup-item { flex-direction: column; align-items: stretch; gap: 10px; }
  .followup-right { flex-direction: row; justify-content: space-between; align-items: center; width: 100%; }
}

@media (max-width: 420px) {
  .navbar { padding: 0 8px; gap: 4px; }
  .navbar-right { gap: 2px; }
  .navbar-toggle { width: 34px; height: 34px; }
  .theme-toggle, .navbar-orgchart-btn, #logout-btn { padding: 6px 7px !important; }
  .user-avatar { width: 28px; height: 28px; font-size: 0.68rem; }

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

  .outcome-buttons, .ryg-selector, .outcome-actions-container, .outcome-btn-set {
    flex-direction: column; width: 100%;
  }
  .outcome-btn, .ryg-btn, .outcome-action-btn { width: 100% !important; flex: 1 1 100% !important; }

  .login-card-wrapper { padding: 12px; }
  .login-card { padding: 24px 16px; border-radius: 18px; }
  .login-logo-icon { width: 54px; height: 54px; font-size: 1.5rem; }
  .login-title { font-size: 1.3rem; }
}

/* ─── LOGIN PAGE SPECIAL STYLES ─────────────────────────────── */
.login-page-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  background: #030c14;
}

#particles-canvas { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

.login-gradient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 80%, rgba(20, 184, 166, 0.16) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(34, 211, 238, 0.12) 0%, transparent 60%),
    #030c14;
}

.login-card-wrapper { position: relative; z-index: 10; width: 100%; max-width: 440px; padding: 24px; }

.login-card {
  background: rgba(10, 31, 48, 0.7);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(45, 212, 191, 0.22);
  border-radius: 24px;
  padding: 44px 40px;
  box-shadow:
    0 0 0 1px rgba(45, 212, 191, 0.1),
    0 20px 60px rgba(0, 0, 0, 0.6),
    0 0 80px rgba(20, 184, 166, 0.08);
  animation: loginCardIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes loginCardIn {
  from { opacity: 0; transform: translateY(30px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo-wrap { display: flex; flex-direction: column; align-items: center; margin-bottom: 36px; }

.login-logo-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #14B8A6 0%, #22D3EE 100%);
  border-radius: 43px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 16px;
  box-shadow: 0 0 30px rgba(20, 184, 166, 0.45), 0 8px 24px rgba(0, 0, 0, 0.4);
  animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% { box-shadow: 0 0 30px rgba(20, 184, 166, 0.4), 0 8px 24px rgba(0, 0, 0, 0.4); }
  50%      { box-shadow: 0 0 50px rgba(34, 211, 238, 0.7), 0 8px 24px rgba(0, 0, 0, 0.4); }
}

.login-title { font-size: 1.6rem; font-weight: 800; color: #fff; letter-spacing: -0.02em; margin-bottom: 4px; }
.login-subtitle { font-size: 0.85rem; color: var(--text-secondary); }

.login-input-group { position: relative; margin-bottom: 18px; }

.login-input-label {
  display: block; font-size: 0.75rem; font-weight: 700; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px;
}

.login-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 13px 16px 13px 44px;
  color: #fff;
  font-size: 0.9rem;
  transition: all 0.25s ease;
  font-family: inherit;
}

.login-input:focus {
  outline: none;
  background: rgba(20, 184, 166, 0.08);
  border-color: rgba(45, 212, 191, 0.6);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.14);
}

.login-input::placeholder { color: rgba(143, 180, 176, 0.5); }

.login-input-icon {
  position: absolute; left: 14px; bottom: 14px; font-size: 1rem; color: var(--text-muted); pointer-events: none;
}

.login-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #14B8A6 0%, #22D3EE 100%);
  border: none;
  border-radius: 12px;
  color: #06141F;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: inherit;
  letter-spacing: 0.02em;
  position: relative;
  overflow: hidden;
  margin-top: 8px;
}

.login-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.25s;
}

.login-btn:hover::before { opacity: 1; }
.login-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(34, 211, 238, 0.45); }
.login-btn:active { transform: translateY(0); }
.login-btn.loading { pointer-events: none; opacity: 0.8; }

.login-error {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 0.84rem;
  color: #F87171;
  margin-bottom: 16px;
  display: none;
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

.login-demo-info {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.login-demo-info code {
  background: rgba(20, 184, 166, 0.14);
  color: var(--accent-aqua);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
}

/* ─── SKELETON LOADERS ───────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg,
      rgba(45, 212, 191, 0.06) 25%,
      rgba(45, 212, 191, 0.14) 50%,
      rgba(45, 212, 191, 0.06) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
  color: transparent !important;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text.w-50  { width: 50%; }
.skeleton-text.w-75  { width: 75%; }
.skeleton-text.w-100 { width: 100%; }

.skeleton-stat { height: 40px; width: 80px; margin-bottom: 6px; }
.skeleton-row { height: 52px; border-radius: 0; border-bottom: 1px solid var(--border-color); }

.skeleton-box {
  height: 16px;
  width: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg,
      rgba(45, 212, 191, 0.06) 25%,
      rgba(45, 212, 191, 0.14) 50%,
      rgba(45, 212, 191, 0.06) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* ─── PAGE ENTER ANIMATION ───────────────────────────────────── */
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── RYG SELECTOR BUTTONS (Calling Report) ──────────────────── */
.ryg-selector { display: flex; gap: 12px; margin-bottom: 4px; }

.ryg-btn {
  flex: 1;
  padding: 14px 12px;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.88rem;
  font-family: inherit;
  transition: all 0.2s ease;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.ryg-btn.ryg-red { background: var(--red-light); color: var(--red); border-color: rgba(248,113,113,0.25); }
.ryg-btn.ryg-red.selected, .ryg-btn.ryg-red:hover {
  background: var(--red); color: #fff; border-color: var(--red);
  box-shadow: 0 4px 16px rgba(248, 113, 113, 0.4); transform: translateY(-1px);
}

.ryg-btn.ryg-yellow { background: var(--yellow-light); color: var(--yellow); border-color: rgba(242,197,114,0.25); }
.ryg-btn.ryg-yellow.selected, .ryg-btn.ryg-yellow:hover {
  background: var(--yellow); color: #1a1300; border-color: var(--yellow);
  box-shadow: 0 4px 16px rgba(242, 197, 114, 0.4); transform: translateY(-1px);
}

.ryg-btn.ryg-green { background: var(--green-light); color: var(--green); border-color: rgba(52,211,153,0.25); }
.ryg-btn.ryg-green.selected, .ryg-btn.ryg-green:hover {
  background: var(--green); color: #06251A; border-color: var(--green);
  box-shadow: 0 4px 16px rgba(52, 211, 153, 0.4); transform: translateY(-1px);
}

/* ─── APPOINTMENT OUTCOME BUTTONS (set) ──────────────────────── */
.outcome-btn-set { display: flex; gap: 10px; flex-wrap: wrap; }

/* ─── PIPELINE STATUS DOTS ───────────────────────────────────── */
.pipeline-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; animation: dotPulse 2s ease-in-out infinite; }
.pipeline-dot.prospect    { background: var(--blue); }
.pipeline-dot.negotiating { background: var(--yellow); }
.pipeline-dot.client      { background: var(--green); }
.pipeline-dot.rejected    { background: var(--red); animation: none; }

@keyframes dotPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.3); opacity: 0.7; }
}

/* ─── CONFIRM DIALOG ─────────────────────────────────────────── */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 10, 16, 0.78);
  backdrop-filter: blur(6px);
  z-index: 999998 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.confirm-box {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 36px;
  max-width: 380px;
  width: 90%;
  text-align: center;
  animation: slideUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.confirm-icon { font-size: 2.5rem; margin-bottom: 16px; }
.confirm-title { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.confirm-message { font-size: 0.875rem; color: var(--text-secondary); margin-bottom: 28px; }
.confirm-actions { display: flex; gap: 12px; justify-content: center; }

/* ─── STATS TREND INDICATORS ─────────────────────────────────── */
.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  margin-top: 4px;
  padding: 3px 8px;
  border-radius: 20px;
}

.stat-trend.up      { background: var(--green-light); color: var(--green); }
.stat-trend.down    { background: var(--red-light);   color: var(--red); }
.stat-trend.neutral { background: rgba(143, 180, 176, 0.14); color: var(--text-secondary); }

/* ─── QUICK ACTION CARDS ─────────────────────────────────────── */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 4px;
}

.quick-action-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.quick-action-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(45, 212, 191, 0.08));
  opacity: 0;
  transition: opacity 0.2s;
}

.quick-action-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-3px) scale(1.015);
  box-shadow: var(--shadow-glow-teal);
}

.quick-action-card:hover::before { opacity: 1; }

.quick-action-icon { font-size: 1.6rem; transition: transform 0.25s ease; }
.quick-action-card:hover .quick-action-icon { transform: scale(1.15) rotate(-4deg); }

.quick-action-title { font-size: 0.88rem; font-weight: 700; color: var(--text-primary); }
.quick-action-desc { font-size: 0.75rem; color: var(--text-muted); }

/* ─── NOTIFICATION BADGE ─────────────────────────────────────── */
.nav-badge-pulse { animation: badgePulse 1.5s ease-in-out infinite; }

@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.15); }
}

/* ─── ENHANCED SIDEBAR LOGO ──────────────────────────────────── */
.sidebar-logo .logo-icon { animation: anchorFloat 4s ease-in-out infinite; }

@keyframes anchorFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}

/* ─── COUNTRY FLAG PILL ──────────────────────────────────────── */
.country-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-light);
  color: var(--accent-primary);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}

/* ─── SEARCH HIGHLIGHT ───────────────────────────────────────── */
.highlight {
  background: rgba(34, 211, 238, 0.28);
  color: var(--accent-aqua);
  border-radius: 3px;
  padding: 0 2px;
}

/* ─── FOLLOW-UP PRIORITY QUEUE ───────────────────────────────── */
.followup-item {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.2s ease;
  margin-bottom: 10px;
}

.followup-item:hover { border-color: rgba(45, 212, 191, 0.3); transform: translateX(4px); }
.followup-item.completed { opacity: 0.55; border-color: rgba(52, 211, 153, 0.2); }
.followup-item.overdue { border-color: rgba(248, 113, 113, 0.4); }

.followup-checkbox { width: 22px; height: 22px; cursor: pointer; margin-top: 4px; accent-color: var(--green); }

/* ─── CONTRACT STATUS COLORS ─────────────────────────────────── */
.contract-expiry-warning {
  background: var(--yellow-light);
  border: 1px solid rgba(242, 197, 114, 0.3);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.78rem;
  color: var(--yellow);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ─── REPORT SECTION ─────────────────────────────────────────── */
.report-date-picker { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }

/* ── Custom cursor: soft aqua glow, no ring/circle ──────────────────── */

/* ============================================================
   CURSOR GLOW — theme-aware, reduced size (v3)
   ============================================================ */

body.custom-cursor-active,
body.custom-cursor-active * {
  cursor: none;
}

.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.25s ease, width 0.2s ease, height 0.2s ease, background 0.3s ease;

  /* Dark mode (default): light aqua glow, visible on deep-sea backgrounds */
  background: radial-gradient(
    circle,
    rgba(94, 234, 212, 0.55) 0%,
    rgba(45, 212, 191, 0.26) 35%,
    rgba(45, 212, 191, 0.07) 65%,
    rgba(45, 212, 191, 0) 100%
  );
  filter: blur(2px);
}

.cursor-glow.is-hover {
  width: 32px;
  height: 32px;
  background: radial-gradient(
    circle,
    rgba(94, 234, 212, 0.62) 0%,
    rgba(45, 212, 191, 0.3) 40%,
    rgba(45, 212, 191, 0.09) 70%,
    rgba(45, 212, 191, 0) 100%
  );
}

.cursor-glow.is-down {
  width: 15px;
  height: 15px;
}

/* Light mode: darker, higher-contrast teal/navy glow so the cursor
   doesn't wash out against the "Sunlit Shallows" background */
.cursor-glow.theme-light {
  background: radial-gradient(
    circle,
    rgba(6, 60, 56, 0.55) 0%,
    rgba(13, 148, 136, 0.32) 35%,
    rgba(13, 148, 136, 0.1) 65%,
    rgba(13, 148, 136, 0) 100%
  );
}

.cursor-glow.theme-light.is-hover {
  background: radial-gradient(
    circle,
    rgba(6, 60, 56, 0.6) 0%,
    rgba(13, 148, 136, 0.36) 40%,
    rgba(13, 148, 136, 0.12) 70%,
    rgba(13, 148, 136, 0) 100%
  );
}

@media (pointer: coarse), (prefers-reduced-motion: reduce) {
  .cursor-glow { display: none !important; }
  body.custom-cursor-active,
  body.custom-cursor-active * { cursor: auto; }
}



/* ============================================================
   SECTION: THEME COMPLETENESS + MOTION PACK
   ============================================================ */

/* ------------------------------------------------------------
   1. THEME COMPLETENESS FIXES
   ------------------------------------------------------------ */
body .page-title,
body .stat-value,
body .card-title,
body .activity-text {
  color: var(--text-primary);
}

body .page-subtitle,
body .stat-title,
body .activity-time,
body .chart-subtitle {
  color: var(--text-secondary);
}

body .stat-card,
body .chart-card,
body .card,
body .quick-action-card {
  background-color: transparent; /* let the .card / .card-glass glass rules win */
}

.main-content [style*="background-color: #112240"],
.main-content [style*="background-color:#112240"] {
  background-color: var(--bg-card) !important;
}

.form-control,
select.form-control,
.dropdown-menu,
.modal,
.toast {
  color: var(--text-primary);
  background-color: var(--bg-input);
}
.modal,
.toast {
  background-color: var(--bg-card);
}

.badge { color: inherit; }

:root {
  --chart-text: var(--text-secondary);
  --chart-grid: var(--border-color);
  --chart-tooltip-bg: var(--bg-card);
  --chart-tooltip-border: var(--glass-border);
}

::selection {
  background: var(--accent-light);
  color: var(--text-primary);
}

/* ------------------------------------------------------------
   2. THEME TRANSITION (no flash, no hard cut)
   ------------------------------------------------------------ */
html.theme-transition,
html.theme-transition * {
  transition: background-color 0.35s ease, border-color 0.35s ease,
    color 0.35s ease, box-shadow 0.35s ease !important;
}

/* ------------------------------------------------------------
   3. PREMIUM DASHBOARD HEADER
   ------------------------------------------------------------ */
.dash-header {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  margin-bottom: 18px;
  border-radius: var(--radius-xl);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-card);
  overflow: hidden;
  animation: dashHeaderIn 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.dash-header::before {
  content: '';
  position: absolute;
  inset: -40% -10% auto auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.18) 0%, transparent 70%);
  animation: floatGlow 7s ease-in-out infinite;
  pointer-events: none;
}

.dash-header::after {
  content: '';
  position: absolute;
  inset: auto auto -50% -6%;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.14) 0%, transparent 70%);
  animation: floatGlow 9s ease-in-out infinite reverse;
  pointer-events: none;
}

@keyframes floatGlow {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(-14px, 10px) scale(1.08); }
}

.dash-header-title-wrap { position: relative; z-index: 1; }

.dash-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-primary);
  margin-bottom: 8px;
}

.dash-eyebrow .live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: livePulse 1.8s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(1.4); }
}

.dash-header .page-title {
  font-size: 1.9rem;
  background: linear-gradient(90deg, var(--text-primary) 30%, var(--accent-aqua));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.dash-header-meta {
  position: relative;
  z-index: 1;
  text-align: right;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dash-header-meta .dash-date {
  color: var(--text-secondary);
  font-weight: 600;
}

@keyframes dashHeaderIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ------------------------------------------------------------
   4. ANIMATED / GLOWING STAT CARDS
   ------------------------------------------------------------ */
.stats-grid .stat-card {
  animation: statRise 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.stats-grid .stat-card:nth-child(1) { animation-delay: 0.05s; }
.stats-grid .stat-card:nth-child(2) { animation-delay: 0.12s; }
.stats-grid .stat-card:nth-child(3) { animation-delay: 0.19s; }
.stats-grid .stat-card:nth-child(4) { animation-delay: 0.26s; }
.stats-grid .stat-card:nth-child(5) { animation-delay: 0.33s; }

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

.stat-card {
  position: relative;
  isolation: isolate;
}

.stat-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-aqua));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card:hover::before { transform: scaleX(1); }

.stat-card:hover {
  transform: translateY(-6px) scale(1.02);
}

.stat-value {
  font-variant-numeric: tabular-nums;
  transition: color 0.3s ease;
}

.stat-card:hover .stat-value {
  color: var(--accent-aqua);
}

/* ------------------------------------------------------------
   5. SECTION REVEAL ON SCROLL
   ------------------------------------------------------------ */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ------------------------------------------------------------
   6. CHART CARD — GLOW + ANIMATED TOOLTIP SHELL
   ------------------------------------------------------------ */
.chart-card {
  position: relative;
}
.chart-card .card-title,
.chart-card h3.card-title {
  position: relative;
  display: inline-block;
}
.chart-card .card-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 28px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-aqua));
  border-radius: 2px;
}

.chart-canvas-container {
  animation: chartFadeIn 0.7s ease 0.15s both;
}
@keyframes chartFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}

.chartjs-tooltip-glass {
  position: absolute;
  pointer-events: none;
  background: var(--chart-tooltip-bg);
  border: 1px solid var(--chart-tooltip-border);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  box-shadow: var(--shadow-glow-teal);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  opacity: 0;
  transform: translate(-50%, -6px) scale(0.94);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 20;
  white-space: nowrap;
}
.chartjs-tooltip-glass.visible {
  opacity: 1;
  transform: translate(-50%, -10px) scale(1);
}

/* ------------------------------------------------------------
   7. PREMIUM HAMBURGER
   ------------------------------------------------------------ */
.navbar-toggle {
  position: relative;
  background: none;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}
.navbar-toggle:hover {
  background: var(--accent-light);
  box-shadow: 0 0 0 4px var(--accent-light);
}
.navbar-toggle .hbg-line {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--text-secondary);
  transition: transform 0.35s cubic-bezier(0.65, 0, 0.35, 1),
    opacity 0.25s ease, background-color 0.25s ease, width 0.25s ease;
}
.navbar-toggle:hover .hbg-line { background: var(--accent-primary); }

.navbar-toggle .hbg-line:nth-child(1) { width: 18px; }
.navbar-toggle .hbg-line:nth-child(3) { width: 13px; align-self: flex-end; margin-right: 9px; }
.navbar-toggle:hover .hbg-line:nth-child(3) { width: 18px; margin-right: 0; }

.navbar-toggle.is-open .hbg-line {
  background: var(--accent-aqua);
}
.navbar-toggle.is-open .hbg-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
  width: 18px;
}
.navbar-toggle.is-open .hbg-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.navbar-toggle.is-open .hbg-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
  width: 18px;
  margin-right: 0;
}

/* ------------------------------------------------------------
   8. SIDEBAR MICRO-INTERACTIONS
   ------------------------------------------------------------ */
.sidebar { transition: width var(--transition-sidebar), box-shadow 0.3s ease; }

.sidebar .nav-item {
  position: relative;
  transition: background-color 0.2s ease, color 0.2s ease, padding-left 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease;
}
.sidebar .nav-item:hover {
  box-shadow: inset 0 0 0 1px rgba(45, 212, 191, 0.14);
}
.sidebar .nav-item.active {
  box-shadow: inset 0 0 0 1px rgba(45, 212, 191, 0.22), 0 0 18px -6px rgba(45, 212, 191, 0.4);
}
.sidebar .nav-icon {
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.sidebar .nav-item:hover .nav-icon,
.sidebar .nav-item.active .nav-icon {
  transform: scale(1.14);
}

.sidebar-logo .login-logo-icon,
.sidebar-logo .logo-icon {
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.sidebar-logo:hover .login-logo-icon,
.sidebar-logo:hover .logo-icon {
  transform: rotate(-6deg) scale(1.06);
}

.sidebar { animation: sidebarIn 0.4s ease both; }
@keyframes sidebarIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ------------------------------------------------------------
   9. GLASS / OCEAN DEPTH — subtle parallax glow on cards
   ------------------------------------------------------------ */
.card,
.chart-card,
.stat-card {
  will-change: transform;
}

.card::after,
.chart-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(160deg, rgba(45, 212, 191, 0.05), transparent 40%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.card:hover::after,
.chart-card:hover::after {
  opacity: 1;
}

/* ------------------------------------------------------------
   10. REDUCED MOTION
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .dash-header::before,
  .dash-header::after,
  .dash-eyebrow .live-dot,
  .stats-grid .stat-card,
  .chart-canvas-container,
  .sidebar { animation: none !important; }
}


/* ============================================================
   POLISH PACK — page transitions, scrollbar, focus, card lift
   ============================================================ */

.page-content {
  animation: pageEnter 0.45s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.page-content.page-exit {
  animation: pageExit 0.16s ease forwards;
}

@keyframes pageExit {
  to { opacity: 0; transform: translateY(-6px); }
}

.card,
.chart-card,
.stat-card,
.quick-action-card,
.oc-node,
.orgchart-node {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.25s ease, background-color 0.25s ease;
}

.card:hover,
.chart-card:hover {
  transform: translateY(-4px);
}

.nav-item.active,
.nav-subitem.active,
.tab-btn.active {
  box-shadow: inset 0 0 0 1px rgba(45, 212, 191, 0.22), 0 0 16px -4px rgba(45, 212, 191, 0.45);
}

::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(45, 212, 191, 0.25);
  border-radius: 4px;
  transition: background-color 0.2s ease;
}
::-webkit-scrollbar-thumb:hover { background: rgba(45, 212, 191, 0.5); }

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(45, 212, 191, 0.3) transparent;
}

a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.nav-item:focus-visible,
.nav-group-header:focus-visible,
.nav-subitem:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.form-control:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.4);
  border-radius: var(--radius-sm);
}

.form-control:focus-visible {
  border-color: var(--accent-primary);
}

.table tbody tr,
.followup-item,
.quick-action-card {
  animation: contentFadeIn 0.3s ease both;
}

@keyframes contentFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .page-content,
  .page-content.page-exit,
  .table tbody tr,
  .followup-item,
  .quick-action-card,
  .card:hover,
  .chart-card:hover {
    animation: none !important;
    transform: none !important;
  }
}  




/* ============================================================
   SIDEBAR / LAYOUT — PRODUCTION PATCH v3
   Fixes: collapsed-desktop navigation, mobile drawer conflicts,
   main-content width/margin-left consolidation.
   ============================================================ */

/* ── 1. Collapsed desktop rail: hover flyout submenu ─────────────
   Submenus are unreachable when collapsed because .nav-submenu is
   height-locked to 0. Give each group a hover flyout instead, so
   HR / Crewing / Reports / etc. stay one hover away. */

.sidebar.collapsed .nav-group {
  position: relative;
}

/* Suppress the plain tooltip on group headers in collapsed mode —
   the flyout below replaces it with something actually clickable. */
.sidebar.collapsed .nav-group-header:hover::after {
  content: none;
}

.sidebar.collapsed .nav-group:hover .nav-submenu,
.sidebar.collapsed .nav-group:focus-within .nav-submenu {
  display: block;
  position: absolute;
  left: calc(100% + 8px);
  top: 0;
  min-width: 220px;
  max-height: none !important;
  opacity: 1 !important;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 250;
  animation: fadeIn 0.15s ease forwards;
}

.sidebar.collapsed .nav-submenu {
  /* default (not hovered): fully hidden, out of flow */
  display: none;
}

.sidebar.collapsed .nav-submenu-inner {
  padding: 2px;
}

.sidebar.collapsed .nav-submenu-inner::before {
  display: none; /* no vertical guide line inside the flyout */
}

/* Inside the flyout, labels must be visible even though the rail
   itself hides .nav-label elsewhere. */
.sidebar.collapsed .nav-group:hover .nav-subitem,
.sidebar.collapsed .nav-group:focus-within .nav-subitem {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}

.sidebar.collapsed .nav-group:hover .nav-label,
.sidebar.collapsed .nav-group:focus-within .nav-label {
  opacity: 1;
  width: auto;
  max-width: none;
  flex: 1 1 auto;
  margin: 0;
  padding: 0;
}

.sidebar.collapsed .nav-subitem {
  margin-left: 0;
  padding: 8px 10px;
}

/* Chevron is meaningless in collapsed mode — hide it, icon centers */
.sidebar.collapsed .nav-chevron {
  display: none;
}

/* ── 2. Tablet + Mobile: collapsed must never apply, and the sidebar
   must default to hidden unless explicitly opened. This must match
   the 991.98px threshold where the sidebar first becomes a fixed
   off-canvas drawer (see the main @media (max-width: 991.98px)
   block above) — NOT a narrower 768px. ────── */
@media (max-width: 991.98px) {
  .sidebar.collapsed {
    width: min(280px, 88vw) !important;
  }

  /* Belt-and-braces default: on tablet/mobile, ANY sidebar state that
     is not '.mobile-open' stays off-screen. */
  .sidebar:not(.mobile-open) {
    transform: translateX(-105%) !important;
  }

  /* mobile-open always wins on tablet/mobile, regardless of a stray
     'collapsed' class (belt-and-braces; JS also strips it) */
  .sidebar.mobile-open {
    transform: translateX(0) !important;
  }

  .sidebar.collapsed .nav-group:hover .nav-submenu {
    display: none; /* no hover-flyouts on touch devices */
  }
}

/* ── 3. Consolidated main-content width / margin rules ───────────
   Single source of truth — remove any OTHER margin-left/width
   declarations for .main-content elsewhere in the file if present,
   including inline style="margin-left:..." in your HTML pages. */
.main-content {
  flex: 1;
  min-width: 0;
  width: auto;
  margin-left: var(--sidebar-width);
  transition: margin-left var(--transition-sidebar);
}

.main-content.sidebar-collapsed {
  margin-left: var(--sidebar-collapsed);
}

@media (max-width: 768px) {
  .main-content,
  .main-content.sidebar-collapsed {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100vw;
  }
}

/* ── 4. Overlay/backdrop — ensure it always sits under the drawer
   but above page content, and never blocks clicks when inactive ── */
.sidebar-overlay {
  pointer-events: none;
}
.sidebar-overlay.active {
  pointer-events: auto;
}

/* ── 5. app-wrapper AND app-layout: sidebar is position:fixed so
   neither wrapper class should be counted as a flex sibling taking
   up space. ─────────────────────────────────────── */
.app-wrapper,
.app-layout {
  width: 100%;
}

/* ============================================================
   ATTENDANCE NAVBAR BUTTON — append this block to styles1.css
   (e.g. right after the "PREMIUM HAMBURGER" section). Uses only
   existing tokens (--green, --yellow, --red, --accent-*, --radius-*)
   so it matches both the dark "Deep Sea" and light "Sunlit Shallows"
   themes automatically.
   ============================================================ */

.attendance-nav-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
}

.attendance-nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 6px var(--yellow);
  animation: badgePulse 1.5s ease-in-out infinite;
  flex-shrink: 0;
}

/* Not checked in yet today — inviting, teal accent (matches primary btn) */
.attendance-nav-btn.state-checkin {
  border-color: rgba(20, 184, 166, 0.35);
  color: var(--accent-primary);
}
.attendance-nav-btn.state-checkin:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-light);
}

/* Currently checked in — amber, with the pulsing dot, so "you are
   actively clocked in" is unmistakable at a glance */
.attendance-nav-btn.state-checkout {
  border-color: rgba(242, 197, 114, 0.4);
  color: var(--yellow);
  background: var(--yellow-light);
}
.attendance-nav-btn.state-checkout:hover {
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px var(--yellow-light);
}

/* Already checked out for the day — calm, neutral/green */
.attendance-nav-btn.state-done {
  border-color: rgba(52, 211, 153, 0.35);
  color: var(--green);
}
.attendance-nav-btn.state-done:hover {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-light);
}

/* Icon-only collapse at ≤576px, matching the Org Chart / Logout / theme
   toggle buttons that already collapse at this breakpoint. */
@media (max-width: 576px) {
  .attendance-nav-btn {
    padding: 7px 9px !important;
    gap: 4px;
  }
  .attendance-nav-btn .navbar-label {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .attendance-nav-dot { animation: none !important; }
}




/* Submit Application Form button */
.page-header .btn-primary {
background: #0d9488 !important;
border-color: #0d9488 !important;
color: #ffffff !important;
transition: all 0.2s ease;
}

.page-header .btn-primary:hover {
background: #0d9488 !important;
border-color: #0d9488 !important;
color: #ffffff !important;
transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.page-header .btn-primary:focus,
.page-header .btn-primary:active {
background: #0d9488 !important;
border-color: #0d9488 !important;
color: #ffffff !important;
}
