/* ============================================================================
   ROLOGICS HUB — REDESIGNED HRMS DESIGN SYSTEM
   Theme: emerald (#059669) -> blue (#2563eb) gradient (matches rologicsinfolabs.com)
   Features: 3D depth, glassmorphism, colorful 3D icons, rich animations, dark mode
   ============================================================================ */

:root {
  /* Brand palette */
  --emerald: #059669;
  --emerald-light: #10b981;
  --emerald-soft: #34d399;
  --blue: #2563eb;
  --blue-light: #3b82f6;
  --blue-soft: #60a5fa;
  --violet: #7c3aed;
  --gold: #d97706;
  --gold-light: #fbbf24;
  --pink: #db2777;
  --rose: #e11d48;
  --cyan: #0891b2;
  --teal: #0d9488;
  --red: #dc2626;
  --orange: #ea580c;
  --lime: #65a30d;
  --indigo: #4f46e5;

  /* Semantic */
  --ink: #0f172a;
  --muted: #64748b;
  --paper: #ffffff;
  --mist: #f1f5f9;
  --line: rgba(15, 23, 42, 0.08);
  --bg: #eef2f7;
  --card-bg: rgba(255, 255, 255, 0.72);
  --topbar-bg: rgba(255, 255, 255, 0.8);
  --input-bg: #ffffff;
  --rail-bg: rgba(255, 255, 255, 0.85);

  /* Gradients */
  --gradient: linear-gradient(135deg, #059669 0%, #2563eb 100%);
  --gradient-3: linear-gradient(135deg, #059669 0%, #2563eb 50%, #7c3aed 100%);
  --gradient-gold: linear-gradient(135deg, #fbbf24, #d97706);
  --gradient-soft: linear-gradient(135deg, rgba(5,150,105,0.12), rgba(37,99,235,0.12));

  /* 3D shadows */
  --shadow-sm: 0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
  --shadow-md: 0 10px 30px -8px rgba(15,23,42,0.12), 0 4px 12px rgba(15,23,42,0.06);
  --shadow-lg: 0 24px 60px -12px rgba(15,23,42,0.22), 0 8px 24px rgba(15,23,42,0.08);
  --shadow-3d: 0 12px 28px -6px rgba(5,150,105,0.28), 0 4px 10px rgba(37,99,235,0.18);
  --glow-emerald: 0 0 24px rgba(5,150,105,0.25);
  --glow-blue: 0 0 24px rgba(37,99,235,0.22);

  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 26px;
  --transition: 320ms cubic-bezier(0.22, 1, 0.36, 1);
  --rail-text: #64748b;
  --rail-text-active: #059669;
  --rail-hover: rgba(5, 150, 105, 0.08);
  --rail-active-bg: linear-gradient(135deg, rgba(5,150,105,0.14), rgba(37,99,235,0.10));
  --rail-active-border: rgba(5, 150, 105, 0.35);
  --rail-divider: rgba(15, 23, 42, 0.08);
}

/* ===================== RESET ===================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  margin: 0;
  overflow-y: scroll;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ''; position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(ellipse 50% 40% at 15% 10%, rgba(5,150,105,0.10) 0%, transparent 60%),
    radial-gradient(ellipse 45% 40% at 85% 90%, rgba(37,99,235,0.10) 0%, transparent 60%),
    radial-gradient(ellipse 30% 25% at 50% 50%, rgba(124,58,237,0.05) 0%, transparent 55%);
  animation: bodyGlow 14s ease-in-out infinite alternate;
}
@keyframes bodyGlow { 0% { opacity: 0.5; } 100% { opacity: 1; } }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.02em; }
h1 { font-size: clamp(1.5rem, 3.5vw, 2rem); line-height: 1.15; font-weight: 800; }
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; }

/* ===================== ANIMATED TOP ACCENT ===================== */
.top-accent {
  position: fixed; top: 0; left: 0; right: 0; z-index: 300; height: 3px;
  background: linear-gradient(90deg, var(--emerald), var(--blue), var(--violet), var(--gold), var(--emerald));
  background-size: 400% 100%;
  animation: accentFlow 8s linear infinite;
  box-shadow: 0 0 18px rgba(5,150,105,0.4);
}
@keyframes accentFlow { 0% { background-position: 0% 50%; } 100% { background-position: 400% 50%; } }

/* ===================== 3D ICONS ===================== */
.r3d-icon { display: block; transition: transform var(--transition), filter var(--transition); }
.r3d-icon-host { display: inline-flex; align-items: center; justify-content: center; }
[data-icon] .r3d-icon { animation: iconFloat 4s ease-in-out infinite; }
@keyframes iconFloat { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-2px) rotate(-2deg); } }
.r3d-icon-host:hover .r3d-icon { transform: scale(1.15) rotate(6deg); filter: drop-shadow(0 6px 10px rgba(37,99,235,0.35)); }

/* ===================== BUTTONS ===================== */
.btn, button:not(.menu-toggle):not(.sidebar-toggle):not(.modal-close):not(.pw-toggle):not(.toast-close):not(.theme-toggle):not(.r3d-icon) {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 22px; color: #fff; border: 0; border-radius: var(--radius-sm);
  font: inherit; font-weight: 650; font-size: 0.9rem; cursor: pointer; text-decoration: none;
  background: var(--gradient); background-size: 160% 160%;
  box-shadow: var(--shadow-3d); position: relative; overflow: hidden; white-space: nowrap;
  transition: transform var(--transition), box-shadow var(--transition), background-position var(--transition);
}
.btn:hover, button:not(.menu-toggle):not(.sidebar-toggle):not(.modal-close):not(.pw-toggle):not(.toast-close):not(.theme-toggle):not(.r3d-icon):hover {
  transform: translateY(-2px); background-position: 100% 0; box-shadow: 0 16px 34px -8px rgba(5,150,105,0.4);
}
.btn:active, button:not(.menu-toggle):not(.sidebar-toggle):not(.modal-close):not(.pw-toggle):not(.toast-close):not(.theme-toggle):not(.r3d-icon):active { transform: translateY(0) scale(0.97); }
.btn::after { content: ''; position: absolute; top: 0; left: -120%; width: 60%; height: 100%; background: linear-gradient(120deg, transparent, rgba(255,255,255,0.45), transparent); transform: skewX(-20deg); transition: left 0.6s ease; }
.btn:hover::after { left: 140%; }
.btn.secondary { background: var(--paper); border: 1.5px solid var(--line); color: var(--ink); box-shadow: var(--shadow-sm); }
.btn.secondary:hover { border-color: var(--emerald); color: var(--emerald); }
.btn.danger { background: linear-gradient(135deg, #f87171, #dc2626); box-shadow: 0 12px 28px -6px rgba(220,38,38,0.35); }
.btn.ghost { background: transparent; color: var(--emerald); box-shadow: none; border: 1.5px solid rgba(5,150,105,0.25); }
.btn.ghost:hover { background: rgba(5,150,105,0.08); }
.btn.small { min-height: 34px; padding: 0 14px; font-size: 0.82rem; }
.btn.block { width: 100%; }

/* ===================== APP LAYOUT ===================== */
.app { min-height: 100vh; display: flex; align-items: flex-start; position: relative; z-index: 0; }

/* ===================== RAIL SIDEBAR (3D) ===================== */
.rail {
  position: sticky; top: 0; left: 0; width: 232px; min-width: 232px; height: 100vh;
  background: var(--rail-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 14px; z-index: 100;
  overflow-y: auto; overflow-x: hidden; flex-shrink: 0;
  box-shadow: 8px 0 30px -18px rgba(15,23,42,0.25);
}
.rail::-webkit-scrollbar { width: 0; }
.rail-brand {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 52px; margin-bottom: 18px;
  padding: 6px 10px; background: var(--paper); border-radius: 14px; border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); text-decoration: none;
}
.rail-brand img { width: 38px; height: 38px; border-radius: 10px; object-fit: contain; transition: transform var(--transition); }
.rail-brand:hover img { transform: scale(1.1) rotate(-4deg); }
.rail-brand span { font-size: 0.84rem; font-weight: 800; color: var(--emerald); white-space: nowrap; letter-spacing: -0.01em; }
.rail-section { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--rail-text); font-weight: 700; padding: 14px 12px 6px; }
.rail-nav { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; overflow-x: hidden; }
.rail-nav::-webkit-scrollbar { width: 0; }
.rail-link {
  width: 100%; height: 46px; display: flex; align-items: center; gap: 12px; padding: 0 12px;
  border-radius: 12px; color: var(--rail-text); text-decoration: none; position: relative;
  transition: all var(--transition);
}

.rail-link .rail-label { font-size: 0.82rem; font-weight: 600; white-space: nowrap; transition: color var(--transition); }
.rail-link:hover { background: var(--rail-hover); }
.rail-link:hover .rail-label { color: var(--emerald); }
.rail-link.active { background: var(--rail-active-bg); border: 1px solid var(--rail-active-border); box-shadow: var(--glow-emerald); }
.rail-link.active .rail-label { color: var(--emerald); font-weight: 700; }
.rail-link.active::before { content: ''; position: absolute; left: 0; top: 18%; bottom: 18%; width: 4px; border-radius: 0 4px 4px 0; background: var(--gradient); }
.rail-divider { width: 100%; height: 1px; background: var(--rail-divider); margin: 10px 0; }
.rail-user { padding: 12px 4px 0; border-top: 1px solid var(--rail-divider); display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.rail-avatar { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--emerald); object-fit: cover; box-shadow: 0 0 12px rgba(5,150,105,0.25); transition: transform var(--transition); }
.rail-avatar:hover { transform: scale(1.1); box-shadow: 0 0 22px rgba(5,150,105,0.45); }

/* ===================== MAIN ===================== */
.main { flex: 1; min-width: 0; padding: clamp(16px, 2.5vw, 40px); position: relative; margin: 0 auto; animation: pageEnter 0.6s cubic-bezier(0.22,1,0.36,1) both; }
@keyframes pageEnter { from { opacity: 0; transform: translateY(28px) scale(0.985); } to { opacity: 1; } }
.main::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 60% 40% at 20% 10%, rgba(5,150,105,0.05) 0%, transparent 50%), radial-gradient(ellipse 40% 50% at 80% 90%, rgba(37,99,235,0.04) 0%, transparent 50%); }

/* ===================== TOPBAR ===================== */
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  background: var(--topbar-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--line); border-radius: var(--radius);
  position: sticky; top: 12px; z-index: 40; margin: 0 0 26px; padding: 14px 22px;
  box-shadow: var(--shadow-sm);
}
.topbar h1 { font-size: 1.4rem; }
.topbar p { margin: 0; font-size: 0.9rem; }
.topbar-actions { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.topbar-name { color: var(--blue); font-weight: 700; }

/* Theme toggle */
.theme-toggle { background: none; border: 1px solid var(--line); cursor: pointer; color: var(--muted); display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 12px; font-size: 1.15rem; transition: var(--transition); background: var(--paper); }
.theme-toggle:hover { background: var(--rail-hover); color: var(--emerald); border-color: var(--rail-active-border); transform: scale(1.06) rotate(8deg); }

/* Notification bell */
.notif-bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); transition: all var(--transition); cursor: pointer; }
.notif-bell:hover { background: var(--rail-hover); color: var(--emerald); transform: translateY(-2px); }
.notif-bell [data-icon] .r3d-icon { animation: bellRing 3s ease-in-out infinite; transform-origin: top center; }
@keyframes bellRing { 0%,88%,100% { transform: rotate(0); } 90% { transform: rotate(12deg); } 94% { transform: rotate(-10deg); } 98% { transform: rotate(6deg); } }
.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, #f87171, #dc2626); color: #fff; font-size: 0.72rem; font-weight: 900; position: absolute; top: -4px; right: -6px; box-shadow: 0 0 0 3px var(--topbar-bg), 0 3px 8px rgba(220,38,38,0.5); border: 1.5px solid var(--topbar-bg); }

/* 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: 42px; padding: 4px 14px 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(--emerald); }
.profile-menu summary::-webkit-details-marker { display: none; }
.profile-menu summary img { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line); transition: border-color var(--transition); }
.profile-menu summary:hover img { border-color: var(--emerald); }
.profile-menu div { position: absolute; z-index: 30; right: 0; top: calc(100% + 10px); width: 230px; 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; animation: dropIn 0.3s cubic-bezier(0.22,1,0.36,1) both; }
@keyframes dropIn { from { opacity: 0; transform: translateY(-8px) scale(0.97); } to { opacity: 1; } }
.profile-menu strong { padding: 6px 10px 0; font-size: 0.94rem; }
.profile-menu 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); display: flex; align-items: center; gap: 10px; }
.profile-menu a:hover { background: rgba(5,150,105,0.08); color: var(--emerald); }

.notif-menu summary { border-radius: 50%; min-width: 42px; min-height: 42px; padding: 0; justify-content: center; position: relative; }
.notif-menu summary img { display: none; }
.notif-menu summary span.notif-badge { position: absolute; top: -4px; right: -4px; }
.notif-menu div { width: 340px; padding: 0; overflow: hidden; }
.notif-menu .notif-dropdown-content { display: flex; flex-direction: column; gap: 0; padding: 0; }
.notif-menu .notif-dropdown-list::-webkit-scrollbar { width: 6px; }
.notif-menu .notif-dropdown-list::-webkit-scrollbar-thumb { background-color: var(--line); border-radius: 6px; }
.notif-item { transition: background var(--transition); }
.notif-item.unread { background: rgba(5,150,105,0.04); }
.notif-item:hover { background: var(--bg); }
.notif-item.unread::before { content: ''; width: 8px; height: 8px; background: var(--emerald); border-radius: 50%; position: absolute; left: 16px; top: 16px; }
.notif-item.unread { padding-left: 32px !important; position: relative; }

/* ===================== MODERN NOTIFICATIONS PAGE ===================== */
.modern-notif-list-container { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; padding: 24px 0; }
.modern-notif-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.modern-mark-all { font-size: 0.85rem; padding: 8px 16px; background: rgba(15,23,42,0.05); color: var(--text); border: 1px solid var(--line); border-radius: 100px; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; cursor: pointer; transition: all var(--transition); }
.modern-mark-all:hover { background: var(--bg); border-color: var(--emerald); color: var(--emerald); }
.modern-notif-empty { text-align: center; padding: 64px 24px; color: var(--muted); background: var(--card-bg); border-radius: var(--radius); border: 1px solid var(--line); }
.modern-notif-empty svg { width: 48px; height: 48px; color: var(--line); margin-bottom: 16px; }
.modern-notif-empty h2 { color: var(--text); font-size: 1.25rem; font-weight: 700; margin-bottom: 8px; }
.modern-notif-empty p { margin: 0; }
.modern-notif-group { display: flex; flex-direction: column; gap: 12px; }
.modern-notif-date-header { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 4px; padding-left: 12px; }
.modern-notif-group-items { display: flex; flex-direction: column; gap: 12px; }
.modern-notif-row { display: flex; gap: 16px; padding: 20px; background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--radius); align-items: flex-start; transition: all var(--transition); position: relative; overflow: hidden; cursor: pointer; }
.modern-notif-row::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: transparent; transition: background var(--transition); }
.modern-notif-row.unread { background: rgba(5,150,105,0.03); border-color: rgba(5,150,105,0.2); }
.modern-notif-row.unread::before { background: var(--emerald); }
.modern-notif-row:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--emerald); }
.modern-notif-icon-wrap { width: 44px; height: 44px; min-width: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.modern-notif-icon-wrap svg { width: 22px; height: 22px; }
.modern-notif-content { flex: 1; min-width: 0; }
.modern-notif-title { font-size: 0.95rem; font-weight: 600; color: var(--text); line-height: 1.4; display: flex; align-items: center; gap: 8px; }
.modern-notif-title .modern-notif-dot { width: 8px; height: 8px; background: var(--emerald); border-radius: 50%; display: inline-block; }
.modern-notif-body { font-size: 0.9rem; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.modern-notif-time { font-size: 0.75rem; color: var(--muted); margin-top: 8px; font-weight: 500; }
.modern-notif-actions { display: flex; align-items: center; gap: 8px; opacity: 0; transition: opacity var(--transition); }
.modern-notif-row:hover .modern-notif-actions, .modern-notif-row.unread .modern-notif-actions { opacity: 1; }
.modern-notif-btn { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: var(--paper); color: var(--muted); cursor: pointer; transition: all var(--transition); }
.modern-notif-btn.view { width: auto; border-radius: 100px; padding: 0 16px; font-size: 0.85rem; font-weight: 600; }
.modern-notif-btn:hover { border-color: var(--emerald); color: var(--emerald); background: rgba(5,150,105,0.1); }
@media(max-width: 640px) { .modern-notif-actions { opacity: 1; } }

/* ===================== CARDS ===================== */
.card { padding: 22px; background: var(--card-bg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition); position: relative; overflow: hidden; }
.card::before { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: linear-gradient(135deg, rgba(5,150,105,0.25), transparent 40%, transparent 60%, rgba(37,99,235,0.25)); -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity var(--transition); pointer-events: none; }
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: rgba(5,150,105,0.18); }
.card:hover::before { opacity: 1; }
.card.clickable { cursor: pointer; }
.card.clickable:hover { box-shadow: var(--shadow-lg), 0 0 0 1px rgba(5,150,105,0.1); }

/* ===================== STAT CARDS (3D) ===================== */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 18px; }
.stat-card { padding: 22px; background: var(--card-bg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); 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 var(--transition); position: relative; overflow: hidden; }
.stat-card:hover { box-shadow: var(--shadow-md), var(--glow-emerald); transform: translateY(-4px); }
.stat-icon { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 16px; background: var(--gradient-soft); flex-shrink: 0; transition: transform 0.4s cubic-bezier(0.22,1,0.36,1); box-shadow: inset 0 1px 0 rgba(255,255,255,0.6); }
.stat-card:hover .stat-icon { transform: scale(1.08) rotate(-4deg); }
.stat-body { flex: 1; min-width: 0; }
.stat-body h3 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 6px; font-weight: 700; }
.stat-value { font-size: 1.9rem; font-weight: 800; line-height: 1.2; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-body p { margin: 4px 0 0; font-size: 0.82rem; }
.stat-trend { display: inline-flex; align-items: center; gap: 4px; font-size: 0.74rem; font-weight: 700; padding: 2px 8px; border-radius: 100px; }
.stat-trend.up { color: var(--emerald); background: rgba(5,150,105,0.1); }
.stat-trend.down { color: var(--red); background: rgba(220,38,38,0.1); }

/* ===================== SECTION HEADING ===================== */
.section-heading { display: flex; align-items: center; gap: 14px; margin: 30px 0 18px; }
.section-heading h2 { font-size: 1.15rem; }
.section-heading::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }

/* ===================== BADGES ===================== */
.badge { display: inline-flex; padding: 4px 12px; border-radius: 100px; background: rgba(5,150,105,0.1); color: var(--emerald); font-size: 0.76rem; font-weight: 700; white-space: nowrap; border: 1px solid rgba(5,150,105,0.18); }
.badge-green { background: rgba(22,163,74,0.1); color: #16a34a; border-color: rgba(22,163,74,0.2); }
.badge-red { background: rgba(220,38,38,0.1); color: var(--red); border-color: rgba(220,38,38,0.2); }
.badge-amber { background: rgba(217,119,6,0.1); color: var(--gold); border-color: rgba(217,119,6,0.2); }
.badge-blue { background: rgba(37,99,235,0.1); color: var(--blue); border-color: rgba(37,99,235,0.2); }
.badge-violet { background: rgba(124,58,237,0.1); color: var(--violet); border-color: rgba(124,58,237,0.2); }

/* ===================== 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 var(--line); 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.04); }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: rgba(5,150,105,0.03); }
tr.row-clickable { cursor: pointer; }

/* ===================== FORMS ===================== */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-card { padding: 26px; background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-md); margin-bottom: 18px; }
label { display: grid; gap: 6px; margin-bottom: 14px; font-size: 0.84rem; font-weight: 650; color: var(--ink); }
input, select, textarea { width: 100%; min-height: 46px; padding: 11px 15px; 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(--emerald); box-shadow: 0 0 0 4px rgba(5,150,105,0.12); }
textarea { resize: vertical; min-height: 90px; }

/* ===================== PROGRESS ===================== */
.progress-track { height: 8px; background: var(--mist); border-radius: 100px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 100px; background: var(--gradient); background-size: 200% 100%; transition: width 800ms cubic-bezier(0.22,1,0.36,1); animation: shimmer 3s ease infinite; }
.progress-fill.warn { background: linear-gradient(90deg, var(--gold), var(--orange)); }
.progress-fill.danger { background: linear-gradient(90deg, #f87171, var(--red)); }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* ===================== CIRCLE PROGRESS ===================== */
.circle-progress { --size: 56px; --stroke: 6px; --pct: 0; width: var(--size); height: var(--size); border-radius: 50%; background: conic-gradient(var(--emerald) calc(var(--pct)*1%), var(--mist) 0); display: grid; place-items: center; position: relative; transition: background 1s ease; }
.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(--paper); box-shadow: inset 0 2px 6px rgba(0,0,0,0.08); }
.circle-progress span { position: relative; z-index: 1; font-size: 0.8rem; font-weight: 800; color: var(--ink); }

/* ===================== TOAST ===================== */
.toast-container { position: fixed; bottom: 90px; 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: toastIn 0.4s cubic-bezier(0.22,1,0.36,1) both; }
.toast.removing { animation: toastOut 0.3s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px) scale(0.95); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px) scale(0.95); } }
.toast.success { border-left: 4px solid var(--emerald); }
.toast.error { border-left: 4px solid var(--red); }
.toast.warn { border-left: 4px solid var(--gold); }

/* ===================== MODAL ===================== */
.modal-overlay { display: none; position: fixed; inset: 0; z-index: 200; background: rgba(15,23,42,0.5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); 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(720px, 95%); max-height: 88vh; overflow-y: auto; padding: 32px; animation: modalPop 0.35s cubic-bezier(0.22,1,0.36,1) both; }
@keyframes modalPop { from { opacity: 0; transform: translateY(20px) scale(0.96); } }
.modal-box h2 { margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.modal-close { float: right; width: 38px; height: 38px; display: grid; place-items: center; background: none; border: 1px solid var(--line); border-radius: 50%; cursor: pointer; color: var(--muted); transition: all var(--transition); }
.modal-close:hover { border-color: var(--red); color: var(--red); transform: rotate(90deg); }

/* ===================== SCROLL REVEAL ===================== */
[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 0.6s cubic-bezier(0.22,1,0.36,1), transform 0.6s cubic-bezier(0.22,1,0.36,1); }
[data-reveal="scale"] { transform: scale(0.94); }
[data-reveal="left"] { transform: translateX(-24px); }
[data-reveal].revealed { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { [data-reveal] { opacity: 1; transform: none; transition: none; } }

/* ===================== 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.07s; }
.stagger > *:nth-child(3) { animation-delay: 0.14s; }
.stagger > *:nth-child(4) { animation-delay: 0.21s; }
.stagger > *:nth-child(5) { animation-delay: 0.28s; }
.stagger > *:nth-child(6) { animation-delay: 0.35s; }
.stagger > *:nth-child(n+7) { animation-delay: 0.42s; }
@keyframes fadeSlideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

/* ===================== GRADIENT TEXT ===================== */
.gradient-text { background: var(--gradient-3); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* ===================== AVATARS ===================== */
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--mist); border: 1px solid var(--line); }
.avatar-ring { padding: 3px; background: var(--gradient-3); border-radius: 50%; display: inline-flex; }
.avatar-ring img { border-radius: 50%; border: 3px solid var(--paper); display: block; width: 100%; height: 100%; object-fit: cover; }
.online-dot { position: absolute; bottom: 2px; right: 2px; width: 12px; height: 12px; border-radius: 50%; background: #22c55e; border: 2px solid var(--paper); box-shadow: 0 0 0 2px rgba(34,197,94,0.2); animation: onlinePulse 2s ease-in-out infinite; }
@keyframes onlinePulse { 0%,100% { box-shadow: 0 0 0 2px rgba(34,197,94,0.2); } 50% { box-shadow: 0 0 0 6px rgba(34,197,94,0.08); } }

/* ===================== EMPLOYEE CARD ===================== */
.employee-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.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-emerald); transform: translateY(-3px); border-color: rgba(5,150,105,0.2); }
.employee-card .avatar { width: 46px; height: 46px; 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(--muted); }

/* ===================== QUICK ACTIONS ===================== */
.qa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.qa-item { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 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.82rem; cursor: pointer; transition: all var(--transition); position: relative; overflow: hidden; }
.qa-item:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: var(--emerald); }
.qa-item:active { transform: scale(0.95); }
.qa-icon { width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform var(--transition); box-shadow: 0 6px 14px -4px rgba(0,0,0,0.2); }
.qa-item:hover .qa-icon { transform: scale(1.12) rotate(-4deg); }
.qa-wall .qa-icon { background: linear-gradient(135deg, #f472b6, #db2777); }
.qa-notif .qa-icon { background: linear-gradient(135deg, #fdba74, #ea580c); }
.qa-mail .qa-icon { background: linear-gradient(135deg, #22d3ee, #0891b2); }
.qa-leave .qa-icon { background: linear-gradient(135deg, #6bcb77, #16a34a); }
.qa-payslip .qa-icon { background: linear-gradient(135deg, #fcd34d, #d97706); }
.qa-profile .qa-icon { background: linear-gradient(135deg, #60a5fa, #2563eb); }
.qa-attendance .qa-icon { background: linear-gradient(135deg, #818cf8, #4f46e5); }
.qa-expenses .qa-icon { background: linear-gradient(135deg, #34d399, #0d9488); }
.qa-settings .qa-icon { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.qa-icon .r3d-icon { filter: drop-shadow(0 2px 3px rgba(0,0,0,0.25)); }

/* ===================== CALENDAR ===================== */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-head { text-align: center; font-size: 0.74rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; padding: 6px 4px; }
.cal-cell { 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: 78px; padding: 6px; transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition); }
.cal-cell.has-events { cursor: pointer; }
.cal-cell:hover { border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(5,150,105,0.1); transform: translateY(-2px); }
.cal-empty { background: transparent; border-color: transparent; }
.cal-empty:hover { border-color: transparent; box-shadow: none; transform: none; }
.cal-num { font-weight: 600; font-size: 0.82rem; line-height: 1; }
.cal-today { background: rgba(5,150,105,0.12); border-color: var(--emerald); box-shadow: 0 0 0 2px rgba(5,150,105,0.18); font-weight: 700; }
.cal-today .cal-num { color: var(--emerald); }
.cal-label { font-size: 0.56rem; font-weight: 700; padding: 1px 4px; border-radius: 3px; margin-top: 2px; line-height: 1.3; text-align: center; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leave-label { background: rgba(22,163,74,0.15); color: #16a34a; }
.holiday-label { background: rgba(5,150,105,0.15); color: var(--emerald); }
.bday-label { background: rgba(219,39,119,0.15); color: var(--pink); }
.ot-label { background: rgba(234,88,12,0.15); color: var(--orange); }

/* ===================== NOTIFICATIONS ===================== */
.notif-row { display: flex; gap: 14px; padding: 16px 18px; background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; cursor: pointer; transition: all var(--transition); align-items: flex-start; position: relative; }
.notif-row:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.notif-row.unread { border-left: 3px solid var(--emerald); }
.notif-icon { width: 44px; height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center; 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-text { font-size: 0.82rem; color: var(--muted); margin-top: 4px; line-height: 1.45; }
.notif-time { font-size: 0.72rem; color: var(--muted); margin-top: 6px; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--emerald); box-shadow: 0 0 6px rgba(5,150,105,0.5); }

/* ===================== WALL ===================== */
.wall-post { margin-bottom: 18px; padding: 20px; background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: box-shadow var(--transition), transform var(--transition); }
.wall-post:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.wall-form { background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.wall-form textarea { border: 1.5px solid var(--line); background: var(--input-bg); border-radius: var(--radius-sm); }
.wall-form-tools { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.wall-tool-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; background: var(--mist); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font-size: 0.82rem; font-weight: 600; color: var(--muted); transition: all var(--transition); }
.wall-tool-btn:hover { background: rgba(5,150,105,0.08); color: var(--emerald); }
.wall-form-submit { margin-left: auto; }

/* ===================== PROFILE HEADER ===================== */
.profile-header { position: relative; overflow: hidden; border-radius: var(--radius); }
.profile-header .cover { height: 130px; background: var(--gradient-3); border-radius: var(--radius) var(--radius) 0 0; position: relative; }
.profile-header .cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.25)); border-radius: inherit; }
.profile-header .profile-info { padding: 0 28px 24px; margin-top: -52px; position: relative; z-index: 2; display: flex; align-items: flex-end; gap: 22px; }
.profile-header .profile-info .avatar-wrap { display: inline-flex; padding: 4px; background: var(--paper); border-radius: 50%; box-shadow: var(--shadow-md); }
.profile-header .profile-info .avatar-wrap .avatar-large { width: 96px; height: 96px; display: block; border-radius: 50%; }

/* ===================== CHIPS / TOGGLE ===================== */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 100px; font-size: 0.78rem; font-weight: 600; background: rgba(5,150,105,0.08); color: var(--emerald); border: 1px solid rgba(5,150,105,0.15); }
.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: 44px; height: 24px; 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: 18px; height: 18px; 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: var(--gradient); }
.toggle input:checked + .track::after { transform: translateX(20px); }

/* ===================== MENU TOGGLE (mobile) ===================== */
.menu-toggle { display: none; align-items: center; justify-content: center; width: 42px; height: 42px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; color: var(--ink); transition: border-color var(--transition); }
.menu-toggle:hover { border-color: var(--emerald); }

/* ===================== MOBILE NAV BAR ===================== */
.mobile-nav-bar { display: none; position: fixed; bottom: 16px; left: 16px; right: 16px; height: 66px; background: var(--topbar-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid var(--line); border-radius: 33px; box-shadow: var(--shadow-lg); 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.7rem; font-weight: 600; text-decoration: none; transition: color var(--transition), transform var(--transition); flex: 1; height: 100%; }
.mobile-nav-item.active { color: var(--emerald); }
.mobile-nav-item.active [data-icon] .r3d-icon { transform: translateY(-3px) scale(1.1); }

/* ===================== SCROLLBAR ===================== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ===================== DARK MODE ===================== */
[data-theme="dark"] {
  --ink: #e8eef6; --muted: #94a3b8; --paper: #0b0f19; --mist: #1a2233;
  --line: rgba(255,255,255,0.09); --bg: #05080f; --card-bg: rgba(17,24,39,0.6);
  --topbar-bg: rgba(8,12,22,0.75); --input-bg: rgba(17,24,39,0.5); --rail-bg: rgba(11,15,25,0.85);
  --rail-text: #94a3b8; --rail-hover: rgba(5,150,105,0.16); --rail-divider: rgba(255,255,255,0.08);
  color-scheme: dark;
}
[data-theme="dark"] body::before { opacity: 0.04; }
[data-theme="dark"] .card, [data-theme="dark"] .stat-card, [data-theme="dark"] .form-card { background: var(--card-bg); }
[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea { background: var(--input-bg); color: var(--ink); }
[data-theme="dark"] .circle-progress::before { background: var(--paper); }

/* ===================== RESPONSIVE ===================== */
@media screen and (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media screen and (max-width: 768px) {
  .rail { display: none; }
  .menu-toggle { display: flex; }
  .mobile-nav-bar { display: flex; }
  .main { padding-bottom: 100px !important; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; gap: 10px; }
  .back-to-top { bottom: 90px; right: 16px; width: 42px; height: 42px; }
}
@media screen and (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr; }
  .profile-menu summary span { display: none; }
  .profile-menu summary { padding: 4px; }
}

/* ===================== MOBILE DRAWER ===================== */
.mobile-drawer { position: fixed; left: -300px; top: 0; width: 280px; height: 100vh; z-index: 100; background: var(--rail-bg); backdrop-filter: blur(20px); border-right: 1px solid var(--line); box-shadow: 4px 0 30px rgba(0,0,0,0.15); transition: left 320ms cubic-bezier(0.22,1,0.36,1); overflow-y: auto; padding: 18px 14px; }
.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; }
body.sidebar-open { overflow: hidden; }

/* ===================== LOGIN (3D) ===================== */
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; z-index: 1; overflow: hidden; }
.login-bg-shapes { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.login-bg-shapes span { position: absolute; border-radius: 50%; background: var(--gradient); opacity: 0.3; filter: blur(8px); animation: floatUp 22s linear infinite; }
@keyframes floatUp { 0% { transform: translateY(0) rotate(0); opacity: 0; } 10% { opacity: 0.35; } 90% { opacity: 0.35; } 100% { transform: translateY(-120vh) rotate(720deg); opacity: 0; } }
.login-glowing-orb { position: fixed; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, rgba(5,150,105,0.18) 0%, transparent 70%); top: -160px; right: -120px; z-index: 0; pointer-events: none; animation: glowPulse 5s ease-in-out infinite; }
.login-glowing-orb:nth-child(2) { top: auto; bottom: -160px; left: -120px; right: auto; width: 600px; height: 600px; background: radial-gradient(circle, rgba(37,99,235,0.16) 0%, transparent 70%); animation-delay: 2.5s; }
@keyframes glowPulse { 0%,100% { opacity: 0.5; transform: scale(1); } 50% { opacity: 0.9; transform: scale(1.08); } }
.login-panel { width: min(440px, 100%); padding: 40px; background: var(--card-bg); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); position: relative; z-index: 1; animation: pageEnter 0.7s cubic-bezier(0.22,1,0.36,1) both; }
.login-panel::before { content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px; background: linear-gradient(135deg, rgba(5,150,105,0.4), transparent 40%, transparent 60%, rgba(37,99,235,0.4)); -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.login-brand img { width: 64px; height: 64px; border-radius: 16px; padding: 6px; background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow-3d); animation: iconFloat 5s ease-in-out infinite; }
.login-brand strong { font-size: 1.05rem; font-weight: 800; color: var(--ink); display: block; }
.login-brand small { color: var(--muted); font-size: 0.84rem; }
.pw-wrap { position: relative; display: flex; align-items: center; }
.pw-wrap input { padding-right: 44px; }
.pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; padding: 6px; color: var(--muted); border-radius: 6px; transition: color 0.15s, background 0.15s; }
.pw-toggle:hover { color: var(--emerald); background: rgba(5,150,105,0.08); }
.login-orbit { position: absolute; top: -40px; right: -40px; width: 120px; height: 120px; pointer-events: none; }
.login-orbit .orbit-dot { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: var(--gradient); box-shadow: var(--glow-emerald); animation: orbit 6s linear infinite; }
@keyframes orbit { from { transform: rotate(0) translateX(50px) rotate(0); } to { transform: rotate(360deg) translateX(50px) rotate(-360deg); } }

/* ===================== HERO STATS (login) ===================== */
.login-feature { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.login-feature-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--radius-sm); backdrop-filter: blur(10px); }
.login-feature-item .fi-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }

/* ===================== FOOTER ===================== */
.footer { margin-top: 40px; padding: 30px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: 0.84rem; }
.footer a { color: var(--emerald); font-weight: 600; }

/* ===================== BACK TO TOP ===================== */
.back-to-top { position: fixed; bottom: 24px; right: 24px; width: 48px; height: 48px; border-radius: 14px; background: var(--gradient); color: #fff; border: none; cursor: pointer; display: grid; place-items: center; box-shadow: var(--shadow-3d); z-index: 90; opacity: 0; transform: translateY(20px) scale(0.8); transition: all var(--transition); }
.back-to-top.show { opacity: 1; transform: none; }
.back-to-top:hover { transform: translateY(-3px) scale(1.05); }

/* ===================== COUNT-UP ===================== */
.count-up { font-variant-numeric: tabular-nums; }

/* ===================== HELP PINS ===================== */
.help-pin { display:inline-flex; align-items:center; justify-content:center; width:18px; height:18px; border-radius:50%; background:linear-gradient(135deg,#34d399,#059669); color:#fff; font-size:10px; font-weight:800; cursor:help; vertical-align:middle; margin-left:4px; position:relative; transition:transform .2s,box-shadow .2s; flex-shrink:0 }
.help-pin:hover { transform:scale(1.2); box-shadow:0 0 16px rgba(5,150,105,.5) }
.help-pin::after { content:attr(data-tip); position:absolute; bottom:calc(100% + 8px); left:50%; transform:translateX(-50%) translateY(4px); background:#0f172a; color:#fff; padding:8px 12px; border-radius:10px; font-size:.75rem; font-weight:400; line-height:1.45; white-space:normal; width:230px; text-align:center; opacity:0; pointer-events:none; transition:opacity .2s,transform .2s; z-index:9999; box-shadow:0 8px 24px rgba(0,0,0,.25) }
.help-pin:hover::after { opacity:1; transform:translateX(-50%) translateY(0) }
.help-pin::before { content:'?'; line-height:1 }
.rail-link .help-pin { position:absolute; right:8px; top:50%; transform:translateY(-50%); width:16px; height:16px; font-size:8px; opacity:0; transition:opacity .2s; margin:0; background:linear-gradient(135deg,#a78bfa,#7c3aed) }
.rail-link:hover .help-pin { opacity:1 }
.rail-link .help-pin::after { left:calc(100% + 8px); bottom:auto; top:50%; transform:translateY(-50%) translateX(-4px) }
.rail-link .help-pin:hover::after { transform:translateY(-50%) translateX(0) }
.stat-card .help-pin, .card .help-pin { position:absolute; top:12px; right:12px; width:16px; height:16px; font-size:8px; margin:0; opacity:0; transition:opacity .2s }
.stat-card:hover .help-pin, .card:hover .help-pin { opacity:1 }
.qa-item .help-pin { position:absolute; top:8px; right:8px; width:14px; height:14px; font-size:7px; margin:0; opacity:0; transition:opacity .2s; background:rgba(255,255,255,.35) }
.qa-item:hover .help-pin { opacity:1 }
.qa-item .help-pin::after { width:200px }
.quick-actions-title .help-pin { margin-left:0 }

/* ===================== WELCOME STRIP ===================== */
.welcome-strip { background:var(--gradient-3); border-radius:var(--radius); padding:24px 28px; color:#fff; margin-bottom:26px; position:relative; overflow:hidden }
.welcome-strip h2 { font-size:1.3rem; font-weight:800; margin-bottom:4px; color:#fff }
.welcome-strip p { color:rgba(255,255,255,.75); margin:0; font-size:.9rem }
.welcome-strip::after { content:''; position:absolute; top:-50%; right:-10%; width:200px; height:200px; border-radius:50%; background:rgba(255,255,255,.08); pointer-events:none }
.welcome-strip::before { content:''; position:absolute; bottom:-30%; right:20%; width:120px; height:120px; border-radius:50%; background:rgba(255,255,255,.05); pointer-events:none }

/* ===================== LAYOUT SECTIONS ===================== */
.quick-actions-title { display:flex; align-items:center; gap:8px; margin:0 0 16px }
.quick-actions-title h2 { margin:0 }
.section-layout { display:grid; grid-template-columns:1fr 320px; gap:22px; margin-bottom:26px }
.section-layout-2 { display:grid; grid-template-columns:1fr 1fr; gap:22px; margin-bottom:26px }
@media (max-width:1024px) { .section-layout, .section-layout-2 { grid-template-columns:1fr } }
@media (max-width:768px) { .welcome-strip { padding:18px 20px } }

/* ===================== HISTORY LIST ===================== */
.history-list { display:grid; gap:10px }
.history-item { display:flex; align-items:center; gap:12px; padding:10px 14px; background:var(--card-bg); border:1px solid var(--line); border-radius:var(--radius-sm); transition:all var(--transition) }
.history-item:hover { border-color:rgba(5,150,105,.2); transform:translateX(4px) }
.history-time { font-size:.72rem; color:var(--muted); font-weight:600; min-width:56px }
.history-text { font-size:.84rem; font-weight:500; flex:1 }

/* ===================== UPCOMING EVENTS ===================== */
.upcoming-grid { display:grid; gap:10px }
.upcoming-item { display:flex; align-items:center; gap:12px; padding:12px 14px; background:var(--card-bg); border:1px solid var(--line); border-radius:var(--radius-sm); transition:all var(--transition); cursor:pointer }
.upcoming-item:hover { box-shadow:var(--shadow-sm); transform:translateY(-2px); border-color:rgba(5,150,105,.2) }
.upcoming-icon { width:36px; height:36px; border-radius:10px; display:grid; place-items:center; flex-shrink:0 }
.upcoming-body { flex:1 }
.upcoming-body strong { font-size:.86rem; display:block }
.upcoming-body p { font-size:.76rem; margin:2px 0 0 }

/* --- OVERRIDES FOR COLLAPSED SIDEBAR & 3D WIDGETS --- */

.rail {
    width: 86px !important;
    min-width: 86px !important;
    overflow: visible !important;
    transition: width 0.3s ease;
}
.rail-label, .rail-brand span, .rail-section {
    display: none !important;
}
.rail-link {
    justify-content: center !important;
    padding: 12px 0 !important;
}
.rail-user {
    justify-content: center !important;
}
.rail-brand {
    justify-content: center !important;
    padding: 6px !important;
}
.rail-brand img {
    margin-right: 0 !important;
}
.main {
    margin-left: 0 !important;
    width: 100% !important; /* Let flex handle it if rail is in flex, but wait, rail is position: sticky */
}
/* Wait, app is flex: align-items: flex-start; so rail is left, main is right. */
/* So main doesn't need margin-left if app is flex and rail is sticky/relative */
.main {
    flex: 1 !important;
    margin-left: 0 !important;
    width: calc(100vw - 86px) !important;
}

.stat-card {
    position: relative;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    will-change: transform, box-shadow;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease !important;
    box-shadow: 0 10px 20px rgba(0,0,0,0.06), inset 0 2px 0 rgba(255,255,255,0.7) !important;
    cursor: pointer;
    overflow: visible !important;
    border: 1px solid rgba(255,255,255,0.4) !important;
    background: linear-gradient(145deg, rgba(255,255,255,0.95), rgba(255,255,255,0.8)) !important;
    backdrop-filter: blur(12px) !important;
}
.stat-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 -4px 10px rgba(0,0,0,0.03);
    pointer-events: none;
}
.stat-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 20px 35px -5px rgba(5,150,105,0.18), inset 0 2px 0 rgba(255,255,255,1), 0 10px 20px -5px rgba(37,99,235,0.1) !important;
    border-color: rgba(5,150,105,0.4) !important;
    z-index: 10;
}
.stat-card:active {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 15px rgba(0,0,0,0.1) !important;
}
.stat-icon {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.stat-card:hover .stat-icon {
    transform: scale(1.08) !important;
}

/* --- 3D ICONS HIGH CLARITY STYLING --- */
.icon-3d {
    image-rendering: -webkit-optimize-contrast;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.15));
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease;
}
a:hover .icon-3d, button:hover .icon-3d {
    transform: translateY(-3px) scale(1.08) !important;
    filter: drop-shadow(0 6px 10px rgba(5,150,105,0.3));
}
.stat-card:hover .icon-3d {
    transform: translateY(-2px) scale(1.06) rotate(3deg) !important;
    filter: drop-shadow(0 6px 10px rgba(5,150,105,0.3));
}

/* --- CAR PARKING PRELOADER (HTMX TRANSITION) --- */
.htmx-preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.htmx-preloader.active {
    opacity: 1 !important;
    pointer-events: all;
}
.preloader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(5, 150, 105, 0.2);
    border-top-color: #059669;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.preloader-text {
    margin-top: 20px;
    font-weight: 700;
    font-size: 1.2rem;
    color: #059669;
    letter-spacing: 1px;
    animation: pulse 1s infinite alternate;
}
@keyframes pulse {
    from { opacity: 0.6; }
    to { opacity: 1; }
}

/* ===================== SIDEBAR TOOLTIPS & HELP ICONS ===================== */
.rail {
    overflow: visible !important;
}
.rail-nav {
    overflow-x: visible !important;
}
.rail-link { position: relative; }
.rail-link::after {
    content: attr(data-flyout);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(-8px);
    background: #0f172a;
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.3);
    z-index: 99999;
    border: 1px solid rgba(255,255,255,0.1);
}
.rail-link:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.help-wr {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    margin-left: 6px;
    cursor: pointer;
    transition: transform 0.2s ease;
}
.help-wr:hover {
    transform: scale(1.15);
}
.help-icon-3d {
    width: 22px !important;
    height: 22px !important;
    vertical-align: middle !important;
    object-fit: contain;
}

