/* Jameel Noori Nastaleeq for Urdu/Arabic script only (unicode-range): Latin text keeps the UI font,
   and the font file is only downloaded when Urdu text is shown or printed. */
@font-face {
  font-family: 'Jameel Noori Nastaleeq';
  src: url('../fonts/jameel-noori-nastaleeq.woff') format('woff');
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F;
}

/* ================= Design tokens ================= */
:root {
  --brand: #4f46e5;
  --brand-2: #7c3aed;
  --brand-3: #db2777;
  --brand-grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #db2777 120%);
  --brand-soft: rgba(79, 70, 229, .10);
  --brand-ring: rgba(79, 70, 229, .35);
  --radius: 16px;
  --radius-sm: 11px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow: 0 10px 30px -12px rgba(30, 27, 75, .18), 0 2px 6px -2px rgba(16, 24, 40, .06);
  --shadow-lg: 0 24px 50px -16px rgba(30, 27, 75, .35);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --app-bg: #f5f6fb;
  --surface: #ffffff;
  --surface-2: #f8f9fe;
  --head-bg: #f1f2fa;
  --line: #e4e6f1;
  --text-mute: #6b7280;
  --sun: #e11d48;
  --topbar-h: 64px;
  --bottomnav-h: 68px;
  --sidebar-w: 256px;
  /* attendance codes */
  --p-bg: #dcfce7; --p-fg: #166534;
  --h-bg: #fef3c7; --h-fg: #92400e;
  --l-bg: #e0f2fe; --l-fg: #075985;
  --a-bg: #ffe4e6; --a-fg: #9f1239;
  --na-line: #d6d9e8;
  --bs-primary: #4f46e5;
  --bs-primary-rgb: 79, 70, 229;
  --bs-primary-text-emphasis: #3730a3;
  --bs-primary-bg-subtle: #eef0ff;
  --bs-primary-border-subtle: #c7cbfb;
  --bs-link-color: #4f46e5;
  --bs-link-color-rgb: 79, 70, 229;
  --bs-link-hover-color: #3730a3;
  --bs-link-hover-color-rgb: 55, 48, 163;
  --bs-font-sans-serif: 'Jameel Noori Nastaleeq', 'Inter Variable', Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --bs-body-font-family: var(--bs-font-sans-serif);
  --bs-border-radius: .65rem;
  --bs-border-radius-lg: .9rem;
}
[data-bs-theme="dark"] {
  --app-bg: #0d0f16;
  --surface: #161a24;
  --surface-2: #1b2030;
  --head-bg: #1c2232;
  --line: #2a3043;
  --text-mute: #9aa3b8;
  --sun: #fb7185;
  --brand-soft: rgba(129, 140, 248, .14);
  --p-bg: rgba(34, 197, 94, .18); --p-fg: #86efac;
  --h-bg: rgba(245, 158, 11, .20); --h-fg: #fcd34d;
  --l-bg: rgba(14, 165, 233, .20); --l-fg: #7dd3fc;
  --a-bg: rgba(244, 63, 94, .20); --a-fg: #fda4af;
  --na-line: #323a50;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, .55);
  --shadow-lg: 0 24px 50px -16px rgba(0, 0, 0, .7);
  --bs-primary: #818cf8;
  --bs-primary-rgb: 129, 140, 248;
  --bs-primary-text-emphasis: #c7d2fe;
  --bs-primary-bg-subtle: rgba(129, 140, 248, .15);
  --bs-primary-border-subtle: #3c4480;
  --bs-link-color: #a5b4fc;
  --bs-link-color-rgb: 165, 180, 252;
  --bs-link-hover-color: #c7d2fe;
  --bs-link-hover-color-rgb: 199, 210, 254;
}

/* ================= Base ================= */
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--app-bg);
  background-image: radial-gradient(1200px 600px at 100% -10%, rgba(124, 58, 237, .10), transparent 60%),
                    radial-gradient(900px 500px at -10% 110%, rgba(219, 39, 119, .07), transparent 60%);
  background-attachment: fixed;
  color: var(--bs-body-color);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
/* Urdu (Nastaleeq) needs more line height and a slightly larger size to read well */
[lang="ur"] body, html[lang="ur"] body { line-height: 1.95; font-size: 1.04rem; }
[lang="ur"] .page-title { line-height: 1.7; }
[lang="ur"] .btn, [lang="ur"] .nav-link, [lang="ur"] label { line-height: 1.8; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.min-w-0 { min-width: 0; }
.tabular { font-variant-numeric: tabular-nums; }
.text-start-safe { text-align: start; }
.btn-icon {
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--bs-body-color);
  transition: transform .2s var(--ease), background-color .2s, box-shadow .2s;
}
.btn-icon:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); background: var(--surface-2); }
.btn-icon i { font-size: 1.3rem; line-height: 1; }

/* ================= Buttons ================= */
.btn { border-radius: 12px; font-weight: 600; transition: transform .18s var(--ease), box-shadow .2s, background-color .2s; }
.btn:active { transform: scale(.97); }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: #4338ca; --bs-btn-hover-border-color: #4338ca; --bs-btn-active-bg: #3730a3; box-shadow: 0 8px 18px -8px rgba(79, 70, 229, .6); }
.btn-primary:hover { box-shadow: 0 12px 24px -10px rgba(79, 70, 229, .7); }
.btn-light { --bs-btn-bg: var(--surface-2); --bs-btn-color: var(--bs-body-color); --bs-btn-border-color: var(--line); --bs-btn-hover-bg: var(--head-bg); --bs-btn-hover-color: var(--bs-body-color); --bs-btn-hover-border-color: var(--line); }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); }
.btn-grad {
  background: var(--brand-grad); border: 0; color: #fff; position: relative; overflow: hidden; isolation: isolate;
  box-shadow: 0 12px 24px -10px rgba(79, 70, 229, .65);
}
.btn-grad::after {
  content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .7s var(--ease); z-index: -1;
}
.btn-grad:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 16px 30px -10px rgba(79, 70, 229, .75); }
.btn-grad:hover::after { transform: translateX(120%); }
.btn-lang { border-radius: 999px; border: 1px solid var(--line); background: var(--surface); padding: .3rem .85rem; font-weight: 700; color: var(--brand); }
.btn-lang:hover { background: var(--brand-soft); color: var(--brand); }
.auth .btn-lang { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .28); color: #fff; }
.auth .btn-lang:hover { background: rgba(255, 255, 255, .22); color: #fff; }

/* ================= Splash ================= */
#splash { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--app-bg); z-index: 2000; }
.splash-logo { width: 84px; height: 84px; border-radius: 24px; overflow: hidden; box-shadow: var(--shadow-lg); animation: splashIn .8s var(--spring) both; }
.splash-logo img { width: 100%; height: 100%; }
.splash-name { margin-top: 16px; font-weight: 800; font-size: 1.25rem; letter-spacing: -.01em; animation: rise .6s .15s var(--ease) both; }
.splash-bar { width: 140px; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 18px; position: relative; }
.splash-bar::after { content: ''; position: absolute; inset: 0; width: 40%; background: var(--brand-grad); border-radius: 4px; animation: slide 1.1s ease-in-out infinite; }
@keyframes splashIn { from { opacity: 0; transform: scale(.6) rotate(-8deg); } to { opacity: 1; transform: none; } }
@keyframes slide { from { transform: translateX(-110%); } to { transform: translateX(260%); } }

/* ================= Login ================= */
.auth { position: relative; min-height: 100dvh; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 24px 16px; background: #0f0c29; color: #eef2ff; }
.auth-bg { position: absolute; inset: 0; z-index: 0; }
.auth-bg .blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; animation: drift 14s ease-in-out infinite alternate; }
.auth-bg .b1 { width: 460px; height: 460px; background: #6366f1; top: -120px; inset-inline-start: -120px; }
.auth-bg .b2 { width: 380px; height: 380px; background: #db2777; bottom: -120px; inset-inline-end: -80px; animation-delay: -4s; }
.auth-bg .b3 { width: 300px; height: 300px; background: #06b6d4; top: 40%; inset-inline-start: 45%; opacity: .35; animation-delay: -8s; }
.grid-lines { position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%); }
@keyframes drift { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(40px, -30px, 0) scale(1.12); } }
.auth-inner { position: relative; z-index: 1; width: 100%; max-width: 1080px; display: grid; gap: 36px; align-items: center; }
@media (min-width: 992px) { .auth-inner { grid-template-columns: 1.15fr .85fr; } }
.auth-hero { color: #eef2ff; }
.brand-row { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.brand-mark { width: 52px; height: 52px; border-radius: 16px; overflow: hidden; box-shadow: 0 12px 30px -8px rgba(0, 0, 0, .5); flex-shrink: 0; animation: rise .7s var(--ease) both; }
.brand-mark img { width: 100%; height: 100%; }
.brand-row .name { font-weight: 800; font-size: 1.1rem; }
.brand-row .tag { font-size: .8rem; opacity: .75; }
.auth-h1 { font-size: clamp(2rem, 4.4vw, 3.2rem); font-weight: 800; line-height: 1.08; letter-spacing: -.02em; margin: 0 0 14px; animation: rise .8s .1s var(--ease) both; }
.auth-h1 .grad { background: linear-gradient(90deg, #a5b4fc, #f0abfc 60%, #fda4af); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead-sm { font-size: 1.02rem; opacity: .85; max-width: 520px; animation: rise .8s .2s var(--ease) both; }
.feature-chips { list-style: none; padding: 0; margin: 22px 0 26px; display: flex; flex-wrap: wrap; gap: 10px; animation: rise .8s .3s var(--ease) both; }
.feature-chips li { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, .10); border: 1px solid rgba(255, 255, 255, .18); font-size: .88rem; backdrop-filter: blur(6px); transition: transform .25s var(--spring), background-color .2s; }
.feature-chips li:hover { transform: translateY(-2px); background: rgba(255, 255, 255, .18); }
.feature-chips i { color: #c4b5fd; }
.hero-art { max-width: 520px; animation: rise .9s .35s var(--ease) both; }
.hero-art svg { width: 100%; height: auto; overflow: visible; }
.hero-art .float-a { animation: floatA 6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.hero-art .float-b { animation: floatB 7s ease-in-out infinite; }
.hero-art .cell { opacity: 0; transform-box: fill-box; transform-origin: center; animation: cellIn .5s var(--spring) forwards; animation-delay: var(--d); }
.hero-art .c-p { fill: #4ade80; } .hero-art .c-a { fill: #fb7185; } .hero-art .c-h { fill: #fbbf24; } .hero-art .c-l { fill: #38bdf8; }
.hero-art .bar { transform-box: fill-box; transform-origin: bottom; transform: scaleY(0); animation: barUp 1s var(--ease) forwards; animation-delay: calc(var(--d) + .4s); }
.hero-art .pulse { animation: pulse 2.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes floatA { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes floatB { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }
@keyframes cellIn { from { opacity: 0; transform: scale(.2); } to { opacity: 1; transform: scale(1); } }
@keyframes barUp { to { transform: scaleY(1); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

.auth-card {
  background: rgba(255, 255, 255, .96); color: #1f2340; border-radius: 24px; padding: 34px 30px; box-shadow: var(--shadow-lg);
  animation: rise .8s .25s var(--ease) both; position: relative;
}
.auth-card h2 { font-weight: 800; font-size: 1.6rem; margin: 0 0 4px; letter-spacing: -.01em; }
.auth-card .sub { color: #6b7194; margin-bottom: 22px; }
.auth-card .btn-login { padding: 12px; font-size: 1.02rem; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.auth-card .btn-login[disabled] { opacity: .8; }
.auth-foot { margin-top: 16px; text-align: center; font-size: .88rem; color: #6b7194; }
.auth-note { text-align: center; font-size: .8rem; color: #8a8fa3; margin-top: 8px; }
.auth-card .alert { border-radius: 12px; }
.field { position: relative; margin-bottom: 16px; }
.field input {
  width: 100%; border: 1.5px solid #dfe2f2; border-radius: 14px; padding: 22px 44px 9px 44px; font-size: 1rem; background: #fbfbff; color: #1f2340;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
[dir="rtl"] .field input { padding: 22px 44px 9px 44px; }
.field input:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 4px rgba(99, 102, 241, .18); background: #fff; }
.field label { position: absolute; inset-inline-start: 44px; top: 50%; transform: translateY(-50%); color: #7c82a6; pointer-events: none; transition: all .2s var(--ease); font-size: 1rem; }
.field input:focus + .lead-icon + label, .field input:not(:placeholder-shown) + .lead-icon + label { top: 9px; transform: none; font-size: .74rem; color: #4f46e5; font-weight: 600; }
.field .lead-icon { position: absolute; inset-inline-start: 16px; top: 50%; transform: translateY(-50%); color: #8a8fb0; font-size: 1.05rem; pointer-events: none; transition: color .2s; }
.field input:focus ~ .lead-icon { color: #4f46e5; }
.field-action { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); color: #7c82a6; padding: 6px 10px; }
.field-action:hover { color: #4f46e5; }
.link-login-hint { background: #eef0ff; color: #3730a3; border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; font-size: .95rem; animation: rise .5s var(--ease) both; }
.btn-attention { animation: attention 1.4s ease-in-out 2; }
@keyframes attention { 0%, 100% { box-shadow: 0 12px 24px -10px rgba(79, 70, 229, .65); } 50% { box-shadow: 0 0 0 10px rgba(79, 70, 229, .18), 0 12px 24px -10px rgba(79, 70, 229, .65); } }
.shake { animation: shake .5s var(--ease); }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(3px); } }
.auth-card .text-success { color: #16a34a !important; }
.auth-card .text-danger { color: #dc2626 !important; }

/* ================= App shell ================= */
#view-app { min-height: 100dvh; }
#sidebar {
  position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--sidebar-w); z-index: 1030; padding: 18px 14px;
  background: var(--surface); border-inline-end: 1px solid var(--line);
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 22px; }
.sidebar-brand .logo { width: 44px; height: 44px; border-radius: 14px; overflow: hidden; flex-shrink: 0; box-shadow: var(--shadow); transition: transform .4s var(--spring); }
.sidebar-brand:hover .logo { transform: rotate(-8deg) scale(1.06); }
.sidebar-brand .logo img { width: 100%; height: 100%; }
.brand-name { font-weight: 800; font-size: 1.05rem; line-height: 1.2; }
.brand-sub { font-size: .75rem; color: var(--text-mute); }
.nav-section { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-mute); font-weight: 700; padding: 16px 12px 6px; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 2px 0; border-radius: 12px;
  color: var(--bs-body-color); font-weight: 600; text-decoration: none; transition: background-color .2s, color .2s, transform .2s var(--ease);
}
.nav-link i { font-size: 1.12rem; color: var(--text-mute); transition: color .2s, transform .3s var(--spring); }
.nav-link:hover { background: var(--surface-2); transform: translateX(3px); }
[dir="rtl"] .nav-link:hover { transform: translateX(-3px); }
.nav-link:hover i { color: var(--brand); transform: scale(1.12); }
.nav-link.active { background: var(--brand-soft); color: var(--brand); }
.nav-link.active i { color: var(--brand); }
.nav-link.active::before {
  content: ''; position: absolute; inset-block: 9px; inset-inline-start: -14px; width: 4px; border-radius: 4px; background: var(--brand-grad);
  animation: barIn .35s var(--spring);
}
@keyframes barIn { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.sidebar-foot { color: var(--text-mute); padding: 10px 12px 0; border-top: 1px solid var(--line); }
#sidebar .nav { padding-top: 2px; }

.app-main { min-height: 100dvh; padding-bottom: calc(var(--bottomnav-h) + 16px + var(--safe-b, 0px)); }
.app-topbar {
  position: sticky; top: 0; z-index: 1020; height: var(--topbar-h); display: flex; align-items: center; gap: 10px; padding: 0 20px;
  background: color-mix(in srgb, var(--app-bg) 82%, transparent); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-title { flex: 1; font-weight: 700; font-size: 1.05rem; min-width: 0; }
.avatar-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--brand-grad); color: #fff; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 18px -8px rgba(79, 70, 229, .7); transition: transform .25s var(--spring); font-size: .9rem;
}
.avatar-btn:hover { transform: scale(1.08); }
.conn-online { background: #dcfce7; color: #166534; font-weight: 600; }
.conn-offline { background: #fee2e2; color: #991b1b; font-weight: 600; }
[data-bs-theme="dark"] .conn-online { background: rgba(34, 197, 94, .18); color: #86efac; }
[data-bs-theme="dark"] .conn-offline { background: rgba(239, 68, 68, .2); color: #fca5a5; }
#conn-badge { font-size: .78rem; padding: .45em .8em; }
#conn-badge i { font-size: .8rem; }
#content { padding: 22px 20px 24px; max-width: 1280px; margin: 0 auto; outline: none; }
@media (min-width: 992px) {
  .app-main { margin-inline-start: var(--sidebar-w); }
  #content { padding: 26px 30px 36px; }
}
@media (max-width: 991.98px) {
  .topbar-title { font-size: 1rem; }
  #content { padding: 16px 14px 20px; }
}

/* Mobile bottom navigation */
#bottom-nav {
  position: fixed; inset-inline: 10px; bottom: calc(10px + var(--safe-b, 0px)); height: var(--bottomnav-h); z-index: 1025;
  display: grid; grid-template-columns: repeat(4, 1fr); align-items: center; padding: 6px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(16px) saturate(1.5); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg);
}
#bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .7rem; font-weight: 600; color: var(--text-mute); text-decoration: none; height: 100%; border-radius: 16px; transition: color .2s, transform .25s var(--spring); }
#bottom-nav a i { font-size: 1.28rem; transition: transform .3s var(--spring); }
#bottom-nav a.active { color: var(--brand); }
#bottom-nav a.active i { transform: translateY(-2px) scale(1.1); }
#bottom-nav a.nav-main i { width: 46px; height: 46px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-grad); color: #fff; font-size: 1.2rem; box-shadow: 0 10px 20px -8px rgba(79, 70, 229, .8); margin-top: -18px; }
#bottom-nav a.nav-main span { margin-top: 2px; }
#bottom-nav a:active { transform: scale(.94); }

/* ================= Page header & panels ================= */
.page-enter { animation: pageIn .45s var(--ease) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(12px) scale(.995); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.page-sub { color: var(--text-mute); font-size: .92rem; margin-top: 2px; }
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  transition: box-shadow .3s var(--ease), border-color .3s;
}
.panel:hover { box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 0; }
.panel-head h2 { font-size: 1rem; font-weight: 700; margin: 0; flex: 1; }
.panel-body { padding: 16px 18px 18px; }
.rise { opacity: 0; animation: rise .6s var(--ease) forwards; animation-delay: calc(var(--i, 0) * 60ms + 60ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.skeleton .skel { border-radius: 16px; background: linear-gradient(90deg, var(--line) 25%, var(--surface-2) 37%, var(--line) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; margin-bottom: 4px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.empty-state { padding: 46px 16px; color: var(--text-mute); }
.es-icon { width: 76px; height: 76px; border-radius: 24px; margin: 0 auto 14px; display: flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand); font-size: 2rem; animation: float 3.2s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* Avatars */
.avatar { width: 40px; height: 40px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; flex-shrink: 0; font-size: .85rem; object-fit: cover; }
img.avatar { background: var(--surface-2); }
.tint-indigo { background: linear-gradient(135deg, #6366f1, #4338ca); }
.tint-violet { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.tint-green { background: linear-gradient(135deg, #34d399, #059669); }
.tint-amber { background: linear-gradient(135deg, #fbbf24, #d97706); }
.tint-cyan { background: linear-gradient(135deg, #22d3ee, #0891b2); }
.tint-pink { background: linear-gradient(135deg, #f472b6, #db2777); }
.tint-red { background: linear-gradient(135deg, #fb7185, #e11d48); }
.tint-slate { background: linear-gradient(135deg, #94a3b8, #475569); }

/* Status pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-active { background: var(--p-bg); color: var(--p-fg); }
.pill-inactive { background: var(--line); color: var(--text-mute); }
.pill-paid { background: var(--p-bg); color: var(--p-fg); }
.pill-unpaid { background: var(--h-bg); color: var(--h-fg); }

/* ================= Dashboard ================= */
.hero {
  position: relative; overflow: hidden; border-radius: 26px; padding: 28px; color: #fff; background: var(--brand-grad);
  box-shadow: var(--shadow-lg); margin-bottom: 20px;
}
.hero::before, .hero::after { content: ''; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .12); animation: drift 10s ease-in-out infinite alternate; }
.hero::before { width: 260px; height: 260px; top: -110px; inset-inline-end: -60px; }
.hero::after { width: 180px; height: 180px; bottom: -90px; inset-inline-start: 30%; animation-delay: -5s; }
.hero h1 { font-weight: 800; font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 6px 0 4px; letter-spacing: -.02em; position: relative; z-index: 1; }
.hero p { opacity: .9; margin: 0; position: relative; z-index: 1; }
.hero .badge-soft { display: inline-flex; gap: 6px; align-items: center; padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .18); font-size: .8rem; font-weight: 600; position: relative; z-index: 1; }
.hero .btn-hero { position: relative; z-index: 1; display: inline-flex; align-items: center; margin-top: 18px; text-decoration: none; background: #fff; color: var(--brand); border: 0; font-weight: 700; border-radius: 14px; padding: 10px 18px; transition: transform .25s var(--spring); }
.hero .btn-hero:hover { transform: translateY(-2px); color: var(--brand-2); }

.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 18px; }
@media (min-width: 992px) { .kpi-grid { grid-template-columns: repeat(4, 1fr); } }
.kpi { padding: 16px 16px 14px; position: relative; overflow: hidden; }
.kpi:hover { transform: translateY(-3px); }
.kpi-ico { width: 42px; height: 42px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 1.2rem; box-shadow: 0 10px 20px -10px currentColor; }
.kpi-ico.g1 { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.kpi-ico.g2 { background: linear-gradient(135deg, #34d399, #059669); }
.kpi-ico.g3 { background: linear-gradient(135deg, #f472b6, #db2777); }
.kpi-ico.g4 { background: linear-gradient(135deg, #22d3ee, #0891b2); }
.kpi .label { color: var(--text-mute); font-size: .83rem; font-weight: 600; margin-top: 12px; }
.kpi .value { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.2; margin-top: 2px; }
.kpi .sub { font-size: .8rem; color: var(--text-mute); margin-top: 4px; }
.kpi .meter { height: 6px; border-radius: 6px; background: var(--line); margin-top: 10px; overflow: hidden; }
.kpi .meter span { display: block; height: 100%; width: var(--w, 0%); background: var(--brand-grad); border-radius: 6px; animation: grow 1.1s var(--ease) both; animation-delay: .3s; }
@keyframes grow { from { width: 0; } }

.chart { display: flex; align-items: flex-end; gap: 12px; height: 210px; padding: 8px 4px 0; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.chart .bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.chart .bar {
  width: min(100%, 52px); height: var(--h, 0%); min-height: 4px; border-radius: 12px 12px 6px 6px;
  background: linear-gradient(180deg, #a78bfa, #4f46e5); box-shadow: 0 10px 20px -12px rgba(79, 70, 229, .8);
  transform-origin: bottom; animation: barGrow .9s var(--ease) both; animation-delay: calc(var(--i) * 90ms + 120ms); position: relative;
  transition: filter .2s;
}
.chart .bar:hover { filter: brightness(1.12); }
.chart .bar.last { background: linear-gradient(180deg, #f472b6, #db2777); }
.chart .val { font-size: .72rem; font-weight: 700; color: var(--text-mute); margin-bottom: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart .lbl { font-size: .75rem; color: var(--text-mute); margin-top: 8px; white-space: nowrap; }
@keyframes barGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }

.quick { display: grid; gap: 10px; }
.quick a {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 16px; text-decoration: none; color: inherit;
  background: var(--surface-2); border: 1px solid transparent; transition: transform .25s var(--spring), border-color .2s, background-color .2s;
}
.quick a:hover { transform: translateX(4px); border-color: var(--brand-ring); background: var(--brand-soft); color: inherit; }
[dir="rtl"] .quick a:hover { transform: translateX(-4px); }
.quick .qi { width: 44px; height: 44px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 1.2rem; flex-shrink: 0; }
.quick .qt { font-weight: 700; }
.quick .qs { font-size: .8rem; color: var(--text-mute); }
.quick .chev { margin-inline-start: auto; color: var(--text-mute); transition: transform .25s var(--ease); }
.quick a:hover .chev { transform: translateX(4px); }
[dir="rtl"] .quick a:hover .chev { transform: translateX(-4px) scaleX(-1); }
[dir="rtl"] .quick .chev { transform: scaleX(-1); }
/* Directional icons mirror in Urdu (right-to-left) layouts */
[dir="rtl"] .bi-chevron-left, [dir="rtl"] .bi-chevron-right, [dir="rtl"] .bi-arrow-left-short, [dir="rtl"] .bi-arrow-right, [dir="rtl"] .bi-arrow-right-short { transform: scaleX(-1); display: inline-block; }

.recent-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); text-decoration: none; color: inherit; }
.recent-item:last-child { border-bottom: 0; }
.recent-item:hover { color: var(--brand); }

/* ================= Employees ================= */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.search { position: relative; flex: 1 1 260px; min-width: 0; }
.search i { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--text-mute); pointer-events: none; }
.search input { padding-inline-start: 40px; height: 44px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); transition: box-shadow .2s, border-color .2s; }
.search input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 4px; gap: 2px; position: relative; }
.seg button {
  border: 0; background: transparent; color: var(--text-mute); font-weight: 600; font-size: .9rem; padding: 7px 14px; border-radius: 10px; position: relative; z-index: 1; transition: color .2s;
}
.seg button.on { color: var(--brand); }
.seg .thumb { position: absolute; top: 4px; bottom: 4px; left: 0; border-radius: 10px; background: var(--brand-soft); transition: left .35s var(--spring), width .35s var(--spring); }
.emp-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.emp-card { padding: 16px; text-decoration: none; color: inherit; display: block; position: relative; overflow: hidden; }
.emp-card:hover { transform: translateY(-4px); border-color: var(--brand-ring); color: inherit; }
.emp-card::after { content: ''; position: absolute; inset-inline-end: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: var(--brand-soft); transition: transform .5s var(--ease); }
.emp-card:hover::after { transform: scale(1.4); }
.emp-top { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.emp-top .avatar { width: 52px; height: 52px; font-size: 1rem; border-radius: 16px; }
.emp-name { font-weight: 800; font-size: 1.02rem; line-height: 1.25; }
.emp-meta { font-size: .8rem; color: var(--text-mute); }
.emp-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); position: relative; z-index: 1; }
.emp-gross { font-weight: 800; font-variant-numeric: tabular-nums; }
.emp-gross small { display: block; font-weight: 600; color: var(--text-mute); font-size: .72rem; }

/* Employee form */
.form-layout { display: grid; gap: 18px; }
@media (min-width: 1100px) { .form-layout { grid-template-columns: 1fr 340px; align-items: start; } }
.sec-card { padding: 0; margin-bottom: 18px; }
.sec-card .panel-body { padding: 18px; }
.sec-title { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1rem; padding: 16px 18px 0; }
.sec-title i { width: 34px; height: 34px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand); font-size: 1.05rem; }
.form-label { font-weight: 600; font-size: .86rem; color: var(--bs-body-color); margin-bottom: 6px; }
.form-control, .form-select { border-radius: 12px; border: 1px solid var(--line); background-color: var(--surface-2); padding: .6rem .85rem; min-height: 44px; transition: border-color .2s, box-shadow .2s, background-color .2s; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); background-color: var(--surface); }
.form-control.is-invalid { border-color: #e11d48; background-image: none; animation: shake .4s var(--ease); }
.form-control[readonly] { background-color: var(--head-bg); color: var(--text-mute); }
.money-input { font-variant-numeric: tabular-nums; }
.input-group-text { border-radius: 12px; background: var(--head-bg); border: 1px solid var(--line); color: var(--text-mute); font-weight: 600; }
.photo-pick { display: flex; align-items: center; gap: 16px; }
.photo-frame { width: 96px; height: 96px; border-radius: 28px; overflow: hidden; background: var(--surface-2); border: 2px dashed var(--line); display: flex; align-items: center; justify-content: center; color: var(--text-mute); flex-shrink: 0; transition: border-color .2s, transform .3s var(--spring); }
.photo-frame:hover { border-color: var(--brand); transform: scale(1.03); }
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }
.summary-card { position: sticky; top: calc(var(--topbar-h) + 14px); overflow: hidden; }
.summary-hero { padding: 22px 18px 18px; background: var(--brand-grad); color: #fff; text-align: center; position: relative; }
.summary-hero::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 20% 0%, rgba(255, 255, 255, .25), transparent 55%); pointer-events: none; }
.summary-hero .avatar { margin: 0 auto; width: 72px; height: 72px; font-size: 1.4rem; border: 3px solid rgba(255, 255, 255, .6); border-radius: 24px; box-shadow: 0 12px 24px -10px rgba(0, 0, 0, .4); }
.summary-hero .nm { font-weight: 800; font-size: 1.1rem; margin-top: 10px; position: relative; z-index: 1; }
.summary-hero .ds { opacity: .85; font-size: .85rem; position: relative; z-index: 1; }
.summary-gross { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; position: relative; z-index: 1; }
.bd-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: .9rem; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.bd-row:last-child { border-bottom: 0; }
.bd-row .k { color: var(--text-mute); }
.bd-row .v { font-weight: 700; font-variant-numeric: tabular-nums; text-align: end; }
.bd-bar { grid-column: 1 / -1; height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.bd-bar span { display: block; height: 100%; width: var(--w, 0%); border-radius: 6px; transition: width .6s var(--ease); }
.bd-bar .c1 { background: #6366f1; } .bd-bar .c2 { background: #22c55e; } .bd-bar .c3 { background: #f59e0b; } .bd-bar .c4 { background: #ec4899; }
.form-actions { position: sticky; bottom: calc(var(--bottomnav-h) + 22px); z-index: 5; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
@media (min-width: 992px) { .form-actions { bottom: 16px; } }
.form-actions .btn { padding: 11px 22px; border-radius: 14px; }

/* ================= Payroll sheet ================= */
.month-nav { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 4px; box-shadow: var(--shadow-sm); }
.month-nav .mname { font-weight: 800; min-width: 170px; text-align: center; padding: 0 8px; cursor: pointer; border-radius: 12px; position: relative; font-variant-numeric: tabular-nums; }
.month-nav .mname:hover { background: var(--brand-soft); }
.month-nav .mname input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.month-nav .btn-icon { border: 0; box-shadow: none; background: transparent; width: 36px; height: 36px; }
.month-nav .mname span { transition: opacity .25s, transform .3s var(--ease); display: inline-block; }
.month-nav .mname span.swap { animation: swapIn .4s var(--ease); }
@keyframes swapIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.kpi-strip { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
@media (min-width: 992px) { .kpi-strip { grid-template-columns: repeat(4, 1fr); } }
.kpi-strip .kpi { padding: 12px 14px; }
.kpi-strip .kpi .value { font-size: 1.2rem; }
.kpi-strip .kpi .label { margin-top: 6px; }
.legend { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.legend .lg { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; padding: 4px 9px; border-radius: 10px; }
.legend .lg b { width: 22px; height: 22px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; }
.code-P { background: var(--p-bg); color: var(--p-fg); } .code-H { background: var(--h-bg); color: var(--h-fg); }
.code-L { background: var(--l-bg); color: var(--l-fg); } .code-A { background: var(--a-bg); color: var(--a-fg); }
.sheet-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sheet-tools .left { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.save-state { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 600; color: var(--text-mute); transition: color .3s; }
.save-state .dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); }
.save-state.busy .dot { background: #f59e0b; animation: ping 1s infinite; }
.save-state.err .dot { background: #e11d48; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, .6); } 100% { box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); } }
.hint { font-size: .82rem; color: var(--text-mute); margin: 0 0 10px; }

.sheet-wrap {
  overflow: auto; max-height: calc(100dvh - 330px); min-height: 260px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); box-shadow: var(--shadow-sm); overscroll-behavior: contain;
}
@media (max-width: 991.98px) { .sheet-wrap { max-height: calc(100dvh - 300px); } }
table.sheet { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: .85rem; }
table.sheet th, table.sheet td {
  border-bottom: 1px solid var(--line); border-inline-end: 1px solid var(--line); padding: 0; white-space: nowrap; background: var(--surface); vertical-align: middle;
}
table.sheet thead th { position: sticky; top: 0; z-index: 3; background: var(--head-bg); font-weight: 700; font-size: .78rem; color: var(--text-mute); text-align: center; height: 44px; padding: 0 6px; }
table.sheet thead th.grp { color: var(--bs-body-color); font-size: .8rem; }
table.sheet .sticky-col { position: sticky; inset-inline-start: 0; z-index: 2; background: var(--surface); }
table.sheet thead .sticky-col { z-index: 4; background: var(--head-bg); }
table.sheet tfoot td { position: sticky; bottom: 0; z-index: 3; background: var(--head-bg); font-weight: 800; height: 44px; }
table.sheet tfoot .sticky-col { z-index: 5; }
table.sheet tbody tr { transition: background-color .2s; }
table.sheet tbody tr:hover td { background: color-mix(in srgb, var(--brand-soft) 60%, var(--surface)); }
table.sheet tbody tr:hover td.sticky-col { background: color-mix(in srgb, var(--brand-soft) 60%, var(--surface)); }
.sheet .emp-cell { min-width: 230px; max-width: 260px; padding: 8px 12px; }
.sheet .emp-cell .who { display: flex; align-items: center; gap: 10px; }
.sheet .emp-cell .avatar { width: 34px; height: 34px; font-size: .75rem; border-radius: 11px; }
.sheet .emp-cell .nm { font-weight: 700; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.sheet .emp-cell .ds { font-size: .72rem; color: var(--text-mute); overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.sheet .day {
  width: 40px; min-width: 40px; height: 40px; text-align: center; font-weight: 700; cursor: pointer; user-select: none;
  transition: background-color .15s, color .15s, transform .15s var(--spring); position: relative; font-size: .85rem;
}
.sheet .day:hover { transform: scale(1.06); z-index: 1; }
.sheet .day.sunday { color: var(--sun); }
.sheet thead th.sunday { color: var(--sun); }
.sheet .day.na { background: repeating-linear-gradient(135deg, transparent 0 5px, var(--na-line) 5px 6px); cursor: not-allowed; color: transparent; }
.sheet .day.na:hover { transform: none; }
.sheet .day.blank { color: var(--na-line); font-weight: 400; }
.sheet .day.code-P { background: var(--p-bg); color: var(--p-fg); }
.sheet .day.code-H { background: var(--h-bg); color: var(--h-fg); }
.sheet .day.code-L { background: var(--l-bg); color: var(--l-fg); }
.sheet .day.code-A { background: var(--a-bg); color: var(--a-fg); }
.sheet tbody tr.rise-row { animation: rowIn .5s var(--ease) both; }
@keyframes rowIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.sheet .day.is-active { box-shadow: inset 0 0 0 2px var(--brand); z-index: 2; }
.sheet .day.pop { animation: pop .45s var(--spring); }
@keyframes pop { 0% { transform: scale(.7); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
.sheet .num { text-align: end; padding: 0 10px; font-variant-numeric: tabular-nums; min-width: 96px; }
.sheet .num.ic { min-width: 110px; }
.sheet .cell-input {
  width: 100%; min-width: 84px; height: 38px; border: 0; background: transparent; text-align: end; font-variant-numeric: tabular-nums; padding: 0 8px; color: inherit; border-radius: 0;
}
.sheet .cell-input:focus { outline: none; background: var(--brand-soft); box-shadow: inset 0 0 0 2px var(--brand); }
.sheet .cell-input::-webkit-outer-spin-button, .sheet .cell-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sheet .cell-input[type=number] { -moz-appearance: textfield; }
.sheet .net { font-weight: 800; color: var(--brand); }
.sheet .net.flash { animation: flash .9s var(--ease); }
@keyframes flash { 0% { background-color: rgba(79, 70, 229, .25); } 100% { background-color: transparent; } }
.sheet .slipbtn, .sheet .paybtn { border: 0; background: transparent; color: var(--brand); width: 34px; height: 34px; border-radius: 10px; transition: transform .2s var(--spring), background-color .2s; }
.sheet .slipbtn:hover { background: var(--brand-soft); transform: scale(1.1); }
.sheet .paybtn { width: auto; padding: 4px 10px; font-weight: 700; font-size: .78rem; }
.sheet .paybtn:hover { background: var(--brand-soft); }
.sheet .paybtn.is-paid { background: var(--p-bg); color: var(--p-fg); }
.sheet .paybtn.is-paid:hover { background: var(--p-bg); filter: brightness(.97); }
.sheet .days-count { font-weight: 800; text-align: center; min-width: 74px; font-variant-numeric: tabular-nums; }
.sheet .fx-row { transition: opacity .2s; }
.sheet .foot-day { text-align: center; min-width: 40px; font-variant-numeric: tabular-nums; font-size: .78rem; }
.sheet .foot-day.zero { color: var(--text-mute); opacity: .6; }

/* ================= Payslip (modal + print) ================= */
.payslip { border: 1.5px solid var(--line); border-radius: 18px; overflow: hidden; background: #fff; color: #111827; }
.payslip-head { display: flex; align-items: center; gap: 14px; padding: 18px 20px; background: var(--brand-grad); color: #fff; }
.payslip-head .co { font-weight: 800; font-size: 1.1rem; }
.payslip-head .per { opacity: .9; font-size: .85rem; }
.payslip-body { padding: 18px 20px; }
.payslip-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; margin-bottom: 14px; font-size: .9rem; }
.payslip-grid .k { color: #6b7280; font-size: .78rem; }
.payslip-grid .v { font-weight: 700; }
.payslip-table { width: 100%; font-size: .92rem; border-collapse: collapse; }
.payslip-table td { padding: 8px 4px; border-bottom: 1px dashed #e5e7eb; }
.payslip-table td.amt { text-align: end; font-variant-numeric: tabular-nums; font-weight: 600; }
.payslip-table tr.total td { border-top: 2px solid #111827; border-bottom: 0; font-weight: 800; font-size: 1.05rem; padding-top: 12px; }
.payslip-sign { display: flex; justify-content: space-between; gap: 20px; margin-top: 36px; font-size: .8rem; color: #6b7280; }
.payslip-sign div { flex: 1; border-top: 1px solid #9ca3af; padding-top: 6px; text-align: center; }
.payslip.dark-safe { color: #111827; }
.print-target .payslip { border: 0; }

/* ================= Settings ================= */
.setting-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-row .txt { flex: 1; min-width: 0; }
.setting-row .t { font-weight: 700; }
.setting-row .d { font-size: .82rem; color: var(--text-mute); }
.form-switch-lg .form-check-input { width: 3em; height: 1.6em; }
.seg-lang { display: inline-flex; background: var(--surface-2); border-radius: 14px; padding: 4px; border: 1px solid var(--line); }
.seg-lang button { border: 0; background: transparent; padding: 8px 18px; border-radius: 11px; font-weight: 700; color: var(--text-mute); transition: all .25s var(--ease); }
.seg-lang button.on { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); }

/* ================= Modal & toasts ================= */
.modal-content { border: 0; border-radius: 22px; box-shadow: var(--shadow-lg); overflow: hidden; }
.modal.fade .modal-dialog { transform: translateY(18px) scale(.98); transition: transform .35s var(--spring); }
.modal.show .modal-dialog { transform: none; }
.modal-header { border-bottom: 1px solid var(--line); }
.modal-footer { border-top: 1px solid var(--line); }
.toast { border-radius: 14px; box-shadow: var(--shadow-lg); }
.toast-anim { animation: toastIn .45s var(--spring) both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(.96); } to { opacity: 1; transform: none; } }
#toast-container { z-index: 2100; }
#loading-overlay { position: fixed; inset: 0; background: rgba(15, 17, 23, .35); display: flex; align-items: center; justify-content: center; z-index: 2050; backdrop-filter: blur(2px); }
#loading-overlay .loading-card { background: var(--surface); padding: 14px 18px; border-radius: 16px; display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow-lg); animation: rise .3s var(--ease) both; }
.dropdown-menu { border-radius: 16px; border: 1px solid var(--line); box-shadow: var(--shadow-lg); padding: 8px; animation: dropIn .25s var(--ease); }
@keyframes dropIn { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.dropdown-item { border-radius: 10px; padding: .55rem .75rem; }
.offcanvas { border-inline-end: 1px solid var(--line); }
.offcanvas .nav-link { margin: 2px 4px; }

/* ================= Responsive & motion ================= */
@media (max-width: 575.98px) {
  .page-title { font-size: 1.3rem; }
  .sec-title { padding-top: 14px; }
  .emp-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 26px 20px; border-radius: 20px; }
  .auth-h1 { font-size: 2rem; }
  .feature-chips { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ================= Print ================= */
@media print {
  @page { size: A4; margin: 12mm; }
  body * { visibility: hidden !important; }
  .print-target, .print-target * { visibility: visible !important; }
  .print-target { position: absolute; inset: 0 auto auto 0; width: 100%; margin: 0; box-shadow: none !important; }
  .modal-backdrop, .modal-header, .modal-footer, .no-print { display: none !important; }
  .modal-dialog { margin: 0 !important; max-width: 100% !important; transform: none !important; }
  .modal-content { border: 0 !important; box-shadow: none !important; }
  .modal-body { padding: 0 !important; overflow: visible !important; }
  .payslip { break-inside: avoid; }
  .sheet-wrap { max-height: none; overflow: visible; }
}
