/* ==========================================================================
   DIGITAL BULL - 2026 Office QR Attendance Management System
   Brand Color Palette from Official Logo:
   - Digital Bull Red: #E62828 / #FF3131 (ADMIN THEME)
   - Digital Bull Blue: #00367D / #002B66 (EMPLOYEE THEME)
   - Background: #F8FAFD
   - Cards: #FFFFFF
   - Text: #172033
   - Secondary Text: #64748B
   - Border: #E5EAF1
   ========================================================================== */

:root {
  /* Digital Bull Official Palette */
  --db-red: #E62828;
  --db-red-hover: #CC1F1F;
  --db-red-dark: #A81515;
  --db-red-subtle: #FFF1F1;
  --db-red-border: #FFCDD2;

  --db-blue: #00367D;
  --db-blue-hover: #002B66;
  --db-blue-light: #004DB3;
  --db-blue-subtle: #F0F5FC;
  --db-blue-border: #C5D8F2;

  /* Theme Defaults */
  --theme-bg: #F8FAFD;
  --theme-card: #FFFFFF;
  --theme-text: #172033;
  --theme-text-secondary: #64748B;
  --theme-text-muted: #94A3B8;
  --theme-border: #E5EAF1;
  --theme-border-light: #EEF2F6;

  /* Status Colors */
  --theme-success: #16A36A;
  --theme-success-bg: #ECFDF5;
  --theme-warning: #F59E0B;
  --theme-warning-bg: #FFFBEB;
  --theme-danger: #DC4444;
  --theme-danger-bg: #FEF2F2;

  --sidebar-width: 260px;
  --header-height: 70px;
  --border-radius-sm: 8px;
  --border-radius: 12px;
  --border-radius-lg: 16px;
  --box-shadow-sm: 0 1px 3px 0 rgba(16, 24, 40, 0.05);
  --box-shadow: 0 4px 16px -2px rgba(16, 24, 40, 0.06), 0 2px 6px -2px rgba(16, 24, 40, 0.04);
  --box-shadow-lg: 0 12px 32px -4px rgba(16, 24, 40, 0.08), 0 4px 12px -2px rgba(16, 24, 40, 0.03);
  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base resets & typography */
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--theme-bg);
  color: var(--theme-text);
  font-size: 0.925rem;
  line-height: 1.5;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--theme-text);
  font-weight: 600;
  letter-spacing: -0.02em;
}

a {
  text-decoration: none;
  transition: var(--transition-fast);
}

/* ==========================================================================
   Layout Shell
   ========================================================================== */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Sidebar Common (Clean Light Theme) */
.app-sidebar {
  width: var(--sidebar-width);
  color: var(--theme-text);
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  transition: var(--transition-normal);
  background-color: #FFFFFF !important;
  border-right: 1px solid var(--theme-border) !important;
  box-shadow: 2px 0 16px rgba(16, 24, 40, 0.04);
}

.sidebar-brand {
  height: var(--header-height);
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #FFFFFF !important;
  border-bottom: 1px solid var(--theme-border) !important;
}

.sidebar-brand .text-white {
  color: #172033 !important;
}

.sidebar-brand .sidebar-toggle-btn {
  color: #64748B !important;
}

.brand-logo-img {
  max-height: 42px;
  width: auto;
  object-fit: contain;
  background: transparent;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
}

.sidebar-menu-wrapper {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.85rem;
}

.sidebar-menu-wrapper::-webkit-scrollbar {
  width: 5px;
}

.sidebar-menu-wrapper::-webkit-scrollbar-thumb {
  background: #E2E8F0;
  border-radius: 4px;
}

.sidebar-heading {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94A3B8;
  font-weight: 700;
  padding: 0.75rem 0.85rem 0.35rem;
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-nav-item .sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.9rem;
  color: #334155;
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: var(--border-radius-sm);
  transition: var(--transition-fast);
  position: relative;
}

.sidebar-nav-item .sidebar-nav-link i {
  font-size: 1.15rem;
  width: 20px;
  text-align: center;
  color: #64748B;
  transition: var(--transition-fast);
}

.sidebar-nav-item .sidebar-nav-link:hover {
  background-color: #F8FAFC;
  color: #0F172A;
}

.sidebar-nav-item .nav-badge {
  margin-left: auto;
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  font-weight: 600;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  background-color: #FFFFFF !important;
  border-top: 1px solid var(--theme-border) !important;
}

.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #FFFFFF;
  font-size: 0.85rem;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  color: #172033;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  color: #64748B;
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   ROLE-SPECIFIC THEMES (ADMIN: RED GRADIENT | EMPLOYEE: BLUE GRADIENT)
   ========================================================================== */

/* 1. ADMIN THEME (DIGITAL BULL RED GRADIENT) */
.theme-admin {
  --theme-bg: #FCF8F8;
}

.theme-admin .app-sidebar {
  background: #FFFFFF !important;
  box-shadow: 2px 0 16px rgba(0, 0, 0, 0.04);
  border-right: 1px solid var(--theme-border) !important;
}

.theme-admin .sidebar-brand {
  background: #FFFFFF !important;
  border-bottom: 1px solid var(--theme-border) !important;
}

.theme-admin .sidebar-footer {
  background: #FFFFFF !important;
  border-top: 1px solid var(--theme-border) !important;
}

.theme-admin .sidebar-avatar {
  background: linear-gradient(135deg, #FF3838 0%, #E62828 100%);
  border: 2px solid #FFE4E4;
  box-shadow: 0 2px 8px rgba(230, 40, 40, 0.25);
  color: #FFFFFF;
}

.theme-admin .sidebar-heading {
  color: #94A3B8;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.theme-admin .sidebar-nav-item .sidebar-nav-link {
  color: #334155;
  border-radius: 10px;
  font-weight: 500;
}

.theme-admin .sidebar-nav-item .sidebar-nav-link i {
  color: #64748B;
}

.theme-admin .sidebar-nav-item .sidebar-nav-link:hover {
  background: #FFF1F1;
  color: var(--db-red);
}

.theme-admin .sidebar-nav-item .sidebar-nav-link:hover i {
  color: var(--db-red);
}

.theme-admin .sidebar-nav-item.active .sidebar-nav-link {
  background: linear-gradient(135deg, #FF3838 0%, #E62828 100%) !important;
  color: #FFFFFF !important;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(230, 40, 40, 0.35) !important;
  border: none !important;
}

.theme-admin .sidebar-nav-item.active .sidebar-nav-link i {
  color: #FFFFFF !important;
}

.theme-admin .app-header {
  border-top: 3px solid #E62828;
}

.theme-admin .role-pill.admin {
  background: linear-gradient(135deg, #FFF1F1 0%, #FFE4E4 100%);
  color: #E62828;
  border: 1px solid #FFCDD2;
}

.theme-admin a:not(.btn):not(.sidebar-nav-link) {
  color: var(--db-red);
}

.theme-admin a:not(.btn):not(.sidebar-nav-link):hover {
  color: var(--db-red-hover);
}

.theme-admin .text-primary {
  color: var(--db-red) !important;
}

.theme-admin .border-primary {
  border-color: var(--db-red) !important;
}

.theme-admin .bg-primary {
  background-color: var(--db-red) !important;
}

.theme-admin .stat-icon.primary {
  background-color: var(--db-red-subtle);
  color: var(--db-red);
}

.theme-admin .stat-icon.navy {
  background-color: #FFF1F1;
  color: var(--db-red);
}

.theme-admin .card-header.bg-navy {
  background: linear-gradient(135deg, #1A0507 0%, #4D0A10 100%) !important;
  border-bottom: 2px solid var(--db-red) !important;
}

.theme-admin .btn-primary,
.theme-admin .btn-navy,
.theme-admin .btn-db-red {
  background: linear-gradient(135deg, #FF3D3D 0%, #E62828 60%, #B81414 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(230, 40, 40, 0.35);
}

.theme-admin .btn-primary:hover,
.theme-admin .btn-navy:hover,
.theme-admin .btn-db-red:hover {
  background: linear-gradient(135deg, #E62828 0%, #A81212 100%);
  color: #FFFFFF;
  box-shadow: 0 6px 20px rgba(230, 40, 40, 0.45);
}

.theme-admin .form-control:focus,
.theme-admin .form-select:focus {
  border-color: var(--db-red);
  box-shadow: 0 0 0 3px rgba(230, 40, 40, 0.15);
}

.theme-admin .btn-teal {
  background: linear-gradient(135deg, #FF3D3D 0%, #E62828 100%);
  border-color: var(--db-red);
  color: #FFFFFF;
}

.theme-admin .btn-teal:hover {
  background: linear-gradient(135deg, #E62828 0%, #B31414 100%);
  color: #FFFFFF;
}

/* 2. EMPLOYEE THEME (DIGITAL BULL BLUE GRADIENT) */
.theme-employee {
  --theme-bg: #F4F8FD;
}

.theme-employee .app-sidebar {
  background: #FFFFFF !important;
  box-shadow: 2px 0 16px rgba(0, 0, 0, 0.04);
  border-right: 1px solid var(--theme-border) !important;
}

.theme-employee .sidebar-brand {
  background: #FFFFFF !important;
  border-bottom: 1px solid var(--theme-border) !important;
}

.theme-employee .sidebar-footer {
  background: #FFFFFF !important;
  border-top: 1px solid var(--theme-border) !important;
}

.theme-employee .sidebar-avatar {
  background: linear-gradient(135deg, #1E68D9 0%, #00367D 100%) !important;
  border: 2px solid #C5D8F2 !important;
  box-shadow: 0 2px 8px rgba(0, 54, 125, 0.25) !important;
  color: #FFFFFF !important;
}

.theme-employee .sidebar-heading {
  color: #94A3B8;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.theme-employee .sidebar-nav-item .sidebar-nav-link {
  color: #334155;
  border-radius: 10px;
  font-weight: 500;
}

.theme-employee .sidebar-nav-item .sidebar-nav-link i {
  color: #64748B;
}

.theme-employee .sidebar-nav-item .sidebar-nav-link:hover {
  background: #F0F5FC;
  color: var(--db-blue);
}

.theme-employee .sidebar-nav-item .sidebar-nav-link:hover i {
  color: var(--db-blue);
}

.theme-employee .sidebar-nav-item.active .sidebar-nav-link {
  background: linear-gradient(135deg, #1E68D9 0%, #00367D 100%) !important;
  color: #FFFFFF !important;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0, 54, 125, 0.35) !important;
  border: none !important;
}

.theme-employee .sidebar-nav-item.active .sidebar-nav-link i {
  color: #FFFFFF !important;
}

.theme-employee .sidebar-menu-wrapper .btn-db-blue {
  background: linear-gradient(135deg, #1E68D9 0%, #00367D 100%) !important;
  color: #FFFFFF !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(0, 54, 125, 0.3) !important;
  transition: all 0.25s ease !important;
}

.theme-employee .sidebar-menu-wrapper .btn-db-blue * {
  color: #FFFFFF !important;
}

.theme-employee .sidebar-menu-wrapper .btn-db-blue:hover {
  background: linear-gradient(135deg, #2563EB 0%, #002B66 100%) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 18px rgba(0, 54, 125, 0.4) !important;
  color: #FFFFFF !important;
}

.theme-employee .app-header {
  border-top: 3px solid #00367D;
}

.theme-employee .role-pill.employee {
  background: linear-gradient(135deg, #F0F5FC 0%, #E0EDFC 100%);
  color: var(--db-blue);
  border: 1px solid var(--db-blue-border);
}

.theme-employee a:not(.btn):not(.sidebar-nav-link) {
  color: var(--db-blue);
}

.theme-employee a:not(.btn):not(.sidebar-nav-link):hover {
  color: var(--db-blue-hover);
}

.theme-employee .text-primary {
  color: var(--db-blue) !important;
}

.theme-employee .border-primary {
  border-color: var(--db-blue) !important;
}

.theme-employee .bg-primary {
  background-color: var(--db-blue) !important;
}

.theme-employee .stat-icon.primary {
  background-color: var(--db-blue-subtle);
  color: var(--db-blue);
}

.theme-employee .stat-icon.navy {
  background-color: var(--db-blue-subtle);
  color: var(--db-blue);
}

.theme-employee .card-header.bg-navy {
  background: linear-gradient(135deg, #05142E 0%, #00367D 100%) !important;
  border-bottom: 2px solid var(--db-blue) !important;
}

.theme-employee .btn-primary,
.theme-employee .btn-teal {
  background: linear-gradient(135deg, #1E68D9 0%, #00367D 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(0, 54, 125, 0.35);
}

.theme-employee .btn-primary:hover,
.theme-employee .btn-teal:hover {
  background: linear-gradient(135deg, #2563EB 0%, #002B66 100%);
  color: #FFFFFF;
  box-shadow: 0 6px 20px rgba(0, 54, 125, 0.45);
}

.theme-employee .form-control:focus,
.theme-employee .form-select:focus {
  border-color: var(--db-blue);
  box-shadow: 0 0 0 3px rgba(0, 54, 125, 0.15);
}

/* Main Content Area */
.app-main {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: var(--transition-normal);
  background-color: var(--theme-bg);
}

/* Header */
.app-header {
  height: var(--header-height);
  background-color: #FFFFFF;
  border-bottom: 1px solid var(--theme-border);
  position: sticky;
  top: 0;
  z-index: 1020;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  box-shadow: var(--box-shadow-sm);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-toggle-btn {
  background: none;
  border: 1px solid var(--theme-border);
  color: var(--theme-text-secondary);
  border-radius: var(--border-radius-sm);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.header-toggle-btn:hover {
  background-color: var(--theme-bg);
  color: var(--theme-text);
}

.header-live-time {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--theme-bg);
  padding: 0.45rem 0.85rem;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--theme-border);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--theme-text-secondary);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.role-pill {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.header-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--theme-border);
  background-color: #FFFFFF;
  color: var(--theme-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: var(--transition-fast);
}

.header-icon-btn:hover {
  background-color: var(--theme-bg);
  color: var(--theme-text);
}

.header-icon-btn .badge-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  background-color: var(--theme-danger);
  border-radius: 50%;
  border: 2px solid #FFFFFF;
}

/* Page Body Container */
.app-content {
  flex: 1;
  padding: 1.75rem;
}

/* 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.45rem;
  font-weight: 700;
  margin: 0;
  color: var(--theme-text);
}

.page-subtitle {
  color: var(--theme-text-secondary);
  font-size: 0.85rem;
  margin: 0.2rem 0 0;
}

/* Footer */
.app-footer {
  padding: 1rem 1.75rem;
  background-color: #FFFFFF;
  border-top: 1px solid var(--theme-border);
  color: var(--theme-text-secondary);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ==========================================================================
   Cards & UI Components
   ========================================================================== */
.card {
  background-color: var(--theme-card);
  border: 1px solid var(--theme-border);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow-sm);
  margin-bottom: 1.5rem;
  transition: var(--transition-fast);
}

.card:hover {
  border-color: #CBD5E1;
}

.card-header {
  background-color: #FFFFFF;
  border-bottom: 1px solid var(--theme-border);
  padding: 1.1rem 1.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top-left-radius: var(--border-radius) !important;
  border-top-right-radius: var(--border-radius) !important;
}

.card-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--theme-text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-body {
  padding: 1.35rem;
}

/* Stat Cards */
.stat-card {
  background: #FFFFFF;
  border: 1px solid var(--theme-border);
  border-radius: var(--border-radius);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--box-shadow);
  border-color: #CBD5E1;
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-icon.red {
  background-color: var(--db-red-subtle);
  color: var(--db-red);
}

.stat-icon.blue {
  background-color: var(--db-blue-subtle);
  color: var(--db-blue);
}

.stat-icon.success {
  background-color: var(--theme-success-bg);
  color: var(--theme-success);
}

.stat-icon.danger {
  background-color: var(--theme-danger-bg);
  color: var(--theme-danger);
}

.stat-icon.warning {
  background-color: var(--theme-warning-bg);
  color: var(--theme-warning);
}

.stat-info {
  flex: 1;
  min-width: 0;
}

.stat-label {
  font-size: 0.76rem;
  color: var(--theme-text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--theme-text);
  line-height: 1.2;
}

.stat-trend {
  font-size: 0.72rem;
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.badge-present {
  background-color: var(--theme-success-bg);
  color: var(--theme-success);
  border: 1px solid #A7F3D0;
}

.badge-present::before {
  background-color: var(--theme-success);
}

.badge-late {
  background-color: var(--theme-warning-bg);
  color: var(--theme-warning);
  border: 1px solid #FDE68A;
}

.badge-late::before {
  background-color: var(--theme-warning);
}

.badge-absent {
  background-color: var(--theme-danger-bg);
  color: var(--theme-danger);
  border: 1px solid #FECACA;
}

.badge-absent::before {
  background-color: var(--theme-danger);
}

.badge-missing {
  background-color: #F1F5F9;
  color: #475569;
  border: 1px solid #CBD5E1;
}

.badge-missing::before {
  background-color: #64748B;
}

.badge-leave {
  background-color: var(--db-blue-subtle);
  color: var(--db-blue);
  border: 1px solid var(--db-blue-border);
}

.badge-leave::before {
  background-color: var(--db-blue);
}

.badge-pending {
  background-color: var(--theme-warning-bg);
  color: var(--theme-warning);
  border: 1px solid #FDE68A;
}

.badge-approved {
  background-color: var(--theme-success-bg);
  color: var(--theme-success);
  border: 1px solid #A7F3D0;
}

.badge-rejected {
  background-color: var(--theme-danger-bg);
  color: var(--theme-danger);
  border: 1px solid #FECACA;
}

/* Daily QR Card */
.qr-frame {
  background: #FFFFFF;
  border: 2px dashed #CBD5E1;
  border-radius: var(--border-radius);
  padding: 1.25rem;
  display: inline-block;
  margin: 1rem 0;
  position: relative;
}

.theme-admin .qr-frame {
  border-color: var(--db-red);
}

.theme-employee .qr-frame {
  border-color: var(--db-blue);
}

.qr-frame svg,
.qr-frame img {
  width: 190px;
  height: 190px;
  display: block;
  margin: 0 auto;
}

.qr-meta-box {
  background-color: var(--theme-bg);
  border: 1px solid var(--theme-border);
  border-radius: var(--border-radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  margin-top: 1rem;
  text-align: left;
}

.qr-pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--theme-success);
  margin-right: 6px;
  animation: pulse-green 1.8s infinite;
}

@keyframes pulse-green {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(22, 163, 106, 0.7);
  }

  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(22, 163, 106, 0);
  }

  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(22, 163, 106, 0);
  }
}

/* Mobile Scanner Simulation Card */
.scanner-viewport {
  width: 100%;
  max-width: 380px;
  height: 380px;
  margin: 0 auto;
  background-color: #030C1A;
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #00367D;
  box-shadow: 0 10px 30px rgba(0, 54, 125, 0.25);
}

.scanner-overlay-target {
  width: 240px;
  height: 240px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 16px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scanner-corner {
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: #3B82F6;
  border-style: solid;
}

.scanner-corner.tl {
  top: -2px;
  left: -2px;
  border-width: 4px 0 0 4px;
  border-top-left-radius: 12px;
}

.scanner-corner.tr {
  top: -2px;
  right: -2px;
  border-width: 4px 4px 0 0;
  border-top-right-radius: 12px;
}

.scanner-corner.bl {
  bottom: -2px;
  left: -2px;
  border-width: 0 0 4px 4px;
  border-bottom-left-radius: 12px;
}

.scanner-corner.br {
  bottom: -2px;
  right: -2px;
  border-width: 0 4px 4px 0;
  border-bottom-right-radius: 12px;
}

.scanner-laser {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #38BDF8, #FFFFFF, #38BDF8, transparent);
  box-shadow: 0 0 12px #38BDF8;
  animation: scan-move 2.2s ease-in-out infinite alternate;
}

@keyframes scan-move {
  0% {
    top: 15px;
    opacity: 0.8;
  }

  100% {
    top: 220px;
    opacity: 1;
  }
}

/* Tables */
.table-custom {
  width: 100%;
  margin-bottom: 0;
  vertical-align: middle;
  border-color: var(--theme-border);
}

.table-custom thead th {
  background-color: #F8FAFC;
  color: var(--theme-text-secondary);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--theme-border);
  white-space: nowrap;
}

.table-custom tbody td {
  padding: 0.9rem 1rem;
  font-size: 0.88rem;
  color: var(--theme-text);
  border-bottom: 1px solid var(--theme-border-light);
  white-space: nowrap;
}

.table-custom tbody tr:hover {
  background-color: #F8FAFD;
}

.table-responsive {
  border-radius: var(--border-radius);
  overflow-x: auto;
}

.table-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.table-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--db-blue-subtle);
  color: var(--db-blue);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--db-blue-border);
}

.theme-admin .table-avatar {
  background: var(--db-red-subtle);
  color: var(--db-red);
  border-color: var(--db-red-border);
}

/* Buttons */
.btn {
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.55rem 1.15rem;
  border-radius: var(--border-radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-fast);
}

.btn-db-red,
a.btn-db-red,
button.btn-db-red,
.theme-admin a.btn-db-red,
.theme-admin .btn-db-red {
  background-color: var(--db-red) !important;
  border-color: var(--db-red) !important;
  color: #FFFFFF !important;
}

.btn-db-red *,
a.btn-db-red *,
button.btn-db-red * {
  color: #FFFFFF !important;
}

.btn-db-red:hover,
a.btn-db-red:hover,
button.btn-db-red:hover {
  background-color: var(--db-red-hover) !important;
  border-color: var(--db-red-hover) !important;
  color: #FFFFFF !important;
}

.btn-db-blue,
a.btn-db-blue,
button.btn-db-blue,
.theme-employee a.btn-db-blue,
.theme-employee .btn-db-blue {
  background-color: var(--db-blue) !important;
  border-color: var(--db-blue) !important;
  color: #FFFFFF !important;
}

.btn-db-blue *,
a.btn-db-blue *,
button.btn-db-blue * {
  color: #FFFFFF !important;
}

.btn-db-blue:hover,
a.btn-db-blue:hover,
button.btn-db-blue:hover {
  background-color: var(--db-blue-hover) !important;
  border-color: var(--db-blue-hover) !important;
  color: #FFFFFF !important;
}

.btn-outline-custom {
  background-color: #FFFFFF;
  border: 1px solid var(--theme-border);
  color: var(--theme-text);
}

.btn-outline-custom:hover {
  background-color: var(--theme-bg);
  border-color: #CBD5E1;
  color: var(--theme-text);
}

/* Form Controls */
.form-control,
.form-select {
  border: 1px solid var(--theme-border);
  border-radius: var(--border-radius-sm);
  padding: 0.6rem 0.9rem;
  font-size: 0.875rem;
  color: var(--theme-text);
  background-color: #FFFFFF;
  transition: var(--transition-fast);
}

.form-label {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--theme-text);
  margin-bottom: 0.35rem;
}

.search-box-group {
  position: relative;
  min-width: 0;
  width: 100%;
}

.search-box-group i {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--theme-text-muted);
  pointer-events: none;
}

.search-box-group .form-control {
  padding-left: 2.35rem;
}

/* Calendar Grid */
.attendance-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.calendar-header-day {
  text-align: center;
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--theme-text-secondary);
  padding: 0.5rem 0;
  background-color: var(--theme-bg);
  border-radius: 6px;
}

.calendar-cell {
  background-color: #FFFFFF;
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  min-height: 80px;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition-fast);
}

.calendar-cell.is-present {
  border-left: 3px solid var(--theme-success);
}

.calendar-cell.is-late {
  border-left: 3px solid var(--theme-warning);
}

.calendar-cell.is-weekend {
  background-color: #F8FAFD;
}

.calendar-cell.is-holiday {
  border-left: 3px solid var(--db-blue);
  background-color: var(--db-blue-subtle);
}

.calendar-date-number {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--theme-text);
}

.calendar-pill {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  text-align: center;
  margin-top: 2px;
}

/* Toast System */
.toast-container-custom {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast-custom {
  pointer-events: auto;
  background-color: #FFFFFF;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow-lg);
  padding: 0.9rem 1.15rem;
  border-left: 4px solid var(--db-blue);
  min-width: 320px;
  max-width: 420px;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  animation: slideInRight 0.3s ease forwards;
}

.toast-custom.toast-red {
  border-left-color: var(--db-red);
}

.toast-custom.toast-blue {
  border-left-color: var(--db-blue);
}

.toast-custom.toast-success {
  border-left-color: var(--theme-success);
}

.toast-custom.toast-danger {
  border-left-color: var(--theme-danger);
}

.toast-custom.toast-warning {
  border-left-color: var(--theme-warning);
}

.toast-icon {
  font-size: 1.25rem;
  line-height: 1;
  margin-top: 2px;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--theme-text);
  margin-bottom: 0.15rem;
}

.toast-message {
  font-size: 0.8rem;
  color: var(--theme-text-secondary);
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  color: var(--theme-text-muted);
  cursor: pointer;
  padding: 0;
  font-size: 1rem;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Fullscreen QR Modal */
.modal-qr-fullscreen .modal-content {
  background-color: #0F172A;
  color: #FFFFFF;
  border: none;
  border-radius: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

/* ==========================================================================
   Face Recognition Webcam Kiosk & Biometrics UI System (2026 Edition)
   ========================================================================== */

.face-camera-card {
  background: #0B1526;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 15px 35px rgba(11, 21, 38, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.camera-feed-container {
  position: relative;
  width: 100%;
  height: 440px;
  background: #050B14;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.camera-video-feed {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* Mirror view for natural interaction */
}

.camera-overlay-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Face Alignment Target Oval */
.face-target-oval {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 230px;
  height: 310px;
  border: 2px dashed rgba(15, 148, 136, 0.65);
  border-radius: 50% 50% 48% 48% / 60% 60% 40% 40%;
  box-shadow: 0 0 25px rgba(15, 148, 136, 0.2), inset 0 0 20px rgba(15, 148, 136, 0.15);
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 10;
}

.face-target-oval.detected {
  border: 2.5px solid #16A36A;
  box-shadow: 0 0 30px rgba(22, 163, 106, 0.4), inset 0 0 25px rgba(22, 163, 106, 0.2);
}

.face-target-oval.warning {
  border: 2.5px solid #F59E0B;
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.4), inset 0 0 25px rgba(245, 158, 11, 0.2);
}

.face-target-oval.danger {
  border: 2.5px solid #DC4444;
  box-shadow: 0 0 30px rgba(220, 68, 68, 0.4), inset 0 0 25px rgba(220, 68, 68, 0.2);
}

/* Vertical Laser Scanner Animation */
.face-scan-line {
  position: absolute;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, #0F9488 20%, #2DD4BF 50%, #0F9488 80%, transparent 100%);
  box-shadow: 0 0 12px #2DD4BF, 0 0 24px rgba(45, 212, 191, 0.5);
  z-index: 12;
  animation: scanLaser 2.4s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes scanLaser {
  0% {
    top: 18%;
    opacity: 0.2;
  }
  50% {
    opacity: 1;
  }
  100% {
    top: 82%;
    opacity: 0.3;
  }
}

/* Camera HUD Corner Accents */
.hud-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: #2DD4BF;
  border-style: solid;
  pointer-events: none;
  z-index: 15;
}
.hud-tl { top: 20px; left: 20px; border-width: 3px 0 0 3px; border-top-left-radius: 4px; }
.hud-tr { top: 20px; right: 20px; border-width: 3px 3px 0 0; border-top-right-radius: 4px; }
.hud-bl { bottom: 20px; left: 20px; border-width: 0 0 3px 3px; border-bottom-left-radius: 4px; }
.hud-br { bottom: 20px; right: 20px; border-width: 0 3px 3px 0; border-bottom-right-radius: 4px; }

/* Status Overlay Badge */
.camera-status-pill {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  padding: 0.45rem 1.25rem;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  backdrop-filter: blur(8px);
  background: rgba(11, 21, 38, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
}

/* Face Registration Badges */
.badge-face-registered {
  background-color: #ECFDF5 !important;
  color: #16A36A !important;
  border: 1px solid #A7F3D0 !important;
}

.badge-face-pending {
  background-color: #FFFBEB !important;
  color: #D97706 !important;
  border: 1px solid #FDE68A !important;
}

.badge-face-not-registered {
  background-color: #FEF2F2 !important;
  color: #DC4444 !important;
  border: 1px solid #FECACA !important;
}

.badge-face-reregister {
  background-color: #EFF6FF !important;
  color: #2563EB !important;
  border: 1px solid #BFDBFE !important;
}

/* Sample Capture Steps */
.sample-thumb-card {
  border: 2px dashed #CBD5E1;
  border-radius: 12px;
  padding: 0.65rem;
  text-align: center;
  transition: all 0.25s ease;
  background: #F8FAFC;
}

.sample-thumb-card.active {
  border-color: #2563EB;
  background: #EFF6FF;
}

.sample-thumb-card.completed {
  border-color: #16A36A;
  background: #ECFDF5;
  border-style: solid;
}

.sample-thumb-preview {
  width: 100%;
  height: 85px;
  border-radius: 8px;
  background: #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.4rem;
  overflow: hidden;
  position: relative;
}

/* Fullscreen Kiosk Mode */
.kiosk-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background: #070F1C;
  display: flex;
  flex-direction: column;
  padding: 2rem;
}

.kiosk-fullscreen .camera-feed-container {
  height: 65vh;
  border-radius: 20px;
}

/* Scenario interactive bar */
.scenario-selector-bar {
  background: #FFFFFF;
  border: 1px solid var(--theme-border);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  box-shadow: var(--box-shadow-sm);
}

.text-navy {
  color: #0F172A !important;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
  .app-sidebar {
    transform: translateX(-100%);
  }

  .app-sidebar.show-mobile {
    transform: translateX(0);
  }

  .app-main {
    margin-left: 0;
    width: 100%;
  }

  .app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1020;
  }

  .app-content {
    padding: calc(var(--header-height) + 1rem) 1rem 1rem 1rem;
  }

  .sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(2px);
    z-index: 1030;
    display: none;
  }

  .sidebar-backdrop.show {
    display: block;
  }
}

@media (max-width: 767.98px) {
  .page-title { font-size: 1.15rem !important; }
  .page-subtitle { font-size: 0.78rem !important; }
  .card-header .card-title { font-size: 0.9rem !important; }
  .stat-card { padding: 0.8rem !important; gap: 0.6rem !important; }
  .stat-icon { width: 38px !important; height: 38px !important; font-size: 1.05rem !important; border-radius: 10px !important; }
  .stat-label { font-size: 0.68rem !important; }
  .stat-value { font-size: 1.15rem !important; }
  .stat-trend { font-size: 0.68rem !important; }
  .table, .table-custom { font-size: 0.75rem !important; }
  .table th, .table td, .table-custom th, .table-custom td {
    padding: 0.55rem 0.5rem !important;
    white-space: nowrap;
  }
  .status-badge, .table .badge {
    font-size: 0.68rem !important;
    padding: 0.22rem 0.5rem !important;
    white-space: nowrap;
  }
  .table-avatar { width: 28px !important; height: 28px !important; font-size: 0.7rem !important; }
}