/* =========================================================
   Decore — Construction Management Dashboard
   Theme stylesheet
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Color Palette (Indigo/Violet & Teal accents) */
  --decore-primary: #6366F1;
  --decore-primary-dark: #4F46E5;
  --decore-primary-light: #818CF8;
  --decore-primary-rgb: 99, 102, 241;
  
  --decore-secondary: #0EA5E9;
  --decore-secondary-dark: #0284C7;
  
  --decore-accent-success: #10B981;
  --decore-accent-success-rgb: 16, 185, 129;
  
  --decore-accent-warning: #F59E0B;
  --decore-accent-warning-rgb: 245, 158, 11;
  
  --decore-accent-danger: #EF4444;
  --decore-accent-danger-rgb: 239, 68, 68;

  --decore-bg-color: #F8FAFC;
  --decore-bg: linear-gradient(135deg, #F8FAFC 0%, #E2E8F0 100%);
  --decore-card-bg: rgba(255, 255, 255, 0.8);
  --decore-border: rgba(226, 232, 240, 0.8);
  
  --decore-text: #0F172A;
  --decore-text-muted: #64748B;
  
  /* Dimensions & Options */
  --decore-sidebar-width: 260px;
  --decore-sidebar-collapsed: 80px;
  --decore-navbar-height: 70px;
  --decore-radius: 1rem;
  
  /* Shadows & Glassmorphism Blur */
  --decore-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05), 0 2px 8px -1px rgba(15, 23, 42, 0.03);
  --decore-shadow-lg: 0 20px 40px -10px rgba(15, 23, 42, 0.08), 0 10px 20px -8px rgba(15, 23, 42, 0.04);
  --decore-shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
  --decore-blur: blur(16px);
  
  --decore-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark mode variables */
[data-bs-theme="dark"] {
  --decore-bg-color: #0B0F19;
  --decore-bg: linear-gradient(135deg, #090D16 0%, #0F172A 100%);
  --decore-card-bg: rgba(15, 23, 42, 0.75);
  --decore-border: rgba(30, 41, 59, 0.8);
  --decore-text: #F8FAFC;
  --decore-text-muted: #94A3B8;
  --decore-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.3), 0 2px 8px -1px rgba(0, 0, 0, 0.2);
  --decore-shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.4), 0 10px 20px -8px rgba(0, 0, 0, 0.3);
  --decore-shadow-glow: 0 0 20px rgba(99, 102, 241, 0.25);
}

* {
  box-sizing: border-box;
}

body {
  background-color: var(--decore-bg-color);
  /* Use a pseudo-element for the fixed gradient so it is on its own
     compositor layer — scrolling no longer causes full-page repaints */
  color: var(--decore-text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  z-index: 0;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  will-change: opacity;
  transition: opacity 0.4s ease-in-out;
  pointer-events: none;
}

/* Light gradient background layer */
body::before {
  background: linear-gradient(135deg, #F8FAFC 0%, #E2E8F0 100%);
  opacity: 1;
}

[data-bs-theme="dark"] body::before {
  opacity: 0;
}

/* Dark gradient background layer */
body::after {
  background: linear-gradient(135deg, #090D16 0%, #0F172A 100%);
  opacity: 0;
}

[data-bs-theme="dark"] body::after {
  opacity: 1;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 700;
  color: var(--decore-text);
}

a {
  text-decoration: none;
  color: var(--decore-primary);
  transition: var(--decore-transition);
}
a:hover {
  color: var(--decore-primary-dark);
}

/* Custom Scrollbar (Desktop only) */
@media (min-width: 992px) {
  ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }
  ::-webkit-scrollbar-track {
    background: transparent;
  }
  ::-webkit-scrollbar-thumb {
    background: var(--decore-border);
    border-radius: 10px;
  }
  ::-webkit-scrollbar-thumb:hover {
    background: var(--decore-primary-light);
  }
}

/* Hide scrollbars on mobile */
@media (max-width: 991.98px) {
  ::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }
  * {
    -ms-overflow-style: none !important;  /* IE and Edge */
    scrollbar-width: none !important;  /* Firefox */
  }
  *::-webkit-scrollbar {
    display: none !important;
  }
}

/* =========================================================
   Layout shell (Floating modern aesthetic)
   ========================================================= */
.decore-wrapper {
  display: flex;
  min-height: 100vh;
  padding: 1rem;
  gap: 1rem;
}

.decore-main {
  flex: 1;
  margin-left: calc(var(--decore-sidebar-width) + 1rem);
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 2rem);
  transition: var(--decore-transition);
  width: 0; /* flexbox fix for nested overflow */
}

.decore-wrapper.sidebar-collapsed .decore-main {
  margin-left: calc(var(--decore-sidebar-collapsed) + 1rem);
}

.decore-content {
  flex: 1;
  padding: 1.5rem 0 0 0;
}

@media (max-width: 991.98px) {
  .decore-wrapper {
    padding: 0.75rem;
  }
  .decore-main {
    margin-left: 0 !important;
    padding-right: 0;
  }
  .decore-content {
    padding: 1rem 0 0 0;
  }
}

/* =========================================================
   Sidebar
   ========================================================= */
.decore-sidebar {
  width: var(--decore-sidebar-width);
  background: linear-gradient(180deg, #1E1B4B 0%, #0F172A 100%);
  color: #fff;
  position: fixed;
  top: 1rem;
  left: 1rem;
  bottom: 1rem;
  border-radius: 1.25rem;
  display: flex;
  flex-direction: column;
  z-index: 1030;
  transition: var(--decore-transition);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--decore-shadow-lg);
  overflow: hidden;
}

.decore-wrapper.sidebar-collapsed .decore-sidebar {
  width: var(--decore-sidebar-collapsed);
}

.decore-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem;
  height: var(--decore-navbar-height);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  white-space: nowrap;
  letter-spacing: -0.02em;
}

.decore-sidebar-brand .bi {
  font-size: 1.6rem;
  background: linear-gradient(135deg, #38BDF8, #818CF8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  flex-shrink: 0;
}

.decore-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.75rem;
}

.decore-sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: rgba(248, 250, 252, 0.65);
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.925rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
  white-space: nowrap;
  transition: var(--decore-transition);
}

.decore-sidebar-nav .nav-link .bi {
  font-size: 1.2rem;
  width: 1.4rem;
  text-align: center;
  flex-shrink: 0;
  transition: var(--decore-transition);
}

.decore-sidebar-nav .nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.decore-sidebar-nav .nav-link:hover .bi {
  transform: scale(1.15);
  color: var(--decore-primary-light);
}

.decore-sidebar-nav .nav-link.active {
  background: linear-gradient(135deg, var(--decore-primary), #4F46E5);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.decore-sidebar-nav .nav-link.active .bi {
  color: #fff !important;
}

.decore-sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.decore-sidebar-footer .nav-link {
  color: rgba(248, 250, 252, 0.65);
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.925rem;
}
.decore-sidebar-footer .nav-link:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #FCA5A5;
}

.decore-wrapper.sidebar-collapsed .decore-sidebar-brand span,
.decore-wrapper.sidebar-collapsed .decore-sidebar-nav .nav-link span,
.decore-wrapper.sidebar-collapsed .decore-sidebar-footer span {
  display: none;
}

.decore-wrapper.sidebar-collapsed .decore-sidebar-brand {
  justify-content: center;
  padding: 1.5rem 0;
}

/* Mobile off-canvas side pane */
@media (max-width: 991.98px) {
  .decore-sidebar {
    left: -280px;
    top: 0.75rem;
    bottom: 0.75rem;
    box-shadow: none;
  }
  .decore-wrapper.sidebar-mobile-open .decore-sidebar {
    left: 0.75rem;
    box-shadow: var(--decore-shadow-lg);
  }
  .decore-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    z-index: 1025;
  }
  .decore-wrapper.sidebar-mobile-open .decore-sidebar-backdrop {
    display: block;
  }
}

/* =========================================================
   Top navbar (Glass floating design)
   ========================================================= */
.decore-navbar {
  /* Keep account and notification menus above page headers, cards, and actions. */
  position: relative;
  z-index: 1040;
  height: var(--decore-navbar-height);
  background: var(--decore-card-bg);
  backdrop-filter: var(--decore-blur);
  -webkit-backdrop-filter: var(--decore-blur);
  border: 1px solid var(--decore-border);
  border-radius: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  box-shadow: var(--decore-shadow);
  transition: var(--decore-transition);
}

.decore-navbar .decore-search {
  max-width: 320px;
}

.decore-navbar .decore-search .input-group-text {
  background: transparent !important;
  border-color: var(--decore-border);
  color: var(--decore-text-muted);
}
.decore-navbar .decore-search .form-control {
  border-color: var(--decore-border);
  background: transparent;
  color: var(--decore-text);
}
.decore-navbar .decore-search .form-control:focus {
  box-shadow: none;
  border-color: var(--decore-primary);
}

.decore-navbar .btn-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--decore-border);
  background: transparent;
  color: var(--decore-text-muted);
  position: relative;
  transition: var(--decore-transition);
}

.decore-navbar .btn-icon:hover {
  background: rgba(99, 102, 241, 0.08);
  color: var(--decore-primary);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-1px);
}

.decore-navbar .btn-icon:active {
  transform: translateY(1px);
}

.decore-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--decore-primary) 0%, #4F46E5 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.25);
  transition: var(--decore-transition);
}
.decore-avatar:hover {
  transform: rotate(5deg) scale(1.05);
}

/* =========================================================
   Cards (Premium glass design)
   ========================================================= */
.decore-card {
  background: var(--decore-card-bg);
  backdrop-filter: var(--decore-blur);
  -webkit-backdrop-filter: var(--decore-blur);
  border: 1px solid var(--decore-border);
  border-radius: var(--decore-radius);
  box-shadow: var(--decore-shadow);
  transition: var(--decore-transition);
  overflow: hidden;
}

.decore-card:hover {
  box-shadow: var(--decore-shadow-lg);
  border-color: rgba(99, 102, 241, 0.2);
}

/* Interactive card actions */
.decore-card-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--decore-shadow-lg), var(--decore-shadow-glow);
}

.decore-stat-card {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.decore-stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  transition: var(--decore-transition);
}

.decore-stat-card:hover .decore-stat-icon {
  transform: scale(1.1) rotate(-3deg);
}

.bg-primary-soft { background: rgba(99, 102, 241, 0.12) !important; color: var(--decore-primary) !important; }
.bg-secondary-soft { background: rgba(14, 165, 233, 0.12) !important; color: var(--decore-secondary) !important; }
.bg-success-soft { background: rgba(16, 185, 129, 0.12) !important; color: var(--decore-accent-success) !important; }
.bg-danger-soft { background: rgba(239, 68, 68, 0.12) !important; color: var(--decore-accent-danger) !important; }
.bg-warning-soft { background: rgba(245, 158, 11, 0.12) !important; color: var(--decore-accent-warning) !important; }

.decore-stat-value {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  white-space: nowrap !important;
}

.decore-stat-label {
  color: var(--decore-text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.decore-stat-trend {
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  margin-top: 0.25rem;
}

/* Mobile responsive stat card optimizations */
@media (max-width: 575.98px) {
  .decore-stat-card {
    padding: 0.85rem 0.75rem !important;
    gap: 0.65rem !important;
    align-items: center !important;
  }
  .decore-stat-icon {
    width: 40px !important;
    height: 40px !important;
    font-size: 1.1rem !important;
    border-radius: 0.65rem !important;
  }
  .decore-stat-value {
    font-size: 1.05rem !important;
  }
  .decore-stat-label {
    font-size: 0.7rem !important;
    margin-bottom: 0.1rem !important;
    letter-spacing: 0.02em !important;
  }
  .decore-stat-trend {
    font-size: 0.65rem !important;
    margin-top: 0.1rem !important;
  }
}

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

.decore-card-header h6 {
  margin: 0;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.decore-card-body {
  padding: 1.5rem;
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  border-radius: 0.75rem;
  padding: 0.55rem 1.15rem;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--decore-transition);
}

.btn:active {
  transform: scale(0.97);
}

.btn-decore-primary {
  background: linear-gradient(135deg, var(--decore-primary) 0%, var(--decore-primary-dark) 100%);
  border: none;
  color: #fff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
}
.btn-decore-primary:hover {
  background: linear-gradient(135deg, var(--decore-primary-light) 0%, var(--decore-primary) 100%);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
}

.btn-decore-secondary {
  background: linear-gradient(135deg, var(--decore-secondary) 0%, var(--decore-secondary-dark) 100%);
  border: none;
  color: #fff;
  box-shadow: 0 4px 15px rgba(14, 165, 233, 0.2);
}
.btn-decore-secondary:hover {
  background: linear-gradient(135deg, #38bdf8 0%, var(--decore-secondary) 100%);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.3);
}

.btn-outline-secondary {
  border-color: var(--decore-border);
  color: var(--decore-text);
}
.btn-outline-secondary:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: var(--decore-primary-light);
  color: var(--decore-primary);
}

/* =========================================================
   Tables
   ========================================================= */
.table-responsive {
  border-radius: 0 0 var(--decore-radius) var(--decore-radius);
}

.decore-table {
  vertical-align: middle;
}

.decore-table thead th {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--decore-text-muted);
  border-bottom: 2px solid var(--decore-border);
  padding: 1rem 1.25rem;
  font-weight: 700;
  background: rgba(148, 163, 184, 0.04);
}

.decore-table td {
  padding: 0.95rem 1.25rem;
  border-bottom: 1px solid var(--decore-border);
  color: var(--decore-text);
}

.decore-table tbody tr {
  transition: var(--decore-transition);
}

.decore-table tbody tr:hover {
  background-color: rgba(99, 102, 241, 0.03) !important;
}

/* =========================================================
   Status badges with glowing dot indicator
   ========================================================= */
.decore-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 50rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.decore-status-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

/* Active / Approved / Completed */
.badge-success {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.badge-success .dot {
  background: #10B981;
  box-shadow: 0 0 8px #10B981;
}

/* On Hold / Pending / Late */
.badge-warning {
  background: rgba(245, 158, 11, 0.12);
  color: #D97706;
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.badge-warning .dot {
  background: #F59E0B;
  box-shadow: 0 0 8px #F59E0B;
}

/* Inactive / Danger / Rejected / Absent */
.badge-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #DC2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.badge-danger .dot {
  background: #EF4444;
  box-shadow: 0 0 8px #EF4444;
}

/* Info / Overtime */
.badge-info {
  background: rgba(14, 165, 233, 0.12);
  color: #0284C7;
  border: 1px solid rgba(14, 165, 233, 0.2);
}
.badge-info .dot {
  background: #0EA5E9;
  box-shadow: 0 0 8px #0EA5E9;
}

/* Standard Gray Badge */
.decore-badge {
  padding: 0.35rem 0.7rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
}

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

.decore-page-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.2rem;
}

.decore-breadcrumb {
  font-size: 0.875rem;
  color: var(--decore-text-muted);
  font-weight: 500;
}

/* =========================================================
   Loading Page-Level Skeleton Overlay
   ========================================================= */
.decore-loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--decore-bg-color);
  display: none;
  z-index: 2500;
  overflow: hidden;
  will-change: opacity;
}

.decore-loading-overlay.active {
  display: block;
  animation: decore-skeleton-fade-in 0.18s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes decore-skeleton-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (max-width: 991.98px) {
  .mobile-skeleton-adjust {
    margin-left: 0 !important;
    padding: 1rem !important;
  }
}

/* =========================================================
   Auth / login page
   ========================================================= */
.decore-auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top right, #1E1B4B 0%, #090D16 100%);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

/* Abstract blobs behind auth card */
.decore-auth-wrapper::before {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  top: -100px;
  right: -100px;
  border-radius: 50%;
}
.decore-auth-wrapper::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.15) 0%, transparent 70%);
  bottom: -150px;
  left: -150px;
  border-radius: 50%;
}

.decore-auth-card {
  width: 100%;
  max-width: 440px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.5rem;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
  padding: 3rem 2.5rem;
  z-index: 10;
  color: #fff;
}

.decore-auth-card h4 {
  color: #fff;
}

.decore-auth-card .form-control, 
.decore-auth-card .form-select {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.decore-auth-card .form-control::placeholder {
  color: rgba(255, 255, 255, 0.4);
}
.decore-auth-card .form-control:focus,
.decore-auth-card .form-select:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--decore-primary-light);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.25);
  color: #fff;
}

.decore-auth-card .input-group-text {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
}

.decore-auth-logo {
  width: 60px;
  height: 60px;
  border-radius: 1.15rem;
  background: linear-gradient(135deg, var(--decore-primary) 0%, #4F46E5 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

/* =========================================================
   Chart wrappers & options
   ========================================================= */
.decore-chart-wrap {
  position: relative;
  width: 100%;
}

/* =========================================================
   Forms (Premium inputs styling)
   ========================================================= */
.form-label {
  color: var(--decore-text);
  font-weight: 600;
  font-size: 0.825rem;
  margin-bottom: 0.4rem;
}

.form-control, .form-select, .input-group-text {
  border-radius: 0.75rem;
  padding: 0.6rem 0.85rem;
  font-size: 0.9rem;
  background-color: var(--decore-card-bg);
  border: 1px solid var(--decore-border);
  color: var(--decore-text);
  transition: var(--decore-transition);
}

.form-control:focus, .form-select:focus {
  border-color: var(--decore-primary-light);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
  background-color: var(--decore-card-bg);
  color: var(--decore-text);
}

.form-check-input:checked {
  background-color: var(--decore-primary);
  border-color: var(--decore-primary);
}

/* =========================================================
   Empty states
   ========================================================= */
.decore-empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--decore-text-muted);
}

.decore-empty-state .bi {
  font-size: 3rem;
  background: linear-gradient(135deg, var(--decore-primary-light) 0%, rgba(99, 102, 241, 0.2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
  display: block;
}

/* =========================================================
   Settings Tab Styling
   ========================================================= */
.list-group-item {
  background-color: transparent;
  border-color: var(--decore-border);
  color: var(--decore-text);
  padding: 0.9rem 1.25rem;
  font-weight: 500;
  font-size: 0.925rem;
  display: flex;
  align-items: center;
  transition: var(--decore-transition);
}

.list-group-item .bi {
  font-size: 1.15rem;
  color: var(--decore-text-muted);
  transition: var(--decore-transition);
}

.list-group-item:hover {
  background-color: rgba(99, 102, 241, 0.05);
  color: var(--decore-primary);
}

.list-group-item:hover .bi {
  color: var(--decore-primary);
  transform: translateX(2px);
}

.list-group-item.active {
  background: linear-gradient(135deg, var(--decore-primary) 0%, var(--decore-primary-dark) 100%);
  color: #fff;
  border-color: transparent;
}

.list-group-item.active .bi {
  color: #fff !important;
}

/* =========================================================
   Dropdowns
   ========================================================= */
.dropdown-menu {
  border: 1px solid var(--decore-border);
  background-color: var(--decore-card-bg);
  backdrop-filter: var(--decore-blur);
  -webkit-backdrop-filter: var(--decore-blur);
  border-radius: 0.75rem;
  box-shadow: var(--decore-shadow-lg);
  padding: 0.4rem;
}

/* Bootstrap's default menu layer is too low when a page contains elevated UI. */
.decore-navbar .dropdown-menu {
  z-index: 1050;
}

.dropdown-item {
  padding: 0.55rem 1rem;
  font-size: 0.875rem;
  border-radius: 0.5rem;
  font-weight: 500;
  color: var(--decore-text);
  transition: var(--decore-transition);
}

.dropdown-item:hover {
  background-color: rgba(99, 102, 241, 0.08);
  color: var(--decore-primary);
}

/* =========================================================
   Utilities
   ========================================================= */
.text-decore-primary { color: var(--decore-primary) !important; }
.text-decore-secondary { color: var(--decore-secondary) !important; }
.bg-decore-primary { background: linear-gradient(135deg, var(--decore-primary) 0%, var(--decore-primary-dark) 100%) !important; }
.bg-decore-secondary { background: linear-gradient(135deg, var(--decore-secondary) 0%, var(--decore-secondary-dark) 100%) !important; }

.avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
}
.avatar-md {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}

.decore-footer {
  background: var(--decore-card-bg);
  backdrop-filter: var(--decore-blur);
  -webkit-backdrop-filter: var(--decore-blur);
  border-color: var(--decore-border) !important;
  color: var(--decore-text-muted);
}

/* Premium separate row table layout */
.decore-table-premium {
  border-collapse: separate !important;
  border-spacing: 0 10px !important;
  width: 100%;
}

.decore-table-premium thead th {
  border: none !important;
  font-size: 0.72rem !important;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--decore-text-muted);
  padding: 8px 16px !important;
}

.decore-table-premium tbody tr {
  background: var(--decore-card-bg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  border-radius: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.decore-table-premium tbody tr:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 16px var(--decore-card-glow);
  background: rgba(99, 102, 241, 0.02) !important;
}

[data-bs-theme="dark"] .decore-table-premium tbody tr:hover {
  background: rgba(99, 102, 241, 0.06) !important;
}

.decore-table-premium tbody td {
  padding: 14px 16px !important;
  vertical-align: middle;
  border-top: 1px solid var(--decore-border) !important;
  border-bottom: 1px solid var(--decore-border) !important;
  border-left: none !important;
  border-right: none !important;
  background: transparent !important;
  color: var(--decore-text) !important;
}

.decore-table-premium tbody td:first-child {
  border-left: 1px solid var(--decore-border) !important;
  border-top-left-radius: 12px !important;
  border-bottom-left-radius: 12px !important;
}

.decore-table-premium tbody td:last-child {
  border-right: 1px solid var(--decore-border) !important;
  border-top-right-radius: 12px !important;
  border-bottom-right-radius: 12px !important;
}

.text-nowrap-custom {
  white-space: nowrap !important;
}

.avatar-premium {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  background: linear-gradient(135deg, var(--decore-primary) 0%, var(--decore-primary-dark) 100%);
  color: white;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.2);
}

/* Responsive select dropdown status colors */
.status-select-present {
  background-color: rgba(16, 185, 129, 0.1) !important;
  color: #059669 !important;
  border-color: rgba(16, 185, 129, 0.25) !important;
  font-weight: 700 !important;
}

.status-select-late {
  background-color: rgba(245, 158, 11, 0.1) !important;
  color: #D97706 !important;
  border-color: rgba(245, 158, 11, 0.25) !important;
  font-weight: 700 !important;
}

.status-select-absent {
  background-color: rgba(239, 68, 68, 0.1) !important;
  color: #DC2626 !important;
  border-color: rgba(239, 68, 68, 0.25) !important;
  font-weight: 700 !important;
}

.status-select-overtime {
  background-color: rgba(14, 165, 233, 0.1) !important;
  color: #0284C7 !important;
  border-color: rgba(14, 165, 233, 0.25) !important;
  font-weight: 700 !important;
}

@keyframes pulse-warning {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(245, 158, 11, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }
}

/* Custom form-select arrow padding & option theme compatibility fixes */
.form-select {
  padding-right: 2.25rem !important;
}
.form-select-sm {
  padding-right: 2rem !important;
  padding-top: 0.25rem !important;
  padding-bottom: 0.25rem !important;
  font-size: 0.825rem !important;
}
.form-select option {
  background-color: var(--decore-bg-color) !important;
  color: var(--decore-text) !important;
}

/* =========================================================
   Skeleton Loading Animation
   ========================================================= */
.decore-skeleton {
  background: linear-gradient(90deg, var(--decore-border) 25%, rgba(148, 163, 184, 0.15) 50%, var(--decore-border) 75%);
  background-size: 200% 100%;
  animation: skeleton-glow 1.5s infinite ease-in-out;
  border-radius: 6px;
  display: inline-block;
  height: 1.25em;
  width: 100%;
  vertical-align: middle;
}

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

/* =========================================================
   Smooth Theme Morph Transition
   ========================================================= */
.theme-transitioning,
.theme-transitioning *,
.theme-transitioning ::before,
.theme-transitioning ::after {
  transition: background 0.4s ease, background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease !important;
  transition-delay: 0s !important;
}

/* =========================================================
   UNIVERSAL HIGH-CONTRAST DARK MODE OVERRIDES
   ========================================================= */
[data-bs-theme="dark"],
[data-theme="dark"],
html[data-bs-theme="dark"],
body.dark-mode {
  color: #F8FAFC !important;
}

/* Override Bootstrap text utility colors in Dark Mode for high contrast */
[data-bs-theme="dark"] .text-primary,
[data-theme="dark"] .text-primary,
html[data-bs-theme="dark"] .text-primary,
.dark-mode .text-primary {
  color: #818CF8 !important; /* Bright Indigo */
}

[data-bs-theme="dark"] .text-info,
[data-theme="dark"] .text-info,
html[data-bs-theme="dark"] .text-info,
.dark-mode .text-info {
  color: #38BDF8 !important; /* Bright Cyan */
}

[data-bs-theme="dark"] .text-success,
[data-theme="dark"] .text-success,
html[data-bs-theme="dark"] .text-success,
.dark-mode .text-success {
  color: #34D399 !important; /* Bright Emerald Green */
}

[data-bs-theme="dark"] .text-danger,
[data-theme="dark"] .text-danger,
html[data-bs-theme="dark"] .text-danger,
.dark-mode .text-danger {
  color: #F87171 !important; /* Bright Coral Red */
}

[data-bs-theme="dark"] .text-warning,
[data-theme="dark"] .text-warning,
html[data-bs-theme="dark"] .text-warning,
.dark-mode .text-warning {
  color: #FBBF24 !important; /* Bright Amber Yellow */
}

[data-bs-theme="dark"] .text-muted,
[data-theme="dark"] .text-muted,
html[data-bs-theme="dark"] .text-muted,
.dark-mode .text-muted {
  color: #CBD5E1 !important; /* Bright Slate Gray */
}

[data-bs-theme="dark"] .text-secondary,
[data-theme="dark"] .text-secondary,
html[data-bs-theme="dark"] .text-secondary,
.dark-mode .text-secondary {
  color: #94A3B8 !important;
}

[data-bs-theme="dark"] .text-dark,
[data-theme="dark"] .text-dark,
html[data-bs-theme="dark"] .text-dark,
.dark-mode .text-dark {
  color: #F8FAFC !important;
}

[data-bs-theme="dark"] .text-decore-primary,
[data-theme="dark"] .text-decore-primary,
html[data-bs-theme="dark"] .text-decore-primary,
.dark-mode .text-decore-primary {
  color: #A5B4FC !important;
}

/* Stat card elements in Dark Mode */
[data-bs-theme="dark"] .decore-stat-label,
[data-theme="dark"] .decore-stat-label,
.dark-mode .decore-stat-label {
  color: #E2E8F0 !important;
  font-weight: 700 !important;
}

[data-bs-theme="dark"] .decore-stat-value,
[data-theme="dark"] .decore-stat-value,
.dark-mode .decore-stat-value {
  color: #FFFFFF !important;
}

[data-bs-theme="dark"] .decore-stat-trend,
[data-theme="dark"] .decore-stat-trend,
.dark-mode .decore-stat-trend {
  font-weight: 600 !important;
}

/* Dark mode cards & backgrounds */
[data-bs-theme="dark"] .decore-card,
[data-theme="dark"] .decore-card,
.dark-mode .decore-card {
  background-color: #0F172A !important;
  border-color: #1E293B !important;
  color: #F8FAFC !important;
}

[data-bs-theme="dark"] .decore-card-header,
[data-theme="dark"] .decore-card-header,
.dark-mode .decore-card-header {
  border-bottom-color: #1E293B !important;
  color: #F8FAFC !important;
}

[data-bs-theme="dark"] .decore-page-title,
[data-theme="dark"] .decore-page-title,
.dark-mode .decore-page-title {
  color: #FFFFFF !important;
}

[data-bs-theme="dark"] .decore-breadcrumb,
[data-theme="dark"] .decore-breadcrumb,
.dark-mode .decore-breadcrumb {
  color: #94A3B8 !important;
}

/* Light background blocks in dark mode */
[data-bs-theme="dark"] .bg-light,
[data-bs-theme="dark"] .bg-light-soft,
[data-theme="dark"] .bg-light,
[data-theme="dark"] .bg-light-soft,
.dark-mode .bg-light,
.dark-mode .bg-light-soft {
  background-color: #1E293B !important;
  color: #F8FAFC !important;
}

[data-bs-theme="dark"] .bg-white,
[data-theme="dark"] .bg-white,
.dark-mode .bg-white {
  background-color: #1E293B !important;
  color: #F8FAFC !important;
}

/* Icon soft backgrounds in Dark Mode */
[data-bs-theme="dark"] .bg-primary-soft,
[data-theme="dark"] .bg-primary-soft,
.dark-mode .bg-primary-soft {
  background-color: rgba(99, 102, 241, 0.25) !important;
}

[data-bs-theme="dark"] .bg-info-soft,
[data-theme="dark"] .bg-info-soft,
.dark-mode .bg-info-soft {
  background-color: rgba(14, 165, 233, 0.25) !important;
}

[data-bs-theme="dark"] .bg-success-soft,
[data-theme="dark"] .bg-success-soft,
.dark-mode .bg-success-soft {
  background-color: rgba(16, 185, 129, 0.25) !important;
}

[data-bs-theme="dark"] .bg-danger-soft,
[data-theme="dark"] .bg-danger-soft,
.dark-mode .bg-danger-soft {
  background-color: rgba(239, 68, 68, 0.25) !important;
}

[data-bs-theme="dark"] .bg-warning-soft,
[data-theme="dark"] .bg-warning-soft,
.dark-mode .bg-warning-soft {
  background-color: rgba(245, 158, 11, 0.25) !important;
}

[data-bs-theme="dark"] .btn-light,
[data-theme="dark"] .btn-light,
.dark-mode .btn-light {
  background-color: #1E293B !important;
  border-color: #334155 !important;
  color: #F8FAFC !important;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
.dark-mode .form-control,
.dark-mode .form-select {
  background-color: #0F172A !important;
  border-color: #334155 !important;
  color: #F8FAFC !important;
}

[data-bs-theme="dark"] .modal-content,
[data-theme="dark"] .modal-content,
.dark-mode .modal-content {
  background-color: #0F172A !important;
  color: #F8FAFC !important;
  border-color: #334155 !important;
}

[data-bs-theme="dark"] .table,
[data-theme="dark"] .table,
.dark-mode .table {
  color: #F8FAFC !important;
}

/* =========================================================
   Overall Premium UI/UX & Micro-Interaction Polish
   ========================================================= */
.decore-card-lift {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s ease !important;
}
.decore-card-lift:hover {
  transform: translateY(-3px) scale(1.003);
  box-shadow: 0 12px 28px -6px rgba(99, 102, 241, 0.18), 0 4px 12px -2px rgba(15, 23, 42, 0.08) !important;
}

/* Live Status Badge Pulse Indicator */
.decore-status-badge.badge-success .dot {
  animation: live-dot-pulse 2s infinite ease-in-out;
}
@keyframes live-dot-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* Touch Active Feedback on Mobile Cards */
@media (max-width: 991.98px) {
  .decore-card:active,
  .btn:active {
    transform: scale(0.98) !important;
    transition: transform 0.1s ease !important;
  }
}

/* Smooth Focus Rings for Form Controls */
.form-control:focus,
.form-select:focus {
  border-color: var(--decore-primary) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2) !important;
}

/* =========================================================
   COMPREHENSIVE FORM UI/UX UPGRADE SYSTEM
   ========================================================= */
.form-label {
  font-weight: 600 !important;
  font-size: 0.825rem !important;
  color: var(--decore-text) !important;
  margin-bottom: 0.4rem !important;
  letter-spacing: 0.01em !important;
}

.form-control,
.form-select {
  border-radius: 0.85rem !important;
  padding: 0.65rem 1rem !important;
  font-size: 0.9rem !important;
  border: 1.5px solid var(--decore-border) !important;
  background-color: var(--decore-card-bg) !important;
  color: var(--decore-text) !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease !important;
}

.form-control:hover,
.form-select:hover {
  border-color: rgba(99, 102, 241, 0.4) !important;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--decore-primary) !important;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18) !important;
  background-color: var(--decore-card-bg) !important;
  outline: none !important;
}

.input-group-text {
  border-radius: 0.85rem 0 0 0.85rem !important;
  border: 1.5px solid var(--decore-border) !important;
  border-right: none !important;
  background-color: rgba(99, 102, 241, 0.08) !important;
  color: var(--decore-primary) !important;
  font-weight: 700 !important;
  padding-left: 1rem !important;
  padding-right: 1rem !important;
}

.input-group > .form-control {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}

.form-text {
  font-size: 0.75rem !important;
  color: var(--decore-text-muted) !important;
  margin-top: 0.35rem !important;
}

/* Valid & Invalid State Highlights */
.form-control:valid:not(:placeholder-shown) {
  border-color: rgba(16, 185, 129, 0.5) !important;
}

.form-control:invalid:not(:placeholder-shown) {
  border-color: rgba(239, 68, 68, 0.5) !important;
}

/* Modal Form Headers & Action Footers */
.modal-content {
  border-radius: 1.25rem !important;
  overflow: hidden !important;
}

.modal-header {
  padding: 1.25rem 1.5rem !important;
  background: transparent !important;
  border-bottom: 1px solid var(--decore-border) !important;
}

.modal-footer {
  padding: 1rem 1.5rem !important;
  border-top: 1px solid var(--decore-border) !important;
}

/* Dark Mode Form Overrides */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
.dark-mode .form-control,
.dark-mode .form-select {
  background-color: #0F172A !important;
  border-color: #334155 !important;
  color: #F8FAFC !important;
}

[data-bs-theme="dark"] .input-group-text,
[data-theme="dark"] .input-group-text,
.dark-mode .input-group-text {
  background-color: rgba(99, 102, 241, 0.2) !important;
  border-color: #334155 !important;
  color: #A5B4FC !important;
}

/* =========================================================
   Decore Auth Card (Login Page High-Contrast Overrides)
   ========================================================= */
.decore-auth-card h1,
.decore-auth-card h2,
.decore-auth-card h3,
.decore-auth-card h4,
.decore-auth-card h5,
.decore-auth-card h6 {
  color: #FFFFFF !important;
}

.decore-auth-card .form-label {
  color: rgba(255, 255, 255, 0.85) !important;
}

.decore-auth-card .form-control {
  background: rgba(15, 23, 42, 0.6) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.15) !important;
  color: #FFFFFF !important;
}

.decore-auth-card .form-control::placeholder {
  color: rgba(255, 255, 255, 0.45) !important;
}

.decore-auth-card .form-control:focus {
  background: rgba(15, 23, 42, 0.85) !important;
  border-color: #818CF8 !important;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.25) !important;
  color: #FFFFFF !important;
}

.decore-auth-card .input-group-text {
  background: rgba(15, 23, 42, 0.8) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.15) !important;
  border-right: none !important;
  color: rgba(255, 255, 255, 0.7) !important;
}

.decore-auth-card #togglePassword {
  background: rgba(15, 23, 42, 0.8) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.15) !important;
  border-left: none !important;
  color: rgba(255, 255, 255, 0.7) !important;
  border-top-right-radius: 0.85rem !important;
  border-bottom-right-radius: 0.85rem !important;
}


/* =========================================================
   Performance & GPU Compositing Optimisations
   ========================================================= */

/* Promote sidebar to GPU layer — but NO transform:translateZ() on fixed elements
   as it breaks iOS Safari fixed positioning and stacking context */
.decore-sidebar {
  will-change: left;
}

.decore-card-lift {
  will-change: transform, box-shadow;
}

.decore-card-lift:hover {
  transform: translateY(-4px) translateZ(0);
}

/* Only animate composited properties (transform + opacity) to avoid layout recalculation */
.decore-card,
.decore-stat-card,
.nav-link,
.btn,
.decore-badge {
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.22s cubic-bezier(0.4, 0, 0.2, 1),
              background-color 0.18s ease,
              border-color 0.18s ease;
}

/* Progress bars — GPU composited width animation */
.progress-bar {
  transition: width 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: width;
  transform: translateZ(0);
}

/* Top navigation progress bar — GPU layer */
#topNavProgressBar {
  will-change: width, opacity;
  transform: translateZ(0);
  transition: width 0.18s ease-out, opacity 0.15s ease;
}

/* content-visibility: auto defers rendering of off-screen table rows
   giving ~40% faster initial paint on large list pages */
.table tbody {
  content-visibility: auto;
  contain-intrinsic-size: 0 400px;
}

/* Reduce backdrop-filter cost on low-power devices */
@media (prefers-reduced-motion: no-preference) {
  .decore-sidebar,
  .decore-card {
    backdrop-filter: var(--decore-blur);
    -webkit-backdrop-filter: var(--decore-blur);
  }
}

/* Respect user's system reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .decore-card-lift:hover {
    transform: none;
  }
}

/* Avoid layout shift from images before they load */
img {
  content-visibility: auto;
}

/* Skeleton loading shimmer for async content */
.decore-skeleton {
  background: linear-gradient(
    90deg,
    var(--decore-border) 25%,
    rgba(255,255,255,0.06) 50%,
    var(--decore-border) 75%
  );
  background-size: 200% 100%;
  animation: decore-shimmer 1.4s infinite;
  border-radius: var(--decore-radius);
}

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

/* =========================================================
   View Transitions API — smooth cross-page animations
   Supported in Chrome 111+, Edge 111+. Gracefully ignored
   by other browsers (no fallback needed).
   ========================================================= */

/* Outgoing page fades+slides up */
@keyframes decore-fade-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-8px); }
}

/* Incoming page fades+slides up from below */
@keyframes decore-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

::view-transition-old(root) {
  animation: 160ms cubic-bezier(0.4, 0, 1, 1) both decore-fade-out;
}

::view-transition-new(root) {
  animation: 200ms cubic-bezier(0, 0, 0.2, 1) 60ms both decore-fade-in;
}

/* Sidebar links get their own named transition so they don't flash */
.decore-sidebar-nav .nav-link {
  view-transition-name: none;
}

/* =========================================================
   Scroll & Interaction Smoothness
   ========================================================= */

/* Smooth scroll everywhere */
html {
  scroll-behavior: smooth;
}

/* Prevent content jump when a modal/dialog opens (scrollbar width compensation) */
html {
  scrollbar-gutter: stable;
}

/* Mobile rubber-band: only bounce at page level, not inside panels */
body {
  overscroll-behavior-y: contain;
}

/* Page main content area scrolls independently (no rubber-band jank in iOS) */
.decore-content {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* Make table scroll containers snappy on mobile */
.table-responsive {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scroll-snap-type: none;
}

/* =========================================================
   Loading Overlay — reduce paint cost
   ========================================================= */
.decore-loading-overlay {
  /* Only composite the transform/opacity, avoid layout */
  will-change: opacity;
  contain: layout style;
}

/* Enable native browser-level cross-page transitions */
@view-transition {
  navigation: auto;
}

