/* ═══════════════════════════════════════════════════════════
   BARRO INDUSTRIES — Operations System v3
   Premium Dark Design System
   Palette: Black · Pink · Blue · Gold
   Apple-inspired · Glass · 3D icons · Rich animations
═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300;0,14..32,400;0,14..32,500;0,14..32,600;0,14..32,700;0,14..32,800;0,14..32,900&display=swap');

/* ══════════════════════════════
   DESIGN TOKENS
══════════════════════════════ */
:root {
  /* ── Core palette ── */
  --black:    #070710;
  --black-2:  #0D0D1A;
  --black-3:  #131325;
  --pink:     #FF2D78;
  --pink-2:   #FF6B9D;
  --pink-glow:rgba(255,45,120,0.35);
  --blue:     #0A84FF;
  --blue-2:   #40A9FF;
  --blue-glow:rgba(10,132,255,0.30);
  --gold:     #FFD60A;
  --gold-2:   #F5C842;
  --gold-3:   #FFAA00;
  --gold-glow:rgba(255,214,10,0.30);
  --white:    #FFFFFF;

  /* ── Gradient presets ── */
  --grad-pk-bl: linear-gradient(135deg, #FF2D78 0%, #0A84FF 100%);
  --grad-gold:  linear-gradient(135deg, #FFD60A 0%, #FF9F0A 100%);
  --grad-dark:  linear-gradient(135deg, #131325 0%, #0D0D1A 100%);
  --grad-card:  linear-gradient(160deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 100%);
  --grad-pink:  linear-gradient(135deg, #FF2D78 0%, #FF6B9D 100%);
  --grad-blue:  linear-gradient(135deg, #0A84FF 0%, #40A9FF 100%);
  --grad-purple:linear-gradient(135deg, #8B5CF6 0%, #0A84FF 100%);
  --grad-teal:  linear-gradient(135deg, #00D4AA 0%, #0A84FF 100%);
  --grad-green: linear-gradient(135deg, #30D158 0%, #00D4AA 100%);
  --grad-amber: linear-gradient(135deg, #FFD60A 0%, #FF9F0A 100%);
  --grad-red:   linear-gradient(135deg, #FF453A 0%, #FF2D78 100%);

  /* ── Surfaces (dark glass) ── */
  --bg:       var(--black);
  --s0:       rgba(255,255,255,0.03);   /* deepest card */
  --s1:       rgba(255,255,255,0.05);   /* card */
  --s2:       rgba(255,255,255,0.08);   /* hover */
  --s3:       rgba(255,255,255,0.11);   /* active / pressed */
  --glass:    rgba(13,13,26,0.82);
  --glass-lt: rgba(255,255,255,0.06);

  /* ── Aliases used by inline JS styles ── */
  --surface:  rgba(255,255,255,0.05);
  --surface2: rgba(255,255,255,0.08);
  --primary:       #9BA8FF;   /* bright lavender — readable on dark */
  --primary-light: #818CF8;
  --primary-dark:  #1a237e;
  --accent:        var(--gold);
  --accent-light:  var(--gold-2);
  --success:  #30D158;
  --warning:  var(--gold-3);
  --danger:   #FF453A;
  --info:     var(--blue);

  /* ── Borders ── */
  --border:      rgba(255,255,255,0.09);
  --border-glow: rgba(255,45,120,0.25);
  --border-gold: rgba(255,214,10,0.25);

  /* ── Text ── */
  --text:       #F0F0FA;
  --text-2:     rgba(240,240,250,0.80);
  --text-muted: rgba(240,240,250,0.45);
  --text-light: rgba(240,240,250,0.28);
  --text-inv:   #070710;

  /* ── Shadows ── */
  --sh-xs:  0 1px 4px rgba(0,0,0,0.4);
  --sh-sm:  0 2px 12px rgba(0,0,0,0.5);
  --sh:     0 4px 20px rgba(0,0,0,0.55);
  --sh-md:  0 8px 32px rgba(0,0,0,0.60);
  --sh-lg:  0 16px 56px rgba(0,0,0,0.70);
  --sh-pink:0 4px 24px rgba(255,45,120,0.30);
  --sh-blue:0 4px 24px rgba(10,132,255,0.25);
  --sh-gold:0 4px 24px rgba(255,214,10,0.25);

  /* ── Radius ── */
  --r-xs:  6px;
  --r-sm:  10px;
  --r:     14px;
  --r-lg:  18px;
  --r-xl:  24px;
  --r-2xl: 32px;
  --pill:  999px;

  /* ── Layout ── */
  --topbar-h:     56px;
  --sidebar-w:    258px;
  --bottom-nav-h: 52px;
  --top-nav-h:    50px;

  /* ── Type ── */
  --font: 'Inter', -apple-system, 'SF Pro Text', system-ui, sans-serif;
  --font-display: 'Inter', -apple-system, 'SF Pro Display', system-ui, sans-serif;
  --font-mono: 'SF Mono', 'Fira Mono', 'Cascadia Code', monospace;

  /* ── Motion ── */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t1: 120ms; --t2: 220ms; --t3: 340ms;

  /* ── Component backgrounds (swap for light mode) ── */
  --topbar-bg:     rgba(7,7,16,0.88);
  --sidebar-bg:    rgba(7,7,16,0.94);
  --notif-bg:      rgba(13,13,26,0.92);
  --login-card-bg: rgba(13,13,26,0.88);
  --bottom-nav-bg: rgba(7,7,16,0.90);
  --modal-bg:      rgba(13,13,26,0.92);
  --drawer-bg:     rgba(10,10,20,0.94);

  /* ── Toast theming (consumed by notifications.js) ── */
  --toast-success: #1E8E45;
  --toast-error:   #D9362B;
  --toast-info:    #2E6FD6;
  --toast-text:    #FFFFFF;
}

/* ══════════════════════════════
   ANIMATIONS
══════════════════════════════ */
@keyframes meshDrift {
  0%,100% {
    background-position: 0% 50%, 100% 50%, 50% 0%;
    opacity: 1;
  }
  50% {
    background-position: 100% 50%, 0% 50%, 50% 100%;
    opacity: 0.8;
  }
}
@keyframes float {
  0%,100% { transform: translateY(0)     rotate(0deg); }
  33%      { transform: translateY(-22px) rotate(2deg); }
  66%      { transform: translateY(-10px) rotate(-1deg); }
}
@keyframes floatB {
  0%,100% { transform: translateY(0)     rotate(0deg) scale(1); }
  50%      { transform: translateY(-30px) rotate(-3deg) scale(1.04); }
}
@keyframes shimmer {
  0%   { transform: translateX(-100%) skewX(-12deg); }
  100% { transform: translateX(250%)  skewX(-12deg); }
}
@keyframes gradRun {
  0%,100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
@keyframes pulseGlow {
  0%,100% { opacity: 0.7; }
  50%      { opacity: 1; }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}
@keyframes ptr-spin {
  to { transform: rotate(360deg); }
}
@keyframes ptr-bounce {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.88) translateY(14px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);    }
}
@keyframes dropDown {
  from { opacity: 0; transform: translateY(-10px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)     scale(1);    }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spin3d {
  from { transform: rotateY(0deg); }
  to   { transform: rotateY(360deg); }
}
@keyframes skeleton {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
@keyframes iconPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}
@keyframes borderGlow {
  0%,100% { box-shadow: 0 0 0 0 var(--pink-glow); }
  50%      { box-shadow: 0 0 0 4px var(--pink-glow); }
}
@keyframes goldShine {
  0%   { left: -120%; }
  100% { left: 200%; }
}

/* ══════════════════════════════
   RESET
══════════════════════════════ */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
  /* Prevent white overscroll flash on iOS */
  background: #070710;
  overscroll-behavior: none;
}

body {
  font-family: var(--font);
  background: linear-gradient(150deg, #070710 0%, #0D0D2B 35%, #120820 65%, #070710 100%);
  color: var(--text);
  font-size: 14px; line-height: 1.5;
  min-height: 100dvh; overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  /* Match overscroll gutter color on iOS */
  background-color: #070710;
}

/* ── Animated background mesh ── */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 60% at 10% 20%,  rgba(255,45,120,0.13) 0%, transparent 65%),
    radial-gradient(ellipse 60% 50% at 90% 80%,  rgba(10,132,255,0.11) 0%, transparent 65%),
    radial-gradient(ellipse 50% 50% at 55% 45%,  rgba(255,214,10,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 80% 80% at 50% 100%, rgba(139,92,246,0.07) 0%, transparent 60%);
  background-size: 200% 200%, 200% 200%, 200% 200%, 200% 200%;
  animation: meshDrift 18s ease-in-out infinite;
}
/* decorative floating orb top-right */
body::after {
  content: '';
  position: fixed; top: -160px; right: -120px; z-index: 0; pointer-events: none;
  width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,45,120,0.10) 0%, transparent 70%);
  animation: floatB 14s ease-in-out infinite;
}

/* everything inside should sit above bg mesh */
#login-screen, #app-shell { position: relative; z-index: 1; }

/* ══════════════════════════════
   UTILITIES
══════════════════════════════ */
.hidden { display: none !important; }
.text-muted  { color: var(--text-muted); font-size: 12px; }
.text-center { text-align: center; }

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 9px; border-radius: var(--pill);
  font-size: 11px; font-weight: 600; letter-spacing: 0.2px;
  white-space: nowrap; border: 1px solid transparent;
}
.badge-blue   { background: rgba(10,132,255,0.15);   color: #60B4FF; border-color: rgba(10,132,255,0.20); }
.badge-green  { background: rgba(48,209,88,0.12);    color: #4DE87A; border-color: rgba(48,209,88,0.18); }
.badge-orange { background: rgba(255,159,10,0.12);   color: #FFB830; border-color: rgba(255,159,10,0.18); }
.badge-red    { background: rgba(255,69,58,0.12);    color: #FF7066; border-color: rgba(255,69,58,0.18); }
.badge-gray   { background: rgba(255,255,255,0.06);  color: var(--text-muted); border-color: var(--border); }
.badge-purple { background: rgba(139,92,246,0.14);   color: #B07EFF; border-color: rgba(139,92,246,0.20); }
.badge-teal   { background: rgba(0,212,170,0.12);    color: #00DDB8; border-color: rgba(0,212,170,0.18); }

/* ── Buttons ── */
.btn-primary {
  position: relative; overflow: hidden;
  background: var(--grad-pk-bl);
  background-size: 200% 200%;
  color: #fff; border: none;
  border-radius: var(--r-sm);
  padding: 10px 18px; font-size: 13px; font-weight: 600;
  cursor: pointer; letter-spacing: 0.1px;
  transition: transform var(--t1), box-shadow var(--t2);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  box-shadow: var(--sh-pink);
  animation: gradRun 4s ease infinite;
  will-change: background-position;
  white-space: nowrap;
}
.btn-primary::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transform: translateX(-100%) skewX(-12deg);
  transition: none;
}
.btn-primary:hover { transform: translateY(-1px) scale(1.01); box-shadow: 0 6px 28px rgba(255,45,120,0.45); }
.btn-primary:hover::before { animation: shimmer 0.5s ease forwards; }
.btn-primary:active { transform: scale(0.97); }
.btn-primary.btn-full { width: 100%; padding: 14px; font-size: 15px; border-radius: var(--r); }
.btn-primary.btn-sm   { padding: 6px 13px; font-size: 12px; border-radius: var(--r-xs); }

.btn-secondary {
  background: var(--s1); color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 9px 16px; font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: background var(--t1), border-color var(--t1), transform var(--t1);
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  backdrop-filter: blur(8px);
}
.btn-secondary:hover { background: var(--s2); border-color: rgba(255,255,255,0.16); transform: translateY(-1px); }
.btn-secondary.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: var(--r-xs); }

.btn-danger {
  background: rgba(255,69,58,0.12); color: #FF7066;
  border: 1px solid rgba(255,69,58,0.22);
  border-radius: var(--r-sm); padding: 9px 16px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background var(--t1), box-shadow var(--t1);
}
.btn-danger:hover { background: rgba(255,69,58,0.22); box-shadow: 0 2px 12px rgba(255,69,58,0.25); }

.btn-success {
  background: rgba(48,209,88,0.12); color: #4DE87A;
  border: 1px solid rgba(48,209,88,0.22);
  border-radius: var(--r-sm); padding: 9px 16px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background var(--t1);
}
.btn-success:hover { background: rgba(48,209,88,0.22); }

.btn-link {
  background: none; border: none;
  color: var(--blue-2); font-size: 13px; font-weight: 500;
  cursor: pointer; padding: 4px 0;
  transition: color var(--t1), opacity var(--t1);
}
.btn-link:hover { color: var(--blue); }

.btn-icon {
  background: none; border: none; cursor: pointer;
  font-size: 15px; padding: 6px 8px; border-radius: var(--r-xs);
  transition: background var(--t1); color: var(--text-muted);
}
.btn-icon:hover { background: var(--s2); color: var(--text); }

/* ── Forms ── */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block; font-size: 11px; font-weight: 600;
  margin-bottom: 5px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.6px;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%; padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 14px; /* base size */
  background: var(--s1); color: var(--text);
  transition: border-color var(--t2), box-shadow var(--t2), background var(--t2);
  outline: none; -webkit-appearance: none;
  backdrop-filter: blur(8px);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--pink);
  background: var(--s2);
  box-shadow: 0 0 0 3px rgba(255,45,120,0.14);
}
.form-group textarea { resize: vertical; min-height: 80px; line-height: 1.6; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.select-sm {
  padding: 7px 10px; border: 1px solid var(--border);
  border-radius: var(--r-xs); font-size: 12px; font-weight: 500;
  background: var(--s1); color: var(--text);
  cursor: pointer; outline: none;
  transition: border-color var(--t2); -webkit-appearance: none;
}
.select-sm:focus { border-color: var(--pink); }

.error-msg {
  color: #FF7066; font-size: 13px; padding: 9px 12px;
  background: rgba(255,69,58,0.08); border: 1px solid rgba(255,69,58,0.18);
  border-radius: var(--r-sm); margin-bottom: 10px;
}
.success-msg {
  color: #4DE87A; font-size: 13px; padding: 9px 12px;
  background: rgba(48,209,88,0.08); border: 1px solid rgba(48,209,88,0.18);
  border-radius: var(--r-sm);
}
.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: #fff; border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

/* ══════════════════════════════
   LOGIN SCREEN
══════════════════════════════ */
.screen { display: flex; min-height: 100dvh; }

#login-screen {
  flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px; position: relative; overflow: hidden;
  background: var(--black);
}

/* Large decorative orbs */
.login-bg {
  position: absolute; inset: 0; pointer-events: none;
  overflow: hidden;
}
.login-bg::before {
  content: '';
  position: absolute; top: -180px; left: -120px;
  width: 560px; height: 560px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,45,120,0.18) 0%, transparent 68%);
  animation: float 11s ease-in-out infinite;
}
.login-bg::after {
  content: '';
  position: absolute; bottom: -160px; right: -100px;
  width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, rgba(10,132,255,0.15) 0%, transparent 68%);
  animation: floatB 14s ease-in-out infinite;
}

/* Gold orb center */
#login-screen::before {
  content: '';
  position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%);
  width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,214,10,0.07) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
  animation: pulseGlow 6s ease-in-out infinite;
}
#login-screen::after { display: none; }

.login-container {
  position: relative; z-index: 2;
  background: var(--login-card-bg);
  backdrop-filter: blur(32px); -webkit-backdrop-filter: blur(32px);
  border-radius: var(--r-xl);
  padding: 40px 32px 32px;
  width: 100%; max-width: 388px;
  border: 1px solid rgba(255,255,255,0.09);
  box-shadow:
    0 0 0 1px rgba(255,214,10,0.10),
    0 20px 60px rgba(0,0,0,0.70),
    inset 0 1px 0 rgba(255,255,255,0.06);
  text-align: center;
  animation: fadeUp 0.5s var(--spring);
}
/* gold top trim */
.login-container::before {
  content: '';
  position: absolute; top: 0; left: 10%; right: 10%; height: 1.5px;
  background: var(--grad-gold);
  border-radius: var(--pill);
  opacity: 0.7;
}

.login-logo-wrap {
  position: relative; overflow: hidden;
  width: 88px; height: 88px; margin: 0 auto 18px;
  border-radius: 22px;
  background: linear-gradient(140deg, #0A0A1A 0%, #131330 60%, #1A0A2E 100%);
  border: 1px solid rgba(255,214,10,0.35);
  box-shadow: 0 0 18px rgba(255,214,10,0.18), inset 0 1px 0 rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: center;
  padding: 6px;
}
/* top gold trim line */
.login-logo-wrap::after {
  content: '';
  position: absolute; top: 0; left: 12%; right: 12%; height: 1.5px;
  background: var(--grad-gold);
  border-radius: var(--pill); opacity: 0.80;
}
/* static inner sheen */
.login-logo-wrap::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 60%);
  border-radius: inherit; pointer-events: none;
}
.login-logo-img {
  width: 100%; height: 100%; object-fit: contain;
  border-radius: 16px; position: relative; z-index: 1;
}
.login-logo-fallback {
  width: 100%; height: 100%;
  background: var(--grad-pk-bl);
  color: #fff; border-radius: 16px;
  font-size: 28px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; margin: 0 auto;
  position: relative; z-index: 1;
}
.login-title {
  font-family: var(--font-display);
  font-size: 24px; font-weight: 800;
  background: var(--grad-pk-bl);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; background-size: 200% 200%;
  animation: gradRun 5s ease infinite;
  margin-bottom: 4px; letter-spacing: -0.4px;
}
.login-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
.login-form { text-align: left; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px; }
.pw-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 6px; display: flex; align-items: center;
  transition: color var(--t1);
}
.pw-toggle:hover { color: var(--text); }
.pw-toggle svg { width: 16px; height: 16px; stroke: currentColor; }
.login-version { margin-top: 20px; font-size: 11px; color: var(--text-light); }

/* ── Company Page ── */
.co-hero {
  position: relative; overflow: hidden;
  border-radius: var(--r); margin-bottom: 20px;
  padding: 36px 28px; display: flex; align-items: center; gap: 20px;
  background: linear-gradient(135deg, #1a1a1e 0%, #111113 60%, #1c1a0e 100%);
  border: 1px solid rgba(255,214,10,0.15);
}
.co-hero-bg {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 80% 50%, rgba(255,214,10,0.08) 0%, transparent 60%);
}
.co-hero-logo { width: 60px; height: 60px; object-fit: contain; flex-shrink: 0; position: relative; z-index: 1; }
.co-hero-text { position: relative; z-index: 1; }
.co-hero-title { font-size: 22px; font-weight: 900; letter-spacing: 0.12em; color: #fff; margin-bottom: 6px; }
.co-hero-tagline { font-size: 13px; color: var(--gold); font-style: italic; font-weight: 500; }

.co-section { background: var(--s1); border: 1px solid var(--border); border-radius: var(--r); padding: 20px; margin-bottom: 16px; }
.co-section-title { font-size: 13px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 14px; }
.co-body { font-size: 13px; color: var(--text-2); line-height: 1.8; }

/* Business cards */
.co-biz-grid { display: flex; flex-direction: column; gap: 12px; }
.co-biz-card {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px; background: var(--s2); border-radius: var(--r-sm);
  border: 1px solid var(--border);
}
.co-biz-logo { width: 44px; height: 44px; object-fit: contain; flex-shrink: 0; border-radius: 8px; }
.co-biz-name { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.co-biz-desc { font-size: 12px; color: var(--text-muted); line-height: 1.6; margin-bottom: 6px; }

/* President card */
.co-president-card {
  display: flex; gap: 20px; align-items: flex-start;
}
.co-president-left { flex-shrink: 0; text-align: center; width: 100px; }
.co-president-photo {
  width: 88px; height: 88px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--gold); margin-bottom: 8px;
}
.co-president-initials {
  width: 88px; height: 88px; border-radius: 50%; background: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 900; color: #000; margin: 0 auto 8px;
}
.co-president-name { font-size: 13px; font-weight: 700; color: var(--text); }
.co-president-title { font-size: 11px; color: var(--text-muted); line-height: 1.5; margin-top: 2px; }
.co-president-msg { flex: 1; }
.co-president-msg p { font-size: 13px; color: var(--text-2); line-height: 1.8; font-style: italic; margin-bottom: 10px; }
.co-quote-mark { font-size: 48px; line-height: 1; color: var(--gold); opacity: 0.4; font-family: Georgia, serif; margin-bottom: -10px; }

/* Core values */
.co-values-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.co-value-card { background: var(--s2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 14px; }
.co-value-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.co-value-name { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.co-value-desc { font-size: 11px; color: var(--text-muted); line-height: 1.6; }

/* Doc cards (memos) */
.co-doc-card {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px; background: var(--s1); border: 1px solid var(--border);
  border-radius: var(--r-sm); margin-bottom: 10px; cursor: pointer;
  transition: background 0.15s;
}
.co-doc-card:hover { background: var(--s2); }
.co-doc-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.co-doc-body { flex: 1; min-width: 0; }
.co-doc-title { font-size: 14px; font-weight: 700; margin-bottom: 3px; }
.co-doc-meta { font-size: 11px; color: var(--text-muted); margin-bottom: 5px; }
.co-doc-preview { font-size: 12px; color: var(--text-muted); line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Download rows */
.co-dl-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; background: var(--s1); border: 1px solid var(--border);
  border-radius: var(--r-sm); margin-bottom: 8px; text-decoration: none; color: var(--text);
  transition: background 0.15s;
}
.co-dl-row:hover { background: var(--s2); }
.co-dl-icon { width: 32px; height: 32px; border-radius: 7px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.co-dl-info { flex: 1; min-width: 0; }
.co-dl-name { font-size: 13px; font-weight: 600; }
.co-dl-desc { font-size: 11px; color: var(--text-muted); }

/* Handbook accordion */
.handbook-accordion { display: flex; flex-direction: column; gap: 8px; }
.handbook-item { background: var(--s1); border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; }
.handbook-header {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: none; border: none; color: var(--text);
  cursor: pointer; font-size: 13px; font-weight: 600; text-align: left;
  min-height: 44px;
}
.handbook-header:hover { background: var(--s2); }
.handbook-icon { width: 28px; height: 28px; background: rgba(255,214,10,0.08); border-radius: 6px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.handbook-chevron { transition: transform 0.2s; }
.handbook-body { padding: 0 16px 16px; }
.handbook-text { font-size: 13px; color: var(--text-2); line-height: 1.8; white-space: pre-wrap; font-family: var(--font); margin: 0; }

/* Badge variants */
.badge-gold { background: rgba(255,214,10,0.15); color: var(--gold); }

/* Light mode overrides */
html.light .co-hero, html.theme-pink .co-hero, html.theme-grey .co-hero { background: linear-gradient(135deg, #1D1D1F 0%, #111113 60%, #1c1a0e 100%); }
html.light .co-section, html.theme-pink .co-section, html.theme-grey .co-section { background: #fff; border-color: rgba(0,0,0,0.08); }
html.light .co-biz-card, html.theme-pink .co-biz-card, html.theme-grey .co-biz-card { background: #f7f7f9; border-color: rgba(0,0,0,0.07); }
html.light .co-value-card, html.theme-pink .co-value-card, html.theme-grey .co-value-card { background: #f7f7f9; border-color: rgba(0,0,0,0.07); }
html.light .co-doc-card, html.theme-pink .co-doc-card, html.theme-grey .co-doc-card { background: #fff; border-color: rgba(0,0,0,0.08); }
html.light .co-doc-card:hover, html.theme-pink .co-doc-card:hover, html.theme-grey .co-doc-card:hover { background: #f7f7f9; }
html.light .co-dl-row, html.theme-pink .co-dl-row, html.theme-grey .co-dl-row { background: #fff; border-color: rgba(0,0,0,0.08); }
html.light .co-dl-row:hover, html.theme-pink .co-dl-row:hover, html.theme-grey .co-dl-row:hover { background: #f7f7f9; }
html.light .handbook-item, html.theme-pink .handbook-item, html.theme-grey .handbook-item { background: #fff; border-color: rgba(0,0,0,0.08); }
html.light .handbook-header:hover, html.theme-pink .handbook-header:hover, html.theme-grey .handbook-header:hover { background: #f7f7f9; }
html.light .co-body, html.theme-pink .co-body, html.theme-grey .co-body { color: rgba(29,29,31,0.75); }
html.light .co-biz-desc, html.theme-pink .co-biz-desc, html.theme-grey .co-biz-desc { color: rgba(29,29,31,0.55); }
html.light .co-president-msg p, html.theme-pink .co-president-msg p, html.theme-grey .co-president-msg p { color: rgba(29,29,31,0.75); }
html.light .co-doc-preview, html.theme-pink .co-doc-preview, html.theme-grey .co-doc-preview { color: rgba(29,29,31,0.50); }
html.light .handbook-text, html.theme-pink .handbook-text, html.theme-grey .handbook-text { color: rgba(29,29,31,0.75); }

@media (max-width: 480px) {
  .co-president-card { flex-direction: column; align-items: center; }
  .co-president-left { width: auto; }
  .co-values-grid { grid-template-columns: 1fr; }
  .co-hero-title { font-size: 18px; }
}

/* System credit card */
.co-credit-card {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 16px;
  background: rgba(10,132,255,0.06);
  border: 1px solid rgba(10,132,255,0.15);
  border-radius: 14px;
}
.co-credit-icon {
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: 10px;
  background: rgba(10,132,255,0.12);
  display: flex; align-items: center; justify-content: center;
}
.co-credit-body { flex: 1; }
.co-credit-title { font-size: 14px; font-weight: 700; color: var(--text-1); margin-bottom: 2px; }
.co-credit-sub   { font-size: 12px; color: var(--primary-light); margin-bottom: 4px; }
.co-credit-note  { font-size: 11px; color: var(--text-muted); line-height: 1.5; }

/* ── Help / Guide Page ── */
.help-guide { max-width: 700px; }
.help-hero {
  display: flex; align-items: center; gap: 16px;
  padding: 20px; background: var(--s1); border-radius: var(--r);
  border: 1px solid var(--border); margin-bottom: 20px;
}
.help-hero-icon {
  width: 56px; height: 56px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.help-hero h2 { font-size: 18px; font-weight: 800; margin-bottom: 4px; }
.help-hero p  { font-size: 13px; color: var(--text-muted); }
.help-section {
  background: var(--s1); border: 1px solid var(--border);
  border-radius: var(--r); padding: 18px 20px; margin-bottom: 14px;
}
.help-section h3 {
  font-size: 14px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.help-h-icon { width: 16px; height: 16px; stroke: var(--text-muted); flex-shrink: 0; }
.help-steps {
  list-style: decimal; padding-left: 20px;
  display: flex; flex-direction: column; gap: 8px;
}
.help-steps li { font-size: 13px; color: var(--text-2); line-height: 1.6; }
.help-list {
  list-style: none; padding: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.help-list li {
  font-size: 13px; color: var(--text-2); line-height: 1.6;
  padding-left: 16px; position: relative;
}
.help-list li::before {
  content: '›'; position: absolute; left: 0;
  color: var(--text-muted); font-weight: 700;
}
.help-tip {
  margin-top: 14px; padding: 10px 14px; border-radius: var(--r-sm);
  background: rgba(255,214,10,0.07); border: 1px solid rgba(255,214,10,0.18);
  font-size: 12px; color: var(--text-2); line-height: 1.6;
}
.help-section p { font-size: 13px; color: var(--text-2); line-height: 1.7; }
.help-section code { font-family: var(--font-mono); font-size: 12px; background: var(--s2); padding: 1px 5px; border-radius: 4px; }

/* ── Login Role Picker ── */
.login-pick-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.8px;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 12px;
}
.login-role-cards {
  display: flex; flex-direction: column; gap: 10px; margin-bottom: 4px;
}
.login-role-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--s1); border: 1px solid var(--border);
  border-radius: var(--r); cursor: pointer; text-align: left;
  transition: background var(--t2), border-color var(--t2), transform var(--t1), box-shadow var(--t2);
  width: 100%;
}
.login-role-card:hover {
  background: var(--s2); border-color: rgba(255,255,255,0.18);
  transform: translateX(3px); box-shadow: var(--sh-sm);
}
.login-role-card:active { transform: scale(0.98); }
.lrc-icon {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--s2);
}
.lrc-icon svg { width: 20px; height: 20px; stroke: var(--text-2); }
.login-role-card[data-type="admin"] .lrc-icon { background: rgba(255,45,120,0.12); }
.login-role-card[data-type="admin"] .lrc-icon svg { stroke: var(--pink); }
.login-role-card[data-type="employee"] .lrc-icon { background: rgba(10,132,255,0.12); }
.login-role-card[data-type="employee"] .lrc-icon svg { stroke: var(--blue); }
.login-role-card[data-type="partner"] .lrc-icon { background: rgba(255,214,10,0.10); }
.login-role-card[data-type="partner"] .lrc-icon svg { stroke: var(--gold); }
.lrc-label {
  font-size: 14px; font-weight: 700; color: var(--text);
  display: block; line-height: 1.2;
}
.lrc-sub { font-size: 11px; color: var(--text-muted); display: block; margin-top: 2px; }

/* ── Login Form Header (back + pill) ── */
.login-form-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 18px;
}
.login-back-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex-shrink: 0;
  background: var(--s1); border: 1px solid var(--border);
  border-radius: 50%; cursor: pointer; color: var(--text-muted);
  transition: background var(--t1), color var(--t1);
}
.login-back-btn:hover { background: var(--s2); color: var(--text); }
.login-back-btn svg { width: 16px; height: 16px; stroke: currentColor; }
.login-type-pill {
  flex: 1; padding: 5px 14px; border-radius: var(--pill);
  background: var(--s2); border: 1px solid var(--border);
  font-size: 12px; font-weight: 700; color: var(--text-2);
  letter-spacing: 0.3px; text-align: center;
}
@keyframes slideInFromLeft {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: translateX(0); }
}
.login-form-slide-in {
  animation: slideInFromLeft 0.25s var(--ease) both;
}

/* ══════════════════════════════
   APP SHELL
══════════════════════════════ */
#app-shell { flex-direction: column; }

/* ── Topbar ── */
.topbar {
  height: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--topbar-bg);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  display: flex; align-items: center;
  padding-left: 16px; padding-right: 16px; gap: 12px;
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
/* gradient line under topbar */
.topbar::after {
  content: '';
  position: absolute; bottom: -1px; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--pink), var(--blue), var(--gold), transparent);
  opacity: 0.35;
}
.menu-toggle {
  background: var(--s1); border: 1px solid var(--border);
  border-radius: var(--r-xs); color: var(--text-muted);
  font-size: 18px; cursor: pointer; padding: 6px 7px;
  display: none; transition: background var(--t1), color var(--t1);
}
.menu-toggle:hover { background: var(--s2); color: var(--text); }

.topbar-logo { display: flex; align-items: center; gap: 10px; flex: 1; }

/* ID-card-style logo pill */
.topbar-logo-card {
  position: relative; overflow: hidden;
  width: 34px; height: 34px; flex-shrink: 0;
  background: linear-gradient(140deg, #0A0A1A 0%, #131330 60%, #1A0A2E 100%);
  border: 1px solid rgba(255,214,10,0.35);
  border-radius: 9px;
  box-shadow: 0 0 10px rgba(255,214,10,0.18), inset 0 1px 0 rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: center;
  padding: 3px;
}
/* static top gold trim line */
.topbar-logo-card::after {
  content: '';
  position: absolute; top: 0; left: 12%; right: 12%; height: 1.5px;
  background: var(--grad-gold);
  border-radius: var(--pill); opacity: 0.80;
}
/* static inner sheen */
.topbar-logo-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 60%);
  border-radius: inherit; pointer-events: none;
}
.topbar-logo-img { width: 100%; height: 100%; object-fit: contain; border-radius: 6px; }
.topbar-logo-fallback {
  width: 100%; height: 100%; border-radius: 6px;
  background: var(--grad-pk-bl);
  color: #fff; font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}

/* Topbar title (replaces logo+brand on mobile) */
.topbar-title {
  flex: 1;
  font-family: var(--font-display);
  font-size: 14px; font-weight: 700; letter-spacing: -0.2px;
  color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: linear-gradient(90deg, #FFFFFF 0%, rgba(255,214,10,0.85) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
/* Keep old brand vars in case anything references them */
.topbar-brand-wrap { display: flex; flex-direction: column; gap: 1px; }
.topbar-brand {
  font-size: 13px; font-weight: 800; letter-spacing: 0.5px; line-height: 1;
  background: linear-gradient(90deg, #FFFFFF 0%, rgba(255,214,10,0.85) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.topbar-brand-sub {
  font-size: 8px; font-weight: 600; letter-spacing: 2px;
  color: rgba(255,255,255,0.38); line-height: 1;
  text-transform: uppercase;
}
.topbar-right { display: flex; align-items: center; gap: 6px; }

/* ── Top Nav Strip (mobile nav below topbar) ── */
.top-nav-strip {
  display: none; /* shown on mobile only */
  position: fixed;
  top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
  left: 0; right: 0;
  height: var(--top-nav-h);
  background: rgba(7,7,16,0.94);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  z-index: 94;
  overflow-x: auto; overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  align-items: center;
  padding: 0 6px;
  gap: 2px;
  box-sizing: border-box;
}
.top-nav-strip::-webkit-scrollbar { display: none; }
.top-nav-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 4px 10px;
  border-radius: var(--r-sm);
  color: var(--text-muted); cursor: pointer;
  background: none; border: none;
  font-size: 9px; font-weight: 600; white-space: nowrap;
  flex-shrink: 0;
  transition: color var(--t2), background var(--t1);
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.top-nav-item:active { background: var(--s2); }
.top-nav-item .bn-icon { font-size: 18px; line-height: 1; transition: transform var(--t2); }
.top-nav-item .bn-icon svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; display: block; }
.top-nav-item .tn-label { font-size: 11px; font-weight: 600; }
.top-nav-item.active { color: var(--pink); }
.top-nav-item.active .bn-icon { transform: scale(1.12); filter: drop-shadow(0 0 4px var(--pink-glow)); }
.top-nav-item .bn-badge,
.top-nav-item .tn-badge {
  position: absolute; top: -2px; right: -4px;
  background: var(--pink); color: #fff; font-size: 9px;
  min-width: 14px; height: 14px; display: none;
  align-items: center; justify-content: center;
  padding: 0 3px; border-radius: var(--pill); font-weight: 700;
  box-shadow: 0 0 8px var(--pink-glow); line-height: 1;
}

.notif-btn {
  position: relative; background: var(--s1);
  border: 1px solid var(--border); border-radius: var(--r-xs);
  padding: 7px 10px; cursor: pointer;
  font-size: 17px; color: var(--text-muted);
  transition: background var(--t1), color var(--t1), box-shadow var(--t2);
}
.notif-btn:hover { background: var(--s2); color: var(--text); box-shadow: var(--sh-pink); }
.notif-badge {
  position: absolute; top: 1px; right: 1px;
  background: var(--grad-pk-bl);
  color: #fff; font-size: 9px; font-weight: 700;
  border-radius: var(--pill); padding: 1px 5px;
  min-width: 16px; text-align: center;
}
.topbar-avatar {
  width: 32px; height: 32px;
  background: var(--grad-pk-bl);
  color: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; cursor: pointer;
  border: 1.5px solid rgba(255,255,255,0.18);
  transition: transform var(--t1), box-shadow var(--t2);
  overflow: hidden;
}
.topbar-avatar:hover { transform: scale(1.08); box-shadow: var(--sh-pink); }

/* ── Notification Panel ── */
.notif-panel {
  position: fixed; top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px) + 8px); right: 12px;
  width: 320px; max-height: 440px;
  background: var(--notif-bg);
  backdrop-filter: blur(32px); -webkit-backdrop-filter: blur(32px);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg), 0 0 0 1px rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.09);
  z-index: 150; display: flex; flex-direction: column; overflow: hidden; max-width: calc(100vw - 24px);
  animation: dropDown 0.22s var(--spring);
}
.notif-panel-header {
  padding: 13px 16px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 700; font-size: 14px; color: var(--text);
  background: rgba(255,255,255,0.02);
}
.notif-list { overflow-y: auto; overflow-x: hidden; flex: 1; }
.notif-backdrop { position: fixed; inset: 0; z-index: 140; }
.notif-item {
  padding: 11px 14px; border-bottom: 1px solid var(--border);
  cursor: default; transition: background var(--t1);
  position: relative;
  display: flex; align-items: center; gap: 10px;
}
.notif-item:hover { background: var(--s1); }
.notif-item.unread { background: rgba(255,59,48,0.06); }
.notif-item.unread::before {
  content: '';
  position: absolute; left: 5px; top: 50%; transform: translateY(-50%);
  width: 5px; height: 5px; border-radius: 50%;
  background: #FF3B30; box-shadow: 0 0 6px rgba(255,59,48,0.50);
}
.notif-item.read { background: transparent; }
.notif-item-emoji {
  font-size: 20px; flex-shrink: 0; line-height: 1;
  width: 28px; text-align: center;
}
.notif-item-text  { flex: 1; min-width: 0; }
.notif-item-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; color: var(--text); }
.notif-item.read .notif-item-title { color: var(--text-2); font-weight: 500; }
.notif-item-body  { font-size: 12px; color: var(--text-muted); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-item-time  { font-size: 10px; color: var(--text-light); margin-top: 3px; }
.notif-item-actions {
  display: flex; align-items: center; gap: 4px; flex-shrink: 0;
}
.notif-action-btn {
  width: 30px; height: 30px; border-radius: 50%;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t1), transform 80ms;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.notif-action-btn:active { transform: scale(0.88); }
.notif-action-btn svg {
  display: block;
  flex-shrink: 0;
  pointer-events: none;
}
.notif-read-btn {
  background: rgba(48,209,88,0.13);
  color: #30D158;
  border: 1px solid rgba(48,209,88,0.22);
}
.notif-read-btn:hover { background: rgba(48,209,88,0.24); }
.notif-read-btn svg { stroke: #30D158; }

.notif-view-btn {
  background: rgba(10,132,255,0.12);
  color: #0A84FF;
  border: 1px solid rgba(10,132,255,0.20);
}
.notif-view-btn:hover { background: rgba(10,132,255,0.22); }
.notif-view-btn svg { stroke: #0A84FF; }
.notif-unread-btn {
  background: rgba(255,159,10,0.12);
  color: #FF9F0A;
  border: 1px solid rgba(255,159,10,0.22);
}
.notif-unread-btn:hover { background: rgba(255,159,10,0.22); }
.notif-unread-btn svg { stroke: #FF9F0A; }

/* ══════════════════════════════
   SIDEBAR
══════════════════════════════ */
#sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px);
  border-right: 1px solid rgba(255,255,255,0.07);
  position: fixed; top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px)); bottom: 0; left: 0;
  z-index: 90; display: flex; flex-direction: column;
  overflow: hidden;
  transition: transform var(--t3) var(--ease);
}

/* vertical gradient accent on left edge */
#sidebar::before {
  content: '';
  position: absolute; top: 0; left: 0; bottom: 0; width: 2px;
  background: linear-gradient(180deg, var(--pink), var(--blue), var(--gold));
  opacity: 0.4;
}

.sidebar-top {
  padding: 18px 14px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: relative;
}
.sidebar-user { display: flex; align-items: center; gap: 11px; width: 100%; min-width: 0; }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name-row { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.sidebar-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--grad-pk-bl); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; flex-shrink: 0; overflow: hidden;
  box-shadow: 0 0 0 2px rgba(255,45,120,0.30), var(--sh-pink);
}
.sidebar-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-user-name {
  font-size: 13px; font-weight: 700;
  color: var(--text); line-height: 1.2; letter-spacing: -0.1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-width: 0; flex: 1;
}
.sidebar-user-role {
  font-size: 10px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.7px; margin-top: 2px;
}
.sidebar-user-dept {
  font-size: 11px; font-weight: 600;
  background: var(--grad-gold);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; margin-top: 1px;
}

.sidebar-nav { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; padding: 8px 0 calc(env(safe-area-inset-bottom, 0px) + 20px) 2px; scrollbar-width: none; }
.sidebar-nav::-webkit-scrollbar { display: none; }

.nav-section-label {
  font-size: 10px; font-weight: 700; color: var(--text-light);
  text-transform: uppercase; letter-spacing: 1.2px;
  padding: 12px 16px 4px;
}

.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 14px 9px 14px;
  color: var(--text-muted); font-size: 13px; font-weight: 500;
  cursor: pointer; border: none; background: none;
  width: 100%; text-align: left;
  transition: color var(--t1), background var(--t1);
  position: relative; border-radius: 0;
  margin: 1px 0;
}
.nav-item:hover {
  background: var(--s1); color: var(--text);
}
.nav-item:hover .nav-icon { animation: iconPop 0.3s var(--spring); }

.nav-item.active { color: var(--text); font-weight: 600; background: var(--s2); }
.nav-item.active::after {
  content: '';
  position: absolute; right: 0; top: 6px; bottom: 6px; width: 3px;
  background: var(--grad-pk-bl); border-radius: 2px 0 0 2px;
}

/* ── iOS-style 3D nav icons ── */
.nav-icon {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; font-size: 15px; flex-shrink: 0;
  background: rgba(255,255,255,0.07);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.08);
  transition: background var(--t2), box-shadow var(--t2);
}
/* Per-page gradient icon colors */
.nav-item[data-page="dashboard"] .nav-icon  { background: linear-gradient(135deg,#FF2D78,#FF6B6B); box-shadow: 0 2px 8px rgba(255,45,120,0.35); }
.nav-item[data-page="tasks"] .nav-icon      { background: linear-gradient(135deg,#0A84FF,#40CFFF); box-shadow: 0 2px 8px rgba(10,132,255,0.35); }
.nav-item[data-page="approvals"] .nav-icon  { background: linear-gradient(135deg,#FFD60A,#FF9F0A); box-shadow: 0 2px 8px rgba(255,214,10,0.35); }
.nav-item[data-page="progress"] .nav-icon   { background: linear-gradient(135deg,#30D158,#00D4AA); box-shadow: 0 2px 8px rgba(48,209,88,0.30); }
.nav-item[data-page="departments"] .nav-icon{ background: linear-gradient(135deg,#8B5CF6,#0A84FF); box-shadow: 0 2px 8px rgba(139,92,246,0.35); }
.nav-item[data-page="team"] .nav-icon       { background: linear-gradient(135deg,#0A84FF,#5856D6); box-shadow: 0 2px 8px rgba(10,132,255,0.30); }
.nav-item[data-page="analytics"] .nav-icon  { background: linear-gradient(135deg,#FF9F0A,#FFD60A); box-shadow: 0 2px 8px rgba(255,159,10,0.35); }
.nav-item[data-page="company"] .nav-icon    { background: linear-gradient(135deg,#FF2D78,#8B5CF6); box-shadow: 0 2px 8px rgba(139,92,246,0.30); }
.nav-item[data-page="submissions"] .nav-icon{ background: linear-gradient(135deg,#32ADE6,#0A84FF); box-shadow: 0 2px 8px rgba(50,173,230,0.30); }
.nav-item[data-page="cash"] .nav-icon       { background: linear-gradient(135deg,#30D158,#34C759); box-shadow: 0 2px 8px rgba(48,209,88,0.30); }
.nav-item[data-page="personal-finance"] .nav-icon { background: linear-gradient(135deg,#FFD60A,#FF9F0A); box-shadow: 0 2px 8px rgba(255,214,10,0.30); }
.nav-item[data-page="files"] .nav-icon      { background: linear-gradient(135deg,#32ADE6,#5856D6); box-shadow: 0 2px 8px rgba(50,173,230,0.25); }
.nav-item[data-page="bs-quote-builder"] .nav-icon { background: linear-gradient(135deg,#0A84FF,#32ADE6); box-shadow: 0 2px 8px rgba(10,132,255,0.35); }
.nav-item[data-page="bs-quotations"] .nav-icon    { background: linear-gradient(135deg,#32ADE6,#5856D6); box-shadow: 0 2px 8px rgba(88,86,214,0.30); }
.nav-item[data-page="bs-clients"] .nav-icon       { background: linear-gradient(135deg,#30D158,#0A84FF); box-shadow: 0 2px 8px rgba(48,209,88,0.30); }
.nav-item[data-page="bs-files"] .nav-icon         { background: linear-gradient(135deg,#5856D6,#8B5CF6); box-shadow: 0 2px 8px rgba(88,86,214,0.30); }
/* New module pages */
.nav-item[data-page="posts"] .nav-icon            { background: linear-gradient(135deg,#FF2D78,#FF6B6B); box-shadow: 0 2px 8px rgba(255,45,120,0.35); }
.nav-item[data-page="team-directory"] .nav-icon   { background: linear-gradient(135deg,#0A84FF,#5856D6); box-shadow: 0 2px 8px rgba(10,132,255,0.30); }
.nav-item[data-page="attendance"] .nav-icon       { background: linear-gradient(135deg,#30D158,#00D4AA); box-shadow: 0 2px 8px rgba(48,209,88,0.30); }
.nav-item[data-page="cash-advances"] .nav-icon    { background: linear-gradient(135deg,#FFD60A,#30D158); box-shadow: 0 2px 8px rgba(255,214,10,0.35); }
.nav-item[data-page="help"] .nav-icon             { background: linear-gradient(135deg,#8B5CF6,#5856D6); box-shadow: 0 2px 8px rgba(139,92,246,0.30); }
/* Operations / catalog / security pages */
.nav-item[data-page="inventory"] .nav-icon         { background: linear-gradient(135deg,#00D4AA,#0A84FF); box-shadow: 0 2px 8px rgba(0,212,170,0.32); }
.nav-item[data-page="projects-lifecycle"] .nav-icon{ background: linear-gradient(135deg,#5856D6,#32ADE6); box-shadow: 0 2px 8px rgba(88,86,214,0.32); }
.nav-item[data-page="sales-orders"] .nav-icon      { background: linear-gradient(135deg,#FF9F0A,#FF2D78); box-shadow: 0 2px 8px rgba(255,159,10,0.32); }
.nav-item[data-page="product-database"] .nav-icon  { background: linear-gradient(135deg,#30D158,#32ADE6); box-shadow: 0 2px 8px rgba(48,209,88,0.30); }
.nav-item[data-page="audit-log"] .nav-icon         { background: linear-gradient(135deg,#8E8E93,#636366); box-shadow: 0 2px 8px rgba(99,99,102,0.32); }

/* Dept pages use data-page="dept:X" — give all a gradient background */
.nav-item[data-page^="dept:"] .nav-icon { background: linear-gradient(135deg,#FF9F0A,#FF6B6B); box-shadow: 0 2px 8px rgba(255,159,10,0.30); }
/* Emoji icons get same pill/gradient treatment */
.nav-icon.emoji-icon { font-size:16px; display:flex; align-items:center; justify-content:center; }

.nav-badge {
  margin-left: auto; background: var(--grad-red); color: #fff;
  font-size: 10px; padding: 1px 6px; border-radius: var(--pill); font-weight: 700;
}

.btn-logout-inline {
  background: rgba(255,69,58,0.08); border: 1px solid rgba(255,69,58,0.18);
  color: rgba(255,100,90,0.80); border-radius: 5px;
  padding: 3px 9px; height: 22px;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.2px;
  cursor: pointer; flex-shrink: 0; white-space: nowrap;
  transition: background var(--t1), box-shadow var(--t1);
}
.btn-logout-inline:hover { background: rgba(255,69,58,0.18); box-shadow: 0 0 6px rgba(255,69,58,0.20); }
.btn-logout-inline svg { width: 11px; height: 11px; stroke: currentColor; fill: none; stroke-width: 2.2; flex-shrink:0; }

.sidebar-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px); z-index: 85;
}

/* ══════════════════════════════
   MAIN + BOTTOM NAV
══════════════════════════════ */
.main-content {
  margin-top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px)); margin-left: var(--sidebar-w);
  min-height: calc(100dvh - var(--topbar-h));
  padding: 20px;
}

/* Lock scroll on body when sidebar is open on mobile */
body.sidebar-open { overflow: hidden; }
body.sidebar-open .main-content { pointer-events: none; user-select: none; }
/* Hide top nav strip when sidebar is open — sidebar is the nav */
body.sidebar-open .top-nav-strip { display: none !important; }

.bottom-nav {
  display: none;
  position: fixed;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  left: 50%; transform: translateX(-50%);
  width: auto; min-width: 260px; max-width: 380px;
  height: var(--bottom-nav-h);
  background: var(--bottom-nav-bg);
  backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px);
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 8px 32px rgba(0,0,0,0.50), 0 2px 8px rgba(0,0,0,0.30);
  z-index: 95;
  padding: 0 8px;
  justify-content: space-around; align-items: center;
  box-sizing: border-box;
  transition: height 0.25s var(--ease), opacity 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
/* Shrunk state — triggered by JS scroll listener */
.bottom-nav.nav-shrunk {
  height: calc(var(--bottom-nav-h) - 14px);
  opacity: 0.72;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35), 0 1px 4px rgba(0,0,0,0.20);
}
.bottom-nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 0 12px;
  color: var(--text-muted); cursor: pointer;
  background: none; border: none;
  transition: color var(--t2), transform var(--t1);
  flex: 1; min-width: 0; position: relative;
  height: 100%; box-sizing: border-box;
}
.bottom-nav-item .bn-icon {
  font-size: 22px; line-height: 1;
  transition: transform var(--t2), font-size 0.25s var(--ease);
}
/* Shrunk state — smaller icons */
.bottom-nav.nav-shrunk .bottom-nav-item .bn-icon { font-size: 18px; }
.bottom-nav.nav-shrunk .bottom-nav-item .bn-icon svg { width: 18px; height: 18px; }
/* Labels hidden — pill nav is icon-only */
.bottom-nav-item .bn-label { display: none; }
.bottom-nav-item.active { color: var(--pink); }
.bottom-nav-item.active .bn-icon { transform: scale(1.15); filter: drop-shadow(0 0 6px var(--pink-glow)); }
.bottom-nav-item .bn-badge {
  position: absolute; top: 4px; right: 6px;
  background: var(--pink); color: #fff; font-size: 9px;
  padding: 1px 4px; border-radius: var(--pill); font-weight: 700;
  box-shadow: 0 0 8px var(--pink-glow);
}

/* ══════════════════════════════
   PAGE SECTIONS
══════════════════════════════ */
.page-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.page-header h2 {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 800;
  color: var(--text); flex: 1; letter-spacing: -0.5px;
}
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── KPI Cards ── */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.kpi-card {
  position: relative; overflow: hidden;
  background: var(--s1); border-radius: var(--r);
  padding: 18px 16px;
  border: 1px solid var(--border);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  transition: transform var(--t2), box-shadow var(--t2);
  animation: fadeUp 0.4s var(--ease) both;
}
.kpi-card:hover { transform: translateY(-3px); }
/* shimmer on hover */
.kpi-card::before {
  content: '';
  position: absolute; inset-y: 0; left: 0; width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
  transform: translateX(-100%) skewX(-12deg);
  transition: none;
}
.kpi-card:hover::before { animation: shimmer 0.7s ease forwards; }
/* top gradient stripe */
.kpi-card::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--grad-pk-bl);
  border-radius: var(--r) var(--r) 0 0;
}
.kpi-card.accent::after { background: var(--grad-amber); box-shadow: 0 0 8px var(--gold-glow); }
.kpi-card.green::after  { background: var(--grad-green);  box-shadow: 0 0 8px rgba(48,209,88,0.30); }
.kpi-card.warn::after   { background: var(--grad-amber); }
.kpi-card.red::after    { background: var(--grad-red);    box-shadow: 0 0 8px rgba(255,69,58,0.30); }

/* Colour variants keep ONLY their top stripe (::after) for identity — the
   box-shadow is intentionally NOT overridden, so every KPI card shares the same
   elevation. (Previously accent/green/red got a flat coloured glow while
   plain/warn got a real drop shadow, which read as "some cards have shadow, some
   don't".) */

.kpi-label {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--text-muted); margin-bottom: 8px;
}
.kpi-value {
  font-family: var(--font-display);
  font-size: 26px; font-weight: 800;
  color: var(--text); line-height: 1; letter-spacing: -0.5px;
}
.kpi-sub { font-size: 11px; color: var(--text-muted); margin-top: 5px; }
.kpi-icon-wrap {
  width: 32px; height: 32px; border-radius: 8px; margin-bottom: 10px;
  display: flex; align-items: center; justify-content: center;
}
.kpi-icon-wrap svg { width: 18px; height: 18px; stroke: currentColor; }

/* ── KPI Progress Bar ── */
.kpi-bar-track {
  height: 6px; border-radius: 3px; background: var(--s2); overflow: hidden;
}
.kpi-bar-fill {
  height: 100%; border-radius: 3px; transition: width 0.8s var(--ease);
  background: var(--primary);
}

/* ── Alert Banners ── */
.alert-banner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-radius: var(--r-sm); margin-bottom: 14px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: opacity var(--t1), transform var(--t1);
  border: 1px solid transparent;
}
.alert-banner:hover { opacity: 0.88; transform: translateX(2px); }
.alert-banner:active { transform: scale(0.98); }
.alert-danger {
  background: rgba(255,69,58,0.12); border-color: rgba(255,69,58,0.25); color: #FF453A;
}
.alert-warn {
  background: rgba(255,170,0,0.10); border-color: rgba(255,170,0,0.22); color: #FFAA00;
}
.alert-chevron { font-size: 18px; font-weight: 700; opacity: 0.7; }

/* ── Task Feed ── */
.task-feed-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 18px; border-bottom: 1px solid var(--border);
  transition: background var(--t1); cursor: pointer;
}
.task-feed-item:last-child { border-bottom: none; }
.task-feed-item:hover { background: var(--s2); }
.task-feed-item.task-overdue { background: rgba(255,69,58,0.04); }
.task-feed-item.task-overdue:hover { background: rgba(255,69,58,0.08); }
.task-feed-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.priority-dot-high   { background: var(--danger); box-shadow: 0 0 6px rgba(255,69,58,0.5); }
.priority-dot-medium { background: var(--gold-3); box-shadow: 0 0 6px rgba(255,170,0,0.4); }
.priority-dot-low    { background: var(--success); }
.task-feed-title {
  font-size: 13px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.task-feed-meta {
  font-size: 11px; color: var(--text-muted); margin-top: 2px;
}

/* ── Quick Action Buttons ── */
.quick-action-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 11px 14px; border-radius: var(--r-sm);
  background: var(--s1); border: 1px solid var(--border); cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--text-2);
  transition: background var(--t1), color var(--t1), border-color var(--t1);
  text-align: left; min-height: 44px;
}
.quick-action-btn:hover { background: var(--s2); color: var(--text); border-color: rgba(255,255,255,0.15); }
.quick-action-btn:active { background: var(--s3); transform: scale(0.98); }
.quick-action-btn svg { width: 16px; height: 16px; stroke: currentColor; flex-shrink: 0; }

/* ── Payslip Rows ── */
.payslip-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--text-2);
}
.payslip-row:last-child { border-bottom: none; }
.payslip-row strong { color: var(--text); }

/* ── Live Clock ── */
.live-clock-line {
  font-size: 12px; color: var(--text-muted); font-weight: 600;
  margin: -12px 0 16px; letter-spacing: 0.2px;
}

/* ── Cards ── */
.card {
  position: relative; overflow: hidden;
  background: var(--s1); border-radius: var(--r);
  border: 1px solid var(--border); margin-bottom: 16px;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  transition: box-shadow var(--t2), border-color var(--t2);
}
.card:hover { border-color: rgba(255,255,255,0.12); }
/* subtle gradient interior */
.card::before {
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background: var(--grad-card); border-radius: inherit;
}
.card-header {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: rgba(255,255,255,0.01);
  position: relative; z-index: 1;
}
.card-header h3 {
  font-size: 14px; font-weight: 700; color: var(--text); letter-spacing: -0.1px;
}
.card-body { padding: 16px 18px; position: relative; z-index: 1; }
.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.chart-wrap { position: relative; height: 200px; }

/* ══════════════════════════════
   EMPLOYEE ID CARD
══════════════════════════════ */
.id-card {
  position: relative; overflow: hidden;
  max-width: 380px;
  border-radius: var(--r-lg); padding: 22px;
  background: linear-gradient(140deg, #0A0A1A 0%, #131330 40%, #1A0A2E 100%);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: var(--sh-md), 0 0 0 1px rgba(255,214,10,0.12);
  color: #fff;
}
/* animated gold shine */
.id-card::before {
  content: '';
  position: absolute; top: -2px; left: -120%; width: 80%; height: calc(100% + 4px);
  background: linear-gradient(90deg, transparent, rgba(255,214,10,0.08), rgba(255,255,255,0.06), transparent);
  transform: skewX(-15deg);
  animation: goldShine 4s ease-in-out infinite;
  border-radius: inherit;
}
/* top gold border */
.id-card::after {
  content: '';
  position: absolute; top: 0; left: 8%; right: 8%; height: 1.5px;
  background: var(--grad-gold); border-radius: var(--pill); opacity: 0.80;
}
/* bg pattern */
.id-card-bg {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
}
.id-card-bg::before {
  content: '';
  position: absolute; right: -50px; top: -50px;
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,45,120,0.12) 0%, transparent 70%);
}
.id-card-bg::after {
  content: '';
  position: absolute; left: -30px; bottom: -40px;
  width: 150px; height: 150px; border-radius: 50%;
  background: radial-gradient(circle, rgba(10,132,255,0.10) 0%, transparent 70%);
}
.id-card-top {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px; position: relative; z-index: 1;
}
.id-card-logo {
  width: 38px; height: 38px; object-fit: contain;
  border-radius: 9px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,214,10,0.25);
  padding: 4px;
}
.id-card-company {
  font-size: 13px; font-weight: 800; letter-spacing: 0.5px;
  background: linear-gradient(90deg, #FFFFFF, rgba(255,214,10,0.85));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.id-card-company-sub { font-size: 9px; opacity: 0.55; letter-spacing: 2px; text-transform: uppercase; }
.id-card-body { display: flex; gap: 16px; align-items: flex-start; position: relative; z-index: 1; }
.id-card-photo {
  width: 72px; height: 88px;
  background: rgba(255,255,255,0.06);
  border-radius: var(--r-sm);
  border: 1px solid rgba(255,214,10,0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; flex-shrink: 0; overflow: hidden; cursor: pointer;
  position: relative;
  transition: border-color var(--t2), box-shadow var(--t2);
}
.id-card-photo:hover { border-color: rgba(255,214,10,0.55); box-shadow: 0 0 12px var(--gold-glow); }
.id-card-photo img { width: 100%; height: 100%; object-fit: cover; }
.id-card-photo-hint {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,0.60); color: rgba(255,255,255,0.80);
  font-size: 8px; text-align: center; padding: 3px; letter-spacing: 0.3px;
}
.id-card-info { flex: 1; min-width: 0; }
.id-card-name {
  font-size: 16px; font-weight: 800; line-height: 1.2;
  margin-bottom: 3px; letter-spacing: -0.2px;
  background: linear-gradient(90deg, #fff, rgba(255,214,10,0.80));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.id-card-title { font-size: 11px; opacity: 0.60; margin-bottom: 10px; text-transform: capitalize; letter-spacing: 0.3px; }
.id-card-detail { font-size: 11px; opacity: 0.58; display: flex; gap: 6px; margin-bottom: 4px; line-height: 1.4; }
.id-card-detail strong { opacity: 1; font-weight: 600; }
.id-card-footer {
  margin-top: 16px; padding-top: 12px;
  border-top: 1px solid rgba(255,214,10,0.15);
  display: flex; justify-content: space-between; align-items: center;
  position: relative; z-index: 1;
}
.id-card-id {
  font-size: 12px; font-weight: 700; letter-spacing: 2px;
  font-family: var(--font-mono);
  background: var(--grad-gold);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.id-card-status {
  font-size: 9px; letter-spacing: 1px; text-transform: uppercase;
  font-weight: 700; padding: 3px 10px; border-radius: var(--pill);
  background: rgba(48,209,88,0.15); color: #4DE87A;
  border: 1px solid rgba(48,209,88,0.25);
  box-shadow: 0 0 8px rgba(48,209,88,0.20);
}

/* ── Calling (back) face — class-driven; dark default, light override below ── */
.id-card--calling {
  background: linear-gradient(135deg,#1a1a2e 0%,#16213e 50%,#0f3460 100%);
  color: #fff; text-align: center; padding: 24px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.id-card--calling .idc-photo {
  width: 72px; height: 72px; border-radius: 50%; overflow: hidden; margin-bottom: 4px;
  display: flex; align-items: center; justify-content: center; font-size: 36px;
  background: rgba(255,255,255,0.10); border: 3px solid rgba(255,255,255,0.30);
}
.id-card--calling .idc-photo img { width: 100%; height: 100%; object-fit: cover; }
.id-card--calling .idc-name { font-size: 18px; font-weight: 800; letter-spacing: .5px; }
.id-card--calling .idc-role { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,0.70); }
.id-card--calling .idc-dept { font-size: 11px; color: rgba(255,255,255,0.50); margin-top: 2px; }
.id-card--calling .idc-divider { width: 100%; height: 1px; background: rgba(255,255,255,0.15); margin: 10px 0; }
.id-card--calling .idc-contact { font-size: 12px; color: rgba(255,255,255,0.80); }
.id-card--calling .idc-brand { font-size: 10px; color: rgba(255,255,255,0.40); margin-top: 8px; letter-spacing: .1em; }

/* ══════════════════════════════════════════════════
   ID CARD — professional LIGHT variant (office / aurora / astral / slate)
   Clean white corporate card: flat, no gold shimmer, blue accent, ink text.
══════════════════════════════════════════════════ */
html.light .id-card, html.theme-pink .id-card, html.theme-grey .id-card {
  background: #FFFFFF; color: var(--text);
  border: 1px solid var(--border); box-shadow: var(--sh-md);
}
/* kill the animated gold shimmer + swap the top trim to the brand-blue accent */
html.light .id-card::before, html.theme-pink .id-card::before, html.theme-grey .id-card::before { display: none; }
html.light .id-card::after, html.theme-pink .id-card::after, html.theme-grey .id-card::after {
  left: 0; right: 0; height: 3px; opacity: 1;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
}
html.light .id-card-bg::before, html.theme-pink .id-card-bg::before, html.theme-grey .id-card-bg::before { background: radial-gradient(circle, rgba(15,108,189,0.05) 0%, transparent 70%); }
html.light .id-card-bg::after, html.theme-pink .id-card-bg::after, html.theme-grey .id-card-bg::after { background: radial-gradient(circle, rgba(15,108,189,0.04) 0%, transparent 70%); }
html.light .id-card-logo, html.theme-pink .id-card-logo, html.theme-grey .id-card-logo { background: #F3F2F1; border-color: var(--border); }
/* solid ink text (undo the gradient text-clip) */
html.light .id-card-company, html.theme-pink .id-card-company, html.theme-grey .id-card-company {
  background: none; -webkit-text-fill-color: var(--text); color: var(--text);
}
html.light .id-card-company-sub, html.theme-pink .id-card-company-sub, html.theme-grey .id-card-company-sub { color: var(--text-muted); opacity: 1; }
html.light .id-card-photo, html.theme-pink .id-card-photo, html.theme-grey .id-card-photo { background: #F3F2F1; border-color: var(--border); }
html.light .id-card-photo:hover, html.theme-pink .id-card-photo:hover, html.theme-grey .id-card-photo:hover { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15,108,189,0.15); }
html.light .id-card-name, html.theme-pink .id-card-name, html.theme-grey .id-card-name {
  background: none; -webkit-text-fill-color: var(--text); color: var(--text);
}
html.light .id-card-title, html.theme-pink .id-card-title, html.theme-grey .id-card-title { color: var(--text-muted); opacity: 1; }
html.light .id-card-detail, html.theme-pink .id-card-detail, html.theme-grey .id-card-detail { color: var(--text-2); opacity: 1; }
html.light .id-card-detail strong, html.theme-pink .id-card-detail strong, html.theme-grey .id-card-detail strong { color: var(--text); }
html.light .id-card-footer, html.theme-pink .id-card-footer, html.theme-grey .id-card-footer { border-top-color: var(--border); }
html.light .id-card-id, html.theme-pink .id-card-id, html.theme-grey .id-card-id {
  background: none; -webkit-text-fill-color: var(--primary); color: var(--primary);
}
html.light .id-card-status, html.theme-pink .id-card-status, html.theme-grey .id-card-status {
  background: rgba(16,124,65,0.10); color: #107C41; border-color: rgba(16,124,65,0.28); box-shadow: none;
}
/* back / calling face — clean white too */
html.light .id-card--calling, html.theme-pink .id-card--calling, html.theme-grey .id-card--calling {
  background: #FFFFFF; color: var(--text);
}
html.light .id-card--calling .idc-photo, html.theme-pink .id-card--calling .idc-photo, html.theme-grey .id-card--calling .idc-photo { background: #F3F2F1; border-color: var(--primary); }
html.light .id-card--calling .idc-role, html.theme-pink .id-card--calling .idc-role, html.theme-grey .id-card--calling .idc-role { color: var(--primary); }
html.light .id-card--calling .idc-dept, html.theme-pink .id-card--calling .idc-dept, html.theme-grey .id-card--calling .idc-dept { color: var(--text-muted); }
html.light .id-card--calling .idc-divider, html.theme-pink .id-card--calling .idc-divider, html.theme-grey .id-card--calling .idc-divider { background: var(--border); }
html.light .id-card--calling .idc-contact, html.theme-pink .id-card--calling .idc-contact, html.theme-grey .id-card--calling .idc-contact { color: var(--text-2); }
html.light .id-card--calling .idc-brand, html.theme-pink .id-card--calling .idc-brand, html.theme-grey .id-card--calling .idc-brand { color: var(--text-muted); }

/* ══════════════════════════════
   PULL-TO-REFRESH
══════════════════════════════ */
/* ══════════════════════════════
   SPLASH SCREEN
══════════════════════════════ */
#splash-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--black);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
#splash-screen.hiding {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.splash-inner {
  display: flex; flex-direction: column; align-items: center;
}
.splash-logo {
  width: 80px; height: 80px; object-fit: cover;
  border-radius: 50%;
}
.splash-wordmark {
  font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: rgba(240,240,250,0.35); margin-bottom: 32px;
}
.splash-bar {
  width: 40px; height: 2px; background: rgba(255,255,255,0.08);
  border-radius: 1px; overflow: hidden; position: relative;
}
.splash-bar::after {
  content: '';
  position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, var(--primary-light), transparent);
  animation: splashBarRun 1.1s ease-in-out infinite;
}
@keyframes splashIn {
  from { opacity: 0; transform: scale(0.82); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes splashBarRun {
  0%   { left: -100%; }
  100% { left: 200%; }
}

/* ══════════════════════════════
   PULL-TO-REFRESH  (arc-ring style)
══════════════════════════════ */
#ptr-indicator {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 56px);
  left: 50%; transform: translateX(-50%) translateY(-90px);
  z-index: 300;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 0;
  background: transparent;
  border: none; box-shadow: none;
  transition: none;
  pointer-events: none;
  opacity: 0;
}
/* Ring wrapper */
.ptr-ring-wrap {
  position: relative;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
}
.ptr-ring-svg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  transform-origin: center;
}
/* Track (background circle) */
.ptr-ring-track {
  fill: none;
  stroke: rgba(255,255,255,0.12);
  stroke-width: 2.5;
}
/* Arc (fills as user pulls) */
.ptr-ring-arc {
  fill: none;
  stroke: var(--primary-light, #0A84FF);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 87.96;   /* 2π × 14 */
  stroke-dashoffset: 87.96;  /* starts empty */
  transition: stroke-dashoffset 0.08s linear, stroke 0.15s ease;
  transform-origin: center;
  transform: rotate(-90deg);  /* start arc at 12 o'clock */
}
/* Ready state — green arc */
#ptr-indicator.ptr-ready .ptr-ring-arc  { stroke: #30D158; }
/* Hard-refresh state — orange arc */
#ptr-indicator.ptr-hard  .ptr-ring-arc  { stroke: #FF9F0A; }
/* Refreshing — spin the whole SVG */
#ptr-indicator.ptr-refreshing .ptr-ring-svg {
  animation: ptrSpin 0.9s linear infinite;
}
#ptr-indicator.ptr-refreshing .ptr-ring-arc {
  stroke-dashoffset: 22;  /* keep arc ~¾ full while spinning */
  transition: none;
}
/* Arrow icon in centre of ring */
.ptr-ring-icon {
  position: absolute;
  font-size: 15px;
  line-height: 1;
  color: var(--text-1);
  transition: transform 0.22s cubic-bezier(0.34,1.28,0.64,1);
  user-select: none;
}
#ptr-indicator.ptr-ready .ptr-ring-icon { transform: rotate(180deg) scaleY(1.1); }
#ptr-indicator.ptr-hard  .ptr-ring-icon { transform: rotate(180deg) scaleY(1.1); }
/* Label below ring */
.ptr-label {
  font-size: 10px; font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .04em;
  white-space: nowrap;
}
@keyframes ptrSpin {
  to { transform: rotate(360deg); }
}
/* On mobile, clear the top-nav-strip */
@media (max-width: 768px) {
  #ptr-indicator {
    top: calc(env(safe-area-inset-top, 0px) + 56px + 50px + 8px);
  }
}

/* ══════════════════════════════
   ID CARD 3D FLIP
══════════════════════════════ */
/* ── Per-face rotation: no preserve-3d needed.
   Avoids iOS Safari backface-visibility bug caused by ancestor overflow:hidden. ── */
.id-flip-scene {
  perspective: 1000px;
  -webkit-perspective: 1000px;
  width: 100%; max-width: 380px; margin: 0 auto;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.id-flip-inner {
  position: relative;
  width: 100%;
  /* No transform-style:preserve-3d — each face handles its own rotation */
}
.id-flip-front,
.id-flip-back {
  width: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: transform 0.55s cubic-bezier(.4,0,.2,1);
  will-change: transform;
}
/* Default state: front visible at 0°, back pre-rotated to 180° */
.id-flip-front { transform: rotateY(0deg); }
.id-flip-back {
  position: absolute;
  top: 0; left: 0;
  transform: rotateY(180deg);
  pointer-events: none;
}
/* Flipped state: front hides at -180°, back returns to 0° */
.id-flip-inner.is-flipped .id-flip-front {
  transform: rotateY(-180deg);
  pointer-events: none;
}
.id-flip-inner.is-flipped .id-flip-back {
  transform: rotateY(0deg);
  pointer-events: auto;
}

/* Swipe visual hint */
.id-flip-hint {
  text-align: center; font-size: 10px;
  color: var(--text-muted); margin-top: 6px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.id-flip-hint span { opacity: 0.5; animation: ptr-bounce 1.8s ease-in-out infinite; }
.id-flip-dots {
  display: flex; justify-content: center; gap: 6px; margin-top: 8px;
}
.id-flip-dot {
  width: 22px; height: 4px; border-radius: 2px;
  background: rgba(255,255,255,0.15);
  transition: background 0.3s;
}
.id-flip-dot.active { background: var(--primary-light); }

/* ══════════════════════════════
   SUBTABS
══════════════════════════════ */
.subtab-bar {
  display: flex; gap: 3px; margin-bottom: 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  flex-wrap: nowrap;
}
.subtab-bar::-webkit-scrollbar { display: none; }
.subtab-btn {
  padding: 8px 14px; border-radius: 9px;
  border: none; background: none;
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  transition: background var(--t2), color var(--t2), box-shadow var(--t2);
  min-height: 36px; display: flex; align-items: center;
}
.subtab-btn.active {
  background: var(--grad-pk-bl);
  background-size: 200% 200%;
  color: #fff; font-weight: 600;
  box-shadow: 0 2px 12px rgba(155,168,255,0.35);
  animation: gradRun 5s ease infinite;
  will-change: background-position;
}
.subtab-btn:hover:not(.active) { background: rgba(255,255,255,0.06); color: var(--text); }

/* ── Chip-style subtabs (declutter pattern) ──────────────
   Wraps to multiple rows instead of horizontal-scrolling, with an
   optional count pill. Use window.chipTabs()/bindChipTabs() (config.js). */
.chip-tabs {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px;
}
.chip-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 999px;
  border: 1px solid var(--border); background: rgba(255,255,255,0.04);
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  cursor: pointer; white-space: nowrap; min-height: 34px;
  transition: background var(--t2), color var(--t2), border-color var(--t2), box-shadow var(--t2);
}
.chip-tab:hover:not(.active) { background: rgba(255,255,255,0.07); color: var(--text); }
.chip-tab.active {
  background: var(--grad-pk-bl); background-size: 200% 200%;
  color: #fff; font-weight: 600; border-color: transparent;
  box-shadow: 0 2px 12px rgba(155,168,255,0.35);
  animation: gradRun 5s ease infinite; will-change: background-position;
}
.chip-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  font-size: 11px; font-weight: 700; line-height: 1;
  background: rgba(255,255,255,0.12); color: var(--text-muted);
}
.chip-tab.active .chip-count { background: rgba(255,255,255,0.28); color: #fff; }
.chip-count.on { background: var(--danger, #e5484d); color: #fff; }
.chip-tab.active .chip-count.on { background: rgba(255,255,255,0.3); color: #fff; }
@media (max-width:600px){ .chip-tab { min-height: 38px; } }

/* ══════════════════════════════
   ITEM LISTS
══════════════════════════════ */
.item-list { display: flex; flex-direction: column; gap: 8px; }
.item-card {
  background: var(--s1); border-radius: var(--r);
  border: 1px solid var(--border); padding: 13px 15px;
  cursor: pointer; position: relative; overflow: hidden;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  transition: background var(--t2), box-shadow var(--t2), transform var(--t1), border-color var(--t2);
  border-left: 3px solid transparent;
}
.item-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
  transform: translateX(-100%) skewX(-12deg);
  pointer-events: none; /* decorative shimmer only — must never intercept clicks on card content */
}
.item-card:hover {
  background: var(--s2); transform: translateY(-1px);
  box-shadow: var(--sh-sm);
}
.item-card:hover::before { animation: shimmer 0.5s ease forwards; }
.item-card.priority-urgent { border-left-color: var(--danger);  box-shadow: inset 3px 0 0 var(--danger); }
.item-card.priority-high   { border-left-color: var(--gold-3);  }
.item-card.priority-medium { border-left-color: var(--blue);    }
.item-card.priority-low    { border-left-color: var(--success); }
.item-card.status-done     { opacity: 0.45; }

.item-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; align-items: flex-start; }
.item-title { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.35; }
.item-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 11px; color: var(--text-muted); align-items: center; }
.item-badges { display: flex; gap: 4px; flex-wrap: wrap; }

/* ── Comments ── */
.comments-section { margin-top: 14px; }
.comments-section h4 { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 10px; }
.comment-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; max-height: 240px; overflow-y: auto; }
.comment-item { background: var(--s1); border-radius: var(--r-sm); padding: 10px 12px; border: 1px solid var(--border); }
.comment-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.comment-author {
  font-size: 12px; font-weight: 700;
  background: var(--grad-pk-bl);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.comment-time { font-size: 11px; color: var(--text-light); }
.comment-text { font-size: 13px; line-height: 1.4; color: var(--text-2); }
.comment-input-row { display: flex; gap: 8px; }
.comment-input-row input {
  flex: 1; padding: 9px 12px; border: 1.5px solid var(--border);
  border-radius: var(--r-sm); font-size: 13px; outline: none;
  background: var(--s1); color: var(--text);
  transition: border-color var(--t2);
}
.comment-input-row input:focus { border-color: var(--pink); box-shadow: 0 0 0 3px var(--pink-glow); }

/* ══════════════════════════════
   TABLES
══════════════════════════════ */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  padding: 9px 12px; text-align: left;
  font-size: 10px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
  background: rgba(255,255,255,0.015);
}
.data-table td { padding: 11px 12px; border-bottom: 1px solid rgba(255,255,255,0.04); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,0.025); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ══════════════════════════════
   QUOTE BUILDER
══════════════════════════════ */
.quote-sheet {
  background: var(--s1); border-radius: var(--r);
  border: 1px solid var(--border); padding: 22px;
  backdrop-filter: blur(20px);
}
.quote-sheet h3 { font-size: 17px; font-weight: 800; color: var(--text); margin-bottom: 18px; display: flex; align-items: center; gap: 8px; }
.line-items-header { display: grid; grid-template-columns: 3fr 70px 100px 36px; gap: 8px; font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; padding: 0 4px; margin-bottom: 8px; }
.line-item-row { display: grid; grid-template-columns: 3fr 70px 100px 36px; gap: 8px; margin-bottom: 6px; align-items: center; }
.line-item-row input { padding: 8px 10px; border: 1.5px solid var(--border); border-radius: var(--r-sm); font-size: 13px; outline: none; width: 100%; background: var(--s1); color: var(--text); transition: border-color var(--t2); }
.line-item-row input:focus { border-color: var(--pink); }
.quote-subtotal { display: flex; justify-content: flex-end; gap: 16px; padding: 12px 0; border-top: 1px solid var(--border); margin-top: 8px; font-size: 14px; color: var(--text); }
.quote-total { font-size: 20px; font-weight: 800; color: var(--gold); text-align: right; padding: 10px 0; border-top: 1px solid var(--border-gold); letter-spacing: -0.3px; }
.quote-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }

.approval-request-bar {
  background: rgba(255,214,10,0.06); border: 1px solid rgba(255,214,10,0.18);
  border-radius: var(--r); padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; flex-wrap: wrap;
}
.approval-request-bar p { font-size: 13px; color: rgba(255,214,10,0.80); }

/* ══════════════════════════════
   CASH / EXPENSE
══════════════════════════════ */
.expense-card { background: var(--s1); border-radius: var(--r); border: 1px solid var(--border); padding: 16px; }
.upload-area {
  display: block;
  border: 2px dashed rgba(255,255,255,0.14); border-radius: var(--r);
  padding: 24px 20px; text-align: center; cursor: pointer;
  background: var(--s0); position: relative;
  transition: border-color var(--t2), background var(--t2);
}
.upload-area:hover, .upload-area.drag-over {
  border-color: var(--pink); background: rgba(255,45,120,0.05);
}
.upload-area.drag-over { transform: scale(1.01); }
.upload-area-inner { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.upload-icon-wrap {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--s2); display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
}
.upload-label-text { font-size: 13px; font-weight: 600; color: var(--text-2); }
.upload-hint { font-size: 11px; color: var(--text-muted); }
.upload-area input[type="file"] { display: none; }

/* Upload progress */
.upload-progress { margin-top: 10px; }
.upload-progress.hidden { display: none; }
.upload-bar-track { height: 5px; border-radius: 3px; background: var(--s2); overflow: hidden; margin-bottom: 6px; }
.upload-bar-fill { height: 100%; border-radius: 3px; background: var(--primary); width: 0%; transition: width 0.4s var(--ease); }
.upload-status { font-size: 12px; color: var(--text-muted); }

/* Uploaded file chips */
.uploaded-files-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.file-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--pill);
  background: var(--s2); border: 1px solid var(--border);
  font-size: 12px; font-weight: 500; color: var(--text-2);
  text-decoration: none; cursor: pointer;
  transition: background var(--t1), color var(--t1);
  max-width: 220px;
}
.file-chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-chip:hover { background: var(--s3); color: var(--text); }
.file-chip-src {
  font-size: 10px; color: var(--text-muted); flex-shrink: 0;
  padding: 2px 5px; border-radius: var(--pill); background: var(--s1);
}

/* Storage status card */
.storage-status-card {
  padding: 16px 18px; border-radius: var(--r); border: 1px solid var(--border);
  background: var(--s1);
}
.storage-status-card.drive-on  { border-color: rgba(255,214,10,0.20); }
.storage-status-card.drive-off { border-color: rgba(10,132,255,0.18); }
.storage-icon-wrap {
  width: 40px; height: 40px; border-radius: 10px; background: var(--s2);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* ══════════════════════════════
   DEPARTMENTS
══════════════════════════════ */
.dept-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.dept-card {
  background: var(--s1); border-radius: var(--r); border: 1px solid var(--border);
  padding: 20px;
  border-top: 2px solid transparent;
  background-clip: padding-box;
  transition: box-shadow var(--t2), transform var(--t2), border-color var(--t2);
  position: relative;
}
.dept-card::before {
  content: '';
  position: absolute; top: -1px; left: 0; right: 0; height: 2px;
  background: var(--grad-pk-bl); border-radius: var(--r) var(--r) 0 0;
  opacity: 0.7;
}
.dept-card:hover { box-shadow: var(--sh-sm), 0 0 24px rgba(255,45,120,0.08); transform: translateY(-2px); }
.dept-name { font-size: 15px; font-weight: 700; margin-bottom: 4px; color: var(--text); }
.dept-head { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.dept-members { display: flex; flex-wrap: wrap; gap: 6px; }
.member-chip {
  background: var(--s2); border-radius: var(--pill);
  padding: 3px 10px; font-size: 11px; font-weight: 500;
  border: 1px solid var(--border); color: var(--text-2);
}

/* ══════════════════════════════
   POLICY CARDS
══════════════════════════════ */
.policy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.policy-card {
  background: var(--s1); border-radius: var(--r); border: 1px solid var(--border);
  padding: 18px; cursor: pointer; position: relative; overflow: hidden;
  transition: box-shadow var(--t2), transform var(--t2);
}
.policy-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--grad-gold); opacity: 0.75;
}
.policy-card:hover { box-shadow: var(--sh-sm), 0 0 24px rgba(255,214,10,0.08); transform: translateY(-2px); }
.policy-icon { font-size: 28px; margin-bottom: 10px; }
.policy-title { font-size: 14px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.policy-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

/* ══════════════════════════════
   ACCESS DENIED
══════════════════════════════ */
.access-denied {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 64px 20px; text-align: center;
  background: var(--s1); border-radius: var(--r); border: 1px solid var(--border);
}
.access-denied .ad-icon { font-size: 56px; margin-bottom: 16px; opacity: 0.35; }
.access-denied h3 { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.access-denied p { font-size: 14px; color: var(--text-muted); max-width: 280px; line-height: 1.6; }

/* ══════════════════════════════
   MODAL
══════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.60);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-overlay.active { display: flex; }
.modal-box {
  background: var(--modal-bg);
  backdrop-filter: blur(32px); -webkit-backdrop-filter: blur(32px);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg), 0 0 0 1px rgba(255,45,120,0.08);
  width: 100%; max-width: 620px; max-height: 92dvh;
  display: flex; flex-direction: column; overflow: hidden;
  animation: popIn 0.26s var(--spring);
  position: relative;
}
/* Roomier variants for content-heavy popups (forms, payslips, sales orders) so
   they don't render as a cramped small dialog. Applied via openModal({size}). */
.modal-box.modal-wide { max-width: 920px; }
.modal-box.modal-full { max-width: min(1200px, 96vw); max-height: 94dvh; }
/* top gradient trim on modal */
.modal-box::before {
  content: '';
  position: absolute; top: 0; left: 8%; right: 8%; height: 1.5px;
  background: var(--grad-pk-bl); border-radius: var(--pill); opacity: 0.6;
}
.modal-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.modal-header h3 { font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: -0.2px; }
.modal-close {
  background: var(--s2); border: 1px solid var(--border);
  font-size: 13px; cursor: pointer; color: var(--text-muted);
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t1), color var(--t1);
}
.modal-close:hover { background: var(--s3); color: var(--text); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 14px 20px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; justify-content: flex-end;
  flex-shrink: 0; background: rgba(255,255,255,0.01);
}

/* ── Drawer ── */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(400px, 100vw);
  background: var(--drawer-bg);
  backdrop-filter: blur(32px); -webkit-backdrop-filter: blur(32px);
  border-left: 1px solid rgba(255,255,255,0.09);
  z-index: 195; display: flex; flex-direction: column;
  box-shadow: -8px 0 48px rgba(0,0,0,0.60);
  transform: translateX(100%);
  transition: transform var(--t3) var(--ease);
}
.drawer.open { transform: translateX(0); }
.drawer-header {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,0.02);
  gap: 8px;
}
.drawer-header h3 { font-size: 15px; font-weight: 700; color: var(--text); flex: 1; text-align: center; }

.drawer-back-btn {
  display: flex; align-items: center; gap: 5px;
  background: var(--s1); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 7px 12px;
  color: var(--blue-2); font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  transition: background var(--t1), color var(--t1), transform var(--t1);
}
.drawer-back-btn:hover { background: var(--s2); color: var(--blue); transform: translateX(-2px); }
.drawer-back-btn:active { transform: scale(0.96); }
.drawer-back-btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2.5; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; }

/* ══════════════════════════════
   MISC
══════════════════════════════ */
.loading-placeholder {
  color: var(--text-muted); font-size: 14px;
  padding: 48px 20px; text-align: center;
  background: linear-gradient(90deg, var(--text-muted) 25%, rgba(255,255,255,0.25) 50%, var(--text-muted) 75%);
  background-size: 800px 100%;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  animation: skeleton 1.8s ease-in-out infinite;
}

.empty-state { text-align: center; padding: 56px 20px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 52px; margin-bottom: 14px; opacity: 0.30; }
.empty-state h4 { font-size: 16px; font-weight: 700; margin-bottom: 6px; color: var(--text-2); }
.empty-state p { font-size: 13px; line-height: 1.6; }

.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

.progress-bar-wrap { background: rgba(255,255,255,0.06); border-radius: var(--pill); height: 6px; overflow: hidden; }
.progress-bar-fill {
  height: 100%; border-radius: var(--pill);
  background: var(--grad-pk-bl); background-size: 200% 200%;
  animation: gradRun 3s ease infinite;
  will-change: background-position;
  transition: width 0.7s var(--ease);
}

/* ══════════════════════════════
   MINI CALENDAR
══════════════════════════════ */
#mini-cal table { width: 100%; border-collapse: collapse; font-size: 12px; }
#mini-cal th { padding: 5px; text-align: center; color: var(--text-muted); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
#mini-cal td { padding: 5px; text-align: center; border-radius: 6px; cursor: default; color: var(--text-2); transition: background var(--t1); }
#mini-cal td.today {
  background: var(--grad-pk-bl); background-size: 200% 200%;
  color: #fff; font-weight: 700; border-radius: 50%;
  animation: gradRun 4s ease infinite;
  box-shadow: var(--sh-pink);
}
#mini-cal td.other-month { opacity: 0.25; }
#mini-cal td:not(.other-month):hover { background: var(--s2); }

/* ══════════════════════════════
   PROFILE DRAWER
══════════════════════════════ */
.profile-photo-wrap { display: flex; flex-direction: column; align-items: center; padding: 24px 0 16px; gap: 10px; }
.profile-photo-large {
  width: 88px; height: 88px; border-radius: 50%;
  background: var(--grad-pk-bl); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 700; overflow: hidden; cursor: pointer;
  box-shadow: var(--sh-pink), 0 0 0 2px rgba(255,45,120,0.25);
  transition: transform var(--t2), box-shadow var(--t2);
}
.profile-photo-large img { width: 100%; height: 100%; object-fit: cover; }
.profile-photo-large:hover { transform: scale(1.05); box-shadow: 0 8px 32px rgba(255,45,120,0.45), 0 0 0 3px rgba(255,45,120,0.30); }

/* ══════════════════════════════
   RESPONSIVE — MOBILE
══════════════════════════════ */
@media (max-width: 768px) {
  #sidebar { transform: translateX(-100%); }
  /* z-index 96 = above top-nav-strip (94) so user info is fully visible */
  #sidebar.open { transform: translateX(0); box-shadow: 4px 0 48px rgba(0,0,0,0.60); z-index: 96; }
  .menu-toggle { display: block; }
  .main-content {
    margin-left: 0;
    margin-top: calc(var(--topbar-h) + var(--top-nav-h) + env(safe-area-inset-top, 0px));
    padding: 14px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }
  /* Top strip replaces bottom nav on mobile */
  .top-nav-strip { display: flex; }
  /* Bottom nav stays hidden on mobile */
  .bottom-nav { display: none !important; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .form-row { grid-template-columns: 1fr; }
  .line-item-row     { grid-template-columns: 2fr 55px 80px 32px; }
  .line-items-header { grid-template-columns: 2fr 55px 80px 32px; }
  .topbar-brand-wrap { display: none; }
  /* Bell navigates to page on mobile — panel/backdrop never show */
  .notif-panel, .notif-backdrop { display: none !important; }
  .modal-box { max-height: 94dvh; border-radius: var(--r-lg) var(--r-lg) 0 0; align-self: flex-end; margin-bottom: 0; margin-top: auto; }
  .page-header h2 { font-size: 19px; }
  /* 44px minimum tap targets */
  .btn-primary, .btn-secondary, .btn-danger { min-height: 44px; }
  /* bottom-nav-item tap target provided by pill container height */
  .notif-btn, .theme-toggle-btn { min-width: 44px; min-height: 44px; }
  .modal-close { min-width: 44px; min-height: 44px; }
  /* Roomier subtab chips for finger taps */
  .subtab-btn { min-height: 40px; padding-top: 9px; padding-bottom: 9px; }
  /* Table scroll on mobile */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* Modal body scroll */
  .modal-body { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  /* Card body safe scroll */
  .card-body { overflow-anchor: none; }
  /* Alert banners full width */
  .alert-banner { font-size: 12px; padding: 10px 14px; }
  /* Task feed compact */
  .task-feed-item { padding: 10px 14px; }
  .task-feed-title { font-size: 12px; }
}

@media (max-width: 420px) {
  .login-container { padding: 24px 16px 20px; }
  /* .kpi-value sizing handled in the max-width:480px block below (currency-safe clamp) */
  .kpi-row { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .kpi-card { padding: 14px 12px; }
  /* .bn-label hidden globally via pill nav styles */
  .page-header { flex-wrap: wrap; gap: 8px; }
  .page-header h2 { font-size: 17px; }
  .card-header h3 { font-size: 13px; }
  .login-role-cards { gap: 8px; }
  .login-role-card { padding: 12px 14px; }
  .lrc-icon { width: 36px; height: 36px; }
  .lrc-icon svg { width: 18px; height: 18px; }
}

/* Android-specific font rendering */
@media (max-width: 768px) {
  body {
    -webkit-text-size-adjust: 100%;
    text-rendering: optimizeLegibility;
  }
}

/* ── iOS / Android: prevent auto-zoom on input focus ──
   iOS Safari zooms in when any input font-size < 16px.
   Force 16px on all touch devices.                    */
@media (hover: none) and (pointer: coarse) {
  input, textarea, select,
  .form-group input, .form-group textarea, .form-group select {
    font-size: 16px !important;
    transform: translateZ(0); /* GPU layer prevents reflow zoom */
  }
}

/* ══════════════════════════════
   SCROLLBAR
══════════════════════════════ */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }

/* ══════════════════════════════════════════════════
   MIDNIGHT THEME — deep navy dark, electric-blue accent
   (a dark theme like the default, shifted to navy blues)
══════════════════════════════════════════════════ */
html.theme-midnight {
  --black:    #0A0E20;
  --black-2:  #0E1530;
  --black-3:  #16203F;
  --bg:       #0A0E20;
  --glass:    rgba(14,21,48,0.86);
  --glass-lt: rgba(120,160,255,0.06);
  --s0:       rgba(120,160,255,0.04);
  --s1:       rgba(120,160,255,0.06);
  --s2:       rgba(120,160,255,0.10);
  --s3:       rgba(120,160,255,0.14);
  --surface:  rgba(120,160,255,0.06);
  --surface2: rgba(120,160,255,0.11);
  --primary:       #5EA0FF;
  --primary-light: #7CB2FF;
  --accent:        #34D399;
  --accent-light:  #6EE7B7;
  --border:        rgba(120,160,255,0.13);
  --text:       #EAF1FF;
  --text-2:     rgba(234,241,255,0.80);
  --text-muted: rgba(234,241,255,0.48);
  --text-light: rgba(234,241,255,0.30);
}
html.theme-midnight body { background: linear-gradient(160deg, #0A0E20 0%, #0E1530 55%, #0A0E20 100%); }

/* ══════════════════════════════════════════════════
   LIGHT MODE
══════════════════════════════════════════════════ */
html.light, html.theme-pink, html.theme-grey {
  /* Borders */
  --border-glow: rgba(255,45,120,0.18);
  --border-gold: rgba(180,120,0,0.22);

  /* Shadows */
  --sh-pink: 0 4px 24px rgba(255,45,120,0.22);
  --sh-blue: 0 4px 24px rgba(10,132,255,0.18);
  --sh-gold: 0 4px 24px rgba(255,214,10,0.18);

  /* Toast theming — slightly deeper hues read well on light surfaces */
  --toast-success: #16A34A;
  --toast-error:   #DC2626;
  --toast-info:    #2563EB;
  --toast-text:    #FFFFFF;
}

/* ══════════════════════════════════════════════════
   AURORA (LIGHT) THEME — crisp daylight, frosted glass
══════════════════════════════════════════════════ */
html.light {
  /* Core palette */
  --bg:         #F8FAFC;
  --black:      #F8FAFC;
  --black-2:    #FFFFFF;
  --black-3:    #F1F5F9;

  /* Surfaces */
  --s0:      rgba(15,23,42,0.018);
  --s1:      rgba(15,23,42,0.04);
  --s2:      rgba(15,23,42,0.07);
  --s3:      rgba(15,23,42,0.11);
  --glass:   rgba(255,255,255,0.75);
  --glass-lt:rgba(15,23,42,0.04);
  --surface: rgba(255,255,255,0.90);
  --surface2:rgba(15,23,42,0.04);
  --grad-card: linear-gradient(160deg, rgba(15,23,42,0.02) 0%, rgba(15,23,42,0.00) 100%);

  /* Borders */
  --border:      #E2E8F0;

  /* Text */
  --text:       #0F172A;
  --text-2:     rgba(15,23,42,0.80);
  --text-muted: #64748B;
  --text-light: rgba(15,23,42,0.32);
  --text-inv:   #F8FAFC;

  /* Shadows — soft, low opacity */
  --sh-xs: 0 1px 4px rgba(15,23,42,0.05);
  --sh-sm: 0 2px 12px rgba(15,23,42,0.06);
  --sh:    0 4px 20px rgba(15,23,42,0.07);
  --sh-md: 0 8px 32px rgba(15,23,42,0.08);
  --sh-lg: 0 16px 56px rgba(15,23,42,0.10);

  /* Primary / secondary accent */
  --primary:       #3B82F6;
  --primary-light: #8B5CF6;

  /* Component backgrounds */
  --topbar-bg:     rgba(248,250,252,0.88);
  --sidebar-bg:    rgba(248,250,252,0.96);
  --notif-bg:      rgba(255,255,255,0.96);
  --login-card-bg: rgba(255,255,255,0.92);
  --bottom-nav-bg: rgba(248,250,252,0.92);
  --modal-bg:      rgba(255,255,255,0.96);
  --drawer-bg:     rgba(248,250,252,0.96);
}
html.light body { background: linear-gradient(150deg, #F8FAFC 0%, #EFF4FA 35%, #F3F0FA 65%, #F8FAFC 100%); }
html.light body::before {
  background:
    radial-gradient(ellipse 70% 60% at 10% 20%,  rgba(59,130,246,0.05) 0%, transparent 65%),
    radial-gradient(ellipse 60% 50% at 90% 80%,  rgba(139,92,246,0.05) 0%, transparent 65%),
    radial-gradient(ellipse 50% 50% at 55% 45%,  rgba(255,214,10,0.03) 0%, transparent 60%),
    radial-gradient(ellipse 80% 80% at 50% 100%, rgba(139,92,246,0.03) 0%, transparent 60%);
}
html.light body::after {
  background: radial-gradient(circle, rgba(59,130,246,0.04) 0%, transparent 70%);
}

/* ══════════════════════════════════════════════════
   OFFICE THEME — Microsoft Fluent (clean white, blue accent)
   Extends the light theme (html gets both `light` + `theme-office`)
══════════════════════════════════════════════════ */
html.theme-office {
  /* Neutral Fluent canvas */
  --bg:       #FAF9F8;
  --black:    #FAF9F8;
  --black-2:  #FFFFFF;
  --black-3:  #F3F2F1;

  /* Surfaces — flat, low-contrast neutrals */
  --s0:      rgba(0,0,0,0.015);
  --s1:      rgba(0,0,0,0.03);
  --s2:      rgba(0,0,0,0.06);
  --s3:      rgba(0,0,0,0.09);
  --glass:   rgba(255,255,255,0.85);
  --glass-lt:rgba(0,0,0,0.03);
  --surface: #FFFFFF;
  --surface2:rgba(0,0,0,0.03);
  --grad-card: none;

  /* Crisp neutral borders */
  --border:      #E1DFDD;
  --border-glow: rgba(15,108,189,0.20);
  --border-gold: rgba(15,108,189,0.20);

  /* Microsoft brand blue — remap the pink/blue accents */
  --pink:      #0F6CBD;
  --pink-2:    #2886DE;
  --pink-glow: rgba(15,108,189,0.18);
  --blue:      #0F6CBD;
  --blue-2:    #2886DE;
  --blue-glow: rgba(15,108,189,0.18);
  --primary:       #0F6CBD;
  --primary-light: #2886DE;
  --accent:        #0F6CBD;
  --accent-light:  #2886DE;
  --info:          #0F6CBD;

  /* Fluent neutral text ramp */
  --text:       #242424;
  --text-2:     #424242;
  --text-muted: #616161;
  --text-light: #909090;
  --text-inv:   #FFFFFF;

  /* Sleeker corners (Fluent ~4px) */
  --r-xs:  3px;
  --r-sm:  4px;
  --r:     6px;
  --r-lg:  8px;
  --r-xl:  10px;
  --r-2xl: 12px;

  /* Segoe UI — authentic Microsoft type */
  --font:         'Segoe UI', -apple-system, system-ui, 'Inter', sans-serif;
  --font-display: 'Segoe UI', -apple-system, system-ui, 'Inter', sans-serif;

  /* Subtle Fluent depth shadows */
  --sh-xs: 0 1px 2px rgba(0,0,0,0.07);
  --sh-sm: 0 1px 3px rgba(0,0,0,0.10);
  --sh:    0 2px 6px rgba(0,0,0,0.11);
  --sh-md: 0 4px 12px rgba(0,0,0,0.12);
  --sh-lg: 0 8px 24px rgba(0,0,0,0.14);
  --sh-pink: 0 2px 8px rgba(15,108,189,0.18);
  --sh-blue: 0 2px 8px rgba(15,108,189,0.18);
  --sh-gold: 0 2px 8px rgba(15,108,189,0.18);

  /* Flatten brand gradients to the single accent */
  --grad-pk-bl: linear-gradient(135deg, #0F6CBD 0%, #2886DE 100%);
  --grad-pink:  linear-gradient(135deg, #0F6CBD 0%, #2886DE 100%);
  --grad-blue:  linear-gradient(135deg, #0F6CBD 0%, #2886DE 100%);
  --grad-purple:linear-gradient(135deg, #0F6CBD 0%, #2886DE 100%);

  /* Clean white/neutral chrome */
  --topbar-bg:     rgba(255,255,255,0.92);
  --sidebar-bg:    #F3F2F1;
  --notif-bg:      #FFFFFF;
  --login-card-bg: #FFFFFF;
  --bottom-nav-bg: rgba(255,255,255,0.94);
  --modal-bg:      #FFFFFF;
  --drawer-bg:     #FAF9F8;
}
/* Flat, distraction-free background — no aurora orbs */
html.theme-office body { background: #FAF9F8; }
html.theme-office body::before,
html.theme-office body::after { display: none; }
/* Solid brand-blue topbar wordmark */
html.theme-office .topbar-brand {
  background: linear-gradient(90deg, #0F6CBD 0%, #2886DE 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* login orbs */
html.light .login-bg::before, html.theme-pink .login-bg::before, html.theme-grey .login-bg::before { background: radial-gradient(circle, rgba(255,45,120,0.06) 0%, transparent 68%); }
html.light .login-bg::after, html.theme-pink .login-bg::after, html.theme-grey .login-bg::after { background: radial-gradient(circle, rgba(10,132,255,0.05) 0%, transparent 68%); }
html.light #login-screen::before, html.theme-pink #login-screen::before, html.theme-grey #login-screen::before { background: radial-gradient(circle, rgba(255,214,10,0.04) 0%, transparent 70%); }

/* login card */
html.light .login-container, html.theme-pink .login-container, html.theme-grey .login-container {
  border-color: rgba(0,0,0,0.08);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.05), 0 20px 60px rgba(0,0,0,0.10), inset 0 1px 0 rgba(255,255,255,0.90);
}

/* topbar */
html.light .topbar, html.theme-pink .topbar, html.theme-grey .topbar { border-bottom-color: rgba(0,0,0,0.07); }
html.light .topbar::after, html.theme-pink .topbar::after, html.theme-grey .topbar::after { opacity: 0.22; }
html.light .topbar-brand, html.theme-pink .topbar-brand, html.theme-grey .topbar-brand {
  background: linear-gradient(90deg, #1D1D1F 0%, #6B3F00 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
html.light .menu-toggle, html.theme-pink .menu-toggle, html.theme-grey .menu-toggle { color: rgba(29,29,31,0.55); }
html.light .menu-toggle:hover, html.theme-pink .menu-toggle:hover, html.theme-grey .menu-toggle:hover { color: #1D1D1F; }

/* sidebar */
html.light #sidebar, html.theme-pink #sidebar, html.theme-grey #sidebar { border-right-color: rgba(0,0,0,0.08); }
html.light #sidebar::before, html.theme-pink #sidebar::before, html.theme-grey #sidebar::before { opacity: 0.30; }
html.light .sidebar-top, html.theme-pink .sidebar-top, html.theme-grey .sidebar-top { border-bottom-color: rgba(0,0,0,0.07); }
html.light .sidebar-user-role, html.theme-pink .sidebar-user-role, html.theme-grey .sidebar-user-role { color: rgba(29,29,31,0.50); }
html.light .sidebar-user-dept, html.theme-pink .sidebar-user-dept, html.theme-grey .sidebar-user-dept {
  background: linear-gradient(90deg, #8B6000, #C47A00);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
html.light .nav-item, html.theme-pink .nav-item, html.theme-grey .nav-item { color: rgba(29,29,31,0.55); }
html.light .nav-item:hover, html.theme-pink .nav-item:hover, html.theme-grey .nav-item:hover { background: rgba(0,0,0,0.04); color: #1D1D1F; }
html.light .nav-item.active, html.theme-pink .nav-item.active, html.theme-grey .nav-item.active { background: rgba(0,0,0,0.06); color: #1D1D1F; }
html.light .nav-section-label, html.theme-pink .nav-section-label, html.theme-grey .nav-section-label { color: rgba(29,29,31,0.35); }
html.light .btn-logout-inline, html.theme-pink .btn-logout-inline, html.theme-grey .btn-logout-inline {
  color: #c9282d;
  background: rgba(255,69,58,0.06);
  border-color: rgba(255,69,58,0.16);
}
html.light .btn-logout-inline:hover, html.theme-pink .btn-logout-inline:hover, html.theme-grey .btn-logout-inline:hover { background: rgba(255,69,58,0.12); }
html.light .sidebar-overlay, html.theme-pink .sidebar-overlay, html.theme-grey .sidebar-overlay { background: rgba(0,0,0,0.30); }

/* bottom nav */
html.light .bottom-nav, html.theme-pink .bottom-nav, html.theme-grey .bottom-nav { border-top-color: rgba(0,0,0,0.07); }
html.light .bottom-nav::before, html.theme-pink .bottom-nav::before, html.theme-grey .bottom-nav::before { opacity: 0.18; }
html.light .bottom-nav-item, html.theme-pink .bottom-nav-item, html.theme-grey .bottom-nav-item { color: rgba(29,29,31,0.50); }
html.light .bottom-nav-item.active, html.theme-pink .bottom-nav-item.active, html.theme-grey .bottom-nav-item.active { color: var(--pink); }

/* notif panel */
html.light .notif-panel, html.theme-pink .notif-panel, html.theme-grey .notif-panel {
  border-color: rgba(0,0,0,0.08);
  box-shadow: 0 8px 40px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.05);
}
html.light .notif-panel-header, html.theme-pink .notif-panel-header, html.theme-grey .notif-panel-header { background: rgba(0,0,0,0.02); }

/* modal */
html.light .modal-box, html.theme-pink .modal-box, html.theme-grey .modal-box {
  border-color: rgba(0,0,0,0.09);
  box-shadow: 0 20px 60px rgba(0,0,0,0.16);
}
html.light .modal-footer, html.theme-pink .modal-footer, html.theme-grey .modal-footer { background: rgba(0,0,0,0.015); }
html.light .drawer, html.theme-pink .drawer, html.theme-grey .drawer {
  border-left-color: rgba(0,0,0,0.08);
  box-shadow: -8px 0 48px rgba(0,0,0,0.12);
}

/* tables */
html.light .data-table th, html.theme-pink .data-table th, html.theme-grey .data-table th { background: rgba(0,0,0,0.025); }
html.light .data-table td, html.theme-pink .data-table td, html.theme-grey .data-table td { border-bottom-color: rgba(0,0,0,0.05); }
html.light .data-table tr:hover td, html.theme-pink .data-table tr:hover td, html.theme-grey .data-table tr:hover td { background: rgba(0,0,0,0.03); }

/* badges */
html.light .badge-gray, html.theme-pink .badge-gray, html.theme-grey .badge-gray { background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.10); color: rgba(29,29,31,0.55); }
html.light .badge-blue, html.theme-pink .badge-blue, html.theme-grey .badge-blue { color: #0055CC; }
html.light .badge-green, html.theme-pink .badge-green, html.theme-grey .badge-green { color: #1B8C3A; }
html.light .badge-orange, html.theme-pink .badge-orange, html.theme-grey .badge-orange { color: #C06000; }
html.light .badge-red, html.theme-pink .badge-red, html.theme-grey .badge-red { color: #C42B22; }
html.light .badge-purple, html.theme-pink .badge-purple, html.theme-grey .badge-purple { color: #5C34B0; }

/* scrollbar */
html.light ::-webkit-scrollbar-thumb, html.theme-pink ::-webkit-scrollbar-thumb, html.theme-grey ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.14); }
html.light ::-webkit-scrollbar-thumb:hover, html.theme-pink ::-webkit-scrollbar-thumb:hover, html.theme-grey ::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.24); }

/* login role cards */
html.light .login-role-card, html.theme-pink .login-role-card, html.theme-grey .login-role-card { color: #1D1D1F; }
html.light .login-role-card:hover, html.theme-pink .login-role-card:hover, html.theme-grey .login-role-card:hover { background: rgba(0,0,0,0.06); }
html.light .login-back-btn, html.theme-pink .login-back-btn, html.theme-grey .login-back-btn { color: rgba(29,29,31,0.55); }
html.light .login-back-btn:hover, html.theme-pink .login-back-btn:hover, html.theme-grey .login-back-btn:hover { background: rgba(0,0,0,0.06); color: #1D1D1F; }
html.light .login-type-pill, html.theme-pink .login-type-pill, html.theme-grey .login-type-pill { color: rgba(29,29,31,0.60); }

/* alert banners */
html.light .alert-danger, html.theme-pink .alert-danger, html.theme-grey .alert-danger { background: rgba(255,69,58,0.08); color: #C42B22; }
html.light .alert-warn, html.theme-pink .alert-warn, html.theme-grey .alert-warn { background: rgba(255,170,0,0.08); color: #C06000; }

/* task feed */
html.light .task-feed-item, html.theme-pink .task-feed-item, html.theme-grey .task-feed-item { border-bottom-color: rgba(0,0,0,0.05); }
html.light .task-feed-item:hover, html.theme-pink .task-feed-item:hover, html.theme-grey .task-feed-item:hover { background: rgba(0,0,0,0.04); }
html.light .task-feed-item.task-overdue, html.theme-pink .task-feed-item.task-overdue, html.theme-grey .task-feed-item.task-overdue { background: rgba(255,69,58,0.04); }
html.light .task-feed-title, html.theme-pink .task-feed-title, html.theme-grey .task-feed-title { color: #1D1D1F; }
html.light .task-feed-meta, html.theme-pink .task-feed-meta, html.theme-grey .task-feed-meta { color: rgba(29,29,31,0.50); }

/* quick actions */
html.light .quick-action-btn, html.theme-pink .quick-action-btn, html.theme-grey .quick-action-btn { color: rgba(29,29,31,0.70); }
html.light .quick-action-btn:hover, html.theme-pink .quick-action-btn:hover, html.theme-grey .quick-action-btn:hover { background: rgba(0,0,0,0.06); color: #1D1D1F; }

/* payslip */
html.light .payslip-row, html.theme-pink .payslip-row, html.theme-grey .payslip-row { border-bottom-color: rgba(0,0,0,0.06); color: rgba(29,29,31,0.70); }

/* kpi bar */
html.light .kpi-bar-track, html.theme-pink .kpi-bar-track, html.theme-grey .kpi-bar-track { background: rgba(0,0,0,0.08); }

/* help guide */
html.light .help-hero, html.theme-pink .help-hero, html.theme-grey .help-hero { background: #fff; border-color: rgba(0,0,0,0.08); }
html.light .help-section, html.theme-pink .help-section, html.theme-grey .help-section { background: #fff; border-color: rgba(0,0,0,0.08); }
html.light .help-section h3, html.theme-pink .help-section h3, html.theme-grey .help-section h3 { color: #1D1D1F; }
html.light .help-steps li, html.theme-pink .help-steps li, html.theme-grey .help-steps li { color: rgba(29,29,31,0.75); }
html.light .help-list  li, html.theme-pink .help-list  li, html.theme-grey .help-list  li { color: rgba(29,29,31,0.75); }
html.light .help-list  li::before, html.theme-pink .help-list  li::before, html.theme-grey .help-list  li::before { color: rgba(29,29,31,0.35); }
html.light .help-tip, html.theme-pink .help-tip, html.theme-grey .help-tip { background: rgba(255,214,10,0.08); border-color: rgba(255,214,10,0.25); color: rgba(29,29,31,0.70); }
html.light .help-section p, html.theme-pink .help-section p, html.theme-grey .help-section p { color: rgba(29,29,31,0.75); }
html.light .help-section code, html.theme-pink .help-section code, html.theme-grey .help-section code { background: rgba(0,0,0,0.06); }

/* ══════════════════════════════════════════════════
   ASTRAL (PINK) THEME — soft rose, lavender, cosmic glow
══════════════════════════════════════════════════ */
html.theme-pink {
  --bg:      #FFF7FB;
  --black:   #FFF7FB;
  --black-2: #FFFFFF;
  --black-3: #FCE7F3;

  --s0:      rgba(74,4,78,0.018);
  --s1:      rgba(74,4,78,0.05);
  --s2:      rgba(74,4,78,0.08);
  --s3:      rgba(74,4,78,0.12);
  --glass:   rgba(255,250,253,0.75);
  --glass-lt:rgba(74,4,78,0.05);
  --surface: rgba(255,255,255,0.90);
  --surface2:rgba(252,231,243,0.60);
  --grad-card: linear-gradient(160deg, rgba(74,4,78,0.03) 0%, rgba(74,4,78,0.00) 100%);

  --border:      #FBCFE8;
  --border-glow: rgba(236,72,153,0.20);
  --border-gold: rgba(180,120,0,0.22);

  --sh-xs: 0 1px 4px rgba(74,4,78,0.06);
  --sh-sm: 0 2px 12px rgba(74,4,78,0.08);
  --sh:    0 4px 20px rgba(74,4,78,0.09);
  --sh-md: 0 8px 32px rgba(74,4,78,0.10);
  --sh-lg: 0 16px 56px rgba(74,4,78,0.12);

  --primary:       #EC4899;
  --primary-light: #A855F7;
  --accent-highlight: #F9A8D4;

  --topbar-bg:     rgba(255,247,251,0.88);
  --sidebar-bg:    rgba(255,247,251,0.96);
  --notif-bg:      rgba(255,255,255,0.96);
  --login-card-bg: rgba(255,255,255,0.92);
  --bottom-nav-bg: rgba(255,247,251,0.92);
  --modal-bg:      rgba(255,255,255,0.96);
  --drawer-bg:     rgba(255,247,251,0.96);

  --text:       #4A044E;
  --text-2:     rgba(74,4,78,0.80);
  --text-muted: #9D174D;
  --text-light: rgba(74,4,78,0.32);
  --text-inv:   #FFF7FB;
}
html.theme-pink body { background: linear-gradient(150deg, #FFF7FB 0%, #FCE7F3 35%, #FDF0F8 65%, #FFF7FB 100%); }
html.theme-pink body::before {
  background:
    radial-gradient(ellipse 70% 60% at 10% 20%,  rgba(236,72,153,0.08) 0%, transparent 65%),
    radial-gradient(ellipse 60% 50% at 90% 80%,  rgba(168,85,247,0.08) 0%, transparent 65%),
    radial-gradient(ellipse 50% 50% at 55% 45%,  rgba(249,168,212,0.05) 0%, transparent 60%),
    radial-gradient(ellipse 80% 80% at 50% 100%, rgba(168,85,247,0.05) 0%, transparent 60%);
}
html.theme-pink body::after { background: radial-gradient(circle, rgba(236,72,153,0.06) 0%, transparent 70%); }
html.theme-pink .bottom-nav-item.active { color: var(--primary); }

/* ══════════════════════════════════════════════════
   SLATE (GREY) THEME — neutral, professional, understated
══════════════════════════════════════════════════ */
html.theme-grey {
  --bg:      #F3F4F6;
  --black:   #F3F4F6;
  --black-2: #FFFFFF;
  --black-3: #E5E7EB;

  --s0:      rgba(17,24,39,0.018);
  --s1:      rgba(17,24,39,0.04);
  --s2:      rgba(17,24,39,0.07);
  --s3:      rgba(17,24,39,0.11);
  --glass:   rgba(249,250,251,0.75);
  --glass-lt:rgba(17,24,39,0.04);
  --surface: rgba(255,255,255,0.90);
  --surface2:rgba(229,231,235,0.60);
  --grad-card: linear-gradient(160deg, rgba(17,24,39,0.02) 0%, rgba(17,24,39,0.00) 100%);

  --border:      #D1D5DB;
  --border-glow: rgba(107,114,128,0.20);
  --border-gold: rgba(180,120,0,0.22);

  --sh-xs: 0 1px 4px rgba(17,24,39,0.05);
  --sh-sm: 0 2px 12px rgba(17,24,39,0.06);
  --sh:    0 4px 20px rgba(17,24,39,0.07);
  --sh-md: 0 8px 32px rgba(17,24,39,0.08);
  --sh-lg: 0 16px 56px rgba(17,24,39,0.10);

  --primary:       #6B7280;
  --primary-light: #374151;

  --topbar-bg:     rgba(243,244,246,0.88);
  --sidebar-bg:    rgba(243,244,246,0.96);
  --notif-bg:      rgba(255,255,255,0.96);
  --login-card-bg: rgba(255,255,255,0.92);
  --bottom-nav-bg: rgba(243,244,246,0.92);
  --modal-bg:      rgba(255,255,255,0.96);
  --drawer-bg:     rgba(243,244,246,0.96);

  --text:       #111827;
  --text-2:     rgba(17,24,39,0.80);
  --text-muted: #6B7280;
  --text-light: rgba(17,24,39,0.32);
  --text-inv:   #F3F4F6;
}
html.theme-grey body { background: linear-gradient(150deg, #F3F4F6 0%, #E9EAEC 35%, #E5E7EB 65%, #F3F4F6 100%); }
html.theme-grey body::before {
  background:
    radial-gradient(ellipse 70% 60% at 10% 20%,  rgba(107,114,128,0.06) 0%, transparent 65%),
    radial-gradient(ellipse 60% 50% at 90% 80%,  rgba(55,65,81,0.06) 0%, transparent 65%),
    radial-gradient(ellipse 50% 50% at 55% 45%,  rgba(156,163,175,0.04) 0%, transparent 60%),
    radial-gradient(ellipse 80% 80% at 50% 100%, rgba(107,114,128,0.04) 0%, transparent 60%);
}
html.theme-grey body::after { background: radial-gradient(circle, rgba(107,114,128,0.05) 0%, transparent 70%); }
html.theme-grey .bottom-nav-item.active { color: var(--primary); }

/* ══════════════════════════════════════════════════
   THEME PICKER (swatches)
══════════════════════════════════════════════════ */
.theme-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.theme-swatch {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--s1); border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--text-muted);
  padding: 10px 4px; font-size: 11px; font-weight: 600;
  cursor: pointer; transition: background var(--t1), color var(--t1), border-color var(--t1);
}
.theme-swatch:hover { background: var(--s2); color: var(--text); }
.theme-swatch.active { border-color: var(--pink); color: var(--text); box-shadow: 0 0 0 1px var(--pink), 0 0 12px var(--pink-glow); }
.theme-swatch-dot {
  width: 22px; height: 22px; border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.10);
}
.theme-swatch-office .theme-swatch-dot { background: linear-gradient(135deg, #FFFFFF 0%, #0F6CBD 100%); }
.theme-swatch-dark  .theme-swatch-dot { background: linear-gradient(135deg, #131325 0%, #070710 100%); }
.theme-swatch-midnight .theme-swatch-dot { background: linear-gradient(135deg, #5EA0FF 0%, #0E1530 100%); }
.theme-swatch-light .theme-swatch-dot { background: linear-gradient(135deg, #FFFFFF 0%, #3B82F6 100%); }
.theme-swatch-pink  .theme-swatch-dot { background: linear-gradient(135deg, #F9A8D4 0%, #A855F7 100%); }
.theme-swatch-grey  .theme-swatch-dot { background: linear-gradient(135deg, #FFFFFF 0%, #6B7280 100%); }

/* ══════════════════════════════════════════════════
   THEME TOGGLE BUTTON
══════════════════════════════════════════════════ */
.theme-toggle-btn {
  background: var(--s1); border: 1px solid var(--border);
  border-radius: var(--r-xs); color: var(--text-muted);
  padding: 7px 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t1), color var(--t1), box-shadow var(--t2);
}
.theme-toggle-btn:hover {
  background: var(--s2); color: var(--gold);
  box-shadow: 0 0 12px var(--gold-glow);
}
.theme-toggle-btn svg {
  width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 2;
}

/* ══════════════════════════════════════════════════
   LUCIDE ICON SIZING
══════════════════════════════════════════════════ */

/* nav-icon: colored rounded container holds Lucide svg */
.nav-icon svg {
  width: 15px; height: 15px;
  stroke: #fff; stroke-width: 2; fill: none;
  display: block;
}
/* emoji fallback */
.nav-icon.emoji-icon { font-size: 15px; }

/* bottom nav icon */
.bn-icon {
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; line-height: 1;
  transition: transform var(--t2);
}
.bn-icon svg {
  width: 22px; height: 22px;
  stroke: currentColor; stroke-width: 2; fill: none;
  display: block;
}
.bn-icon.emoji-icon { font-size: 22px; display: block; }

/* active bottom nav icon — lucide version */
.bottom-nav-item.active .bn-icon svg {
  transform: scale(1.10);
  filter: drop-shadow(0 0 6px var(--pink-glow));
}

/* Topbar icons */
.notif-btn svg {
  width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2;
}

/* Prevent double-scale for Lucide bn-icons on active */
.bottom-nav-item.active .bn-icon:not(.emoji-icon) { transform: none; }

/* Light mode topbar logo card */
html.light .topbar-logo-card, html.theme-pink .topbar-logo-card, html.theme-grey .topbar-logo-card {
  background: linear-gradient(140deg, #1A1A2E 0%, #16213E 60%, #0F3460 100%);
  border-color: rgba(255,214,10,0.40);
  box-shadow: 0 0 10px rgba(255,214,10,0.14), inset 0 1px 0 rgba(255,255,255,0.08);
}
html.light .topbar-brand, html.theme-pink .topbar-brand, html.theme-grey .topbar-brand {
  background: linear-gradient(90deg, #1D1D1F 0%, #6B3F00 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
html.light .topbar-brand-sub, html.theme-pink .topbar-brand-sub, html.theme-grey .topbar-brand-sub { color: rgba(29,29,31,0.35); }

/* ══════════════════════════════════════════════
   NEW MODULES — Posts, Team, Attendance,
                 Cash Advance, Finance, Company
══════════════════════════════════════════════ */

/* ── Posts ─────────────────────────────────── */
.post-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px; margin-bottom: 14px;
  transition: box-shadow var(--t1);
}
.post-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.12); }
.post-header { display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.post-avatar {
  width:38px; height:38px; border-radius:50%;
  background:var(--primary-light); display:flex; align-items:center;
  justify-content:center; font-weight:700; color:#fff; font-size:15px;
  overflow:hidden; flex-shrink:0;
}
.post-avatar img { width:100%; height:100%; object-fit:cover; }
.post-meta { flex:1; }
.post-author { font-weight:700; font-size:14px; color:var(--text); }
.post-time { font-size:11px; color:var(--text-muted); }
.post-title { font-size:16px; font-weight:700; color:var(--text); margin-bottom:8px; }
.post-body { font-size:14px; color:var(--text); line-height:1.6; white-space:pre-wrap; margin-bottom:10px; }
.post-image { width:100%; max-height:320px; object-fit:cover; border-radius:10px; cursor:pointer; margin-bottom:10px; }
.post-attachment { display:inline-flex; align-items:center; gap:6px; padding:6px 12px; background:var(--s1); border:1px solid var(--border); border-radius:8px; font-size:13px; color:var(--primary-light); text-decoration:none; margin-bottom:10px; }
.post-actions { display:flex; gap:8px; padding-top:10px; border-top:1px solid var(--border); flex-wrap:wrap; align-items:center; }
.post-heart-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: 1.5px solid rgba(255,107,43,0.20);
  border-radius: 20px; padding: 5px 10px; cursor: pointer;
  color: var(--text-muted); transition: background var(--t1), border-color var(--t1), transform 0.1s;
}
.post-heart-btn svg { width: 15px; height: 15px; transition: transform 0.15s, fill 0.15s, stroke 0.15s; }
.post-heart-btn .heart-count { font-size: 12px; font-weight: 600; color: var(--text-muted); min-width: 6px; transition: color 0.15s; }
.post-heart-btn:hover { background: rgba(255,107,43,0.08); border-color: rgba(255,107,43,0.45); }
.post-heart-btn.hearted { border-color: rgba(255,107,43,0.50); background: rgba(255,107,43,0.07); }
.post-heart-btn.hearted .heart-count { color: #FF6B2B; }
@keyframes heartPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.45); }
  70%  { transform: scale(0.88); }
  100% { transform: scale(1); }
}
.post-heart-btn.heart-pop svg { animation: heartPop 0.36s var(--ios-spring-out, cubic-bezier(0.34,1.28,0.64,1)) both; }

/* ── Team Cards (legacy) ──────────────────── */
.team-card-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:14px; }
.team-card { background:var(--surface); border:1px solid var(--border); border-radius:14px; padding:16px; text-align:center; }
.team-card-avatar { width:64px; height:64px; border-radius:50%; background:var(--primary-light); margin:0 auto 10px; display:flex; align-items:center; justify-content:center; font-size:24px; font-weight:700; color:#fff; overflow:hidden; }
.team-card-avatar img { width:100%; height:100%; object-fit:cover; }
.team-card-name { font-size:14px; font-weight:700; color:var(--text); margin-bottom:4px; }
.team-card-dept { font-size:11px; color:var(--text-muted); margin-top:4px; }
.team-card-id { font-size:10px; color:var(--text-muted); font-family:monospace; margin-top:2px; }

/* ── Team Tab — Aesthetic Redesign ───────────── */
.team-masonry {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}
.team-member-card {
  position: relative;
  background: var(--glass-surface, rgba(255,255,255,0.06));
  backdrop-filter: var(--glass-blur-sm, blur(16px) saturate(140%));
  -webkit-backdrop-filter: var(--glass-blur-sm, blur(16px) saturate(140%));
  border: 1px solid var(--glass-border, rgba(255,255,255,0.12));
  border-radius: 20px;
  padding: 20px 14px 14px;
  text-align: center;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.team-member-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 16px 40px rgba(0,0,0,0.3);
  border-color: var(--primary-light);
}
.team-note-bubble {
  position: absolute;
  top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  pointer-events: none;
  z-index: 2;
}
.team-note-bubble::after {
  content: '';
  position: absolute;
  bottom: -5px; left: 50%; transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--primary);
}
.team-member-avatar-wrap {
  position: relative;
  width: 68px; height: 68px;
  margin: 8px 0 6px;
}
.team-member-avatar {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: #fff;
  overflow: hidden;
  border: 2.5px solid rgba(255,255,255,0.15);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.team-member-avatar img { width:100%; height:100%; object-fit:cover; border-radius:50%; }
.team-online-dot {
  position: absolute; bottom: 2px; right: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  border: 2.5px solid var(--surface);
}
.team-online-dot--on { background: #30D158; box-shadow: 0 0 8px rgba(48,209,88,0.6); }
.team-online-dot--off { background: var(--border); }
.team-member-name {
  font-size: 13px; font-weight: 700; color: var(--text);
  line-height: 1.3; text-align: center;
}
.team-member-role {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; opacity: .85;
}
.team-member-dept {
  font-size: 10px; color: var(--text-muted); text-align: center;
  line-height: 1.4;
}
.team-status-pill {
  font-size: 9px; font-weight: 700; padding: 2px 8px;
  border-radius: 20px; margin-top: 2px;
  background: var(--surface2); color: var(--text-muted);
  letter-spacing: .04em;
}
.team-status-pill--on {
  background: rgba(48,209,88,0.12); color: #30D158;
}
.team-card-actions {
  margin-top: 6px;
  display: flex; gap: 6px; justify-content: center;
}
.team-card-btn {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 4px 10px; cursor: pointer;
  font-size: 14px; line-height: 1; transition: background .15s;
}
.team-card-btn:hover { background: var(--primary); }

/* light mode */
html.light .team-member-card, html.theme-pink .team-member-card, html.theme-grey .team-member-card { background: rgba(255,255,255,0.7); border-color: rgba(0,0,0,0.1); }
html.light .team-member-card:hover, html.theme-pink .team-member-card:hover, html.theme-grey .team-member-card:hover { border-color: var(--primary); }

/* ── Employee of the Month (Barro Industries) ── */
.eom-banner {
  position: relative;
  border-radius: 20px;
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,196,0,0.35);
  background: linear-gradient(135deg, rgba(255,196,0,0.16) 0%, rgba(255,138,0,0.10) 45%, rgba(255,255,255,0.04) 100%);
  backdrop-filter: var(--glass-blur-sm, blur(16px) saturate(140%));
  -webkit-backdrop-filter: var(--glass-blur-sm, blur(16px) saturate(140%));
  box-shadow: 0 10px 30px rgba(255,170,0,0.12);
}
.eom-ribbon {
  font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: #FFB800; padding: 11px 16px 0;
}
.eom-body { display: flex; align-items: center; gap: 14px; padding: 8px 16px 16px; }
.eom-avatar {
  flex: 0 0 auto;
  width: 62px; height: 62px; border-radius: 50%;
  background: linear-gradient(135deg, #FFB800 0%, #FF8A00 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: #fff; overflow: hidden;
  border: 2.5px solid rgba(255,196,0,0.5);
  box-shadow: 0 6px 18px rgba(255,138,0,0.35);
}
.eom-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.eom-info { flex: 1 1 auto; min-width: 0; }
.eom-name { font-size: 17px; font-weight: 800; color: var(--text); line-height: 1.2; }
.eom-role { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-top: 3px; }
.eom-reason { font-size: 12.5px; color: var(--text); opacity: .85; font-style: italic; margin-top: 6px; line-height: 1.4; }
.eom-auto-tag { font-size: 10.5px; font-weight: 600; color: var(--text-muted); margin-top: 6px; opacity: .9; }
.eom-edit-btn {
  flex: 0 0 auto; align-self: flex-start;
  background: rgba(255,255,255,0.1); border: 1px solid var(--glass-border, rgba(255,255,255,0.15));
  border-radius: 8px; padding: 5px 9px; cursor: pointer; font-size: 13px; line-height: 1;
  transition: background .15s;
}
.eom-edit-btn:hover { background: rgba(255,196,0,0.25); }
.eom-banner--empty { display: flex; align-items: center; gap: 14px; padding: 16px; }
.eom-empty-icon { font-size: 28px; flex: 0 0 auto; }
.eom-empty-text { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; }
.eom-empty-text strong { font-size: 14px; color: var(--text); }
.eom-empty-text span { font-size: 12px; color: var(--text-muted); }

/* ── Attendance Calendar ────────────────────── */
.att-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.att-cal-hdr {
  text-align:center; font-size:11px; font-weight:700;
  color:var(--text-muted); padding:6px 0;
}
.att-cal-day {
  border-radius: 8px; padding: 6px 4px; text-align:center;
  min-height: 52px; font-size:13px; position:relative;
  background: var(--surface); border:1px solid var(--border);
  display:flex; flex-direction:column; align-items:center; justify-content:flex-start;
  gap:2px;
}
.att-day-num { font-size:12px; font-weight:600; color:var(--text); }
.att-mark { font-size:14px; font-weight:800; }
.att-present { background:rgba(48,209,88,.12); border-color:rgba(48,209,88,.3); }
.att-present .att-mark { color:#30d158; }
.att-half { background:rgba(255,170,0,.12); border-color:rgba(255,170,0,.3); }
.att-half .att-mark { color:#ffaa00; }
.att-absent { background:rgba(255,69,58,.10); border-color:rgba(255,69,58,.25); }
.att-absent .att-mark { color:#ff453a; }
.att-weekend { background:var(--s1); opacity:0.45; }
.att-holiday { background:rgba(255,214,0,0.10); border-color:rgba(255,214,0,0.35); }
.att-holiday .att-mark { color:rgba(180,140,0,0.9); }
.att-holiday.att-dot { background:rgba(255,214,0,0.6); border:1px solid rgba(180,140,0,0.4); }
.att-future { background:var(--s1); opacity:0.7; }
.att-today { outline:2px solid var(--primary-light); outline-offset:1px; }
.att-edit-btn {
  display:none; position:absolute; bottom:3px; right:3px;
  font-size:11px; cursor:pointer; color:var(--text-muted);
  background:var(--s2); border-radius:4px; padding:1px 4px;
}
.att-cal-day:hover .att-edit-btn { display:block; }
.att-dot {
  display:inline-block; width:10px; height:10px; border-radius:50%; margin-right:4px;
}
.att-present.att-dot, .att-dot.att-present { background:#30d158; }
.att-half.att-dot, .att-dot.att-half { background:#ffaa00; }
.att-absent.att-dot, .att-dot.att-absent { background:#ff453a; }
.att-holiday.att-dot { background:var(--s2); border:1px solid var(--border); }

/* ── Cash Advance Cards ─────────────────────── */
.ca-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px; margin-bottom: 14px;
}
.ca-card-header { display:flex; align-items:center; gap:10px; margin-bottom:12px; flex-wrap:wrap; }
.ca-card-name { flex:1; font-weight:600; font-size:14px; }
.ca-amount { font-size:22px; font-weight:800; color:var(--text); }
.ca-card-body { display:flex; flex-direction:column; gap:6px; }
.ca-detail { display:flex; justify-content:space-between; font-size:13px; color:var(--text); }
.ca-detail span:first-child { color:var(--text-muted); }
.ca-card-actions { display:flex; gap:8px; margin-top:12px; padding-top:12px; border-top:1px solid var(--border); }
.ca-calc-box {
  background:var(--s2); border:1.5px solid var(--border);
  border-radius:10px; padding:12px 14px; margin-bottom:8px;
  display:flex; flex-direction:column; gap:6px;
}

/* ── Company Overview ───────────────────────── */
.company-hero {
  text-align:center; padding:28px 20px 20px;
  background:var(--surface); border:1px solid var(--border);
  border-radius:16px; margin-bottom:16px;
}
.company-hero-logo { width:80px; height:80px; border-radius:50%; object-fit:cover; margin-bottom:12px; }
.company-hero-name { font-size:22px; font-weight:800; color:var(--text); margin:0 0 4px; }
.company-hero-tagline { font-size:13px; color:var(--text-muted); margin:0; }
.trademark-card { display:flex; align-items:flex-start; gap:14px; }
.trademark-icon { font-size:28px; flex-shrink:0; }
.trademark-name { font-weight:700; font-size:15px; color:var(--text); margin-bottom:4px; }
.trademark-desc { font-size:13px; color:var(--text-muted); line-height:1.5; }

/* ── Subtab bar responsive (scrolls horizontally, no wrapping needed) ── */
@media (max-width: 480px) {
  .subtab-btn { padding: 7px 10px; font-size: 12px; }
  /* .kpi-value currency-safe sizing is handled by the canonical clamp() rule
     (search ".kpi-value" → "clamp"), which correctly wins by source order. */
}

/* ── Payroll table photo ────────────────────── */
.payroll-photo { width:32px; height:32px; border-radius:50%; object-fit:cover; }


/* ── BK Quote Builder ───────────────────────────── */
.bk-line-row input[type="text"],
.bk-line-row input[type="number"],
.bk-line-row select { box-sizing: border-box; }

/* ── Stat cards (quotations summary) ──────────────── */
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px; text-align: center;
}
.stat-num  { font-size: 22px; font-weight: 800; color: var(--text); }
.stat-label{ font-size: 11px; color: var(--text-muted); margin-top: 3px; }


/* ── Bottom nav individual icon colors ──────────── */
.bottom-nav-item[data-page="dashboard"] .bn-icon svg  { stroke: #FF6B6B; }
.bottom-nav-item[data-page="tasks"]     .bn-icon svg  { stroke: #40CFFF; }
.bottom-nav-item[data-page="posts"]     .bn-icon svg  { stroke: #FF2D78; }
.bottom-nav-item[data-page="cash-advances"] .bn-icon svg { stroke: #FFD60A; }
.bottom-nav-item[data-page="personal-finance"] .bn-icon svg { stroke: #FF9F0A; }
.bottom-nav-item[data-page="approvals"] .bn-icon svg  { stroke: #FFD60A; }
.bottom-nav-item[data-page="team-directory"] .bn-icon svg { stroke: #40CFFF; }
.bottom-nav-item[data-page="attendance"] .bn-icon svg { stroke: #30D158; }
.bottom-nav-item[data-page="analytics"] .bn-icon svg  { stroke: #FF9F0A; }
.bottom-nav-item[data-page="files"]     .bn-icon svg  { stroke: #5856D6; }
.bottom-nav-item[data-page="bs-quote-builder"] .bn-icon svg { stroke: #40CFFF; }
.bottom-nav-item[data-page="bs-quotations"]    .bn-icon svg { stroke: #5856D6; }
.bottom-nav-item[data-page="bs-clients"]       .bn-icon svg { stroke: #30D158; }
.bottom-nav-item[data-page="bs-files"]         .bn-icon svg { stroke: #8B5CF6; }
/* Keep active state override */
.bottom-nav-item.active .bn-icon svg { stroke: var(--pink) !important; }

/* ── Attendance edit button — always visible for admin ── */
.att-edit-btn.att-edit-visible {
  display: block !important;
  position: absolute; bottom: 2px; right: 2px;
  font-size: 10px; cursor: pointer;
  color: #fff; background: var(--primary-light);
  border: none; border-radius: 4px;
  padding: 1px 5px; line-height: 1.4;
  opacity: 0.85;
}
.att-edit-btn.att-edit-visible:hover { opacity: 1; }


/* ── Departments grid — clickable cards ─────────── */
.dept-card-clickable { transition: transform var(--t1), box-shadow var(--t1); }
.dept-card-clickable:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(0,0,0,.18); }
.dept-subtabs-preview { display:flex; flex-wrap:wrap; gap:5px; margin:8px 0 6px; }
.dept-subtab-chip {
  font-size:10px; padding:2px 8px;
  background:var(--s2); border:1px solid var(--border);
  border-radius:6px; color:var(--text-muted);
}
.dept-open-hint { font-size:11px; color:var(--primary-light); margin-top:4px; font-weight:600; }
.dept-icon-large { font-size:36px; line-height:1; margin-bottom:4px; }

/* Dept quick-tab buttons on employee dashboard */
.dept-quick-tab {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 10px;
  background: var(--s2); border: 1.5px solid var(--border);
  color: var(--text); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all var(--t1);
}
.dept-quick-tab:hover { background: var(--s3); border-color: var(--primary-light); transform: translateY(-1px); }


/* ── Remember me / Guest save row ──────────────── */
.remember-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-muted);
  cursor: pointer; margin-bottom: 14px;
  user-select: none;
}
.remember-row input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--primary-light); cursor: pointer;
}


/* ═══════════════════════════════════════════════════════════
   LIQUID GLASS — Design Layer v1
   Apple-inspired frosted glass surfaces with specular edge
   lighting, deep saturation blur, and iridescent accents.
   Written as cascade overrides — all prior rules still apply.
═══════════════════════════════════════════════════════════ */

/* ── Glass design tokens ── */
:root {
  --glass-blur:      blur(28px) saturate(160%) brightness(1.06);
  --glass-blur-sm:   blur(16px) saturate(140%) brightness(1.04);
  --glass-blur-lg:   blur(44px) saturate(180%) brightness(1.08);
  --glass-surface:   rgba(255,255,255,0.072);
  --glass-surface-2: rgba(255,255,255,0.110);
  --glass-border:    rgba(255,255,255,0.145);
  --glass-border-sm: rgba(255,255,255,0.095);
  /* Specular edge lighting — top bright / bottom dark / side subtle */
  --glass-spec:    inset 0 1px 0 rgba(255,255,255,0.18),
                   inset 0 -1px 0 rgba(0,0,0,0.12),
                   inset 1px 0 0 rgba(255,255,255,0.07),
                   inset -1px 0 0 rgba(0,0,0,0.06);
  --glass-spec-sm: inset 0 1px 0 rgba(255,255,255,0.13),
                   inset 0 -1px 0 rgba(0,0,0,0.09);
  --glass-shadow:    0 8px 32px rgba(0,0,0,0.38), 0 2px 8px rgba(0,0,0,0.22);
  --glass-shadow-lg: 0 22px 64px rgba(0,0,0,0.58), 0 4px 16px rgba(0,0,0,0.28);
}

/* ── Liquid glass animations ── */
@keyframes iridescent {
  0%,100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
@keyframes glassBreath {
  0%,100% { opacity: 0.80; }
  50%     { opacity: 1; }
}

/* ══════ BODY — richer ambient light field ══════ */
body::before {
  background:
    radial-gradient(ellipse 80% 70% at 8%  15%, rgba(255,45,120,0.18) 0%, transparent 62%),
    radial-gradient(ellipse 70% 60% at 92% 85%, rgba(10,132,255,0.16) 0%, transparent 62%),
    radial-gradient(ellipse 55% 55% at 52% 42%, rgba(255,214,10,0.09) 0%, transparent 60%),
    radial-gradient(ellipse 90% 90% at 50% 100%,rgba(139,92,246,0.10) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 85% 20%, rgba(0,212,170,0.07) 0%, transparent 60%);
  background-size: 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%;
}

/* ══════ TOPBAR ══════ */
.topbar {
  background: rgba(7,7,16,0.58);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border-sm);
  box-shadow: var(--glass-spec-sm), 0 1px 28px rgba(0,0,0,0.35);
}
.topbar::after {
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255,45,120,0.55) 15%,
    rgba(10,132,255,0.55) 40%,
    rgba(0,212,170,0.45) 62%,
    rgba(255,214,10,0.50) 82%,
    transparent 100%);
  background-size: 200% 100%;
  animation: iridescent 6s ease infinite;
  opacity: 0.55; height: 1px;
}

/* ══════ SIDEBAR ══════ */
#sidebar {
  background: rgba(7,7,16,0.52);
  backdrop-filter: var(--glass-blur-lg);
  -webkit-backdrop-filter: var(--glass-blur-lg);
  border-right: 1px solid var(--glass-border-sm);
  box-shadow: var(--glass-spec-sm), 4px 0 28px rgba(0,0,0,0.22);
}
#sidebar::before {
  background: linear-gradient(180deg,
    rgba(255,45,120,0.45) 0%,
    rgba(10,132,255,0.38) 48%,
    rgba(255,214,10,0.32) 100%);
  opacity: 0.55; width: 1.5px;
}

/* ══════ NOTIFICATION PANEL ══════ */
.notif-panel {
  background: rgba(9,9,20,0.52);
  backdrop-filter: var(--glass-blur-lg);
  -webkit-backdrop-filter: var(--glass-blur-lg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow-lg), var(--glass-spec);
}
.notif-panel-header {
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--glass-border-sm);
}

/* ══════ CARDS ══════ */
.card {
  background: var(--glass-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow), var(--glass-spec);
}
.card:hover {
  border-color: rgba(255,255,255,0.20);
  box-shadow: 0 14px 44px rgba(0,0,0,0.50), var(--glass-spec);
  transform: translateY(-1px);
}
/* Replace gradient-card interior with specular top sheen */
.card::before {
  background: linear-gradient(180deg,
    rgba(255,255,255,0.09) 0%,
    rgba(255,255,255,0.02) 42%,
    transparent 100%);
}
.card-header {
  background: rgba(255,255,255,0.025);
  border-bottom: 1px solid var(--glass-border-sm);
}

/* ══════ KPI CARDS ══════ */
.kpi-card {
  background: var(--glass-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow), var(--glass-spec-sm);
}
.kpi-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255,255,255,0.22);
  box-shadow: 0 18px 48px rgba(0,0,0,0.52), var(--glass-spec-sm);
}
/* Replace old shimmer pseudo with specular top sheen */
.kpi-card::before {
  background: linear-gradient(180deg,
    rgba(255,255,255,0.11) 0%,
    rgba(255,255,255,0.03) 38%,
    transparent 100%);
  transform: none !important; animation: none !important;
  pointer-events: none; width: 100%;
}
.kpi-card:hover::before { animation: none !important; }

/* ══════ MODAL ══════ */
.modal-overlay {
  background: rgba(0,0,0,0.52);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
}
.modal-box {
  background: rgba(9,9,20,0.50);
  backdrop-filter: var(--glass-blur-lg);
  -webkit-backdrop-filter: var(--glass-blur-lg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow-lg), var(--glass-spec),
    0 0 0 1px rgba(255,45,120,0.10);
}
.modal-box::before {
  background: linear-gradient(90deg,
    transparent,
    rgba(255,45,120,0.60),
    rgba(10,132,255,0.52),
    rgba(255,214,10,0.48),
    transparent);
  background-size: 200% 100%;
  animation: iridescent 5s ease infinite;
  opacity: 0.75; height: 1px;
}
.modal-header {
  background: rgba(255,255,255,0.025);
  border-bottom: 1px solid var(--glass-border-sm);
}
.modal-footer {
  background: rgba(255,255,255,0.015);
  border-top: 1px solid var(--glass-border-sm);
}
.modal-close {
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--glass-border-sm);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.modal-close:hover { background: rgba(255,255,255,0.13); }

/* ══════ DRAWER ══════ */
.drawer {
  background: rgba(8,8,20,0.50);
  backdrop-filter: var(--glass-blur-lg);
  -webkit-backdrop-filter: var(--glass-blur-lg);
  border-left: 1px solid var(--glass-border);
  box-shadow: -14px 0 64px rgba(0,0,0,0.62), var(--glass-spec-sm);
}
.drawer-header {
  background: rgba(255,255,255,0.025);
  border-bottom: 1px solid var(--glass-border-sm);
}

/* ══════ SUBTAB BAR ══════ */
.subtab-bar {
  background: rgba(255,255,255,0.045);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  border: 1px solid var(--glass-border-sm);
  box-shadow: var(--glass-spec-sm), 0 2px 14px rgba(0,0,0,0.22);
}
.subtab-btn.active {
  box-shadow: 0 2px 18px rgba(255,45,120,0.40),
    inset 0 1px 0 rgba(255,255,255,0.24),
    inset 0 -1px 0 rgba(0,0,0,0.12);
  text-shadow: 0 1px 6px rgba(255,45,120,0.45);
}
.subtab-btn:hover:not(.active) {
  background: rgba(255,255,255,0.07);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}

/* ══════ ITEM CARDS (tasks, list items) ══════ */
.item-card {
  background: var(--glass-surface);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  border: 1px solid var(--glass-border-sm);
  box-shadow: var(--glass-spec-sm), 0 2px 10px rgba(0,0,0,0.20);
}
.item-card:hover {
  background: var(--glass-surface-2);
  border-color: rgba(255,255,255,0.18);
  box-shadow: 0 10px 32px rgba(0,0,0,0.38), var(--glass-spec-sm);
}
.item-card::before {
  background: linear-gradient(180deg,
    rgba(255,255,255,0.07) 0%, transparent 55%);
  transform: none !important; animation: none !important;
  pointer-events: none !important; /* this override cancels the off-screen transform, so it must also stay non-interactive or it blocks every click on the card */
}
.item-card:hover::before { animation: none !important; }

/* ══════ BOTTOM NAV ══════ */
.bottom-nav {
  background: rgba(7,7,16,0.46);
  backdrop-filter: var(--glass-blur-lg);
  -webkit-backdrop-filter: var(--glass-blur-lg);
  border-top: 1px solid var(--glass-border-sm);
  box-shadow: var(--glass-spec-sm), 0 -4px 28px rgba(0,0,0,0.32);
}
.bottom-nav::before {
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255,45,120,0.50) 20%,
    rgba(10,132,255,0.45) 50%,
    rgba(255,214,10,0.42) 80%,
    transparent 100%);
  background-size: 200% 100%;
  animation: iridescent 7s ease infinite;
  opacity: 0.50;
}

/* ══════ FORM INPUTS — frosted glass ══════ */
.form-group input,
.form-group textarea,
.form-group select {
  background: rgba(255,255,255,0.055);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  border: 1px solid var(--glass-border-sm);
  box-shadow: var(--glass-spec-sm), inset 0 2px 8px rgba(0,0,0,0.18);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  background: rgba(255,255,255,0.082);
  border-color: rgba(255,45,120,0.55);
  box-shadow: 0 0 0 3px rgba(255,45,120,0.14),
    var(--glass-spec-sm), inset 0 2px 8px rgba(0,0,0,0.10);
}

/* ══════ BUTTONS ══════ */
.btn-secondary {
  background: rgba(255,255,255,0.065);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  border: 1px solid var(--glass-border-sm);
  box-shadow: var(--glass-spec-sm), 0 2px 8px rgba(0,0,0,0.18);
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.20);
  box-shadow: var(--glass-spec-sm), 0 4px 18px rgba(0,0,0,0.28);
}
/* Reusable glass outline variant */
.btn-outline {
  background: rgba(255,255,255,0.055);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border-sm);
  box-shadow: var(--glass-spec-sm);
  color: var(--text-2); border-radius: var(--r-sm);
  padding: 9px 16px; font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background var(--t1), border-color var(--t1), box-shadow var(--t1), color var(--t1);
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-outline:hover {
  background: rgba(255,255,255,0.092);
  border-color: rgba(255,255,255,0.20); color: var(--text);
  box-shadow: var(--glass-spec-sm), 0 4px 16px rgba(0,0,0,0.25);
}
.btn-outline.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: var(--r-xs); }

/* ══════ ALERT BANNERS ══════ */
.alert-banner {
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  box-shadow: var(--glass-spec-sm), 0 4px 18px rgba(0,0,0,0.24);
}
.alert-warn {
  background: rgba(255,170,0,0.08);
  border-color: rgba(255,170,0,0.24);
  box-shadow: 0 0 22px rgba(255,170,0,0.08), var(--glass-spec-sm);
}
.alert-danger {
  background: rgba(255,69,58,0.08);
  border-color: rgba(255,69,58,0.24);
  box-shadow: 0 0 22px rgba(255,69,58,0.08), var(--glass-spec-sm);
}

/* ══════ LOGIN CARD ══════ */
.login-container {
  background: rgba(10,10,22,0.50);
  backdrop-filter: var(--glass-blur-lg);
  -webkit-backdrop-filter: var(--glass-blur-lg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow-lg), var(--glass-spec),
    0 0 0 1px rgba(255,214,10,0.12);
}
.login-container::before {
  background: linear-gradient(90deg,
    transparent,
    rgba(255,45,120,0.62),
    rgba(10,132,255,0.52),
    rgba(255,214,10,0.55),
    transparent);
  background-size: 200% 100%;
  animation: iridescent 5s ease infinite;
  opacity: 0.80; height: 1.5px;
}

/* ══════ LOGIN ROLE CARDS ══════ */
.login-role-card {
  background: rgba(255,255,255,0.055);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  border: 1px solid var(--glass-border-sm);
  box-shadow: var(--glass-spec-sm), 0 2px 10px rgba(0,0,0,0.24);
}
.login-role-card:hover {
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.22);
  box-shadow: var(--glass-spec-sm), 0 6px 28px rgba(0,0,0,0.36);
  transform: translateX(4px);
}

/* ══════ QUICK ACTION BUTTONS ══════ */
.quick-action-btn {
  background: var(--glass-surface);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  border: 1px solid var(--glass-border-sm);
  box-shadow: var(--glass-spec-sm), 0 2px 10px rgba(0,0,0,0.20);
}
.quick-action-btn:hover {
  background: var(--glass-surface-2);
  border-color: rgba(255,255,255,0.18);
  box-shadow: var(--glass-spec-sm), 0 6px 22px rgba(0,0,0,0.32);
}

/* ══════ DEPT CARDS ══════ */
.dept-card {
  background: var(--glass-surface);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  border: 1px solid var(--glass-border-sm);
  box-shadow: var(--glass-spec-sm), 0 2px 14px rgba(0,0,0,0.22);
}
.dept-card:hover {
  border-color: rgba(255,255,255,0.18);
  box-shadow: 0 12px 40px rgba(0,0,0,0.44), var(--glass-spec-sm),
    0 0 28px rgba(255,45,120,0.08);
}

/* ══════ POLICY CARDS ══════ */
.policy-card {
  background: var(--glass-surface);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  border: 1px solid var(--glass-border-sm);
  box-shadow: var(--glass-spec-sm), 0 2px 12px rgba(0,0,0,0.20);
}
.policy-card:hover {
  border-color: rgba(255,255,255,0.18);
  box-shadow: 0 12px 38px rgba(0,0,0,0.42), var(--glass-spec-sm);
}

/* ══════ DATA TABLE HEADER ══════ */
.data-table th {
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--glass-border-sm);
}

/* ══════ UPLOAD AREA ══════ */
.upload-area {
  background: rgba(255,255,255,0.03);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  border: 2px dashed rgba(255,255,255,0.12);
}
.upload-area:hover, .upload-area.drag-over {
  background: rgba(255,45,120,0.06);
  border-color: rgba(255,45,120,0.42);
  box-shadow: 0 0 28px rgba(255,45,120,0.10);
}

/* ══════ SIDEBAR OVERLAY ══════ */
.sidebar-overlay {
  backdrop-filter: blur(8px) brightness(0.68);
  -webkit-backdrop-filter: blur(8px) brightness(0.68);
}

/* ══════ LIGHT MODE GLASS TINTS ══════ */
html.light .topbar, html.theme-pink .topbar, html.theme-grey .topbar { background: rgba(248,248,252,0.70); }
html.light #sidebar, html.theme-pink #sidebar, html.theme-grey #sidebar { background: rgba(248,248,252,0.76); }
html.light .modal-box, html.theme-pink .modal-box, html.theme-grey .modal-box { background: rgba(250,250,254,0.78); }
html.light .drawer, html.theme-pink .drawer, html.theme-grey .drawer { background: rgba(250,250,254,0.78); }
html.light .notif-panel, html.theme-pink .notif-panel, html.theme-grey .notif-panel { background: rgba(246,246,252,0.78); }
html.light .bottom-nav, html.theme-pink .bottom-nav, html.theme-grey .bottom-nav { background: rgba(248,248,252,0.76); }
html.light .login-container, html.theme-pink .login-container, html.theme-grey .login-container { background: rgba(255,255,255,0.74); border-color: rgba(0,0,0,0.10); }
html.light .card, html.theme-pink .card, html.theme-grey .card { background: rgba(255,255,255,0.60); border-color: rgba(0,0,0,0.08);
                            box-shadow: 0 4px 20px rgba(0,0,0,0.10), inset 0 1px 0 rgba(255,255,255,0.90); }
html.light .kpi-card, html.theme-pink .kpi-card, html.theme-grey .kpi-card { background: rgba(255,255,255,0.72); border-color: rgba(0,0,0,0.08); box-shadow: var(--sh-sm); }
html.light .kpi-card:hover, html.theme-pink .kpi-card:hover, html.theme-grey .kpi-card:hover { box-shadow: var(--sh-md); }
html.light .item-card, html.theme-pink .item-card, html.theme-grey .item-card { background: rgba(255,255,255,0.56); border-color: rgba(0,0,0,0.08); }
html.light .subtab-bar, html.theme-pink .subtab-bar, html.theme-grey .subtab-bar { background: rgba(0,0,0,0.04);       border-color: rgba(0,0,0,0.08); }
html.light .login-role-card, html.theme-pink .login-role-card, html.theme-grey .login-role-card { background: rgba(255,255,255,0.55); border-color: rgba(0,0,0,0.08); }
html.light .btn-secondary, html.theme-pink .btn-secondary, html.theme-grey .btn-secondary { background: rgba(0,0,0,0.04);       border-color: rgba(0,0,0,0.10); }
/* Tinted action buttons: the dark-theme light-green / light-red text is
   unreadable on a pale tint in light mode — use darker, WCAG-legible ink. */
html.light .btn-success, html.theme-pink .btn-success, html.theme-grey .btn-success { background: rgba(16,124,65,0.10); color: #0E6B33; border-color: rgba(16,124,65,0.32); }
html.light .btn-success:hover, html.theme-pink .btn-success:hover, html.theme-grey .btn-success:hover { background: rgba(16,124,65,0.18); }
html.light .btn-danger, html.theme-pink .btn-danger, html.theme-grey .btn-danger { background: rgba(200,32,26,0.09); color: #B42318; border-color: rgba(200,32,26,0.30); }
html.light .btn-danger:hover, html.theme-pink .btn-danger:hover, html.theme-grey .btn-danger:hover { background: rgba(200,32,26,0.16); }
/* btn-link on light: light-blue is too faint on white — use the brand accent. */
html.light .btn-link, html.theme-pink .btn-link, html.theme-grey .btn-link { color: var(--primary); }
html.light .quick-action-btn, html.theme-pink .quick-action-btn, html.theme-grey .quick-action-btn { background: rgba(255,255,255,0.55); border-color: rgba(0,0,0,0.09); }
html.light .dept-card, html.theme-pink .dept-card, html.theme-grey .dept-card { background: rgba(255,255,255,0.55); border-color: rgba(0,0,0,0.08); }
html.light .policy-card, html.theme-pink .policy-card, html.theme-grey .policy-card { background: rgba(255,255,255,0.55); border-color: rgba(0,0,0,0.08); }
html.light .form-group input, html.theme-pink .form-group input, html.theme-grey .form-group input,
html.light html.light, html.theme-pink html.light, html.theme-grey html.light,
html.light html.theme-pink, html.theme-pink html.theme-pink, html.theme-grey html.theme-pink,
html.light html.theme-grey .form-group textarea, html.theme-pink html.theme-grey .form-group textarea, html.theme-grey html.theme-grey .form-group textarea,
html.light html.light, html.theme-pink html.light, html.theme-grey html.light,
html.light html.theme-pink, html.theme-pink html.theme-pink, html.theme-grey html.theme-pink,
html.light html.theme-grey .form-group select, html.theme-pink html.theme-grey .form-group select, html.theme-grey html.theme-grey .form-group select {
  background: rgba(255,255,255,0.65); border-color: rgba(0,0,0,0.12);
  box-shadow: inset 0 1px 4px rgba(0,0,0,0.06);
}

/* ── Messenger-style chat UI ──────────────────────── */
.messenger-wrap {
  display: flex; flex-direction: column;
  border: 1.5px solid var(--border); border-radius: 16px;
  overflow: hidden; background: var(--surface);
  margin-top: 12px;
}
.messenger-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  background: var(--surface2); font-size: 13px;
}
.messenger-body {
  flex: 1; overflow-y: auto; padding: 16px 12px;
  display: flex; flex-direction: column; gap: 10px;
  max-height: 380px; min-height: 120px;
  background: var(--bg);
}
.messenger-empty {
  text-align: center; font-size: 13px; color: var(--text-muted);
  padding: 32px 16px;
}
.ms-row {
  display: flex; align-items: flex-end; gap: 8px; max-width: 88%;
}
.ms-row-mine  { align-self: flex-end;  flex-direction: row-reverse; }
.ms-row-theirs { align-self: flex-start; }
.ms-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary-light); color: #fff;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ms-avatar-mine { background: var(--primary); }
.ms-bubble-wrap { display: flex; flex-direction: column; gap: 3px; min-width: 0; max-width: 100%; }
.ms-row-mine .ms-bubble-wrap { align-items: flex-end; }
.ms-name { font-size: 10px; color: var(--text-muted); font-weight: 600; padding: 0 4px; }
.ms-bubble {
  padding: 9px 13px; border-radius: 18px;
  max-width: 100%; word-break: break-word; overflow-wrap: anywhere;
}
.ms-bubble-mine {
  background: var(--primary); color: #fff;
  border-bottom-right-radius: 4px;
}
.ms-bubble-theirs {
  background: var(--surface2); color: var(--text);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border);
}
.ms-text { font-size: 13px; line-height: 1.5; }
.ms-meta { display: flex; gap: 5px; align-items: center; margin-top: 4px; }
.ms-time { font-size: 10px; opacity: .65; }
.ms-edited { font-size: 10px; opacity: .55; font-style: italic; }
.ms-file-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; text-decoration: none;
  background: rgba(0,0,0,0.12); color: inherit;
  padding: 4px 10px; border-radius: 20px; margin-top: 5px;
}
.ms-bubble-theirs .ms-file-chip { background: var(--surface); color: var(--primary-light); }
.ms-actions {
  display: none; gap: 4px; padding: 0 2px;
}
.ms-row:hover .ms-actions { display: flex; }
.ms-act-btn {
  background: none; border: none; cursor: pointer; padding: 2px 5px;
  font-size: 12px; color: var(--text-muted); border-radius: 6px;
  transition: background .15s;
}
.ms-act-btn:hover { background: var(--surface2); color: var(--text); }
.ms-del-btn:hover { color: var(--danger); }
.ms-seen {
  font-size: 10px; color: var(--text-muted); margin-top: 2px;
  display: flex; align-items: center; gap: 4px;
}
.ms-seen::before { content: '✓✓'; font-size: 11px; color: var(--primary-light); }
.messenger-input-row {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-top: 1px solid var(--border);
  background: var(--surface2);
}
.ms-attach-btn {
  cursor: pointer; font-size: 18px; line-height: 1;
  padding: 6px; border-radius: 50%; transition: background .15s;
}
.ms-attach-btn:hover { background: var(--surface); }
.ms-input {
  flex: 1; border: 1.5px solid var(--border); border-radius: 24px;
  padding: 9px 16px; background: var(--surface); color: var(--text);
  font-size: 13px; outline: none; transition: border-color .2s;
}
.ms-input:focus { border-color: var(--primary-light); }
.ms-send-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); color: #fff; border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; transition: background .15s, transform .1s;
}
.ms-send-btn:hover { background: var(--primary-light); transform: scale(1.06); }
.ms-send-btn:disabled { opacity: .5; }

/* light mode overrides */
html.light .ms-bubble-theirs, html.theme-pink .ms-bubble-theirs, html.theme-grey .ms-bubble-theirs { background: #f0f0f5; border-color: #ddd; }
html.light .messenger-body, html.theme-pink .messenger-body, html.theme-grey .messenger-body { background: #f8f8fc; }
html.light .ms-input, html.theme-pink .ms-input, html.theme-grey .ms-input { background: #fff; }

/* ── Task fullscreen panel messenger fills height ── */
#task-fullscreen-panel .messenger-wrap {
  flex: 1; margin-top: 0; border-radius: 0; border: none;
  overflow: hidden; display: flex; flex-direction: column;
}
#task-fullscreen-panel .messenger-body {
  max-height: none; flex: 1;
}
#task-fullscreen-panel #task-comments-wrap {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════
   iOS DESIGN OVERHAUL — v1
   Large titles · Spring easing · Grouped surfaces · Inset lists
   Appended as cascade layer — overrides prior rules on cascade.
═══════════════════════════════════════════════════════════ */

/* ── iOS motion tokens ── */
:root {
  --ios-spring:     cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ios-spring-out: cubic-bezier(0.34, 1.28, 0.64, 1);
  --ios-enter:      cubic-bezier(0.36, 0.66, 0.04, 1);
  /* Override default ease with iOS standard */
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  /* Slightly larger radii for iOS feel */
  --r:     16px;
  --r-sm:  12px;
  --r-lg:  20px;
  --r-xl:  26px;
}

/* ── Large Title Page Headers ── */
.page-header {
  padding: 6px 0 8px;
  margin-bottom: 18px;
}
.page-header h2 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.7px;
  line-height: 1.12;
  color: var(--text);
}

@media (max-width: 768px) {
  .page-header h2 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.1;
  }
  .page-header {
    margin-bottom: 20px;
    padding: 8px 0 4px;
  }
}

/* ── Task feed — inset separators (not full-width) ── */
.task-feed-item {
  padding: 13px 16px;
  border-bottom: none;
  position: relative;
  transition: background 120ms var(--ios-spring);
}
.task-feed-item::after {
  content: '';
  position: absolute;
  bottom: 0; left: 52px; right: 0;
  height: 0.5px;
  background: var(--border);
}
.task-feed-item:last-child::after { display: none; }
.task-feed-item:active { background: var(--s2); }

/* ── Top nav strip — iOS tab bar feel ── */
.top-nav-strip {
  background: rgba(7,7,16,0.88);
  backdrop-filter: blur(32px) saturate(160%);
  -webkit-backdrop-filter: blur(32px) saturate(160%);
  border-bottom: 0.5px solid rgba(255,255,255,0.09);
  height: 50px;
  padding: 0 6px;
  gap: 0;
}
.top-nav-item {
  padding: 6px 11px;
  border-radius: 10px;
  gap: 3px;
  min-height: 44px;
  transition: color 160ms var(--ios-spring), background 160ms var(--ios-spring);
}
.top-nav-item .bn-icon { font-size: 20px; }
.top-nav-item .tn-label { font-size: 11px; font-weight: 600; letter-spacing: -0.1px; }
.top-nav-item.active {
  color: var(--pink);
  background: rgba(255,45,120,0.10);
}
.top-nav-item.active .bn-icon {
  transform: scale(1.10);
  filter: drop-shadow(0 0 5px rgba(255,45,120,0.50));
}

/* ── Bottom sheet modal on mobile ── */
@keyframes sheetRise {
  from { transform: translateY(60px); opacity: 0.7; }
  to   { transform: translateY(0);    opacity: 1; }
}
@media (max-width: 768px) {
  .modal-overlay {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  .modal-box {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 92dvh !important;
    border-radius: 22px 22px 0 0 !important;
    margin: 0 !important;
    align-self: flex-end !important;
    animation: sheetRise 0.36s var(--ios-spring) both !important;
  }
  /* Pull handle */
  .modal-box::after {
    content: '';
    position: absolute; top: 8px; left: 50%;
    transform: translateX(-50%);
    width: 36px; height: 4px; border-radius: 2px;
    background: rgba(255,255,255,0.20);
    z-index: 10; pointer-events: none;
  }
  .modal-header {
    padding-top: 26px;
  }
}

/* ── Sidebar nav items — iOS Settings style ── */
.nav-item {
  padding: 11px 14px;
  border-radius: 10px;
  margin: 1px 8px;
  width: calc(100% - 16px);
  font-size: 14px;
  font-weight: 500;
  min-height: 44px;
  transition: background 160ms var(--ios-spring), color 160ms var(--ios-spring);
}
/* Remove right-edge bar indicator; use background instead */
.nav-item.active::after { display: none; }
.nav-item.active {
  background: rgba(255,45,120,0.12);
  color: var(--pink);
  font-weight: 600;
}
.nav-item:hover {
  background: rgba(255,255,255,0.07);
}

/* ── Back buttons — iOS text+chevron style ── */
.drawer-back-btn {
  background: none;
  border: none;
  box-shadow: none;
  color: var(--blue-2);
  padding: 8px 6px;
  font-size: 16px;
  font-weight: 500;
  border-radius: var(--r-sm);
}
.drawer-back-btn:hover {
  background: rgba(10,132,255,0.10);
  color: var(--blue);
  box-shadow: none;
  transform: none;
}
.drawer-back-btn:active { transform: scale(0.96) !important; }
.drawer-back-btn svg { width: 16px; height: 16px; }

/* ── Haptic-feel button press ── */
.btn-primary:active    { transform: scale(0.96) !important; transition-duration: 70ms !important; }
.btn-secondary:active  { transform: scale(0.96) !important; transition-duration: 70ms !important; }
.btn-danger:active     { transform: scale(0.96) !important; transition-duration: 70ms !important; }
.btn-success:active    { transform: scale(0.96) !important; transition-duration: 70ms !important; }
.login-role-card:active { transform: scale(0.97) !important; transition-duration: 70ms !important; }
.quick-action-btn:active { background: var(--s3) !important; transform: scale(0.99) !important; }

/* ── KPI cards — cleaner feel ── */
.kpi-value {
  /* Responsive: 28px on desktop, scales down on phones so large peso figures
     (6-7 digits) don't clip in half-width cards. tabular-nums keeps alignment. */
  font-size: clamp(15px, 4.6vw, 28px);
  font-weight: 800;
  letter-spacing: -0.6px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.kpi-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* ── Card headers ── */
.card-header h3 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

/* ── Notification items — more iOS-spacious ── */
.notif-item {
  padding: 13px 16px;
}
.notif-item-title { font-size: 14px; font-weight: 600; }
.notif-item-body  { font-size: 13px; }
.notif-item-time  { font-size: 11px; }
.notif-item:active { background: var(--s2); transition: background 80ms; }

/* ── Springy bottom nav pill ── */
.bottom-nav {
  border-radius: 24px;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  height: 58px;
  min-width: 250px;
  padding: 0 10px;
}
.bottom-nav-item .bn-icon { font-size: 24px; }
.bottom-nav-item .bn-icon svg { width: 24px; height: 24px; }
.bottom-nav-item:active .bn-icon { transform: scale(0.88); transition-duration: 80ms; }

/* ── Subtab bar — iOS segmented control ── */
.subtab-bar {
  border-radius: 12px;
  padding: 3px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.09);
}
.subtab-btn {
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  transition: all 200ms var(--ios-spring);
}
.subtab-btn.active {
  background: rgba(255,45,120,0.18);
  color: var(--pink);
  box-shadow: 0 1px 8px rgba(255,45,120,0.22),
    inset 0 1px 0 rgba(255,255,255,0.14),
    inset 0 -1px 0 rgba(0,0,0,0.10);
}

/* ── Drawer — full-screen on mobile (iOS sheet) ── */
@media (max-width: 768px) {
  .drawer {
    top: 0;
    border-left: none;
    border-radius: 0;
    width: 100%;
    z-index: 198; /* above sidebar overlay (190) */
  }
}

/* ── Sidebar — full height on mobile, starts at top ── */
@media (max-width: 768px) {
  #sidebar {
    top: 0;
    padding-top: env(safe-area-inset-top, 0px);
  }
  /* Sidebar top section gets extra padding so avatar clears notch */
  #sidebar .sidebar-top {
    padding-top: calc(18px + env(safe-area-inset-top, 0px));
  }
}

/* ── Item cards — rounded on mobile ── */
@media (max-width: 768px) {
  .item-card { border-radius: 14px !important; }
  .kpi-card  { border-radius: 16px !important; padding: 16px 14px; }
  .card      { border-radius: 18px !important; }
}

/* PTR arc ring styles are in the PULL-TO-REFRESH block */

/* ── Item title — slightly larger ── */
.item-title { font-size: 15px; font-weight: 600; }

/* ── Badge — iOS red dot style ── */
.nav-badge {
  background: #FF3B30;
  min-width: 18px; height: 18px;
  font-size: 11px; padding: 0 5px;
  border-radius: var(--pill);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 6px rgba(255,59,48,0.50);
}

/* ── Mobile padding refinements ── */
@media (max-width: 768px) {
  .main-content {
    padding: 16px;
    padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
  }
  .kpi-row { gap: 10px; }
}

/* ── Form labels — iOS style ── */
.form-group label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

/* ── Login container on mobile ── */
@media (max-width: 480px) {
  .login-container {
    padding: 36px 24px 28px;
    border-radius: 28px;
  }
}

/* ── Light mode iOS tints ── */
html.light .top-nav-strip, html.theme-pink .top-nav-strip, html.theme-grey .top-nav-strip {
  background: rgba(248,248,252,0.92);
  border-bottom-color: rgba(0,0,0,0.10);
}
html.light .top-nav-item.active, html.theme-pink .top-nav-item.active, html.theme-grey .top-nav-item.active {
  color: var(--pink);
  background: rgba(255,45,120,0.07);
}
html.light .nav-item.active, html.theme-pink .nav-item.active, html.theme-grey .nav-item.active {
  background: rgba(255,45,120,0.08);
  color: var(--pink);
}
html.light .nav-item:hover, html.theme-pink .nav-item:hover, html.theme-grey .nav-item:hover { background: rgba(0,0,0,0.05); }
html.light .bottom-nav, html.theme-pink .bottom-nav, html.theme-grey .bottom-nav { border-radius: 24px; }
html.light .modal-box::after, html.theme-pink .modal-box::after, html.theme-grey .modal-box::after { background: rgba(0,0,0,0.18); }
html.light .subtab-btn.active, html.theme-pink .subtab-btn.active, html.theme-grey .subtab-btn.active { background: rgba(255,45,120,0.10); }

/* ══════════════════════════════════════════
   TASK 4 — Splash + Topbar Logo + Light Mode
══════════════════════════════════════════ */

/* ── Splash: circle logo + spinning ring ── */
#splash-screen {
  background: #070710 !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Entrance */
.splash-inner {
  animation: splashEnter 0.55s cubic-bezier(0.34,1.18,0.64,1) both;
}
@keyframes splashEnter {
  from { opacity: 0; transform: scale(0.78) translateY(14px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}

/* Ring wrapper */
.splash-logo-ring {
  position: relative;
  width: 120px; height: 120px;
  margin-bottom: 24px;
}
.splash-ring-svg {
  position: absolute;
  inset: 0;
  width: 120px; height: 120px;
  animation: ringRotate 1.6s linear infinite;
  transform-origin: center;
}
@keyframes ringRotate {
  to { transform: rotate(360deg); }
}
.splash-ring-track {
  fill: none;
  stroke: rgba(255,255,255,0.07);
  stroke-width: 3;
}
.splash-ring-arc {
  fill: none;
  stroke: var(--primary-light, #6C8EF5);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 339.3;   /* 2π × 54 */
  stroke-dashoffset: 254.5;  /* shows ≈25% arc */
  opacity: 0.85;
}

/* Circular logo */
.splash-logo-circle {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(108,142,245,0.10);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 28px rgba(108,142,245,0.28);
}
.splash-logo {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Loading bar */
.splash-bar {
  width: 120px; height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
}
.splash-bar::after {
  background: linear-gradient(90deg, transparent 0%, var(--primary-light) 50%, transparent 100%);
  animation: splashBarRun 1.4s ease-in-out infinite;
}

/* old single-line wordmark — replaced by stack below */
.splash-wordmark { display: none; }

/* New two-line wordmark */
.splash-wordmark-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 36px;
  gap: 2px;
}
.splash-word-main {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: rgba(240,240,255,0.92);
}
.splash-word-sub {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(240,240,255,0.42);
}

/* BI initials fallback */
.splash-bi-fallback {
  width: 100px; height: 100px;
  border-radius: 28px;
  background: linear-gradient(135deg, var(--primary-light), var(--pink));
  align-items: center; justify-content: center;
  font-size: 42px; font-weight: 800; color: #fff;
  letter-spacing: -2px;
  margin-bottom: 20px;
  box-shadow: 0 8px 40px rgba(108,142,245,0.50);
}
.splash-bar {
  width: 100px; height: 3px;
  background: rgba(255,255,255,0.10);
  border-radius: 2px;
}
.splash-bar::after {
  background: linear-gradient(90deg, transparent 0%, var(--primary-light) 50%, transparent 100%);
  animation: splashBarRun 1.3s ease-in-out infinite;
}

/* ── Topbar: logo area ── */
.topbar-logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.topbar-logo-card {
  width: 32px; height: 32px;
  border-radius: 9px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(108,142,245,0.15);
}
.topbar-logo-img {
  width: 32px; height: 32px;
  object-fit: contain;
}
.topbar-logo-fallback {
  width: 32px; height: 32px;
  align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800;
  color: var(--primary-light);
  letter-spacing: -0.5px;
}
.topbar-wordmark-stack {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}
.topbar-brand-main {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: rgba(255,255,255,0.95);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-brand-sub {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.40);
}

/* ── Light mode topbar text ── */
html.light .topbar, html.theme-pink .topbar, html.theme-grey .topbar { background: rgba(248,248,252,0.92); }
html.light .topbar-brand-main, html.theme-pink .topbar-brand-main, html.theme-grey .topbar-brand-main { color: rgba(0,0,0,0.85); }
html.light .topbar-brand-sub, html.theme-pink .topbar-brand-sub, html.theme-grey .topbar-brand-sub { color: rgba(0,0,0,0.38); }
html.light .topbar-logo-card, html.theme-pink .topbar-logo-card, html.theme-grey .topbar-logo-card { background: rgba(108,142,245,0.10); }
html.light .menu-toggle, html.theme-pink .menu-toggle, html.theme-grey .menu-toggle { color: var(--text-primary); }
html.light .notif-btn, html.theme-pink .notif-btn, html.theme-grey .notif-btn { color: var(--text-primary); }

/* Hide sub-label on very small screens, keep brand name */
@media (max-width: 360px) {
  .topbar-brand-sub { display: none; }
  .topbar-brand-main { font-size: 13px; }
}
html.light .drawer-back-btn:hover, html.theme-pink .drawer-back-btn:hover, html.theme-grey .drawer-back-btn:hover { background: rgba(10,132,255,0.07); }

/* ══════════════════════════════════════════
   Top Nav — equal-space tabs, no notif tab
══════════════════════════════════════════ */
.top-nav-strip {
  justify-content: space-around;
  padding: 0 4px;
  overflow-x: hidden;
}
.top-nav-item {
  flex: 1;
  justify-content: center;
  padding: 6px 4px;
  min-width: 0;
}
.top-nav-item .tn-label {
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ══════════════════════════════════════════
   Notifications — left content, centered actions
══════════════════════════════════════════ */
.notif-item {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}
.notif-item-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.notif-item-emoji { margin-top: 1px; }
.notif-item-text  { text-align: left; }
.notif-item-body  { white-space: normal; }
.notif-item-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 0.5px solid var(--border);
}
.notif-action-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  border-radius: 20px;
  padding: 5px 14px;
  height: auto;
  width: auto;
}
.notif-btn-label { font-size: 12px; font-weight: 600; }

/* ══════════════════════════════════════════
   TASK 5 — Profile Drawer Polish
══════════════════════════════════════════ */

/* ── Hero section ── */
.profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 20px 20px;
  text-align: center;
}
.profile-avatar-wrap {
  position: relative;
  width: 88px; height: 88px;
  border-radius: 50%;
  overflow: visible;
  cursor: pointer;
  margin-bottom: 14px;
}
.profile-avatar-img {
  width: 88px; height: 88px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  box-shadow: 0 4px 24px rgba(0,0,0,0.35);
}
.profile-avatar-initials {
  width: 88px; height: 88px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--primary-light), var(--pink));
  box-shadow: 0 4px 24px rgba(108,142,245,0.40);
}
.profile-avatar-edit-badge {
  position: absolute;
  bottom: 2px; right: 2px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--s2);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.profile-avatar-edit-badge svg {
  width: 13px; height: 13px;
  stroke: var(--text-muted);
  fill: none; stroke-width: 2;
}
.profile-hero-name {
  font-size: 22px; font-weight: 700; letter-spacing: -0.4px;
  color: var(--text);
  margin-bottom: 4px;
}
.profile-hero-role {
  font-size: 13px; color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 4px;
}
.profile-hero-id {
  font-size: 11px; color: var(--text-muted);
  font-family: monospace;
  background: var(--s1);
  padding: 3px 10px;
  border-radius: 20px;
  margin-top: 4px;
  letter-spacing: 0.05em;
}

/* ── Section labels ── */
.profile-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 14px 20px 6px;
}

/* ── Inset grouped card ── */
.profile-inset-card {
  margin: 0 16px 4px;
  background: var(--s1);
  border-radius: 14px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.profile-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 0.5px solid var(--border);
  gap: 12px;
}
.profile-info-row.no-border { border-bottom: none; }
.pir-label {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
  flex-shrink: 0;
}
.pir-value {
  font-size: 14px;
  color: var(--text-muted);
  text-align: right;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pir-mono { font-family: monospace; font-size: 12px; }
.pir-phone { font-size: 14px; display: flex; align-items: center; }

/* ── Editable row ── */
.profile-row-edit {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
}
.profile-inline-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--text);
  min-width: 0;
}
.profile-inline-input::placeholder { color: var(--text-muted); }

/* ── Sign out ── */
.profile-signout-btn {
  width: calc(100% - 32px);
  margin: 16px 16px 0;
  display: block;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 14px;
}

/* ── Notification toggle switch ── */
.notif-toggle-wrap {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  cursor: pointer;
}
.notif-toggle-wrap input { opacity: 0; width: 0; height: 0; position: absolute; }
.notif-toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.15);
  border-radius: 26px;
  transition: background .2s;
}
.notif-toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.notif-toggle-wrap input:checked + .notif-toggle-slider { background: var(--primary); }
.notif-toggle-wrap input:checked + .notif-toggle-slider::before { transform: translateX(18px); }
html.light .notif-toggle-slider, html.theme-pink .notif-toggle-slider, html.theme-grey .notif-toggle-slider { background: rgba(0,0,0,0.15); }

/* ── Touch tap-targets — comfortable hit areas on phones/tablets ──────
   Small icon/chip buttons measured under ~32px (hard to tap one-handed):
   notification Unread/Open chips, team-directory 📇/👋 buttons, attendance ✎.
   Scoped to coarse pointers so desktop density is untouched. */
@media (hover: none) and (pointer: coarse) {
  .notif-action-btn { min-height: 38px; padding: 9px 16px; }
  .team-card-btn    { min-height: 38px; min-width: 40px; padding: 8px 12px; }
  /* Attendance pencil lives in a small calendar cell — modest, cell-safe bump */
  .att-edit-btn.att-edit-visible { font-size: 12px; padding: 3px 9px; line-height: 1.5; }
}

/* ── Light mode overrides ── */
html.light .profile-inset-card, html.theme-pink .profile-inset-card, html.theme-grey .profile-inset-card { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.08); }
html.light .profile-info-row, html.theme-pink .profile-info-row, html.theme-grey .profile-info-row { border-color: rgba(0,0,0,0.07); }
html.light .profile-section-label, html.theme-pink .profile-section-label, html.theme-grey .profile-section-label { color: rgba(0,0,0,0.40); }
html.light .profile-hero-id, html.theme-pink .profile-hero-id, html.theme-grey .profile-hero-id { background: rgba(0,0,0,0.05); }

/* ══════════════════════════════════════════════════
   ACCESSIBILITY — keyboard focus visibility
   :focus-visible only, so mouse clicks don't show a ring
══════════════════════════════════════════════════ */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.nav-item:focus-visible,
.bottom-nav-item:focus-visible,
.top-nav-item:focus-visible,
.modal-close:focus-visible,
.menu-toggle:focus-visible,
.icon-btn:focus-visible,
.btn:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}
/* Drop the default UA outline on mouse focus, keep keyboard ring above */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
[role="button"]:focus:not(:focus-visible),
.nav-item:focus:not(:focus-visible),
.bottom-nav-item:focus:not(:focus-visible),
.top-nav-item:focus:not(:focus-visible),
.modal-close:focus:not(:focus-visible),
.menu-toggle:focus:not(:focus-visible),
.icon-btn:focus:not(:focus-visible) {
  outline: none;
}

/* ══════════════════════════════════════════════════
   REDUCED MOTION — neutralize decorative infinite anims
   Keep functional transitions, just make them subtle
══════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  /* Background drift / orbs */
  body::before,
  body::after,
  .login-bg::before,
  .login-bg::after {
    animation: none !important;
  }
  /* Decorative infinite loops: gradient run, gold shine, pulse, float */
  .btn-primary,
  .id-card-shine,
  [class*="float"],
  [class*="pulse"] {
    animation: none !important;
    will-change: auto !important;
  }
  /* Any element animated with the decorative keyframes */
  *,
  *::before,
  *::after {
    animation-iteration-count: 1 !important;
    animation-duration: 0.001ms !important;
    transition-duration: var(--t1) !important;
    scroll-behavior: auto !important;
  }
}
