/* ============================================================
   ATTENDANCE MANAGEMENT SYSTEM — GLOBAL STYLESHEET
   Version: 2.0.0 — Modern SaaS UI/UX refresh

   DESIGN CHANGES IN THIS VERSION (visual/interaction only —
   no markup, business logic, or data changes were required):

   1. Typography: Poppins -> Inter, the de-facto typeface of
      modern SaaS products (Linear, GitHub, Slack, Vercel).
      Tighter tracking on headings, clearer size scale.
   2. Color system: the old navy/Bootstrap-blue palette is
      replaced with a neutral slate base + a single indigo
      accent, plus an accessible, muted semantic palette
      (success/warning/danger/info/purple). Every "-light"
      tint now pairs with a "-dark" text tone so text on
      tinted backgrounds (badges, alerts) clears WCAG AA
      contrast (4.5:1) instead of relying on the saturated
      base color for text.
   3. Elevation: heavy drop shadows replaced with hairline
      borders + very soft shadows; cards feel flatter/calmer
      and only lift on hover or in overlays (modals, dropdowns),
      matching contemporary component libraries.
   4. Sidebar: swapped the rounded "pill" nav (dated admin-
      template look) for full-width rounded rows with a slim
      active indicator bar, closer to Linear/GitHub navigation.
      Implemented the `.sidebar.collapsed` state that the JS
      already toggled but the old stylesheet never styled.
   5. Forms & buttons: consistent 8px radius, visible
      `:focus-visible` rings everywhere (keyboard accessibility),
      larger min hit target (36px+) on icon buttons, refined
      disabled/loading states.
   6. Motion: shorter, calmer transitions; `prefers-reduced-motion`
      is now respected.
   7. All class names, IDs, and DOM structure are unchanged —
      only property values changed, so every page/template
      continues to work without edits.
   ============================================================ */

/* ============================================================
   CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ============================================================ */
:root {
  /* --- Brand / neutrals -----------------------------------
     "primary" now drives dark text + dark surfaces (sidebar),
     built from a slate scale instead of the old single navy. */
  --primary:        #0F172A;   /* slate-900 — headings, dark surfaces */
  --primary-dark:   #0B1220;   /* deeper slate — sidebar base */
  --primary-light:  #1E293B;   /* slate-800 — sidebar hover/secondary dark */

  /* --- Accent (indigo) — one confident accent color used for
     primary actions, links, active states, focus rings. */
  --accent:         #4F46E5;   /* indigo-600 */
  --accent-dark:    #4338CA;   /* indigo-700 — hover/pressed */
  --accent-light:   #6366F1;   /* indigo-500 — on dark surfaces */
  --accent-soft:    #EEF2FF;   /* indigo-50 — tint background */

  /* --- Semantic colors — each has base / dark(text-on-tint) / light(tint bg) */
  --success:        #16A34A;   /* green-600 */
  --success-dark:   #15803D;   /* green-700 — accessible text on tint */
  --success-light:  #DCFCE7;   /* green-100 */

  --warning:        #D97706;   /* amber-600 */
  --warning-dark:   #92400E;   /* amber-800 — accessible text on tint */
  --warning-light:  #FEF3C7;   /* amber-100 */

  --danger:         #DC2626;   /* red-600 */
  --danger-dark:    #B91C1C;   /* red-700 — accessible text on tint */
  --danger-light:   #FEE2E2;   /* red-100 */

  --info:           #0891B2;   /* cyan-600 */
  --info-dark:      #0E7490;   /* cyan-700 — accessible text on tint */
  --info-light:     #CFFAFE;   /* cyan-100 */

  --purple:         #7C3AED;   /* violet-600 */
  --purple-dark:    #6D28D9;   /* violet-700 */
  --purple-light:   #EDE9FE;   /* violet-100 */

  /* --- Neutral scale (slate) -------------------------------- */
  --light:          #F1F5F9;   /* slate-100 */
  --lighter:        #F8FAFC;   /* slate-50 — page background */
  --dark:           #0F172A;
  --gray:           #64748B;   /* slate-500 — muted text */
  --gray-light:     #94A3B8;   /* slate-400 */
  --gray-lighter:   #CBD5E1;   /* slate-300 */
  --white:          #FFFFFF;
  --border:         #E2E8F0;   /* slate-200 — default hairline border */
  --border-strong:  #CBD5E1;   /* slate-300 — emphasized border */

  /* --- Layout ------------------------------------------------ */
  --sidebar-width:      260px;
  --sidebar-collapsed:  76px;
  --header-height:      64px;

  /* --- Radius -------------------------------------------------
     One consistent, modest scale (8/10/14) instead of the
     older 8/12/16 — reads less "rounded card app", more
     professional software. */
  --border-radius:      8px;
  --border-radius-lg:   10px;
  --border-radius-xl:   14px;

  /* --- Elevation — soft, layered, restrained ----------------- */
  --shadow-sm:          0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow:             0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-hover:       0 12px 28px rgba(15, 23, 42, 0.14);
  --shadow-card:        0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);

  /* --- Focus ring (accessibility) ---------------------------- */
  --focus-ring:         0 0 0 3px rgba(79, 70, 229, 0.28);

  /* --- Motion -------------------------------------------------
     Slightly quicker than before — snappy, not bouncy. */
  --transition:         all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast:    all 0.12s cubic-bezier(0.4, 0, 0.2, 1);

  --font-primary:       'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-primary);
  background: var(--lighter);
  color: #1E293B;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01';
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition-fast);
}

a:hover {
  color: var(--accent-dark);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: var(--font-primary);
  cursor: pointer;
}

ul, ol {
  list-style: none;
}

/* Accessible, consistent keyboard focus across the whole app.
   Mouse clicks don't show the ring (":focus-visible"), but
   keyboard/AT users always get a clear indicator. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar        { width: 8px; height: 8px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: var(--gray-lighter); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-light); }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--primary);
}

h1 { font-size: 1.75rem; letter-spacing: -0.02em; }
h2 { font-size: 1.5rem;  letter-spacing: -0.015em; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.9rem; }

p { margin-bottom: 0.75rem; color: #475569; }
p:last-child { margin-bottom: 0; }

code {
  font-size: 0.85em;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  background: var(--light);
  padding: 2px 6px;
  border-radius: 4px;
  color: #BE123C;
}

/* ============================================================
   APP LAYOUT (Sidebar + Main)
   ============================================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--primary-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1000;
  transition: var(--transition);
  border-right: 1px solid rgba(255,255,255,0.06);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand {
  padding: 0 1.25rem;
  height: var(--header-height);
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
  width: 100%;
}

.brand-icon {
  width: 34px;
  height: 34px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #fff;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.brand-name {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  color: #fff;
}

.brand-sub {
  font-size: 0.64rem;
  opacity: 0.5;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

.sidebar-nav {
  padding: 0.875rem 0.75rem;
  flex: 1;
}

.sidebar-group {
  margin-bottom: 0.375rem;
}

.sidebar-group-label {
  padding: 0.875rem 0.5rem 0.375rem;
  font-size: 0.66rem;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.32);
  font-weight: 600;
}

/* Nav rows: full-width rounded rects (not the old "pill"),
   with a slim left indicator bar on the active item — a
   pattern shared by Linear, GitHub and VS Code. */
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0.55rem 0.625rem;
  color: rgba(255,255,255,0.62);
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 7px;
  margin: 1px 0;
  transition: var(--transition-fast);
  position: relative;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-item:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
  text-decoration: none;
}

.sidebar-item.active {
  background: rgba(79, 70, 229, 0.22);
  color: #fff;
}

.sidebar-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent-light);
}

.sidebar-item.text-danger {
  color: rgba(248, 113, 113, 0.85);
}
.sidebar-item.text-danger:hover {
  background: rgba(220, 38, 38, 0.14);
  color: #fca5a5;
}

.sidebar-icon {
  width: 18px;
  text-align: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.sidebar-label {
  flex: 1;
  transition: opacity 0.15s ease;
}

.sidebar-badge {
  background: var(--danger);
  color: #fff;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 7px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 0.875rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.sidebar-footer-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.32);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 999;
  backdrop-filter: blur(2px);
}

/* Collapsed desktop state — the JS already toggles this class;
   it previously had no effect at all. Icons stay centered,
   labels/text fade out, width shrinks. */
.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}
.sidebar.collapsed .brand-text,
.sidebar.collapsed .sidebar-label,
.sidebar.collapsed .sidebar-group-label,
.sidebar.collapsed .sidebar-badge,
.sidebar.collapsed .sidebar-footer-info span:last-child {
  display: none;
}
.sidebar.collapsed .sidebar-brand,
.sidebar.collapsed .brand-link {
  justify-content: center;
}
.sidebar.collapsed .sidebar-item {
  justify-content: center;
  padding: 0.6rem;
}
.sidebar.collapsed ~ .main-content {
  margin-left: var(--sidebar-collapsed);
}

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: var(--transition);
}

.content-area {
  padding: 1.5rem;
  flex: 1;
  max-width: 1440px;
  width: 100%;
}

/* ============================================================
   HEADER
   ============================================================ */
.app-header {
  height: var(--header-height);
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 900;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-shrink: 0;
}

.sidebar-toggle {
  background: none;
  border: none;
  padding: 0.5rem;
  color: var(--gray);
  font-size: 1rem;
  border-radius: 7px;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-toggle:hover {
  background: var(--light);
  color: var(--primary);
}

.header-clock {
  font-size: 0.8rem;
  color: var(--gray);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  display: none;
  padding: 0 0.75rem;
}

@media (min-width: 1024px) {
  .header-clock { display: block; }
}

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow: hidden;
}

.breadcrumb-item {
  font-size: 0.82rem;
  color: var(--gray);
  white-space: nowrap;
}

.breadcrumb-item.active {
  color: var(--primary);
  font-weight: 600;
}

.breadcrumb-separator {
  font-size: 0.55rem;
  color: var(--gray-lighter);
}

/* ============================================================
   NOTIFICATION BELL
   ============================================================ */
.notification-wrapper {
  position: relative;
}

.notification-bell {
  background: none;
  border: none;
  padding: 0.5rem;
  font-size: 1.05rem;
  color: var(--gray);
  border-radius: 8px;
  transition: var(--transition-fast);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
}

.notification-bell:hover {
  background: var(--light);
  color: var(--primary);
}

.notification-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  background: var(--danger);
  color: #fff;
  border-radius: 50%;
  width: 17px;
  height: 17px;
  font-size: 0.62rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

.notification-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 360px;
  background: #fff;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-hover);
  border: 1px solid var(--border);
  z-index: 1000;
  animation: slideIn 0.15s ease;
  max-height: 480px;
  overflow: hidden;
  display: none;
  flex-direction: column;
}

.notification-dropdown.show {
  display: flex;
}

.notif-header {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.notif-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary);
}

.mark-all-read {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-primary);
  border-radius: 6px;
  padding: 4px 6px;
}
.mark-all-read:hover { background: var(--accent-soft); }

.notif-list {
  overflow-y: auto;
  flex: 1;
}

.notif-loading {
  padding: 2rem;
  text-align: center;
  color: var(--gray);
}

.notif-item {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.notif-item:hover {
  background: var(--lighter);
}

.notif-item.unread {
  background: var(--accent-soft);
}

.notif-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.notif-item-icon.success { background: var(--success-light); color: var(--success-dark); }
.notif-item-icon.info    { background: var(--info-light);    color: var(--info-dark); }
.notif-item-icon.warning { background: var(--warning-light); color: var(--warning-dark); }
.notif-item-icon.error   { background: var(--danger-light);  color: var(--danger-dark); }

.notif-item-body { flex: 1; min-width: 0; }
.notif-item-title { font-size: 0.83rem; font-weight: 600; color: var(--primary); }
.notif-item-msg   { font-size: 0.78rem; color: #64748B; margin-top: 2px; }
.notif-item-time  { font-size: 0.7rem; color: var(--gray-light); margin-top: 4px; }

.notif-empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--gray);
  font-size: 0.85rem;
}

.notif-footer {
  padding: 0.65rem;
  text-align: center;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.notif-footer a {
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 500;
}

/* ============================================================
   USER MENU
   ============================================================ */
.user-menu-wrapper {
  position: relative;
}

.user-menu-btn {
  background: none;
  border: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.6rem 0.35rem 0.35rem;
  border-radius: 8px;
  transition: var(--transition-fast);
  cursor: pointer;
}

.user-menu-btn:hover {
  background: var(--light);
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  display: none;
}

@media (min-width: 768px) {
  .user-name { display: block; }
}

.user-menu-btn .fa-chevron-down {
  font-size: 0.65rem;
  color: var(--gray-light);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 260px;
  background: #fff;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-hover);
  border: 1px solid var(--border);
  z-index: 1000;
  display: none;
  animation: slideIn 0.15s ease;
  overflow: hidden;
}

.user-dropdown.show {
  display: block;
}

.user-dropdown-header {
  padding: 1rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  background: var(--lighter);
}

.user-avatar-lg {
  width: 42px;
  height: 42px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.user-dropdown-name  { font-weight: 600; font-size: 0.9rem; color: var(--primary); }
.user-dropdown-role  { font-size: 0.74rem; color: var(--accent); font-weight: 600; }
.user-dropdown-email { font-size: 0.72rem; color: var(--gray); margin-top: 2px; word-break: break-all; }

.user-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 0.25rem 0;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  color: #334155;
  transition: var(--transition-fast);
  text-decoration: none;
}

.user-dropdown-item:hover {
  background: var(--lighter);
  color: var(--accent);
  text-decoration: none;
}

.user-dropdown-item i {
  width: 18px;
  text-align: center;
  color: var(--gray-light);
}

.user-dropdown-item:hover i { color: var(--accent); }

.user-dropdown-item.text-danger       { color: var(--danger); }
.user-dropdown-item.text-danger i     { color: var(--danger); }
.user-dropdown-item.text-danger:hover { background: var(--danger-light); }

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.page-title i {
  color: var(--accent);
  font-size: 0.9em;
}

.page-subtitle {
  font-size: 0.85rem;
  color: var(--gray);
  margin-top: 2px;
}

.page-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ============================================================
   CARDS — flat, hairline border, minimal shadow
   ============================================================ */
.card {
  background: var(--white);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  overflow: hidden;
}

.card-header {
  padding: 0.95rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
}

.card-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.card-title i { color: var(--accent); }

.card-body {
  padding: 1.25rem;
}

.card-footer {
  padding: 0.875rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--lighter);
}

/* ============================================================
   STAT CARDS (Dashboard)
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--white);
  border-radius: var(--border-radius-lg);
  padding: 1.15rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--border-strong);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--stat-color, var(--accent));
}

.stat-card.blue   { --stat-color: var(--accent); }
.stat-card.green  { --stat-color: var(--success); }
.stat-card.red    { --stat-color: var(--danger); }
.stat-card.orange { --stat-color: var(--warning); }
.stat-card.purple { --stat-color: var(--purple); }

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  background: var(--accent-soft);
  background: color-mix(in srgb, var(--stat-color, var(--accent)) 12%, white);
  color: var(--stat-color, var(--accent));
}

.stat-body { flex: 1; min-width: 0; }
.stat-value { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; color: var(--primary); line-height: 1.15; }
.stat-label { font-size: 0.78rem; color: var(--gray); margin-top: 4px; font-weight: 500; }
.stat-trend { font-size: 0.72rem; margin-top: 6px; font-weight: 600; }
.stat-trend.up   { color: var(--success-dark); }
.stat-trend.down { color: var(--danger-dark); }

/* ============================================================
   DASHBOARD GRID
   ============================================================ */
.dashboard-grid,
.dashboard-split {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  align-items: start;
}

.profile-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.chart-card .card-body { padding: 1rem; }
.chart-container { position: relative; height: 280px; }

/* ============================================================
   CHECK IN/OUT CARD
   ============================================================ */
.checkin-card {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%);
  border-radius: var(--border-radius-xl);
  padding: 2rem;
  color: #fff;
  text-align: center;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.22);
  margin-bottom: 1.5rem;
}

.checkin-date {
  font-size: 0.85rem;
  opacity: 0.65;
  margin-bottom: 0.5rem;
}

.checkin-time-display {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
  margin: 0.5rem 0;
}

.checkin-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.checkin-btn {
  padding: 0.75rem 2rem;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
  font-family: var(--font-primary);
}

.btn-checkin {
  background: var(--success);
  color: #fff;
  box-shadow: 0 4px 14px rgba(22,163,74,0.35);
}

.btn-checkin:hover:not(:disabled) {
  background: #15803D;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(22,163,74,0.45);
}

.btn-checkout {
  background: var(--warning);
  color: #fff;
  box-shadow: 0 4px 14px rgba(217,119,6,0.35);
}

.btn-checkout:hover:not(:disabled) {
  background: #B45309;
  transform: translateY(-1px);
}

.checkin-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.checkin-status-row {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.checkin-status-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.checkin-status-label {
  font-size: 0.7rem;
  opacity: 0.55;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.checkin-status-value {
  font-size: 1rem;
  font-weight: 600;
}

.working-hours-display {
  font-size: 2rem;
  font-weight: 700;
  color: #FBBF24;
}

/* ============================================================
   LEAVE BALANCE CARDS
   ============================================================ */
.leave-balance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.leave-balance-card {
  background: var(--white);
  border-radius: var(--border-radius-lg);
  padding: 1.25rem;
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.leave-balance-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}

.leave-balance-type {
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray);
  margin-bottom: 0.75rem;
}

.leave-balance-number {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent);
  line-height: 1;
}

.leave-balance-of {
  font-size: 0.8rem;
  color: var(--gray);
  margin-top: 4px;
}

.leave-balance-bar {
  height: 5px;
  background: var(--light);
  border-radius: 3px;
  margin-top: 0.75rem;
  overflow: hidden;
}

.leave-balance-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.6s ease;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-card {
  background: var(--white);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.table-toolbar {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.data-table thead th {
  background: var(--lighter);
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
}

.data-table thead th.sortable {
  cursor: pointer;
  user-select: none;
}

.data-table thead th.sortable:hover {
  background: var(--light);
  color: var(--primary);
}

.data-table thead th .sort-icon {
  margin-left: 4px;
  font-size: 0.7rem;
  opacity: 0.4;
}

.data-table thead th.asc .sort-icon,
.data-table thead th.desc .sort-icon {
  opacity: 1;
  color: var(--accent);
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: var(--transition-fast);
}

.data-table tbody tr:last-child { border-bottom: none; }

.data-table tbody tr:hover {
  background: var(--lighter);
}

.data-table tbody td {
  padding: 0.8rem 1rem;
  color: #334155;
  vertical-align: middle;
}

.data-table .actions-cell {
  white-space: nowrap;
}

.reason-cell {
  max-width: 280px;
}

.reason-preview {
  display: inline-block;
  line-height: 1.4;
}

.reason-clickable {
  cursor: pointer;
  border-bottom: 1px dotted var(--accent);
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.reason-clickable:hover,
.reason-clickable:focus {
  color: var(--accent);
  border-bottom-color: var(--accent-dark);
  outline: none;
}

.btn-view-reason {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 500;
  vertical-align: middle;
}

/* ============================================================
   SEARCH & FILTER BAR
   ============================================================ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.search-wrapper {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}

.search-wrapper i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-light);
  font-size: 0.85rem;
}

.search-input {
  width: 100%;
  padding: 0.55rem 0.75rem 0.55rem 2.25rem;
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  font-size: 0.85rem;
  background: var(--white);
  transition: var(--transition-fast);
  font-family: var(--font-primary);
  color: var(--primary);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

.filter-select {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  font-size: 0.85rem;
  background: var(--white);
  font-family: var(--font-primary);
  color: var(--primary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.filter-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
  margin-bottom: 1.1rem;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.4rem;
}

.form-label .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-control {
  display: block;
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  font-family: var(--font-primary);
  color: var(--primary);
  background: #fff;
  transition: var(--transition-fast);
  line-height: 1.5;
  appearance: auto;
}

.form-control::placeholder {
  color: var(--gray-light);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

.form-control.is-valid {
  border-color: var(--success);
}

.form-control.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220,38,38,0.12);
}

.invalid-feedback {
  display: none;
  font-size: 0.78rem;
  color: var(--danger-dark);
  margin-top: 4px;
}

.form-control.is-invalid ~ .invalid-feedback {
  display: block;
}

.form-text {
  font-size: 0.78rem;
  color: var(--gray);
  margin-top: 4px;
}

select.form-control { cursor: pointer; }

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.input-with-toggle {
  position: relative;
}

.input-with-toggle .form-control {
  padding-right: 2.75rem;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--gray-light);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: var(--transition-fast);
}

.password-toggle:hover { color: var(--primary); background: var(--light); }

.password-strength-bar {
  height: 4px;
  border-radius: 2px;
  margin-top: 6px;
  background: var(--light);
  overflow: hidden;
}

.password-strength-fill {
  height: 100%;
  border-radius: 2px;
  transition: var(--transition);
}

.strength-weak   .password-strength-fill { width: 25%;  background: var(--danger); }
.strength-fair   .password-strength-fill { width: 50%;  background: var(--warning); }
.strength-good   .password-strength-fill { width: 75%;  background: var(--info); }
.strength-strong .password-strength-fill { width: 100%; background: var(--success); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.1rem;
  min-height: 38px;
  border-radius: var(--border-radius);
  font-size: 0.85rem;
  font-weight: 500;
  font-family: var(--font-primary);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
  user-select: none;
}

.btn:active { transform: translateY(0.5px); }

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-sm  { padding: 0.4rem 0.85rem; min-height: 32px; font-size: 0.79rem; }
.btn-lg  { padding: 0.8rem 1.6rem;  min-height: 44px; font-size: 0.95rem; }
.btn-xs  { padding: 0.25rem 0.6rem; min-height: 26px; font-size: 0.72rem; }
.btn-block { width: 100%; }
.btn-icon { padding: 0.5rem; width: 36px; height: 36px; min-height: 36px; }
.btn-icon.btn-sm { width: 30px; height: 30px; min-height: 30px; padding: 0.3rem; }

.btn-primary   { background: var(--accent);   color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; text-decoration: none; }

.btn-secondary { background: #475569; color: #fff; border-color: #475569; }
.btn-secondary:hover { background: #334155; color: #fff; text-decoration: none; }

.btn-success   { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: var(--success-dark); color: #fff; text-decoration: none; }

.btn-danger    { background: var(--danger);  color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-dark); color: #fff; text-decoration: none; }

.btn-warning   { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-warning:hover { background: var(--warning-dark); color: #fff; text-decoration: none; }

.btn-info      { background: var(--info);    color: #fff; border-color: var(--info); }
.btn-info:hover { background: var(--info-dark); color: #fff; text-decoration: none; }

.btn-light     { background: var(--white); color: var(--primary); border-color: var(--border); }
.btn-light:hover { background: var(--lighter); border-color: var(--border-strong); text-decoration: none; }

.btn-dark      { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-dark:hover { background: var(--primary-dark); color: #fff; text-decoration: none; }

.btn-outline-primary { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-outline-primary:hover { background: var(--accent-soft); color: var(--accent-dark); text-decoration: none; }

.btn-outline-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-outline-danger:hover { background: var(--danger-light); color: var(--danger-dark); text-decoration: none; }

.btn-outline-secondary { background: transparent; color: #475569; border-color: var(--border-strong); }
.btn-outline-secondary:hover { background: var(--light); color: #1E293B; text-decoration: none; }

/* Loading state */
.btn.loading { pointer-events: none; }
.btn.loading::before {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

/* ============================================================
   BADGES — soft tint bg + accessible dark-tint text
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.71rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.badge-success   { background: var(--success-light); color: var(--success-dark); }
.badge-danger    { background: var(--danger-light);  color: var(--danger-dark); }
.badge-warning   { background: var(--warning-light); color: var(--warning-dark); }
.badge-info      { background: var(--info-light);    color: var(--info-dark); }
.badge-primary   { background: var(--accent-soft);   color: var(--accent-dark); }
.badge-secondary { background: var(--light);          color: #475569; }
.badge-purple    { background: var(--purple-light);  color: var(--purple-dark); }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  padding: 0.875rem 1rem;
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
  font-size: 0.875rem;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  border: 1px solid transparent;
}

.alert-success { background: var(--success-light); color: #14532D; border-color: #BBF7D0; }
.alert-danger  { background: var(--danger-light);  color: #7F1D1D; border-color: #FECACA; }
.alert-warning { background: var(--warning-light); color: #78350F; border-color: #FDE68A; }
.alert-info    { background: var(--info-light);    color: #164E63; border-color: #A5F3FC; }

/* ============================================================
   AVATAR
   ============================================================ */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  flex-shrink: 0;
}

.avatar-sm  { width: 32px; height: 32px; font-size: 0.72rem; }
.avatar-md  { width: 42px; height: 42px; font-size: 0.88rem; }
.avatar-lg  { width: 64px; height: 64px; font-size: 1.2rem; }
.avatar-xl  { width: 90px; height: 90px; font-size: 1.7rem; }
.avatar-circle { border-radius: 50%; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.25rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pagination {
  display: flex;
  gap: 4px;
  align-items: center;
}

.page-item {}

.page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid var(--border);
  color: var(--primary);
  font-size: 0.83rem;
  font-weight: 500;
  transition: var(--transition-fast);
  text-decoration: none;
}

.page-link:hover {
  background: var(--light);
  border-color: var(--border-strong);
  color: var(--primary);
  text-decoration: none;
}

.page-item.active .page-link {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.page-item.disabled .page-link {
  opacity: 0.4;
  pointer-events: none;
}

.pagination-info {
  font-size: 0.8rem;
  color: var(--gray);
}

/* ============================================================
   MODAL / CONFIRM DIALOG
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(2px);
  animation: fadeIn 0.15s ease;
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: #fff;
  border-radius: var(--border-radius-xl);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
  width: 100%;
  max-width: 460px;
  animation: slideInUp 0.2s cubic-bezier(0.4,0,0.2,1);
}

.modal.modal-lg { max-width: 720px; }

.modal-header {
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--gray-light);
  cursor: pointer;
  padding: 5px;
  border-radius: 6px;
  transition: var(--transition-fast);
}

.modal-close:hover { color: var(--danger); background: var(--danger-light); }

.modal-body {
  padding: 1.4rem;
  color: #334155;
}

.modal-footer {
  padding: 1rem 1.4rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: 360px;
  pointer-events: none;
}

.toast {
  background: #fff;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-hover);
  border: 1px solid var(--border);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  border-left: 3px solid var(--toast-color, var(--accent));
  animation: slideInRight 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: all;
  position: relative;
  overflow: hidden;
}

.toast.dismissing {
  animation: slideOutRight 0.2s ease forwards;
}

.toast-success { --toast-color: var(--success); }
.toast-error   { --toast-color: var(--danger); }
.toast-warning { --toast-color: var(--warning); }
.toast-info    { --toast-color: var(--accent); }

.toast-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
  background: var(--toast-color, var(--accent));
  color: #fff;
}

.toast-body { flex: 1; min-width: 0; }
.toast-title   { font-size: 0.83rem; font-weight: 600; color: var(--primary); }
.toast-message { font-size: 0.8rem; color: #475569; margin-top: 2px; }

.toast-close {
  background: none;
  border: none;
  color: var(--gray-light);
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.toast-close:hover { color: var(--danger); }

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--toast-color, var(--accent));
  opacity: 0.4;
  animation: toastProgress linear forwards;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--gray);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--gray-lighter);
}

.empty-state-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.empty-state-text {
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}

/* ============================================================
   SKELETON LOADERS
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--light) 25%, var(--border) 50%, var(--light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 4px;
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
  border-radius: 4px;
}

.skeleton-text:last-child { width: 60%; }

.skeleton-card {
  height: 100px;
  border-radius: var(--border-radius-lg);
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-body {
  background:
    radial-gradient(circle at 15% 15%, rgba(99,102,241,0.35), transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(79,70,229,0.25), transparent 45%),
    linear-gradient(135deg, var(--primary-dark) 0%, #1E1B4B 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
}

.login-wrapper {
  width: 100%;
  max-width: 408px;
}

.login-card {
  background: #fff;
  border-radius: var(--border-radius-xl);
  padding: 2.25rem;
  box-shadow: 0 24px 64px rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.08);
}

.login-brand {
  text-align: center;
  margin-bottom: 1.75rem;
}

.login-logo {
  width: 60px;
  height: 60px;
  background: var(--accent);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: #fff;
  margin: 0 auto 1rem;
  box-shadow: 0 10px 24px rgba(79,70,229,0.35);
}

.login-app-name {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.login-tagline {
  font-size: 0.82rem;
  color: var(--gray);
  margin: 0;
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.forgot-link {
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 500;
}

.back-link {
  font-size: 0.85rem;
  color: var(--gray);
}

.back-link:hover { color: var(--accent); }

.login-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.78rem;
  color: var(--gray);
}

.demo-creds {
  background: var(--lighter);
  color: #475569;
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 0.8rem 1rem;
  font-size: 0.8rem;
  margin-top: 1rem;
  text-align: center;
}

.demo-creds code {
  background: var(--light);
  color: var(--primary);
  padding: 1px 6px;
  border-radius: 4px;
}

/* ============================================================
   HOLIDAY LIST
   ============================================================ */
.holiday-list .holiday-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.holiday-list .holiday-item:last-child { border-bottom: none; }

.holiday-date-badge {
  text-align: center;
  background: var(--lighter);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 6px 10px;
  min-width: 52px;
  flex-shrink: 0;
}

.holiday-date-day  { font-size: 1.25rem; font-weight: 700; color: var(--accent); line-height: 1; }
.holiday-date-month { font-size: 0.63rem; text-transform: uppercase; color: var(--gray); letter-spacing: 0.5px; }
.holiday-name      { font-weight: 600; font-size: 0.875rem; color: var(--primary); }
.holiday-type-label { font-size: 0.75rem; color: var(--gray); }

/* ============================================================
   REPORT FILTERS
   ============================================================ */
.report-filter-card {
  background: #fff;
  border-radius: var(--border-radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
}

.report-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

/* ============================================================
   MONTHLY SUMMARY GRID
   ============================================================ */
.monthly-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.summary-item {
  text-align: center;
  background: var(--lighter);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 1rem;
}

.summary-count {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--primary);
}

.summary-label {
  font-size: 0.75rem;
  color: var(--gray);
  margin-top: 4px;
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.d-flex        { display: flex; }
.d-grid        { display: grid; }
.d-block       { display: block; }
.d-inline      { display: inline; }
.d-none        { display: none; }
.hidden        { display: none !important; }

.align-items-center  { align-items: center; }
.align-items-start   { align-items: flex-start; }
.align-items-end     { align-items: flex-end; }
.justify-content-between { justify-content: space-between; }
.justify-content-center  { justify-content: center; }
.justify-content-end     { justify-content: flex-end; }
.flex-wrap     { flex-wrap: wrap; }
.flex-1        { flex: 1; }

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

.w-100   { width: 100%; }
.w-50    { width: 50%; }
.min-w-0 { min-width: 0; }

.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-left    { text-align: left; }
.text-muted   { color: var(--gray); }
.text-primary { color: var(--primary); }
.text-accent  { color: var(--accent); }
.text-success { color: var(--success-dark); }
.text-danger  { color: var(--danger-dark); }
.text-warning { color: var(--warning-dark); }
.text-info    { color: var(--info-dark); }

.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fs-sm  { font-size: 0.8rem; }
.fs-xs  { font-size: 0.72rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.5rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.5rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }

.rounded     { border-radius: var(--border-radius); }
.rounded-lg  { border-radius: var(--border-radius-lg); }
.rounded-xl  { border-radius: var(--border-radius-xl); }
.rounded-full { border-radius: 50px; }

.overflow-hidden { overflow: hidden; }

/* ============================================================
   ANIMATIONS / KEYFRAMES
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(80px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideOutRight {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(100px); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.04); }
}

@keyframes toastProgress {
  from { width: 100%; }
  to   { width: 0%; }
}

/* ============================================================
   RESPONSIVE — TABLET (max 1024px)
   ============================================================ */
@media (max-width: 1024px) {
  .dashboard-grid,
  .dashboard-split {
    grid-template-columns: 1fr;
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.show {
    display: block;
  }

  .main-content {
    margin-left: 0;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================================
   RESPONSIVE — PROFILE COLLAPSE (max 900px)
   ============================================================ */
@media (max-width: 900px) {
  .profile-layout {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

/* ============================================================
   RESPONSIVE — MOBILE (max 768px)
   ============================================================ */
@media (max-width: 768px) {
  html { font-size: 14px; }

  html, body {
    overflow-x: hidden;
    max-width: 100vw;
  }

  .app-layout {
    overflow-x: hidden;
  }

  .main-content {
    width: 100%;
    min-width: 0;
  }

  .content-area {
    padding: 1rem 0.85rem;
    overflow-x: hidden;
  }

  .app-header {
    padding: 0 0.85rem;
  }

  .stats-grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; }

  .form-row { grid-template-columns: 1fr; }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
  }

  .page-title {
    font-size: 1.25rem;
  }

  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .filter-bar {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .filter-bar > * {
    width: 100%;
  }

  .filter-bar .filter-select,
  .filter-bar .form-control {
    width: 100%;
  }

  .filter-bar div[style*="display:flex"] {
    width: 100%;
    flex-wrap: wrap;
  }

  .filter-bar div[style*="display:flex"] input[type="date"] {
    flex: 1 1 calc(50% - 1rem);
    min-width: 120px;
  }

  /* Check-in Card (Mobile) */
  .checkin-card {
    padding: 1.5rem 1rem;
    border-radius: var(--border-radius-lg);
  }

  .checkin-time-display {
    font-size: 2.25rem;
    margin: 0.25rem 0;
  }

  .checkin-actions {
    margin: 1rem 0;
    gap: 0.75rem;
  }

  .checkin-status-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem 0.5rem;
    margin-top: 0.75rem;
  }

  .checkin-status-item {
    align-items: center;
    text-align: center;
  }

  .working-hours-display {
    font-size: 1.5rem;
  }

  .toast-container { max-width: calc(100vw - 2rem); right: 1rem; }

  .notification-dropdown {
    width: min(320px, calc(100vw - 2rem));
    right: -10px;
    max-width: calc(100vw - 2rem);
  }

  .user-dropdown {
    width: min(280px, calc(100vw - 2rem));
    right: 0;
    max-width: calc(100vw - 2rem);
  }

  .monthly-summary { grid-template-columns: repeat(2, 1fr); }

  .leave-balance-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .modal { margin: 0 0.5rem; }

  .table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ============================================================
   RESPONSIVE — SMALL MOBILE (max 480px)
   ============================================================ */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }

  .login-card { padding: 1.75rem 1.25rem; }

  /* Check-in Card (Small Mobile) */
  .checkin-card {
    padding: 1.25rem 0.75rem;
  }

  .checkin-time-display {
    font-size: 1.85rem;
    letter-spacing: 0;
  }

  .checkin-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }

  .checkin-actions .checkin-btn {
    width: 100%;
    justify-content: center;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
  }

  .checkin-status-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 0.5rem;
  }

  .checkin-status-label {
    font-size: 0.65rem;
  }

  .checkin-status-value {
    font-size: 0.85rem;
  }

  .working-hours-display {
    font-size: 1.25rem;
  }

  /* Leave Balance Grid */
  .leave-balance-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .leave-balance-card {
    padding: 0.75rem 0.5rem;
  }

  .leave-balance-type {
    font-size: 0.68rem;
    margin-bottom: 0.4rem;
  }

  .leave-balance-number {
    font-size: 1.6rem;
  }

  .monthly-summary { grid-template-columns: 1fr 1fr; gap: 0.5rem; }

  .notification-dropdown {
    width: calc(100vw - 1.5rem);
    right: -45px;
    left: auto;
  }

  .user-menu-btn span.user-name { display: none; }

  .pagination-nav { flex-direction: column; }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  .sidebar,
  .app-header,
  .sidebar-overlay,
  .toast-container,
  .page-header .page-actions,
  .filter-bar,
  .pagination-nav,
  .btn,
  .no-print {
    display: none !important;
  }

  .print-header {
    display: block !important;
  }

  .modal-overlay {
    position: static !important;
    background: transparent !important;
    display: block !important;
    padding: 0 !important;
  }

  .modal-overlay.hidden {
    display: none !important;
  }

  .modal {
    box-shadow: none !important;
    border: none !important;
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
  }

  .modal-header,
  .modal-footer {
    display: none !important;
  }

  .modal-body {
    padding: 0 !important;
  }

  .main-content {
    margin-left: 0 !important;
    padding: 0 !important;
  }

  .content-area {
    padding: 0 !important;
  }

  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt;
  }

  .printable-slip {
    display: block !important;
  }

  .card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
    page-break-inside: avoid;
  }

  .table {
    width: 100% !important;
    border-collapse: collapse !important;
  }

  .table th, .table td {
    border: 1px solid #ddd !important;
    padding: 6px 8px !important;
  }

  @page {
    margin: 1.2cm;
  }
}
