:root {
  --ink: #0f172a;
  --muted: #64748b;
  --blue: #2563eb;
  --accent: #059669;
  --accent-light: #10b981;
  --secondary: #1e40af;
  --secondary-light: #2563eb;
  --primary: #1e40af;
  --gold: #d4a017;
  --gold-light: #fbbf24;
  --teal: #0d9488;
  --green: #16a34a;
  --lime: #65a30d;
  --paper: #ffffff;
  --mist: #f1f5f9;
  --line: rgba(0, 0, 0, 0.06);
  --danger: #dc2626;
  --warn: #d97706;
  --pink: #db2777;
  --orange: #ea580c;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 10px 25px rgba(0,0,0,0.06);
  --shadow-lg: 0 20px 50px rgba(0,0,0,0.1);
  --glow-accent: 0 0 20px rgba(5,150,105,0.12), 0 0 60px rgba(5,150,105,0.04);
  --glow-secondary: 0 0 20px rgba(30,64,175,0.12), 0 0 60px rgba(30,64,175,0.04);
  --bg: #fafcfb;
  --card-bg: rgba(255, 255, 255, 0.7);
  --topbar-bg: rgba(255, 255, 255, 0.85);
  --input-bg: #ffffff;
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 280ms cubic-bezier(0.22,1,0.36,1);
  --rail-bg: #ffffff;
  --rail-hover: rgba(5, 150, 105, 0.08);
  --rail-active-bg: linear-gradient(135deg, rgba(5,150,105,0.12), rgba(30,64,175,0.08));
  --rail-active-border: rgba(5, 150, 105, 0.3);
  --rail-text: #64748b;
  --rail-text-active: #059669;
  --rail-section: #94a3b8;
  --rail-divider: rgba(0, 0, 0, 0.06);
  --gradient: linear-gradient(135deg, #059669, #1e40af);
  --gradient-gold: linear-gradient(135deg, #d4a017, #fbbf24);
}

@keyframes fadeSlideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes pageEnter { from { opacity: 0; transform: translateY(30px) scale(0.98); } to { opacity: 1; } }
@keyframes toastSlideIn { from { opacity: 0; transform: translateX(40px) scale(0.95); } to { opacity: 1; transform: translateX(0) scale(1); } }
@keyframes toastSlideOut { to { opacity: 0; transform: translateX(40px) scale(0.95); } }
@keyframes skeletonShimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes gradShift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes pulseAmber { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
@keyframes bellShake { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(12deg); } 30% { transform: rotate(-12deg); } 45% { transform: rotate(8deg); } 60% { transform: rotate(-8deg); } 75% { transform: rotate(4deg); } 90% { transform: rotate(-4deg); } }
@keyframes onlinePulse { 0%, 100% { box-shadow: 0 0 0 2px rgba(34,197,94,0.3); } 50% { box-shadow: 0 0 0 6px rgba(34,197,94,0.1); } }
@keyframes cb-fall { 0% { transform: translateY(-20px) rotate(0deg); opacity: 0.9; } 80% { opacity: 0.5; } 100% { transform: translateY(200px) rotate(720deg); opacity: 0; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes floatBg { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-20px) scale(1.02); } }
@keyframes glow-pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 0.8; } }
@keyframes border-rotate { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes nebula-drift { 0% { transform: translate(0,0) scale(1); } 33% { transform: translate(30px,-20px) scale(1.1); } 66% { transform: translate(-20px,15px) scale(0.95); } 100% { transform: translate(0,0) scale(1); } }

input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; flex-shrink: 0; }
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
.main { animation: pageEnter 0.6s cubic-bezier(0.22,1,0.36,1) both; }

body {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  overflow-y: scroll;
}

body::before {
  content: ''; position: fixed; inset: 0; z-index: -1;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg) 100%),
    radial-gradient(ellipse 50% 40% at 20% 20%, rgba(5,150,105,0.04) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 80% 80%, rgba(30,64,175,0.03) 0%, transparent 60%),
    radial-gradient(ellipse 30% 25% at 50% 50%, rgba(212,160,23,0.02) 0%, transparent 50%);
  animation: bodyGlow 12s ease-in-out infinite alternate;
}

@keyframes bodyGlow {
  0% { opacity: 0.4; }
  100% { opacity: 1; }
}

a { color: inherit; text-decoration: none; }

/* Particle canvas */
#particle-canvas {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}

/* Top accent bar */
.top-accent {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--secondary), var(--pink), var(--accent));
  background-size: 300% 100%;
  animation: border-rotate 6s ease infinite;
  box-shadow: 0 0 20px rgba(5,150,105,0.3);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  z-index: 1;
  background:
    radial-gradient(ellipse 50% 40% at 20% 30%, rgba(5,150,105,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 40% 50% at 80% 70%, rgba(30,64,175,0.1) 0%, transparent 60%),
    radial-gradient(ellipse 30% 30% at 50% 10%, rgba(25,188,122,0.06) 0%, transparent 50%);
}

.login-shell::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.03) 1px, transparent 0);
  background-size: 40px 40px;
  pointer-events: none;
}

.panel {
  width: min(440px, 100%);
  padding: 36px;
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
  animation: fadeSlideUp 0.6s cubic-bezier(0.22,1,0.36,1) both;
}

.panel::before {
  content: ''; position: absolute; inset: -1px; border-radius: inherit;
  background: linear-gradient(135deg, rgba(5,150,105,0.15), transparent 40%, transparent 60%, rgba(30,64,175,0.15));
  z-index: -1; mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  padding: 1px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.brand img {
  width: 65px; height: 65px;
  object-fit: contain;
  padding: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

h1, h2, h3, h4 { margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.5rem, 3.5vw, 2rem); line-height: 1.15; font-weight: 750; color: var(--secondary); }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 650; }
p { color: var(--muted); line-height: 1.65; margin: 0 0 12px; }

label {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 0.86rem;
  font-weight: 650;
  color: var(--ink);
}

input, select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.94rem;
  background: var(--input-bg);
  color: var(--ink);
  transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(5,150,105,0.1);
}

textarea { resize: vertical; min-height: 80px; }

/* Buttons */
.button, button:not(.menu-toggle):not(.sidebar-toggle):not(.sidebar-expand):not(.modal-close):not(.pw-toggle):not(.toast-close) {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--secondary));
  border: 0;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 650;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 300ms cubic-bezier(0.22,1,0.36,1), box-shadow var(--transition);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.button:hover, button:not(.menu-toggle):not(.sidebar-toggle):not(.sidebar-expand):not(.modal-close):not(.pw-toggle):not(.toast-close):hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.button.secondary { background: var(--paper); border: 1.5px solid var(--line); color: var(--ink); box-shadow: none; }
.button.secondary:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.button.danger { background: linear-gradient(135deg, var(--danger), #dc2626); }
.button.danger:hover { box-shadow: var(--shadow-md); }
.button:active, button:not(.menu-toggle):not(.sidebar-toggle):not(.sidebar-expand):not(.modal-close):not(.pw-toggle):not(.toast-close):active { transform: translateY(0) scale(0.97); }
.button.small { min-height: 32px; padding: 0 14px; font-size: 0.82rem; }
.button.small svg, button.small svg { width: 16px; height: 16px; }
button svg { width: 18px; height: 18px; flex-shrink: 0; }

/* App layout */
.app {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  position: relative;
  z-index: 0;
}

/* === RAIL SIDEBAR === */
.rail {
  position: sticky;
  top: 0;
  left: 0;
  width: 200px;
  min-width: 200px;
  height: 100vh;
  background: var(--rail-bg);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
}
.rail::-webkit-scrollbar { width: 0; }

.rail-brand {
  width: 100%;
  height: 48px;
  margin-bottom: 16px;
  flex-shrink: 0;
  background: var(--paper);
  border-radius: 12px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.rail-brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
  transition: transform 200ms ease;
}
.rail-brand:hover img {
  transform: scale(1.08);
}
.rail-brand span {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}

.rail-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}
.rail-nav::-webkit-scrollbar { display: none; }

.rail-link {
  width: 100%;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--gold);
  transition: all 200ms ease;
  position: relative;
  text-decoration: none;
  flex-shrink: 0;
}
.rail-link i {
  font-size: 22px;
  transition: all 200ms ease;
  color: var(--gold);
  flex-shrink: 0;
}
.rail-link .rail-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--rail-text);
  white-space: nowrap;
  transition: color 200ms ease;
}
.rail-link:hover {
  background: var(--rail-hover);
}
.rail-link:hover .rail-label {
  color: var(--gold-light);
}
.rail-link:hover i {
  color: var(--gold-light);
  transform: scale(1.1);
  filter: drop-shadow(0 0 8px var(--gold));
}
.rail-link.active {
  background: var(--rail-active-bg);
  border: 1px solid var(--rail-active-border);
  box-shadow: 0 0 16px rgba(212, 160, 23, 0.15);
}
.rail-link.active .rail-label {
  color: var(--gold-light);
  font-weight: 700;
}
.rail-link.active i {
  color: var(--gold-light);
  filter: drop-shadow(0 0 6px var(--gold));
}
/* Flyout labels hidden — labels are now inline */
.rail-link[data-flyout]::after {
  display: none !important;
}
/* Premium items get brighter gold + stronger glow */
.rail-link[data-gold] i {
  color: var(--gold-light);
}
.rail-link[data-gold] .rail-label {
  color: var(--gold-light);
}
.rail-link[data-gold]:hover i {
  color: #f0c850;
  filter: drop-shadow(0 0 10px var(--gold));
}
.rail-link[data-gold].active i {
  color: #f0c850;
  filter: drop-shadow(0 0 8px var(--gold));
}

.rail-divider {
  width: 100%;
  height: 1px;
  background: var(--rail-divider);
  margin: 8px 0;
  flex-shrink: 0;
}

.rail-user {
  padding: 10px 4px;
  border-top: 1px solid var(--rail-divider);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.rail-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  object-fit: cover;
  transition: all 200ms ease;
  box-shadow: 0 0 10px rgba(212, 160, 23, 0.2);
}
.rail-avatar:hover {
  border-color: var(--gold-light);
  box-shadow: 0 0 24px rgba(212, 160, 23, 0.4), 0 0 48px rgba(212, 160, 23, 0.15);
  transform: scale(1.08);
}

/* === TOOLTIP (help) - legacy flyout items === */
.flyout { display: none; }

/* === THEME TOGGLE === */
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card-bg);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  font-size: 24px;
  transition: all 200ms ease;
}
.theme-toggle:hover {
  background: var(--rail-hover);
  color: var(--accent);
  border-color: var(--rail-active-border);
  transform: scale(1.05);
}

/* === CUSTOM CURSOR === */
.custom-cursor {
  position: fixed;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gradient);
  pointer-events: none;
  z-index: 99999;
  mix-blend-mode: difference;
  transition: width 200ms ease, height 200ms ease, margin 200ms ease;
  will-change: transform;
}
.custom-cursor.hovering {
  width: 40px;
  height: 40px;
  margin-left: -10px;
  margin-top: -10px;
}
@media (hover: none) {
  .custom-cursor { display: none; }
}

/* === SCROLL REVEAL === */
[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s cubic-bezier(0.22,1,0.36,1), transform 0.5s cubic-bezier(0.22,1,0.36,1);
}
[data-reveal="scale"] { transform: scale(0.95); }
[data-reveal="left"] { transform: translateX(-20px); }
[data-reveal].revealed { opacity: 1; transform: none; }
[data-reveal].revealed > *:nth-child(1) { transition-delay: 0s; }
[data-reveal].revealed > *:nth-child(2) { transition-delay: 0.06s; }
[data-reveal].revealed > *:nth-child(3) { transition-delay: 0.12s; }
[data-reveal].revealed > *:nth-child(4) { transition-delay: 0.18s; }
[data-reveal].revealed > *:nth-child(5) { transition-delay: 0.24s; }
[data-reveal].revealed > *:nth-child(6) { transition-delay: 0.3s; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* === HELP TOOLTIPS === */
[data-help] { position: relative; }
[data-help]::after {
  content: attr(data-help);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--ink);
  color: var(--paper);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.35;
  white-space: normal;
  width: 200px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease, transform 150ms ease;
  z-index: 99999;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}
[data-help]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Tooltip for rail/flyout items - show to the right */
.rail-link[data-help]::after,
.flyout-item[data-help]::after {
  bottom: auto;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  width: 180px;
  text-align: left;
}
.rail-link[data-help]:hover::after,
.flyout-item[data-help]:hover::after {
  transform: translateY(-50%) translateX(0);
}
.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.55rem;
  font-weight: 700;
  cursor: help;
  vertical-align: super;
  margin-left: 4px;
  position: relative;
  transition: background 150ms ease, transform 150ms ease;
  flex-shrink: 0;
  z-index: 10000;
}
.help-icon:hover {
  background: var(--secondary);
  transform: scale(1.1);
}
.help-wr {
  display: inline-flex;
  align-items: center;
  gap: 0;
  vertical-align: middle;
  position: relative;
  z-index: 10000;
}
.help-wr[data-help] { position: relative; }
.help-wr[data-help]::after {
  content: attr(data-help);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--ink);
  color: var(--paper);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.4;
  white-space: normal;
  width: 220px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease, transform 150ms ease;
  z-index: 10000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}
.help-wr[data-help]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
/* Stat section help icon */
.stat-pill[data-help]::after,
.report-section[data-help]::after {
  bottom: auto;
  top: -8px;
  left: auto;
  right: 0;
  transform: translateY(-100%) translateX(0);
}
.stat-pill[data-help]:hover::after,
.report-section[data-help]:hover::after {
  transform: translateY(-100%) translateX(0);
}

/* === BUTTON RIPPLE === */
.ripple {
  position: absolute;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(5, 150, 105, 0.3);
  transform: translate(-50%, -50%);
  animation: rippleExpand 600ms ease-out forwards;
  pointer-events: none;
}
@keyframes rippleExpand {
  to { width: 200px; height: 200px; opacity: 0; }
}

/* === TOPBAR === */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}
.topbar-name {
  color: var(--secondary);
  font-weight: 700;
}

/* Dashboard quick actions menu */
.qa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

@media screen and (min-width: 1200px) {
  .qa-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
.qa-item, button.qa-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 10px 12px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  user-select: none;
}
.qa-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
  border-color: var(--accent);
}
.qa-item:active {
  transform: scale(0.94);
  transition-duration: 0.08s;
}
.qa-item .qa-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.qa-item:hover .qa-icon {
  transform: scale(1.08) rotate(-2deg);
}
.qa-item .qa-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.qa-item .qa-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(5,150,105,0.25);
  transform: scale(0);
  animation: qa-ripple-effect 0.5s ease-out;
  pointer-events: none;
}
@keyframes qa-ripple-effect {
  to { transform: scale(4); opacity: 0; }
}

/* Quick action color themes */
.qa-wall .qa-icon { background: rgba(255,107,181,0.12); color: #ff6bb5; }
.qa-notif .qa-icon { background: rgba(255,165,0,0.12); color: #ff8c00; }
.qa-mail .qa-icon { background: rgba(10,123,181,0.12); color: #0a7bb5; }
.qa-leave .qa-icon { background: rgba(107,203,119,0.12); color: #6bcb77; }
.qa-payslip .qa-icon { background: rgba(255,217,61,0.12); color: #d4a017; }
.qa-profile .qa-icon { background: rgba(77,150,255,0.12); color: #4d96ff; }
.qa-attendance .qa-icon { background: rgba(77,150,255,0.12); color: #4d96ff; }
.qa-checkout .qa-icon { background: rgba(239,68,68,0.12); color: #ef4444; }
.qa-expenses .qa-icon { background: rgba(52,211,153,0.12); color: #34d399; }
.qa-settings .qa-icon { background: rgba(166,108,255,0.12); color: #a66cff; }

/* Original sidebar tools (for backward compatibility) */
.sidebar-tools .st-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
  border: none;
  background: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all var(--transition);
}
.sidebar-tools .st-btn svg {
  width: 14px; height: 14px;
  stroke: currentColor; fill: none; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

/* Sidebar states (desktop) */
@media screen and (min-width: 769px) {
  .sidebar.collapsed { width: 56px; min-width: 56px; padding: 16px 4px; border-radius: 0 18px 18px 0; }
  .sidebar.collapsed .brand { justify-content: center; gap: 4px; padding: 4px 0 8px; border-bottom: 1px solid rgba(255,255,255,0.1); }
  .sidebar.collapsed .brand img { width: 32px; height: 32px; border-radius: 8px; }
  .sidebar.collapsed .brand-text,
  .sidebar.collapsed .brand-sub { display: none; }
  .sidebar.collapsed .nav { padding: 0; }
  .sidebar.collapsed .nav a { justify-content: center; padding: 12px 0; border-radius: 12px; width: 44px; margin: 0 auto; gap: 0; }
  .sidebar.collapsed .nav a span { display: none; }
  .sidebar.collapsed .nav a svg { width: 30px; height: 30px; }
  .sidebar.collapsed .sidebar-expand { width: 44px; margin: 8px auto 0; padding: 11px 0; border-radius: 14px; }
  .sidebar.collapsed .sidebar-expand svg { width: 20px; height: 20px; transform: rotate(180deg); }
  .sidebar.collapsed .st-label { display: none; }
  .sidebar.collapsed .sidebar-tools { display: flex; flex-direction: column; align-items: center; }
  .sidebar.collapsed .sidebar-tools a,
  .sidebar.collapsed .sidebar-tools button { justify-content: center; padding: 10px 0; width: 36px; }
  .sidebar.collapsed .sidebar-tools a svg { margin: 0; }
  .sidebar.collapsed .sidebar-tools a span { display: none; }
  .sidebar.collapsed .sidebar-toggle { right: -13px; top: 10px; width: 22px; height: 22px; font-size: 0.65rem; }

  .sidebar.stretched { width: 280px; min-width: 280px; padding: 16px 12px; }
  .sidebar.stretched .brand { padding: 4px 12px 8px; flex-direction: row; gap: 12px; }
  .sidebar.stretched .brand img { width: 52px; height: 52px; }
  .sidebar.stretched .brand-text strong { font-size: 1rem; }
  .sidebar.stretched .nav a { padding: 12px 14px; gap: 14px; font-size: 0.92rem; }
  .sidebar.stretched .nav a svg { width: 30px; height: 30px; }
}
@media screen and (max-width: 768px) {
  .sidebar.collapsed { width: 240px; min-width: 240px; padding: 16px 10px; }
  .sidebar.collapsed .brand { padding: 0 8px 8px; gap: 4px; }
  .sidebar.collapsed .brand-text,
  .sidebar.collapsed .brand-sub { display: flex; }
  .sidebar.collapsed .nav { padding: 0; }
  .sidebar.collapsed .nav a { border-radius: 12px; width: auto; padding: 10px 12px; justify-content: flex-start; }
  .sidebar.collapsed .nav a span { display: inline; }
  .sidebar.collapsed .nav a svg { margin: 0; }
  .sidebar.collapsed .sidebar-tools a span { display: inline; }
}

/* Main content */
.main {
  flex: 1;
  min-width: 0;
  padding: clamp(16px, 2.5vw, 40px);
  width: 100%;
  position: relative;
  margin: 0 auto;
}

@media screen and (min-width: 1400px) {
  .main { padding: 32px 48px; }
}

@media screen and (min-width: 769px) and (max-width: 1000px) {
  .sidebar { width: 180px; min-width: 180px; }
}

.main::before {
  content: ''; position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 60% 40% at 20% 10%, rgba(5,150,105,0.04) 0%, transparent 50%),
    radial-gradient(ellipse 40% 50% at 80% 90%, rgba(30,64,175,0.03) 0%, transparent 50%);
  pointer-events: none;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--line);
}

.topbar {
  background: var(--topbar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 2px; z-index: 40;
  margin: 0 calc(-1 * clamp(16px,3vw,36px)) 24px;
  padding: 12px clamp(16px,3vw,36px);
  border-radius: 16px;
}

.topbar h1 { font-size: 1.4rem; }
.topbar p { margin: 0; font-size: 0.9rem; }
.topbar p .badge { font-size: 0.75rem !important; padding: 3px 12px !important; vertical-align: middle; margin-left: 6px; }

/* Profile menu */
.profile-menu { position: relative; min-width: 44px; text-align: right; }

.profile-menu summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 4px 12px 4px 4px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 100px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.profile-menu summary:hover { box-shadow: var(--shadow-sm); border-color: var(--accent); }
.profile-menu summary::-webkit-details-marker { display: none; }

.profile-menu summary img { border: 2px solid var(--line); transition: border-color 300ms ease; width: 32px; height: 32px; }
.profile-menu summary:hover img { border-color: var(--accent); }

.profile-menu img, .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--mist);
  border: 1px solid var(--line);
}

.avatar-large { width: 70px; height: 70px; }

.profile-menu > div {
  position: absolute;
  z-index: 30;
  right: 0;
  top: calc(100% + 10px);
  width: 220px;
  display: grid;
  gap: 2px;
  padding: 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  text-align: left;
}

.profile-menu div strong { padding: 6px 10px 0; font-size: 0.94rem; }
.profile-menu div small { color: var(--muted); padding: 2px 10px 8px; font-size: 0.8rem; }
.profile-menu a { padding: 10px 12px; border-radius: var(--radius-sm); font-weight: 600; font-size: 0.88rem; transition: all var(--transition); }
.profile-menu a:hover { background: rgba(5,150,105,0.08); color: var(--accent); }

/* Grids */
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }

.employee-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }

/* Cards */
.card {
  padding: 20px;
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.card.pill, .form-card.pill { border-radius: 16px; }
.card.clickable { cursor: pointer; }
.card.clickable:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg), 0 0 0 1px rgba(5,150,105,0.08); }

/* Stat cards */
.stat-card {
  padding: 20px;
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: box-shadow var(--transition), transform 300ms cubic-bezier(0.22,1,0.36,1);
}

.stat-card:hover { box-shadow: var(--shadow-md), var(--glow-accent); transform: translateY(-2px); }

.stat-card.event-card {
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 24px;
  gap: 14px;
  background: var(--card-bg);
}

.stat-card.event-card .stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(5,150,105,0.06);
  flex-shrink: 0;
  display: grid;
  place-items: center;
}
.stat-card.event-card .stat-body { text-align: center; }
.stat-card.event-card .stat-body h3 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 8px;
}
.stat-card.event-card .event-list { margin-top: 0; }
.stat-card.event-card .event-item { text-align: left; }

.stat-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(5,150,105,0.1), rgba(30,64,175,0.1));
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.stat-icon svg { width: 28px; height: 28px; stroke: var(--accent); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stat-icon i { font-size: 28px; color: var(--accent); }
.stat-card:hover .stat-icon { transform: scale(1.05) rotate(-3deg); }

.stat-body { flex: 1; min-width: 0; }
.stat-body h3 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 6px; }

.stat-value {
  font-size: 1.8rem;
  font-weight: 750;
  color: var(--ink);
  line-height: 1.2;
  background: linear-gradient(135deg, var(--accent), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-body p { margin: 4px 0 0; font-size: 0.82rem; }

/* Tables */
.table-wrap {
  overflow: auto;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

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

th, td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  background: rgba(5,150,105,0.03);
}

tr:last-child td { border-bottom: 0; }
tr:hover td { background: rgba(5,150,105,0.03); }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }

.form-card {
  padding: 24px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  margin-bottom: 16px;
}

.form-card h2 { margin-bottom: 18px; }

/* Flash */
.flash {
  padding: 14px 18px;
  margin-bottom: 18px;
  border-radius: var(--radius-sm);
  background: rgba(22,163,74,0.06);
  color: var(--green);
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid rgba(22,163,74,0.15);
  border-left: 4px solid var(--green);
  animation: toastIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.flash.error { background: rgba(220,38,38,0.06); color: var(--danger); border-color: rgba(220,38,38,0.15); border-left-color: var(--danger); }

/* Badges */
.badge {
  display: inline-flex;
  padding: 4px 12px;
  border-radius: 100px;
  background: rgba(5,150,105,0.08);
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 650;
  white-space: nowrap;
  letter-spacing: 0.02em;
  border: 1px solid rgba(5,150,105,0.15);
}

.badge-green { background: rgba(22,163,74,0.08); color: var(--green); border-color: rgba(22,163,74,0.15); }
.badge-red { background: rgba(220,38,38,0.08); color: var(--danger); border-color: rgba(220,38,38,0.15); }
.badge-amber { background: rgba(217,119,6,0.08); color: var(--warn); border-color: rgba(217,119,6,0.15); }

.badge-amber, .status-open { animation: pulseAmber 2s ease-in-out infinite; }

/* Notification bell */
.notif-bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; transition: all var(--transition); }
.notif-bell:hover { background: rgba(5,150,105,0.08); }
.notif-bell svg { width: 24px; height: 24px; }

.notif-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 100px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-size: 0.72rem; font-weight: 900; line-height: 1;
  position: absolute; top: -4px; right: -10px;
  box-shadow: 0 0 0 3px var(--bg), 0 3px 8px rgba(220,38,38,0.5);
  border: 1.5px solid var(--bg);
}

.notif-bell .notif-badge + svg { animation: bellShake 1s ease-in-out 0.5s; }
.notif-bell:hover svg { color: var(--accent); }

/* ---- Admin tabs ---- */
.admin-tabs {
  display: flex; gap: 4px; margin-bottom: 20px; flex-wrap: wrap;
  background: var(--card-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 6px;
}
.admin-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border: none; border-radius: var(--radius-sm);
  background: transparent; color: var(--muted); font-size: 0.8rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition); white-space: nowrap;
}
.admin-tab:hover { background: rgba(5,150,105,0.06); color: var(--ink); }
.admin-tab.active {
  background: rgba(5,150,105,0.1); color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent);
}
.admin-tab svg { flex-shrink: 0; }
.admin-content { animation: fadeIn 0.2s ease; }
.admin-content[data-tab-content]:not(.active) { display: none; }
.admin-tools {
  display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; align-items: center;
  padding: 16px; background: var(--card-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-radius: var(--radius);
}

/* ---- Notifications page ---- */
.notif-page { max-width: 720px; margin: 0 auto; padding: 0; }
.notif-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.notif-stats { display: flex; gap: 12px; margin-bottom: 24px; }
.notif-stat {
  flex: 1; padding: 16px 20px;
  background: var(--card-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-radius: var(--radius); text-align: center;
  transition: box-shadow var(--transition), transform var(--transition);
}
.notif-stat:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.notif-stat-value {
  font-size: 1.5rem; font-weight: 800; line-height: 1.2;
  background: linear-gradient(135deg, var(--accent), var(--secondary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.notif-stat.unread .notif-stat-value { background: linear-gradient(135deg, #ef4444, #dc2626); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.notif-stat.read .notif-stat-value { background: linear-gradient(135deg, var(--green), #22c55e); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.notif-stat-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-top: 4px; font-weight: 600; }

.notif-date-group { margin-bottom: 24px; }
.notif-date-header {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); font-weight: 700; margin-bottom: 10px; padding: 0 4px;
}

.notif-row {
  display: flex; gap: 14px; padding: 16px 18px;
  background: var(--card-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: 8px; cursor: pointer;
  transition: all var(--transition); align-items: start; position: relative;
}
.notif-row:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.notif-row.unread { border-left: 3px solid var(--accent); padding-left: 16px; }

.notif-icon {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.notif-body { flex: 1; min-width: 0; }
.notif-title {
  font-size: 0.9rem; font-weight: 600; color: var(--ink);
  display: flex; align-items: center; gap: 8px;
}
.notif-row.unread .notif-title { font-weight: 700; }
.notif-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent); box-shadow: 0 0 6px rgba(5,150,105,0.4);
}
.notif-text { font-size: 0.82rem; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.notif-time { font-size: 0.72rem; color: var(--muted); margin-top: 6px; }

.notif-actions {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
  opacity: 0; transition: opacity var(--transition);
}
.notif-row:hover .notif-actions,
.notif-row.unread .notif-actions { opacity: 1; }

.notif-mark-read {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card-bg);
  color: var(--green); cursor: pointer; display: grid; place-items: center;
  transition: all var(--transition);
}
.notif-mark-read:hover { background: rgba(22,163,74,0.08); border-color: var(--green); }

.notif-view {
  font-size: 0.75rem; padding: 5px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--card-bg);
  color: var(--ink); text-decoration: none; font-weight: 600;
  transition: all var(--transition);
}
.notif-view:hover { border-color: var(--accent); color: var(--accent); }

.notif-empty {
  text-align: center; padding: 60px 0; color: var(--muted);
}
.notif-empty svg { width: 48px; height: 48px; stroke: var(--line); margin-bottom: 16px; }
.notif-empty p { font-size: 0.9rem; }

/* Status indicators */
.status-open { color: var(--green); font-weight: 650; }
.status-closed { color: var(--muted); }

/* Progress bars */
.progress-bar { margin: 6px 0; }

.progress-track {
  height: 6px;
  background: rgba(255,255,255,0.04);
  border-radius: 100px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--accent), var(--secondary), var(--accent));
  background-size: 200% 100%;
  transition: width 600ms cubic-bezier(0.22, 1, 0.36, 1);
  animation: shimmer 3s ease infinite;
}

.progress-fill.warn { background: linear-gradient(90deg, var(--warn), var(--orange)); }
.progress-fill.danger { background: linear-gradient(90deg, var(--danger), #dc2626); }

/* Celebration */
.celebration-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.mini-profile {
  display: flex;
  gap: 14px;
  align-items: center;
}

.mini-profile .avatar { width: 38px; height: 38px; border: 2px solid rgba(255,255,255,0.06); transition: border-color 300ms ease, transform 300ms ease; }
.mini-profile:hover .avatar { border-color: var(--accent); transform: scale(1.03); }

/* Detail list */
.detail-list { display: grid; gap: 4px; }

.detail-list div {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.02);
  transition: all var(--transition);
}

.detail-list div:nth-child(even) { background: transparent; }
.detail-list:not(.modern) div:hover { background: rgba(5,150,105,0.03); }

.detail-list strong { font-weight: 650; color: var(--ink); font-size: 0.86rem; }
.detail-list span { color: var(--muted); font-size: 0.9rem; }

.detail-list.modern div {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; background: var(--mist);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  margin-bottom: 6px; transition: all var(--transition);
}
.detail-list.modern div:hover { border-color: rgba(5,150,105,0.2); transform: translateX(3px); }
.detail-list.modern div:nth-child(even) { background: rgba(5,150,105,0.02); }
.detail-list.modern .dl-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: rgba(5,150,105,0.06); flex-shrink: 0; }
.detail-list.modern .dl-icon svg { width: 16px; height: 16px; stroke: var(--accent); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.detail-list.modern .dl-content { flex: 1; min-width: 0; }
.detail-list.modern .dl-content strong { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 700; margin-bottom: 2px; }
.detail-list.modern .dl-content span { font-size: 0.92rem; color: var(--ink); font-weight: 500; word-break: break-word; }

/* Wall posts */
.wall-post { margin-bottom: 16px; }
.wall-post:last-child { margin-bottom: 0; }

.wall-post header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.84rem;
  margin-bottom: 10px;
}

.wall-media {
  display: block;
  max-width: 100%;
  width: auto;
  max-height: 420px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  margin: 10px auto 0;
}

.wall-post .wall-actions { margin-top: 10px; }

.wall-body {
  font-size: 0.96rem;
  line-height: 1.7;
  color: var(--ink);
  margin: 6px 0;
  word-break: break-word;
}

.wall-gif-wrap {
  margin-top: 10px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: transparent;
  display: flex;
  justify-content: center;
  max-width: 100%;
}

.wall-gif { 
  display: block; 
  max-width: 100%; 
  width: auto; 
  max-height: 320px; 
  object-fit: contain; 
  border-radius: var(--radius-sm); 
  transition: transform 0.3s ease; 
}
.wall-gif:hover { transform: scale(1.02); }

/* Comments */
.wall-comments { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.04); }
.comment-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.84rem; font-weight: 600; color: var(--muted);
  cursor: pointer; padding: 4px 10px; border-radius: var(--radius-sm);
  transition: all var(--transition); user-select: none;
}
.comment-toggle:hover { background: rgba(5,150,105,0.06); color: var(--accent); }
.comment-thread { margin-top: 12px; display: grid; gap: 10px; }
.comment-empty { font-size: 0.84rem; color: var(--muted); text-align: center; padding: 12px; background: rgba(255,255,255,0.02); border-radius: var(--radius-sm); }
.comment-item { display: flex; gap: 10px; align-items: flex-start; }
.comment-item .avatar { width: 28px; height: 28px; flex-shrink: 0; margin-top: 2px; }
.comment-bubble { flex: 1; min-width: 0; padding: 10px 14px; background: rgba(255,255,255,0.02); border-radius: var(--radius-sm); border: 1px solid rgba(255,255,255,0.04); }
.comment-bubble strong { font-size: 0.84rem; display: inline; }
.comment-time { font-size: 0.72rem; color: var(--muted); margin-left: 8px; }
.comment-bubble p { margin: 4px 0 0; font-size: 0.88rem; color: var(--ink); word-break: break-word; }
.comment-del-form { flex-shrink: 0; opacity: 0; transition: opacity var(--transition); }
.comment-item:hover .comment-del-form { opacity: 1; }
.comment-form { display: flex; gap: 8px; margin-top: 4px; align-items: center; }
.comment-form input[type="text"] { flex: 1; min-height: 36px; padding: 6px 12px; font-size: 0.86rem; background: var(--input-bg); border: 1.5px solid var(--line); border-radius: var(--radius-sm); }
.comment-form button { min-height: 36px; padding: 0 14px; font-size: 0.84rem; white-space: nowrap; }
.emoji-btn { cursor: pointer; padding: 2px 4px; border-radius: 4px; transition: background 0.15s, transform 0.15s; user-select: none; display: inline-block; }
.emoji-btn:hover { background: rgba(5,150,105,0.12); transform: scale(1.25); }
.giphy-item { border-radius: 6px; overflow: hidden; border: 2px solid transparent; transition: border-color 0.2s, transform 0.2s; cursor: pointer; }
.giphy-item:hover { border-color: var(--accent); transform: scale(1.04); }
.giphy-item img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }

/* Online dot */
.online-dot { position: absolute; bottom: 2px; right: 2px; width: 12px; height: 12px; border-radius: 50%; background: #22c55e; border: 2px solid var(--bg); box-shadow: 0 0 0 2px rgba(34,197,94,0.2); animation: onlinePulse 2s ease-in-out infinite; }

/* Calendar */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-head { text-align: center; font-size: 0.75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; padding: 6px 4px; }
.cal-cell { aspect-ratio: auto; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; border-radius: var(--radius-sm); background: var(--mist); border: 1px solid var(--line); font-size: 0.85rem; position: relative; min-height: 75px; padding: 4px; transition: border-color var(--transition), box-shadow var(--transition); }
.cal-cell.has-events { cursor: pointer; }
.cal-cell:hover { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(5,150,105,0.08); }
.cal-empty { background: transparent; border-color: transparent; }
.cal-empty:hover { border-color: transparent; box-shadow: none; }
.cal-num { font-weight: 600; font-size: 0.82rem; line-height: 1; }
.cal-today { background: rgba(5,150,105,0.1); border-color: var(--accent); box-shadow: 0 0 0 2px rgba(5,150,105,0.15); font-weight: 700; }
.cal-today .cal-num { color: var(--accent); font-size: 0.9rem; }
.cal-off { background: rgba(234,179,8,0.04); border-color: rgba(234,179,8,0.12); }
.cal-leave { background: rgba(22,163,74,0.06); border-color: rgba(22,163,74,0.15); }
.cal-holiday { background: rgba(5,150,105,0.06); border-color: rgba(5,150,105,0.15); }
.cal-ot { background: rgba(234,88,12,0.06); border-color: rgba(234,88,12,0.15); }
.cal-birthday { background: rgba(219,39,119,0.06); border-color: rgba(219,39,119,0.15); }
.cal-anniversary { background: rgba(30,64,175,0.06); border-color: rgba(30,64,175,0.15); }
.cal-label { font-size: 0.5rem; font-weight: 600; padding: 1px 3px; border-radius: 2px; margin-top: 1px; line-height: 1.3; text-align: center; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.off-label { background: rgba(234,179,8,0.1); color: var(--warn); }
.leave-label { background: rgba(22,163,74,0.1); color: var(--green); }
.holiday-label { background: rgba(5,150,105,0.1); color: var(--accent); }
.ot-label { background: rgba(234,88,12,0.1); color: var(--orange); }
.bday-label { background: rgba(219,39,119,0.1); color: var(--pink); }
.anni-label { background: rgba(30,64,175,0.1); color: var(--secondary); }

/* Celebration banners */
.celebration-banner { position: relative; overflow: hidden; border-radius: var(--radius); padding: 28px 20px 24px; text-align: center; margin-bottom: 14px; border: 1px solid rgba(255,255,255,0.04); }
.celebration-banner .cb-content { position: relative; z-index: 2; }
.celebration-banner .cb-emoji { font-size: 2.4rem; display: block; margin-bottom: 8px; }
.celebration-banner h3 { font-size: 1.15rem; margin-bottom: 4px; }
.celebration-banner p { font-size: 0.86rem; margin: 0; opacity: 0.85; }
.cb-particle { position: absolute; width: var(--s, 8px); height: var(--s, 8px); background: var(--c, var(--accent)); left: var(--x, 50%); border-radius: var(--r, 50%); top: -16px; animation: cb-fall var(--dur, 3s) var(--d, 0s) infinite ease-in; opacity: 0.8; z-index: 1; pointer-events: none; }
.cb-square { border-radius: 2px; }
.cb-star { clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); border-radius: 0; background: transparent !important; }
.cb-theme-1 { background: linear-gradient(135deg, rgba(255,107,107,0.1), rgba(255,217,61,0.08)); }
.cb-theme-2 { background: linear-gradient(135deg, rgba(166,108,255,0.1), rgba(255,107,181,0.08)); }
.cb-theme-3 { background: linear-gradient(135deg, rgba(77,150,255,0.1), rgba(107,203,119,0.08)); }
.cb-theme-4 { background: linear-gradient(135deg, rgba(255,217,61,0.1), rgba(255,107,107,0.08)); }
.cb-theme-5 { background: linear-gradient(135deg, rgba(107,203,119,0.1), rgba(77,150,255,0.08)); }

/* Upcoming events */
.event-list { display: grid; gap: 10px; }
.event-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius-sm); background: var(--mist); border: 1px solid var(--line); transition: all var(--transition); cursor: pointer; text-decoration: none; color: inherit; }
.event-item:hover { background: rgba(5,150,105,0.04); border-color: rgba(5,150,105,0.2); }
.event-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--radius-sm); flex-shrink: 0; font-size: 1.2rem; }
.event-icon.birthday { background: rgba(236,72,153,0.06); }
.event-icon.anniversary { background: rgba(30,64,175,0.06); }
.event-icon.holiday { background: rgba(5,150,105,0.06); }
.event-body { flex: 1; min-width: 0; }
.event-body strong { font-size: 0.9rem; }
.event-body p { font-size: 0.8rem; margin: 2px 0 0; }

tr.row-clickable { cursor: pointer; }
tr.row-clickable:hover td { background: rgba(5,150,105,0.03); }

/* Employee card */
.employee-card {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: all var(--transition);
}
.employee-card:hover { box-shadow: var(--shadow-md), var(--glow-accent); transform: translateY(-2px); border-color: rgba(5,150,105,0.15); }
.employee-card .avatar { width: 42px; height: 42px; flex-shrink: 0; }
.employee-card h4 { font-size: 0.94rem; margin-bottom: 2px; color: var(--ink); font-weight: 700; }
.employee-card p { font-size: 0.78rem; margin: 0; color: var(--ink); opacity: 0.6; }
.employee-card .badge { font-size: 0.65rem; padding: 2px 8px; }

/* Profile head name/designation */
.profile-head-text h1 { font-size: 1.6rem; font-weight: 800; color: var(--ink); margin: 0 0 4px; letter-spacing: -0.02em; }
.profile-head-text p { font-size: 0.9rem; color: var(--ink); opacity: 0.6; margin: 0; }


/* Print */
.print-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

/* Sidebar toggles */
.menu-toggle { display: none; align-items: center; justify-content: center; width: 40px; height: 40px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 1.3rem; cursor: pointer; color: var(--ink); padding: 0; line-height: 1; transition: border-color var(--transition); }
.menu-toggle:hover { border-color: var(--accent); }
.sidebar-toggle { display: none; align-items: center; justify-content: center; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--muted); padding: 0; line-height: 1; width: 32px; height: 32px; }

/* Glass utility */
.glass { background: var(--card-bg); border-color: var(--line); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* Section heading */
.section-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.section-heading::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(255,255,255,0.04), transparent); }

/* Toggle */
.toggle { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: 0.86rem; font-weight: 600; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle .track { width: 40px; height: 22px; border-radius: 12px; background: var(--mist); border: 1px solid var(--line); transition: background 250ms ease; position: relative; flex-shrink: 0; }
.toggle .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.3); transition: transform 250ms cubic-bezier(0.22,1,0.36,1); }
.toggle input:checked + .track { background: linear-gradient(135deg, var(--accent), var(--secondary)); }
.toggle input:checked + .track::after { transform: translateX(18px); }
.toggle input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Chip */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 14px; border-radius: 100px; font-size: 0.78rem; font-weight: 600; background: rgba(5,150,105,0.06); color: var(--accent); border: 1px solid rgba(5,150,105,0.12); white-space: nowrap; transition: all var(--transition); }
.chip:hover { background: rgba(5,150,105,0.1); }
.chip-amber { background: rgba(234,179,8,0.06); color: var(--warn); border-color: rgba(234,179,8,0.12); }
.chip-outline { background: transparent; border-color: var(--line); color: var(--muted); }
.chip-outline:hover { border-color: var(--accent); color: var(--accent); }
.chip svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* Skeleton */
.skeleton { background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.02) 50%, rgba(255,255,255,0.04) 75%); background-size: 200% 100%; animation: skeletonShimmer 1.6s ease infinite; border-radius: var(--radius-sm); color: transparent !important; user-select: none; pointer-events: none; }
.skeleton.text { display: inline-block; height: 1em; width: 60%; vertical-align: middle; }
.skeleton.block { display: block; height: 16px; width: 100%; margin-bottom: 8px; }
.skeleton.circle { border-radius: 50%; }
.skeleton.card { height: 120px; width: 100%; }

/* Toast */
.toast-container {
  position: fixed; bottom: 88px; right: 32px; z-index: 999;
  display: grid; gap: 10px; pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px; min-width: 300px; max-width: 420px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  font-size: 0.9rem; font-weight: 500;
  animation: toastSlideIn 0.4s cubic-bezier(0.22,1,0.36,1) both;
}
.toast.removing { animation: toastSlideOut 0.3s ease both; }
.toast svg { width: 20px; height: 20px; flex-shrink: 0; stroke-width: 2; stroke: currentColor; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.toast .toast-close { margin-left: auto; cursor: pointer; opacity: 0.4; transition: opacity var(--transition); background: none; border: none; padding: 4px; color: var(--ink); }
.toast .toast-close:hover { opacity: 0.8; }
.toast.success { border-left: 4px solid var(--green); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.warn { border-left: 4px solid var(--warn); }

/* Tooltip */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  padding: 5px 12px; border-radius: 6px;
  background: var(--ink); color: var(--paper);
  font-size: 0.76rem; font-weight: 600; white-space: nowrap;
  pointer-events: none; opacity: 0;
  transition: opacity 200ms ease, transform 200ms ease;
}
[data-tooltip]:hover::after { opacity: 1; transform: translateX(-50%) translateY(-2px); }

/* Gradient text */
.gradient-text { background: linear-gradient(135deg, var(--accent), var(--secondary), var(--pink)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* Circular progress */
.circle-progress { --size: 48px; --stroke: 4px; --pct: 0; width: var(--size); height: var(--size); border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--pct)*1%), rgba(255,255,255,0.04) 0); display: grid; place-items: center; position: relative; }
.circle-progress::before { content: ''; position: absolute; width: calc(var(--size) - var(--stroke)*2); height: calc(var(--size) - var(--stroke)*2); border-radius: 50%; background: var(--card-bg); }
.circle-progress span { position: relative; z-index: 1; font-size: 0.72rem; font-weight: 700; color: var(--ink); }

/* Stagger */
.stagger > * { animation: fadeSlideUp 0.5s cubic-bezier(0.22,1,0.36,1) both; }
.stagger > *:nth-child(1) { animation-delay: 0s; }
.stagger > *:nth-child(2) { animation-delay: 0.06s; }
.stagger > *:nth-child(3) { animation-delay: 0.12s; }
.stagger > *:nth-child(4) { animation-delay: 0.18s; }
.stagger > *:nth-child(5) { animation-delay: 0.24s; }
.stagger > *:nth-child(6) { animation-delay: 0.30s; }
.stagger > *:nth-child(n+7) { animation-delay: 0.36s; }

/* Lift */
.lift { transition: transform 300ms cubic-bezier(0.22,1,0.36,1), box-shadow 300ms ease; }
.lift:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

/* Input group */
.input-group { position: relative; margin-bottom: 20px; }
.input-group input, .input-group select, .input-group textarea { padding-top: 20px; padding-bottom: 6px; }
.input-group label { position: absolute; top: 12px; left: 14px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); pointer-events: none; transition: all 200ms ease; }
.input-group input:focus + label, .input-group input:not(:placeholder-shown) + label, .input-group select:focus + label { top: 4px; font-size: 0.6rem; color: var(--accent); }

/* Page enter */
.page-enter { animation: pageEnter 0.6s cubic-bezier(0.22,1,0.36,1) both; }

/* Password toggle */
.pw-wrap { position: relative; display: flex; align-items: center; }
.pw-wrap input { padding-right: 40px; }
.pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; padding: 6px; color: var(--muted); line-height: 1; min-height: auto; display: flex; align-items: center; justify-content: center; border-radius: 4px; transition: color .15s, background .15s; }
.pw-toggle:hover { color: var(--accent); background: rgba(5,150,105,0.06); }

/* Profile header */
.profile-header { position: relative; overflow: hidden; padding: 0; }
.profile-header .cover { height: 100px; background: linear-gradient(135deg, var(--accent), var(--secondary), var(--pink)); border-radius: var(--radius) var(--radius) 0 0; position: relative; }
.profile-header .cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.3)); border-radius: inherit; }
.profile-header .profile-info { padding: 0 24px 24px; margin-top: -44px; position: relative; z-index: 2; }
.profile-header .profile-info .avatar-wrap { display: inline-flex; padding: 4px; background: var(--card-bg); border-radius: 50%; box-shadow: 0 4px 16px rgba(0,0,0,0.3); margin-bottom: 10px; }
.profile-header .profile-info .avatar-wrap .avatar-large { width: 80px; height: 80px; display: block; }

/* Avatar ring */
.avatar-ring { padding: 3px; background: linear-gradient(135deg, var(--accent), var(--secondary), var(--pink)); border-radius: 50%; display: inline-flex; }
.avatar-ring img { border-radius: 50%; border: 3px solid var(--card-bg); display: block; width: 100%; height: 100%; object-fit: cover; }

/* Premium stat card */
.stat-card.premium .stat-icon { background: linear-gradient(135deg, rgba(5,150,105,0.1), rgba(30,64,175,0.1)); }
.stat-card.premium .stat-icon svg { stroke: var(--accent); }
.stat-card.premium:hover .stat-icon { transform: scale(1.05) rotate(-3deg); transition: transform 0.3s ease; }

/* Form card elevated */
.form-card.elevated { box-shadow: var(--shadow-md); border-color: transparent; background: linear-gradient(var(--card-bg), var(--card-bg)) padding-box, linear-gradient(135deg, rgba(5,150,105,0.1), transparent, rgba(30,64,175,0.06)) border-box; }

/* Modal */
.modal-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.5);
  align-items: center; justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
.modal-overlay.is-open { display: flex; }
.modal-box {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: min(740px, 95%);
  max-height: 85vh;
  overflow-y: auto;
  padding: 32px;
  animation: fadeSlideUp 0.3s ease;
}
.modal-box h2 { margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.modal-close {
  float: right;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: none; border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer; font-size: 1.2rem;
  color: var(--muted);
  transition: all var(--transition);
}
.modal-close:hover { border-color: var(--danger); color: var(--danger); }

.modal-box button[type="submit"] { width: 100%; margin-top: 6px; }

/* Crop modal */
.crop-modal { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: fadeIn 0.2s ease; }
.crop-modal-content { background: var(--paper); border-radius: var(--radius); padding: 24px; max-width: 600px; width: 90%; box-shadow: var(--shadow-lg); max-height: 90vh; overflow-y: auto; }
.crop-modal-content h3 { margin-bottom: 16px; font-size: 1.1rem; }
.crop-wrapper { max-height: 400px; }
.crop-wrapper img { max-width: 100%; }
.crop-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

/* Counter badge */
.counter-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 100px; background: linear-gradient(135deg, var(--danger), #dc2626); color: #fff; font-size: 0.7rem; font-weight: 700; line-height: 1; position: absolute; top: -4px; right: -6px; box-shadow: 0 2px 6px rgba(239,68,68,0.3); }

/* ================================================================
   PROFILE PAGE REDESIGNED
   ================================================================ */
.profile-page { max-width: 840px; margin: 0 auto; display: grid; gap: 20px; animation: fadeSlideUp 0.5s cubic-bezier(0.22,1,0.36,1) both; }

/* Profile card */
.prof-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.prof-cover {
  height: 140px;
  background: linear-gradient(135deg, #059669 0%, #1e40af 50%, #db2777 100%);
  position: relative;
}
.prof-cover::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.15));
}
.prof-head {
  display: flex; align-items: flex-end; gap: 24px;
  padding: 0 28px 16px;
  margin-top: -80px;
  position: relative; z-index: 2;
}
.prof-avatar {
  width: 110px; height: 110px; flex-shrink: 0;
  border-radius: 50%; padding: 4px;
  background: linear-gradient(135deg, var(--accent), var(--secondary), var(--pink));
  position: relative;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.prof-avatar img {
  width: 100%; height: 100%; border-radius: 50%;
  object-fit: cover; border: 3px solid var(--paper); display: block; cursor: pointer;
  image-rendering: auto; image-rendering: -webkit-optimize-contrast;
}
.prof-avatar-btn {
  position: absolute; bottom: 2px; right: 2px;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--card-bg); border: 2px solid var(--line);
  color: var(--accent); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); padding: 0;
}
.prof-avatar-btn:hover {
  background: var(--accent); color: #fff; border-color: var(--accent);
  transform: scale(1.1);
}
.prof-avatar-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.prof-info { flex: 1; min-width: 0; padding-bottom: 4px; }
.prof-info h1 { font-size: 1.7rem; font-weight: 800; margin: 0 0 2px; color: var(--secondary); letter-spacing: -0.02em; text-shadow: 0 0 12px var(--paper), 0 1px 0 var(--paper); }
.prof-role { font-size: 0.95rem; color: var(--ink); font-weight: 600; margin: 0 0 10px; text-shadow: 0 0 8px var(--paper), 0 1px 0 var(--paper); }
.prof-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.prof-tag {
  font-size: 0.7rem; font-weight: 600; padding: 3px 10px;
  border-radius: 100px; display: inline-flex; align-items: center;
}
.tag-id { background: var(--mist); color: var(--muted); border: 1px solid var(--line); }
.tag-pending { background: rgba(217,119,6,0.1); color: #d97706; border: 1px solid rgba(217,119,6,0.2); }
.tag-active { background: rgba(16,138,78,0.1); color: var(--green); border: 1px solid rgba(16,138,78,0.2); }
.tag-inactive { background: rgba(220,38,38,0.1); color: var(--danger); border: 1px solid rgba(220,38,38,0.2); }

/* Profile stat row */
.prof-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--line); border-top: 1px solid var(--line);
}
.prof-stat {
  background: var(--card-bg); padding: 16px 12px; text-align: center;
}
.prof-stat-num { display: block; font-size: 1.3rem; font-weight: 800; color: var(--ink); }
.prof-stat-lbl { display: block; font-size: 0.72rem; color: var(--muted); font-weight: 600; margin-top: 2px; text-transform: uppercase; letter-spacing: 0.03em; }

/* Sections */
.prof-section {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px 18px;
  transition: border-color var(--transition);
}
.prof-section:hover { border-color: rgba(5,150,105,0.15); }
.prof-section-hd {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--accent); font-weight: 700; margin-bottom: 16px;
}
.prof-section-hd svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Field grid */
.prof-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

/* Field row */
.prof-field {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: var(--mist);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition);
}
.prof-field:hover { border-color: rgba(5,150,105,0.2); }
.prof-field-display { flex: 1; min-width: 0; }
.prof-field-lbl {
  display: block; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted); font-weight: 700; margin-bottom: 1px;
}
.prof-field-val { font-size: 0.88rem; color: var(--ink); font-weight: 500; word-break: break-word; }

/* Edit button */
.prof-edit {
  width: 32px; height: 32px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--card-bg); border: 1px solid var(--line);
  border-radius: 50%; cursor: pointer; color: var(--accent);
  transition: all var(--transition); padding: 0;
}
.prof-edit:hover {
  background: var(--accent); color: #fff; border-color: var(--accent);
  transform: scale(1.12);
  box-shadow: 0 2px 12px rgba(5,150,105,0.3);
}
.prof-edit svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Edit inline */
.prof-edit-wrap { display: flex; align-items: center; gap: 8px; flex: 1; padding: 4px 0; }
.prof-input {
  flex: 1; min-width: 0; padding: 10px 12px; font-size: 0.9rem;
  border: 2px solid var(--accent); border-radius: 8px;
  background: var(--input-bg); color: var(--ink); outline: none;
  transition: border-color var(--transition);
}
.prof-input:focus { border-color: var(--secondary); box-shadow: 0 0 0 3px rgba(30,64,175,0.15); }
.prof-save, .prof-cancel {
  padding: 10px 18px; border: none; border-radius: 8px;
  font-size: 0.82rem; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.prof-save { background: var(--accent); color: #fff; }
.prof-save:hover { opacity: 0.85; }
.prof-cancel { background: var(--mist); color: var(--muted); border: 1px solid var(--line); }
.prof-cancel:hover { background: var(--line); }

/* ================================================================
   ADMIN PROFILE STYLES (used in admin.php edit forms)
   ================================================================ */
.profile-card-premium { position: relative; border-radius: var(--radius); background: var(--card-bg); border: 1px solid var(--line); box-shadow: var(--shadow-md); }
.profile-card-premium .profile-card-body { padding: 24px; }
.profile-card-premium .profile-card-body > h2 { font-size: 1.3rem; margin-top: 12px; display: flex; align-items: center; gap: 8px; }
.profile-section { padding: 20px; margin-bottom: 14px; background: var(--mist); border-radius: var(--radius-sm); border: 1px solid var(--line); }
.profile-section-title { display: flex; align-items: center; gap: 8px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent); font-weight: 700; margin-bottom: 14px; }
.profile-section-title svg { width: 16px; height: 16px; stroke: var(--accent); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.profile-section-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.profile-section-grid label { font-size: 0.78rem; margin-bottom: 0; }
.profile-section-grid .full { grid-column: 1 / -1; }

/* Field edit pencil (used in admin employee list) */
.field-edit-btn {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  color: var(--accent);
  transition: all var(--transition);
}
.field-edit-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: scale(1.1);
  box-shadow: 0 2px 12px rgba(5,150,105,0.3);
}
.field-edit-btn svg { width: 16px; height: 16px; display: block; }

/* Modal overrides for admin form sections */
.modal-box .profile-section { padding: 20px; margin-bottom: 12px; background: var(--mist); border-radius: var(--radius-sm); border: 1px solid var(--line); }
.modal-box .profile-section-grid input,
.modal-box .profile-section-grid select,
.modal-box .profile-section-grid textarea { min-height: 36px; font-size: 0.85rem; padding: 6px 10px; }

/* ================================================================
   PROFILE POPUP CARD
   ================================================================ */
.pp-card { position: relative; border-radius: var(--radius); overflow: hidden; }
.pp-cover { height: 100px; background: linear-gradient(135deg, #059669, #1e40af 50%, #db2777); position: relative; }
.pp-cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.2)); }
.pp-top { display: flex; align-items: flex-end; gap: 16px; padding: 0 24px 14px; margin-top: -60px; position: relative; z-index: 1; }
.pp-avatar { width: 80px; height: 80px; flex-shrink: 0; border-radius: 50%; padding: 3px; background: linear-gradient(135deg, var(--accent), var(--secondary), var(--pink)); box-shadow: 0 2px 12px rgba(0,0,0,0.12); cursor: pointer; }
.pp-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 2px solid var(--paper); display: block; }
.pp-top-info { flex: 1; min-width: 0; padding-bottom: 2px; }
.pp-top-info h2 { margin: 0; font-size: 1.25rem; font-weight: 700; color: var(--ink); text-shadow: 0 0 8px var(--paper), 0 1px 0 var(--paper); }
.pp-role { margin: 2px 0 8px; font-size: 0.88rem; color: var(--ink); font-weight: 600; text-shadow: 0 0 6px var(--paper), 0 1px 0 var(--paper); }
.pp-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.pp-tag { font-size: 0.66rem; font-weight: 600; padding: 3px 10px; border-radius: 100px; background: var(--mist); color: var(--muted); border: 1px solid var(--line); }
.pp-tag-tenure { background: rgba(5,150,105,0.08); color: var(--accent); border-color: rgba(5,150,105,0.15); }
.pp-tag-email { background: rgba(16,138,78,0.08); color: var(--green); border-color: rgba(16,138,78,0.15); }
.pp-body { padding: 8px 24px 20px; }
.pp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pp-row { display: flex; flex-direction: column; padding: 10px 12px; background: var(--mist); border-radius: 6px; border: 1px solid var(--line); }
.pp-row-full { grid-column: 1 / -1; }
.pp-lbl { font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 700; }
.pp-val { font-size: 0.88rem; color: var(--ink); font-weight: 500; word-break: break-word; margin-top: 2px; }
@media (max-width: 500px) { .pp-grid { grid-template-columns: 1fr; } }

/* Popup zoom overlay */
.pp-zoom { position: fixed; inset: 0; z-index: 10000; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,0.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); cursor: zoom-out; }
.pp-zoom > div { max-width: 92vw; max-height: 92vh; display: flex; align-items: center; justify-content: center; padding: 0; }
.pp-zoom img { max-width: 100%; max-height: 92vh; border-radius: 8px; box-shadow: 0 8px 40px rgba(0,0,0,0.5); display: block; cursor: default; }

/* === MOBILE RAIL === */
@media screen and (max-width: 768px) {
  .rail { display: none; }
  .flyout { display: none; }
  .topbar .menu-toggle { display: flex; }
}

/* Mobile sidebar */
@media screen and (max-width: 768px) {
  .rail { display: none; }
  .flyout { display: none; }
  .mobile-drawer { 
    position: fixed; left: -280px; top: 0; width: 260px; height: 100vh; 
    z-index: 100; background: var(--rail-bg); border-right: 1px solid var(--line);
    box-shadow: 4px 0 24px rgba(0,0,0,0.1); transition: left 300ms cubic-bezier(0.22,1,0.36,1);
    overflow-y: auto; padding: 16px 12px;
  }
  .mobile-drawer.is-open { left: 0; }
  .mobile-drawer-overlay { 
    display: none; position: fixed; inset: 0; z-index: 99;
    background: rgba(0,0,0,0.4); backdrop-filter: blur(4px);
  }
  .mobile-drawer-overlay.is-open { display: block; }
  .menu-toggle { display: flex; }
  body.sidebar-open { overflow: hidden; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .celebration-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .profile-section-grid { grid-template-columns: 1fr; }
  .prof-grid { grid-template-columns: 1fr; }
  .pf-grid-2, .pf-grid-3, .sl-grid, .s-grid { grid-template-columns: 1fr; }
  .prof-stats { grid-template-columns: repeat(3,1fr); }
  .prof-head { flex-wrap: wrap; margin-top: -60px; padding: 0 16px 12px; gap: 16px; }
  .prof-avatar { width: 80px; height: 80px; }
  .prof-info h1 { font-size: 1.3rem; }
}

@media screen and (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr; }
  .panel { padding: 24px; }
  .modal-box { padding: 20px; }
  .toast-container { right: 16px; left: 16px; }
  .toast { min-width: auto; }
}

@media (prefers-color-scheme: dark) {
  [data-theme="auto"] {
    --ink: #f1f5f9;
    --muted: #94a3b8;
    --paper: #0b0f19;
    --mist: #1e293b;
    --line: rgba(255, 255, 255, 0.08);
    --bg: #030712;
    --card-bg: rgba(15, 23, 42, 0.5);
    --topbar-bg: rgba(3, 7, 18, 0.7);
    --input-bg: rgba(15, 23, 42, 0.35);
    --accent: #10b981;
    --accent-light: #34d399;
    --secondary: #3b82f6;
    --primary: #3b82f6;
    --rail-bg: #0f172a;
    --rail-text: #94a3b8;
    --rail-hover: rgba(5, 150, 105, 0.15);
    --rail-active-border: rgba(5, 150, 105, 0.4);
    --rail-divider: rgba(255, 255, 255, 0.06);
    color-scheme: dark;
  }

  /* Dark mode element overrides */
  [data-theme="auto"] body::before { opacity: 0.03; }
  [data-theme="auto"] .top-accent { background: linear-gradient(90deg, var(--accent), var(--secondary)); }
  [data-theme="auto"] .card, [data-theme="auto"] .stat-card, [data-theme="auto"] .form-card { background: var(--card-bg); border-color: var(--line); }
  [data-theme="auto"] .flash { background: rgba(5,150,105,0.08); border-color: rgba(5,150,105,0.2); color: var(--accent); }
  [data-theme="auto"] .flash.error { background: rgba(220,38,38,0.08); border-color: rgba(220,38,38,0.2); color: var(--danger); }
  [data-theme="auto"] .badge { background: rgba(5,150,105,0.12); color: var(--accent); }
  [data-theme="auto"] .badge-green { background: rgba(22,163,74,0.15); color: #4ade80; }
  [data-theme="auto"] .badge-red { background: rgba(220,38,38,0.15); color: #f87171; }
  [data-theme="auto"] .badge-amber { background: rgba(245,158,11,0.15); color: #fbbf24; }
  [data-theme="auto"] input, [data-theme="auto"] select, [data-theme="auto"] textarea { background: var(--input-bg); border-color: var(--line); color: var(--ink); }
  [data-theme="auto"] input:focus, [data-theme="auto"] select:focus, [data-theme="auto"] textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(5,150,105,0.15); }
  [data-theme="auto"] .table-wrap table { background: var(--card-bg); }
  [data-theme="auto"] .table-wrap th { background: var(--mist); color: var(--muted); border-bottom-color: var(--line); }
  [data-theme="auto"] .table-wrap td { border-bottom-color: var(--line); }
  [data-theme="auto"] .table-wrap tr:hover td { background: rgba(5,150,105,0.04); }
  [data-theme="auto"] .modal-box { background: var(--card-bg); border-color: var(--line); }
  [data-theme="auto"] .modal-close { color: var(--muted); }
  [data-theme="auto"] .modal-close:hover { color: var(--accent); }
  [data-theme="auto"] .wall-post { background: var(--card-bg); border-color: var(--line); }
  [data-theme="auto"] .wall-body { color: var(--ink); }
  [data-theme="auto"] .comment-bubble { background: var(--mist); border-color: var(--line); }
  [data-theme="auto"] .wall-form { background: var(--card-bg); border-color: var(--line); }
  [data-theme="auto"] .wall-form textarea { background: var(--input-bg); color: var(--ink); }
  [data-theme="auto"] .nav a { color: var(--muted); }
  [data-theme="auto"] .nav a.active { color: var(--accent); background: rgba(5,150,105,0.08); }
  [data-theme="auto"] .profile-menu summary { border-color: var(--line); }
  [data-theme="auto"] .profile-menu > div { background: var(--card-bg); border-color: var(--line); }
  [data-theme="auto"] .notif-row { background: var(--card-bg); border-color: var(--line); }
  [data-theme="auto"] .notif-row.unread { background: rgba(5,150,105,0.04); }
  [data-theme="auto"] .cal-cell { background: var(--card-bg); border-color: var(--line); }
  [data-theme="auto"] .cal-today { background: rgba(5,150,105,0.12); }
  [data-theme="auto"] .detail-list div { border-bottom-color: var(--line); }
  [data-theme="auto"] .pf-card { background: var(--card-bg) !important; }
  [data-theme="auto"] .pf-card-hd { color: var(--ink) !important; }
  [data-theme="auto"] .ts-wrap td input { background: var(--input-bg); color: var(--ink); border-color: var(--line); }
  [data-theme="auto"] .pf-bar { background: var(--mist) !important; }
}

[data-theme="dark"] {
  --ink: #f1f5f9;
  --muted: #94a3b8;
  --paper: #0b0f19;
  --mist: #1e293b;
  --line: rgba(255, 255, 255, 0.08);
  --bg: #030712;
  --card-bg: rgba(15, 23, 42, 0.5);
  --topbar-bg: rgba(3, 7, 18, 0.7);
  --input-bg: rgba(15, 23, 42, 0.35);
  --accent: #10b981;
  --accent-light: #34d399;
  --secondary: #3b82f6;
  --primary: #3b82f6;
  --rail-bg: #0f172a;
  --rail-text: #94a3b8;
  --rail-hover: rgba(5, 150, 105, 0.15);
  --rail-active-border: rgba(5, 150, 105, 0.4);
  --rail-divider: rgba(255, 255, 255, 0.06);
  color-scheme: dark;
}

/* Dark mode element overrides */
[data-theme="dark"] body::before { opacity: 0.03; }
[data-theme="dark"] .top-accent { background: linear-gradient(90deg, var(--accent), var(--secondary)); }
[data-theme="dark"] .card, [data-theme="dark"] .stat-card, [data-theme="dark"] .form-card { background: var(--card-bg); border-color: var(--line); }
[data-theme="dark"] .flash { background: rgba(5,150,105,0.08); border-color: rgba(5,150,105,0.2); color: var(--accent); }
[data-theme="dark"] .flash.error { background: rgba(220,38,38,0.08); border-color: rgba(220,38,38,0.2); color: var(--danger); }
[data-theme="dark"] .badge { background: rgba(5,150,105,0.12); color: var(--accent); }
[data-theme="dark"] .badge-green { background: rgba(22,163,74,0.15); color: #4ade80; }
[data-theme="dark"] .badge-red { background: rgba(220,38,38,0.15); color: #f87171; }
[data-theme="dark"] .badge-amber { background: rgba(245,158,11,0.15); color: #fbbf24; }
[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea { background: var(--input-bg); border-color: var(--line); color: var(--ink); }
[data-theme="dark"] input:focus, [data-theme="dark"] select:focus, [data-theme="dark"] textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(5,150,105,0.15); }
[data-theme="dark"] .table-wrap table { background: var(--card-bg); }
[data-theme="dark"] .table-wrap th { background: var(--mist); color: var(--muted); border-bottom-color: var(--line); }
[data-theme="dark"] .table-wrap td { border-bottom-color: var(--line); }
[data-theme="dark"] .table-wrap tr:hover td { background: rgba(5,150,105,0.04); }
[data-theme="dark"] .modal-box { background: var(--card-bg); border-color: var(--line); }
[data-theme="dark"] .modal-close { color: var(--muted); }
[data-theme="dark"] .modal-close:hover { color: var(--accent); }
[data-theme="dark"] .wall-post { background: var(--card-bg); border-color: var(--line); }
[data-theme="dark"] .wall-body { color: var(--ink); }
[data-theme="dark"] .comment-bubble { background: var(--mist); border-color: var(--line); }
[data-theme="dark"] .wall-form { background: var(--card-bg); border-color: var(--line); }
[data-theme="dark"] .wall-form textarea { background: var(--input-bg); color: var(--ink); }
[data-theme="dark"] .nav a { color: var(--muted); }
[data-theme="dark"] .nav a.active { color: var(--accent); background: rgba(5,150,105,0.08); }
[data-theme="dark"] .profile-menu summary { border-color: var(--line); }
[data-theme="dark"] .profile-menu > div { background: var(--card-bg); border-color: var(--line); }
[data-theme="dark"] .notif-row { background: var(--card-bg); border-color: var(--line); }
[data-theme="dark"] .notif-row.unread { background: rgba(5,150,105,0.04); }
[data-theme="dark"] .cal-cell { background: var(--card-bg); border-color: var(--line); }
[data-theme="dark"] .cal-today { background: rgba(5,150,105,0.12); }
[data-theme="dark"] .detail-list div { border-bottom-color: var(--line); }
[data-theme="dark"] .pf-card { background: var(--card-bg) !important; }
[data-theme="dark"] .pf-card-hd { color: var(--ink) !important; }
[data-theme="dark"] .ts-wrap td input { background: var(--input-bg); color: var(--ink); border-color: var(--line); }
[data-theme="dark"] .pf-bar { background: var(--mist) !important; }

/* Floating bottom navigation bar for mobile devices */
.mobile-nav-bar {
  display: none;
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  height: 64px;
  background: var(--topbar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--line);
  border-radius: 32px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  z-index: 1000;
  justify-content: space-around;
  align-items: center;
  padding: 0 12px;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none;
  transition: color var(--transition), transform var(--transition);
  flex: 1;
  height: 100%;
}

.mobile-nav-item svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  transition: stroke var(--transition), transform var(--transition);
}

.mobile-nav-item i {
  font-size: 24px;
  transition: color var(--transition), transform var(--transition);
}

.mobile-nav-item:hover, .mobile-nav-item.active {
  color: var(--accent);
}

.mobile-nav-item.active svg {
  stroke: var(--accent);
  transform: translateY(-2px);
}

@media screen and (max-width: 768px) {
  .mobile-nav-bar {
    display: flex;
  }
  .main {
    padding-bottom: 96px !important;
  }
  .menu-toggle {
    display: flex !important;
  }
}

/* Staggered card entry animations */
.grid-2 > :nth-child(1), .grid-3 > :nth-child(1), .grid-4 > :nth-child(1) {
  animation: fadeSlideUp 0.5s cubic-bezier(0.22,1,0.36,1) 0.05s both;
}
.grid-2 > :nth-child(2), .grid-3 > :nth-child(2), .grid-4 > :nth-child(2) {
  animation: fadeSlideUp 0.5s cubic-bezier(0.22,1,0.36,1) 0.12s both;
}
.grid-3 > :nth-child(3), .grid-4 > :nth-child(3) {
  animation: fadeSlideUp 0.5s cubic-bezier(0.22,1,0.36,1) 0.20s both;
}
.grid-4 > :nth-child(4) {
  animation: fadeSlideUp 0.5s cubic-bezier(0.22,1,0.36,1) 0.28s both;
}

/* Enhanced Card hover glows */
.card:hover, .form-card:hover {
  transform: translateY(-3px);
  border-color: rgba(6, 182, 212, 0.25);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08), 0 0 15px rgba(6, 182, 212, 0.04);
}
[data-theme="dark"] .card:hover, [data-theme="dark"] .form-card:hover {
  border-color: rgba(6, 182, 212, 0.35);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35), 0 0 20px rgba(6, 182, 212, 0.08);
}

/* Wall post enhancements */
.wall-pinned { border: 1px solid rgba(255,193,7,0.25) !important; background: linear-gradient(135deg, rgba(255,193,7,0.03), transparent) !important; }
.wall-pin-badge { font-size: 0.72rem; padding: 4px 10px 4px 12px; background: rgba(255,193,7,0.1); color: var(--gold); border-bottom: 1px solid rgba(255,193,7,0.1); font-weight: 600; letter-spacing: 0.02em; display: flex; align-items: center; gap: 4px; }
.wall-actions-bar { display: flex; align-items: center; gap: 4px; padding: 10px 16px 6px; border-top: 1px solid var(--line); margin-top: 12px; }
.wall-actions-bar form { margin: 0; }
.wall-like-btn { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border: none; background: none; cursor: pointer; font-size: 0.85rem; font-weight: 600; color: var(--muted); border-radius: 8px; transition: all 200ms ease; min-height: auto; }
.wall-like-btn:hover { background: rgba(239,68,68,0.06); color: var(--danger); }
.wall-like-btn.liked { color: var(--danger); }
.wall-like-btn span { font-size: 0.82rem; }
.wall-pin-btn, .wall-del-btn { background: none; border: none; cursor: pointer; font-size: 0.9rem; padding: 4px 6px; border-radius: 6px; transition: background 200ms ease; min-height: auto; opacity: 0.5; }
.wall-pin-btn:hover, .wall-del-btn:hover { background: rgba(255,255,255,0.1); opacity: 1; }
.wall-del-btn:hover { background: rgba(239,68,68,0.08); }
.inline-form { display: inline; }
.comment-toggle.active { color: var(--accent); }

/* Wall form redesign */
.wall-form-section { display: block; max-width: 100%; margin: 0 0 20px; }

.wall-form { background: rgba(255,255,255,0.08); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,0.15); border-radius: 20px; overflow: hidden; box-shadow: 0 8px 40px rgba(0,0,0,0.05), 0 1px 8px rgba(0,0,0,0.02), inset 0 1px 0 rgba(255,255,255,0.4); margin: 0; transition: box-shadow 300ms ease, transform 300ms ease; }
.wall-form:focus-within { box-shadow: 0 12px 48px rgba(0,0,0,0.07), 0 0 0 1px rgba(255,255,255,0.2), inset 0 1px 0 rgba(255,255,255,0.4); transform: scale(1.005); }

.wall-form-header { display: flex; align-items: center; gap: 12px; padding: 18px 20px 0; }
.wall-form-header img.avatar { width: 42px; height: 42px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,0.3); flex-shrink: 0; }
.wall-form-header div { display: flex; flex-direction: column; gap: 1px; }
.wall-form-header strong { font-size: 0.92rem; font-weight: 750; color: var(--ink); }
.wall-form-header span { font-size: 0.74rem; color: var(--muted); }

.wall-form-body { padding: 12px 20px; }
.wall-form-body textarea { width: 100%; border: none; background: rgba(255,255,255,0.05); border-radius: 14px; padding: 14px 16px; font-size: 0.92rem; font-family: inherit; resize: vertical; min-height: 52px; transition: background 200ms ease; color: var(--ink); }
.wall-form-body textarea:focus { outline: none; background: rgba(255,255,255,0.1); }
.wall-form-body textarea::placeholder { color: var(--muted); font-size: 0.9rem; }

.wall-form-tools { display: flex; align-items: center; gap: 8px; padding: 10px 18px 14px; border-top: 1px solid rgba(255,255,255,0.06); }
.wall-tool-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06); border-radius: 12px; cursor: pointer; font-size: 0.82rem; font-weight: 600; color: var(--muted); transition: all 200ms ease; min-height: auto; }
.wall-tool-btn:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.12); color: var(--ink); }
.wall-tool-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wall-form-submit { margin-left: auto; padding: 9px 24px; background: linear-gradient(135deg, var(--accent), var(--secondary)); color: #fff; border: none; border-radius: 12px; font-size: 0.85rem; font-weight: 700; cursor: pointer; transition: all 250ms ease; box-shadow: 0 3px 12px rgba(5,150,105,0.2); }
.wall-form-submit:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(5,150,105,0.3); }

/* Wall gallery */
.wall-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; padding: 8px 16px; }
.wall-gallery-item { border-radius: 10px; overflow: hidden; cursor: pointer; aspect-ratio: 1; }
.wall-gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 300ms ease; }
.wall-gallery-item:hover img { transform: scale(1.05); }
.wall-media-wrap { padding: 8px 16px; }
.wall-media-wrap img { width: 100%; max-height: 400px; object-fit: contain; border-radius: 12px; cursor: pointer; transition: transform 300ms ease; }
.wall-media-wrap:hover img { transform: scale(1.01); }

/* Lightbox */
.lightbox-overlay { display: none; position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,0.85); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); align-items: center; justify-content: center; flex-direction: column; padding: 32px; animation: lbFadeIn 200ms ease; }
@keyframes lbFadeIn { from { opacity: 0; } to { opacity: 1; } }
.lightbox-img { max-width: 90vw; max-height: 85vh; object-fit: contain; border-radius: 12px; box-shadow: 0 8px 40px rgba(0,0,0,0.5); animation: lbZoomIn 250ms ease; }
@keyframes lbZoomIn { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.lightbox-caption { color: rgba(255,255,255,0.7); font-size: 0.82rem; margin-top: 12px; text-align: center; }
.lightbox-close { position: absolute; top: 16px; right: 20px; color: #fff; font-size: 2rem; cursor: pointer; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.1); border-radius: 50%; transition: background 200ms ease; }
.lightbox-close:hover { background: rgba(255,255,255,0.2); }

/* ================================================================
   COMPREHENSIVE RESPONSIVE ENHANCEMENTS
   ================================================================ */

/* All tables: force horizontal scroll on small screens */
@media screen and (max-width: 768px) {
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  th, td { white-space: nowrap; }
  .table-wrap table { display: table; }
}

@media screen and (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .pf-grid-2, .pf-grid-3, .sl-grid, .s-grid { grid-template-columns: 1fr; }
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; }
  .employee-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .qa-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .celebrations-grid { grid-template-columns: 1fr; }
  .admin-tab { font-size: 0.75rem; padding: 6px 10px; }
  .admin-tools { flex-direction: column; align-items: stretch; }
  .admin-tools button,
  .admin-tools .button,
  .admin-tools a.button { width: 100%; justify-content: center; }
  .topbar { flex-wrap: wrap; gap: 8px; padding: 10px clamp(12px, 3vw, 24px); }
  .topbar h1 { font-size: 1.1rem; }
  .topbar p { font-size: 0.78rem; }
  .topbar p .badge { font-size: 0.65rem !important; padding: 2px 8px !important; }
  .profile-menu summary span { display: none; }
  .profile-menu summary { padding: 4px; min-height: 36px; }
  .profile-menu summary img { width: 28px; height: 28px; }
  .modal-box { width: 98%; padding: 20px 16px; max-height: 90vh; }
  .modal-box h2 { font-size: 1.1rem; }
  .stat-value { font-size: 1.4rem; }
  .stat-card { padding: 14px; gap: 12px; }
  .stat-icon { width: 38px; height: 38px; }
  .stat-icon svg { width: 18px; height: 18px; }
  .card { padding: 14px; }
  .form-card { padding: 16px; }
  .form-grid { gap: 10px; }
  .notif-stats { flex-direction: column; gap: 8px; }
  .notif-row { padding: 12px 14px; gap: 10px; }
  .notif-actions { opacity: 1; }
  .wall-form-header { padding: 14px 14px 0; }
  .wall-form-body { padding: 10px 14px; }
  .wall-form-tools { flex-wrap: wrap; padding: 10px 14px 14px; }
  .wall-form-tools .wall-tool-btn { font-size: 0.75rem; padding: 6px 10px; }
  .section-heading { flex-wrap: wrap; }
  .detail-list div { grid-template-columns: 1fr; gap: 2px; padding: 10px 12px; }
  .detail-list.modern div { padding: 10px 14px; }
  .prof-head { flex-direction: column; align-items: center; text-align: center; margin-top: -50px; }
  .prof-avatar { width: 70px; height: 70px; }
  .prof-info h1 { font-size: 1.2rem; }
  .prof-tags { justify-content: center; }
  .prof-stats { grid-template-columns: repeat(3, 1fr); }
  .prof-stat { padding: 10px 8px; }
  .prof-stat-num { font-size: 1.1rem; }
  .prof-section { padding: 16px; }
  .profile-header .profile-info { padding: 0 16px 16px; margin-top: -36px; }
  .profile-header .profile-info .avatar-wrap .avatar-large { width: 60px; height: 60px; }
  .pp-card .pp-top { padding: 0 16px 10px; margin-top: -50px; gap: 12px; }
  .pp-avatar { width: 64px; height: 64px; }
  .pp-top-info h2 { font-size: 1.05rem; }
  .cal-grid { gap: 2px; }
  .cal-cell { min-height: 50px; font-size: 0.75rem; padding: 2px; }
  .cal-label { font-size: 0.45rem; }
  .wall-gallery { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .crop-modal-content { padding: 16px; max-width: 98%; }
  .event-card .event-item { padding: 10px; gap: 10px; }
  .event-card .event-icon { width: 32px; height: 32px; font-size: 1rem; }
  .profile-menu > div { right: -60px; width: 200px; }
  .print-actions { flex-direction: column; }
  .print-actions button,
  .print-actions .button { width: 100%; justify-content: center; }
}

@media screen and (max-width: 400px) {
  .main { padding: 12px 10px; }
  .panel { padding: 16px; }
  .modal-box { padding: 14px 10px; }
  .modal-box .form-grid { gap: 6px; }
  .modal-box input,
  .modal-box select { min-height: 38px; font-size: 0.82rem; }
  .brand img { width: 50px; height: 50px; }
  .login-shell { padding: 12px; }
  .toast { min-width: auto; max-width: 100%; font-size: 0.82rem; padding: 10px 14px; }
  .toast-container { right: 8px; left: 8px; bottom: 72px; }
  .mobile-nav-bar { height: 56px; left: 8px; right: 8px; padding: 0 8px; }
  .mobile-nav-item { font-size: 0.6rem; }
  .mobile-nav-item svg { width: 18px; height: 18px; }
  .employee-grid { grid-template-columns: 1fr; }
  .qa-grid { grid-template-columns: repeat(2, 1fr); }
  .employee-card { padding: 12px; }
  .employee-card .avatar { width: 34px; height: 34px; }
  .employee-card h4 { font-size: 0.84rem; }
}

/* Large desktop: constrain content width for readability */
@media screen and (min-width: 1400px) {
  .main { padding: 32px 48px; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .stat-value { font-size: 2rem; }
  .employee-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .qa-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* Tablet / small laptop landscape */
@media screen and (min-width: 769px) and (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .sidebar { width: 180px; min-width: 180px; }
  .nav a { padding: 8px 10px; font-size: 0.82rem; gap: 8px; }
  .nav a svg { width: 26px; height: 26px; }
  .stat-value { font-size: 1.5rem; }
  .topbar h1 { font-size: 1.2rem; }
}

/* Print styles */
@media print {
  .sidebar, .mobile-nav-bar, .menu-toggle, .sidebar-toggle,
  .sidebar-overlay, .top-accent, #particle-canvas,
  .notif-bell, .profile-menu, .toast-container { display: none !important; }
  .main { padding: 0 !important; margin: 0 !important; animation: none !important; }
  .card, .form-card, .stat-card, .panel { box-shadow: none !important; border: 1px solid #ddd !important; break-inside: avoid; }
  body { background: #fff !important; font-size: 11pt; }
  .table-wrap { overflow: visible !important; }
  table { font-size: 9pt; }
  th, td { padding: 6px 8px; }
}