:root {
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

body {
  font-family: var(--font-sans);
  background-color: #f1f5f9;
  color: #0f172a;
  transition: background-color 0.2s, color 0.2s;
  overflow-x: hidden;
}

.auth-bg {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4f46e5 100%);
}

/* Fixed Viewport Height Pinned Sidebar with Independent Scroll */
.sidebar-panel {
  width: 252px;
  height: 100vh;
  max-height: 100vh;
  position: sticky;
  top: 0;
  align-self: flex-start;
  overflow: hidden;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s ease;
}

.sidebar-scroll {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

.sidebar-scroll::-webkit-scrollbar {
  width: 5px;
}
.sidebar-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-scroll::-webkit-scrollbar-thumb {
  background-color: rgba(148, 163, 184, 0.35);
  border-radius: 9999px;
}
.sidebar-scroll::-webkit-scrollbar-thumb:hover {
  background-color: rgba(148, 163, 184, 0.6);
}

.sidebar-collapsed .sidebar-panel {
  width: 72px;
}

.sidebar-collapsed .nav-label,
.sidebar-collapsed .brand-text {
  display: none !important;
}

.sidebar-collapsed .tab-btn {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

/* Mobile Responsive Sidebar Drawer with Independent Scroll */
@media (max-width: 767px) {
  .sidebar-panel {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    height: 100dvh;
    max-height: 100dvh;
    z-index: 50;
    transform: translateX(-100%);
    width: 260px !important;
  }
  body.mobile-sidebar-open .sidebar-panel {
    transform: translateX(0);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  }
  body.mobile-sidebar-open .nav-label,
  body.mobile-sidebar-open .brand-text {
    display: inline !important;
  }
  body.mobile-sidebar-open #mobileSidebarBackdrop {
    display: block;
  }
}

.tab-btn-active {
  background: linear-gradient(90deg, #4f46e5 0%, #4338ca 100%);
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.28);
}

.tab-btn-inactive {
  color: #cbd5e1;
}

.tab-btn-inactive:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.modal-backdrop {
  background-color: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(3px);
}

/* Financial Mask Blur */
.fin-masked {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 2px;
  color: #64748b;
  user-select: none;
}

/* Attendance Matrix Compact Cells */
.att-matrix-table th,
.att-matrix-table td {
  border: 1px solid #e2e8f0;
  padding: 5px 4px;
  font-size: 11px;
  text-align: center;
  white-space: nowrap;
}
.att-matrix-table th.sticky-col,
.att-matrix-table td.sticky-col {
  text-align: left;
  padding-left: 8px;
  padding-right: 8px;
}
.att-pill-p { background-color: #dcfce7; color: #166534; font-weight: 700; border-radius: 4px; padding: 1px 5px; display: inline-block; min-width: 18px; }
.att-pill-a { background-color: #ffe4e6; color: #be123c; font-weight: 700; border-radius: 4px; padding: 1px 5px; display: inline-block; min-width: 18px; }
.att-pill-l { background-color: #fef3c7; color: #b45309; font-weight: 700; border-radius: 4px; padding: 1px 5px; display: inline-block; min-width: 18px; }
.att-pill-none { color: #cbd5e1; }

/* Dropzone active highlight */
.dropzone-active {
  border-color: #4f46e5 !important;
  background-color: #eef2ff !important;
}

/* Dark Mode Styling */
body.dark-mode {
  background-color: #090d16;
  color: #f1f5f9;
}

body.dark-mode header,
body.dark-mode .bg-white {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  color: #f1f5f9 !important;
}

body.dark-mode .bg-slate-50,
body.dark-mode .bg-slate-100 {
  background-color: #0f172a !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

body.dark-mode .text-slate-900,
body.dark-mode .text-slate-800,
body.dark-mode .text-slate-700 {
  color: #f8fafc !important;
}

body.dark-mode .text-slate-600,
body.dark-mode .text-slate-500 {
  color: #94a3b8 !important;
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
  background-color: #0f172a !important;
  border-color: #475569 !important;
  color: #f8fafc !important;
}

body.dark-mode .divide-slate-200 > :not([hidden]) ~ :not([hidden]),
body.dark-mode .border-slate-200,
body.dark-mode .border-slate-100,
body.dark-mode .att-matrix-table th,
body.dark-mode .att-matrix-table td {
  border-color: #334155 !important;
}
