/* ==========================================================================
   SANLAX HRMS — GOOGLE STITCH MASTER DESIGN SYSTEM (v2.0)
   Enterprise Design Authority for Administrative Console
   ========================================================================== */

:root {
  /* Canvas & Surfaces */
  --stitch-canvas: #f8fafc;
  --stitch-surface: #ffffff;
  --stitch-surface-subtle: #f1f5f9;
  --stitch-surface-hover: #f8fafc;
  
  /* Borders */
  --stitch-border-subtle: #f1f5f9;
  --stitch-border: #e2e8f0;
  --stitch-border-strong: #cbd5e1;
  --stitch-border-focus: #2563eb;

  /* Typography Colors */
  --stitch-text-primary: #0f172a;
  --stitch-text-secondary: #475569;
  --stitch-text-muted: #64748b;
  --stitch-text-caption: #94a3b8;

  /* Semantic Accents */
  --stitch-primary: #0f172a;
  --stitch-primary-hover: #1e293b;
  --stitch-accent-blue: #2563eb;
  --stitch-accent-blue-hover: #1d4ed8;

  --stitch-success: #059669;
  --stitch-success-bg: #ecfdf5;
  --stitch-success-border: #a7f3d0;

  --stitch-warning: #d97706;
  --stitch-warning-bg: #fffbeb;
  --stitch-warning-border: #fde68a;

  --stitch-danger: #e11d48;
  --stitch-danger-bg: #fff1f2;
  --stitch-danger-border: #fecdd3;

  --stitch-info: #4f46e5;
  --stitch-info-bg: #eef2ff;
  --stitch-info-border: #c7d2fe;

  /* Component Metrics */
  --stitch-radius-sm: 6px;
  --stitch-radius-md: 8px;
  --stitch-radius-lg: 12px;
  --stitch-radius-xl: 16px;
  --stitch-control-h: 36px;
}

/* Base Document Reset for HRMS Console */
body {
  background-color: var(--stitch-canvas) !important;
  color: var(--stitch-text-primary) !important;
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   1. TYPOGRAPHY SYSTEM
   ========================================================================== */

.stitch-display {
  font-size: 24px !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
  letter-spacing: -0.025em !important;
  color: var(--stitch-text-primary) !important;
}

.stitch-page-title {
  font-size: 20px !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  letter-spacing: -0.02em !important;
  color: var(--stitch-text-primary) !important;
}

.stitch-page-subtitle {
  font-size: 13px !important;
  font-weight: 400 !important;
  line-height: 1.4 !important;
  color: var(--stitch-text-muted) !important;
}

.stitch-section-title {
  font-size: 15px !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
  letter-spacing: -0.01em !important;
  color: var(--stitch-text-primary) !important;
}

.stitch-card-title {
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  color: var(--stitch-text-primary) !important;
}

.stitch-body {
  font-size: 13px !important;
  font-weight: 400 !important;
  line-height: 1.45 !important;
  color: var(--stitch-text-secondary) !important;
}

.stitch-label {
  font-size: 12.5px !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
  color: var(--stitch-text-secondary) !important;
  margin-bottom: 4px !important;
  display: block !important;
}

.stitch-caption {
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  color: var(--stitch-text-caption) !important;
}

.stitch-kpi-val {
  font-size: 28px !important;
  font-weight: 800 !important;
  line-height: 1.1 !important;
  letter-spacing: -0.02em !important;
  color: var(--stitch-text-primary) !important;
}

/* ==========================================================================
   2. BUTTON FAMILIES
   ========================================================================== */

/* Primary Button (Authoritative actions: Save, Approve, Add) */
.stitch-btn-primary {
  height: var(--stitch-control-h) !important;
  padding: 0 16px !important;
  border-radius: var(--stitch-radius-md) !important;
  background-color: var(--stitch-primary) !important;
  color: #ffffff !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  border: 1px solid var(--stitch-primary) !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08) !important;
  cursor: pointer !important;
  transition: all 0.15s ease-in-out !important;
  white-space: nowrap !important;
}
.stitch-btn-primary:hover {
  background-color: var(--stitch-primary-hover) !important;
  border-color: var(--stitch-primary-hover) !important;
}
.stitch-btn-primary:active {
  transform: scale(0.98) !important;
}

/* Secondary Button (Neutral actions: Refresh, Export, Cancel) */
.stitch-btn-secondary {
  height: var(--stitch-control-h) !important;
  padding: 0 14px !important;
  border-radius: var(--stitch-radius-md) !important;
  background-color: #ffffff !important;
  color: var(--stitch-text-secondary) !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  border: 1px solid var(--stitch-border-strong) !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03) !important;
  cursor: pointer !important;
  transition: all 0.15s ease-in-out !important;
  white-space: nowrap !important;
}
.stitch-btn-secondary:hover {
  background-color: var(--stitch-surface-subtle) !important;
  color: var(--stitch-text-primary) !important;
  border-color: #94a3b8 !important;
}

/* Ghost Button (Inline row actions: Details, Open) */
.stitch-btn-ghost {
  height: 32px !important;
  padding: 0 10px !important;
  border-radius: var(--stitch-radius-sm) !important;
  background-color: transparent !important;
  color: var(--stitch-text-secondary) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  border: none !important;
  cursor: pointer !important;
  transition: all 0.12s ease-in-out !important;
  white-space: nowrap !important;
}
.stitch-btn-ghost:hover {
  background-color: var(--stitch-surface-subtle) !important;
  color: var(--stitch-text-primary) !important;
}

/* Danger Button (Destructive: Delete, Reject, Terminate) */
.stitch-btn-danger {
  height: var(--stitch-control-h) !important;
  padding: 0 14px !important;
  border-radius: var(--stitch-radius-md) !important;
  background-color: var(--stitch-danger-bg) !important;
  color: var(--stitch-danger) !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  border: 1px solid var(--stitch-danger-border) !important;
  cursor: pointer !important;
  transition: all 0.15s ease-in-out !important;
  white-space: nowrap !important;
}
.stitch-btn-danger:hover {
  background-color: #ffe4e6 !important;
  border-color: #f43f5e !important;
}

/* Icon Button (Square action trigger: Close, Search, Refresh, More) */
.stitch-btn-icon {
  width: var(--stitch-control-h) !important;
  height: var(--stitch-control-h) !important;
  border-radius: var(--stitch-radius-md) !important;
  background-color: #ffffff !important;
  color: var(--stitch-text-secondary) !important;
  border: 1px solid var(--stitch-border) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03) !important;
  transition: all 0.15s ease-in-out !important;
  flex-shrink: 0 !important;
}
.stitch-btn-icon:hover {
  background-color: var(--stitch-surface-subtle) !important;
  color: var(--stitch-text-primary) !important;
  border-color: var(--stitch-border-strong) !important;
}

/* ==========================================================================
   3. ENTERPRISE FORM CONTROLS & FILTERS
   ========================================================================== */

.stitch-input {
  height: var(--stitch-control-h) !important;
  padding: 0 12px !important;
  border-radius: var(--stitch-radius-md) !important;
  border: 1px solid var(--stitch-border) !important;
  background-color: #ffffff !important;
  color: var(--stitch-text-primary) !important;
  font-size: 12.5px !important;
  font-weight: 500 !important;
  outline: none !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}
.stitch-input::placeholder {
  color: var(--stitch-text-caption) !important;
  font-weight: 400 !important;
}
.stitch-input:hover {
  border-color: var(--stitch-border-strong) !important;
}
.stitch-input:focus {
  border-color: var(--stitch-border-focus) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
}

.stitch-select {
  height: var(--stitch-control-h) !important;
  padding: 0 32px 0 12px !important;
  border-radius: var(--stitch-radius-md) !important;
  border: 1px solid var(--stitch-border) !important;
  background-color: #ffffff !important;
  color: var(--stitch-text-primary) !important;
  font-size: 12.5px !important;
  font-weight: 500 !important;
  outline: none !important;
  cursor: pointer !important;
  appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  background-size: 14px 14px !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}
.stitch-select:hover {
  border-color: var(--stitch-border-strong) !important;
}
.stitch-select:focus {
  border-color: var(--stitch-border-focus) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
}

.stitch-search-wrapper {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
}
.stitch-search-wrapper svg {
  position: absolute !important;
  left: 10px !important;
  width: 15px !important;
  height: 15px !important;
  color: var(--stitch-text-muted) !important;
  pointer-events: none !important;
}
.stitch-search-wrapper input {
  padding-left: 32px !important;
  width: 100% !important;
}

/* ==========================================================================
   4. MASTER DATATABLE SYSTEM
   ========================================================================== */

.stitch-table-container {
  background-color: #ffffff !important;
  border: 1px solid var(--stitch-border) !important;
  border-radius: var(--stitch-radius-lg) !important;
  box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.04) !important;
  overflow: hidden !important;
  width: 100% !important;
}

.stitch-table-toolbar {
  padding: 12px 16px !important;
  border-bottom: 1px solid var(--stitch-border-subtle) !important;
  background-color: #ffffff !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
}

.stitch-table-wrapper {
  width: 100% !important;
  overflow-x: auto !important;
}

.stitch-table {
  width: 100% !important;
  text-align: left !important;
  border-collapse: collapse !important;
  font-size: 13px !important;
}

.stitch-table thead tr {
  background-color: var(--stitch-canvas) !important;
  border-bottom: 1px solid var(--stitch-border) !important;
}

.stitch-table th {
  padding: 10px 14px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  color: var(--stitch-text-muted) !important;
  white-space: nowrap !important;
  user-select: none !important;
}

.stitch-table tbody tr {
  border-bottom: 1px solid var(--stitch-border-subtle) !important;
  transition: background-color 0.12s ease !important;
}
.stitch-table tbody tr:hover {
  background-color: var(--stitch-surface-hover) !important;
}
.stitch-table tbody tr:last-child {
  border-bottom: none !important;
}

.stitch-table td {
  padding: 12px 14px !important;
  color: var(--stitch-text-primary) !important;
  vertical-align: middle !important;
  font-size: 13px !important;
}

.stitch-table-pagination {
  padding: 12px 16px !important;
  border-top: 1px solid var(--stitch-border-subtle) !important;
  background-color: #ffffff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  font-size: 12px !important;
  color: var(--stitch-text-muted) !important;
}

/* ==========================================================================
   5. REFINED STATUS BADGES (SEMANTIC DOT CHIPS)
   ========================================================================== */

.stitch-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 2.5px 8.5px !important;
  border-radius: 9999px !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  line-height: 1 !important;
}

.stitch-badge-dot {
  width: 6px !important;
  height: 6px !important;
  border-radius: 50% !important;
  flex-shrink: 0 !important;
}

.stitch-badge-success {
  background-color: var(--stitch-success-bg) !important;
  color: var(--stitch-success) !important;
  border: 1px solid var(--stitch-success-border) !important;
}
.stitch-badge-success .stitch-badge-dot {
  background-color: var(--stitch-success) !important;
}

.stitch-badge-warning {
  background-color: var(--stitch-warning-bg) !important;
  color: var(--stitch-warning) !important;
  border: 1px solid var(--stitch-warning-border) !important;
}
.stitch-badge-warning .stitch-badge-dot {
  background-color: var(--stitch-warning) !important;
}

.stitch-badge-danger {
  background-color: var(--stitch-danger-bg) !important;
  color: var(--stitch-danger) !important;
  border: 1px solid var(--stitch-danger-border) !important;
}
.stitch-badge-danger .stitch-badge-dot {
  background-color: var(--stitch-danger) !important;
}

.stitch-badge-info {
  background-color: var(--stitch-info-bg) !important;
  color: var(--stitch-info) !important;
  border: 1px solid var(--stitch-info-border) !important;
}
.stitch-badge-info .stitch-badge-dot {
  background-color: var(--stitch-info) !important;
}

.stitch-badge-neutral {
  background-color: var(--stitch-surface-subtle) !important;
  color: var(--stitch-text-muted) !important;
  border: 1px solid var(--stitch-border) !important;
}
.stitch-badge-neutral .stitch-badge-dot {
  background-color: var(--stitch-text-caption) !important;
}

/* ==========================================================================
   6. MASTER DRAWER & OVERLAYS
   ========================================================================== */

.stitch-drawer-backdrop {
  position: fixed !important;
  inset: 0 !important;
  background-color: rgba(15, 23, 42, 0.45) !important;
  backdrop-filter: blur(2px) !important;
  z-index: 9990 !important;
  transition: opacity 0.25s ease !important;
}

.stitch-drawer {
  position: fixed !important;
  top: 0 !important;
  bottom: 0 !important;
  right: 0 !important;
  width: 540px !important;
  max-width: 100vw !important;
  background-color: #ffffff !important;
  border-left: 1px solid var(--stitch-border) !important;
  box-shadow: -8px 0 32px rgba(15, 23, 42, 0.12) !important;
  z-index: 9995 !important;
  display: flex !important;
  flex-direction: column !important;
  transform: translateX(100%) !important;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.stitch-drawer.open {
  transform: translateX(0) !important;
}

.stitch-drawer-header {
  padding: 18px 24px !important;
  border-bottom: 1px solid var(--stitch-border-subtle) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  background-color: #ffffff !important;
}

.stitch-drawer-body {
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  padding: 24px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 20px !important;
}

.stitch-drawer-footer {
  padding: 16px 24px !important;
  border-top: 1px solid var(--stitch-border-subtle) !important;
  background-color: var(--stitch-canvas) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
}

/* ==========================================================================
   7. OPERATIONAL KPI SUMMARY STRIP
   ========================================================================== */

.stitch-kpi-strip {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
  width: 100% !important;
}
@media (min-width: 768px) {
  .stitch-kpi-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}
@media (min-width: 1200px) {
  .stitch-kpi-strip {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  }
}

.stitch-kpi-card {
  background-color: #ffffff !important;
  border: 1px solid var(--stitch-border) !important;
  border-radius: var(--stitch-radius-lg) !important;
  padding: 14px 16px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  min-height: 104px !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02) !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}
.stitch-kpi-card:hover {
  border-color: var(--stitch-border-strong) !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05) !important;
}

/* ==========================================================================
   8. PAGE HEADER COMPONENT
   ========================================================================== */

.stitch-page-header {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  margin-bottom: 20px !important;
}
@media (min-width: 768px) {
  .stitch-page-header {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
  }
}

/* ==========================================================================
   9. UNIVERSAL BADGE & CHIP HARMONIZATION
   Quiet semantic dot chips instead of loud rectangular pills
   ========================================================================== */

.badge,
.stitch-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 4px 12px !important;
  border-radius: 9999px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  line-height: 1.35 !important;
  white-space: nowrap !important;
}

/* Universal un-cramp for any tight utility badges */
span[class*="py-0.5"][class*="px-"] {
  padding-top: 3.5px !important;
  padding-bottom: 3.5px !important;
  padding-left: 9px !important;
  padding-right: 9px !important;
  line-height: 1.35 !important;
}

.badge-dot,
.stitch-badge-dot {
  width: 6px !important;
  height: 6px !important;
  border-radius: 50% !important;
  flex-shrink: 0 !important;
}

/* Success / Present / Active */
.badge-present,
.stitch-badge-success,
.stitch-badge-emerald {
  background-color: var(--stitch-success-bg) !important;
  color: var(--stitch-success) !important;
  border: 1px solid var(--stitch-success-border) !important;
}
.badge-present .badge-dot,
.stitch-badge-success .stitch-badge-dot,
.stitch-badge-emerald .stitch-badge-dot {
  background-color: var(--stitch-success) !important;
}

/* Warning / Late / Pending */
.badge-late,
.stitch-badge-warning,
.stitch-badge-amber {
  background-color: var(--stitch-warning-bg) !important;
  color: var(--stitch-warning) !important;
  border: 1px solid var(--stitch-warning-border) !important;
}
.badge-late .badge-dot,
.stitch-badge-warning .stitch-badge-dot,
.stitch-badge-amber .stitch-badge-dot {
  background-color: var(--stitch-warning) !important;
}

/* Danger / Absent / Terminated / Rejected */
.badge-absent,
.stitch-badge-danger,
.stitch-badge-rose {
  background-color: var(--stitch-danger-bg) !important;
  color: var(--stitch-danger) !important;
  border: 1px solid var(--stitch-danger-border) !important;
}
.badge-absent .badge-dot,
.stitch-badge-danger .stitch-badge-dot,
.stitch-badge-rose .stitch-badge-dot {
  background-color: var(--stitch-danger) !important;
}

/* Info / Leave / Holiday / System */
.badge-leave,
.badge-info,
.stitch-badge-info,
.stitch-badge-indigo,
.stitch-badge-blue {
  background-color: var(--stitch-info-bg) !important;
  color: var(--stitch-info) !important;
  border: 1px solid var(--stitch-info-border) !important;
}
.badge-leave .badge-dot,
.badge-info .badge-dot,
.stitch-badge-info .stitch-badge-dot,
.stitch-badge-indigo .stitch-badge-dot,
.stitch-badge-blue .stitch-badge-dot {
  background-color: var(--stitch-info) !important;
}

/* Neutral / Inactive / Off */
.badge-neutral,
.stitch-badge-neutral {
  background-color: var(--stitch-surface-subtle) !important;
  color: var(--stitch-text-muted) !important;
  border: 1px solid var(--stitch-border) !important;
}
.badge-neutral .badge-dot,
.stitch-badge-neutral .stitch-badge-dot {
  background-color: var(--stitch-text-caption) !important;
}

/* ==========================================================================
   10. MASTER MODAL & DRAWER OVERLAY SYSTEM
   Flexbox-centered viewport overlays & hardware-accelerated drawers
   ========================================================================== */

.stitch-modal-overlay,
#manual-attendance-overlay,
#checkout-correction-overlay {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background-color: rgba(15, 23, 42, 0.45) !important;
  backdrop-filter: blur(2px) !important;
  z-index: 99998 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px !important;
  box-sizing: border-box !important;
}

.stitch-modal-overlay.hidden,
#manual-attendance-overlay.hidden,
#checkout-correction-overlay.hidden {
  display: none !important;
}

.stitch-modal,
#manual-attendance-modal,
#checkout-correction-modal {
  position: relative !important;
  margin: auto !important;
  top: auto !important;
  left: auto !important;
  transform: none !important;
  background-color: #ffffff !important;
  border: 1px solid var(--stitch-border) !important;
  border-radius: var(--stitch-radius-xl) !important;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25) !important;
  z-index: 99999 !important;
  padding: 24px !important;
  width: 100% !important;
  max-width: 520px !important;
  max-height: 90vh !important;
  overflow-y: auto !important;
  box-sizing: border-box !important;
}

.stitch-drawer,
#attendance-details-drawer {
  position: fixed !important;
  top: 0 !important;
  bottom: 0 !important;
  right: 0 !important;
  width: 520px !important;
  max-width: 100vw !important;
  background-color: #ffffff !important;
  border-left: 1px solid var(--stitch-border) !important;
  box-shadow: -8px 0 32px rgba(15, 23, 42, 0.15) !important;
  z-index: 99999 !important;
  display: flex !important;
  flex-direction: column !important;
  transform: translateX(100%) !important;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.stitch-drawer.open,
#attendance-details-drawer.open {
  transform: translateX(0) !important;
}

#attendance-drawer-backdrop {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background-color: rgba(15, 23, 42, 0.4) !important;
  backdrop-filter: blur(2px) !important;
  z-index: 99998 !important;
  transition: opacity 0.28s ease !important;
}

/* ==========================================================================
   11. UNIVERSAL TABLE & CONTAINER HARMONIZATION (ACROSS ALL SCREENS)
   Ensures React views and custom views share the exact same Stitch hierarchy
   ========================================================================== */

main table {
  width: 100% !important;
  text-align: left !important;
  border-collapse: collapse !important;
  font-size: 13px !important;
}

main table thead tr {
  background-color: var(--stitch-canvas) !important;
  border-bottom: 1px solid var(--stitch-border) !important;
}

main table th {
  padding: 10px 14px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  color: var(--stitch-text-muted) !important;
  white-space: nowrap !important;
}

main table tbody tr {
  border-bottom: 1px solid var(--stitch-border-subtle) !important;
  transition: background-color 0.12s ease !important;
}

main table tbody tr:hover {
  background-color: var(--stitch-surface-hover) !important;
}

main table td {
  padding: 12px 14px !important;
  color: var(--stitch-text-primary) !important;
  vertical-align: middle !important;
  font-size: 13px !important;
}

/* Eliminate Card-in-Card Nesting Fatigues */
main > div.grid > div.bg-white,
main .border.border-slate-200.bg-white.rounded-xl {
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03) !important;
  border-color: var(--stitch-border) !important;
}

/* ==========================================================================
   12. BUTTON GRADIENT NEUTRALIZATION
   Replace arbitrary gradients with authoritative Stitch button styling
   ========================================================================== */

.stitch-btn-indigo,
.stitch-btn-emerald,
.stitch-btn-blue {
  height: var(--stitch-control-h) !important;
  padding: 0 14px !important;
  border-radius: var(--stitch-radius-md) !important;
  background-color: #ffffff !important;
  color: var(--stitch-text-secondary) !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  border: 1px solid var(--stitch-border-strong) !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03) !important;
  cursor: pointer !important;
  transition: all 0.15s ease-in-out !important;
  white-space: nowrap !important;
}

.stitch-btn-indigo:hover,
.stitch-btn-emerald:hover,
.stitch-btn-blue:hover {
  background-color: var(--stitch-surface-subtle) !important;
  color: var(--stitch-text-primary) !important;
  border-color: #94a3b8 !important;
}

/* ==========================================================================
   13. MASTER TOP NAVIGATION HEADER
   Standardized 56px Google Stitch console header
   ========================================================================== */

header.sticky.top-0 {
  background-color: #ffffff !important;
  border-bottom: 1px solid var(--stitch-border) !important;
  box-shadow: 0 1px 2px 0 rgba(15, 23, 42, 0.03) !important;
  z-index: 100 !important;
}

header.sticky.top-0 > div {
  min-height: 56px !important;
  height: 56px !important;
  padding: 0 20px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

#bt-global-search-container {
  max-width: 460px !important;
  margin: 0 16px !important;
  flex: 1 1 auto !important;
}

#bt-global-search-input {
  height: 34px !important;
  background-color: var(--stitch-canvas) !important;
  border: 1px solid var(--stitch-border) !important;
  border-radius: var(--stitch-radius-md) !important;
  font-size: 12px !important;
  color: var(--stitch-text-primary) !important;
  transition: all 0.15s ease !important;
}

#bt-global-search-input:focus {
  background-color: #ffffff !important;
  border-color: var(--stitch-border-focus) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}

/* ==========================================================================
   14. REPORTS & ANALYTICS HARMONIZATION
   Neutralize rainbow gradient left-borders into authoritative Stitch KPI cards
   ========================================================================== */

.bt-stat-card,
div[class*="bt-gradient-"] {
  background: #ffffff !important;
  border: 1px solid var(--stitch-border) !important;
  border-left: 1px solid var(--stitch-border) !important;
  border-radius: var(--stitch-radius-lg) !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02) !important;
  padding: 16px 18px !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

.bt-stat-card:hover,
div[class*="bt-gradient-"]:hover {
  border-color: var(--stitch-border-strong) !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05) !important;
}

.bt-stat-title {
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  color: var(--stitch-text-muted) !important;
  margin-bottom: 6px !important;
}

.bt-stat-value {
  font-size: 26px !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em !important;
  color: var(--stitch-text-primary) !important;
}

.bt-stat-sub {
  font-size: 11.5px !important;
  font-weight: 500 !important;
  color: var(--stitch-text-caption) !important;
  margin-top: 4px !important;
}

/* Reports Tab Navigation */
.bt-tabs-container {
  border-bottom: 1px solid var(--stitch-border) !important;
  gap: 8px !important;
  padding-bottom: 0 !important;
}

.bt-tab-btn {
  font-size: 12.5px !important;
  font-weight: 600 !important;
  color: var(--stitch-text-secondary) !important;
  padding: 10px 16px !important;
  border-bottom: 2px solid transparent !important;
  transition: all 0.15s ease !important;
}

.bt-tab-btn:hover {
  color: var(--stitch-text-primary) !important;
}

.bt-tab-btn.active {
  color: var(--stitch-accent-blue) !important;
  border-bottom-color: var(--stitch-accent-blue) !important;
  background: transparent !important;
}

/* Reports Action Buttons */
button.bg-indigo-600,
button.bg-indigo-500,
button.bg-emerald-500,
button.bg-emerald-600,
button[onclick*="exportReportsCSV"],
button[onclick*="exportReportsExcel"],
button[onclick*="printReport"] {
  height: var(--stitch-control-h) !important;
  padding: 0 14px !important;
  border-radius: var(--stitch-radius-md) !important;
  background-color: #ffffff !important;
  color: var(--stitch-text-secondary) !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  border: 1px solid var(--stitch-border-strong) !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03) !important;
  cursor: pointer !important;
  transition: all 0.15s ease-in-out !important;
}

button[onclick*="applyReportsFilter"],
button.bg-emerald-600.text-white {
  background-color: var(--stitch-primary) !important;
  color: #ffffff !important;
  border: 1px solid var(--stitch-primary) !important;
}

button[onclick*="applyReportsFilter"]:hover,
button.bg-emerald-600.text-white:hover {
  background-color: var(--stitch-primary-hover) !important;
}

/* ==========================================================================
   15. PAYROLL & MONTH CLOSING HARMONIZATION
   Calm authoritative controls instead of jarring neon blocks
   ========================================================================== */

button[onclick*="closeMonth"],
button[onclick*="lockMonth"],
button[onclick*="archiveMonth"],
button[onclick*="reopenMonth"] {
  height: 32px !important;
  padding: 0 12px !important;
  border-radius: var(--stitch-radius-md) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

button[onclick*="closeMonth"],
button[onclick*="lockMonth"],
button[onclick*="archiveMonth"] {
  background-color: #ffffff !important;
  color: var(--stitch-text-secondary) !important;
  border: 1px solid var(--stitch-border-strong) !important;
}

button[onclick*="closeMonth"]:hover,
button[onclick*="lockMonth"]:hover,
button[onclick*="archiveMonth"]:hover {
  background-color: var(--stitch-surface-subtle) !important;
  color: var(--stitch-text-primary) !important;
}

button[onclick*="reopenMonth"] {
  background-color: var(--stitch-danger-bg) !important;
  color: var(--stitch-danger) !important;
  border: 1px solid var(--stitch-danger-border) !important;
}

button[onclick*="generatePayroll"] {
  background-color: var(--stitch-primary) !important;
  color: #ffffff !important;
  border: 1px solid var(--stitch-primary) !important;
}

/* ==========================================================================
   16. EMPLOYEE MANAGEMENT & FORM INPUTS
   ========================================================================== */

.stitch-panel-header,
div[onclick*="toggleBranchTransfer"],
div[onclick*="toggleIdCards"] {
  border-radius: var(--stitch-radius-md) !important;
  border: 1px solid var(--stitch-border) !important;
  background-color: #ffffff !important;
  transition: all 0.15s ease !important;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
  font-family: inherit !important;
}

/* ==========================================================================
   17. DASHBOARD COMMAND CENTER OPEN CANVAS
   Ensure open canvas header without redundant card framing
   ========================================================================== */

main > .space-y-6 > .bg-white.rounded-2xl.border.border-slate-200.p-6,
main > .space-y-6 > .bg-white.rounded-2xl.p-6 {
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03) !important;
}

/* ==========================================================================
   18. ATTENDANCE CONTROL & DATA GRID DE-BOXING
   Clean modern typography, elimination of cramped border-boxes around table text
   ========================================================================== */

#attendance-main-table {
  width: 100% !important;
  min-width: 980px !important;
}

#attendance-main-table th,
#attendance-main-table td {
  padding-left: 8px !important;
  padding-right: 8px !important;
  padding-top: 13px !important;
  padding-bottom: 13px !important;
  vertical-align: middle !important;
}

#attendance-main-table th:first-child,
#attendance-main-table td:first-child {
  padding-left: 16px !important;
}

#attendance-main-table th:last-child,
#attendance-main-table td:last-child {
  padding-right: 16px !important;
  white-space: nowrap !important;
}

#attendance-main-table tr:hover {
  background-color: rgba(248, 250, 252, 0.9) !important;
}

/* Date picker well harmonization */
#attendance-date-picker {
  color: var(--stitch-text-primary) !important;
  font-weight: 600 !important;
  font-size: 13px !important;
}

#attendance-date-picker::-webkit-calendar-picker-indicator {
  cursor: pointer !important;
  opacity: 0.6 !important;
  transition: opacity 0.15s ease !important;
}

#attendance-date-picker::-webkit-calendar-picker-indicator:hover {
  opacity: 1 !important;
}

/* Micro-icon harmonization in attendance table */
#attendance-main-table td svg {
  width: 14px !important;
  height: 14px !important;
  min-width: 14px !important;
  min-height: 14px !important;
  max-width: 14px !important;
  max-height: 14px !important;
  display: inline-block !important;
  flex-shrink: 0 !important;
  vertical-align: middle !important;
}

#attendance-main-table td button svg {
  width: 15px !important;
  height: 15px !important;
  min-width: 15px !important;
  min-height: 15px !important;
  max-width: 15px !important;
  max-height: 15px !important;
}

/* ==========================================================================
   DRAWER, MODAL & SVG ICON SIZING NORMALIZATION
   Fixes SVG distortion and runaway scaling in Drawers and Modals
   ========================================================================== */

/* Universal SVG containment inside drawers and modals */
#attendance-details-drawer svg,
#attendance-drawer-body svg,
.stitch-drawer svg,
.stitch-modal svg,
.stitch-modal-overlay svg {
  display: inline-block;
  flex-shrink: 0;
  vertical-align: middle;
}

/* Section Header SVGs (14px) */
#attendance-details-drawer h4 svg,
#attendance-drawer-body h4 svg,
.stitch-drawer h4 svg {
  width: 14px !important;
  height: 14px !important;
  min-width: 14px !important;
  min-height: 14px !important;
  max-width: 14px !important;
  max-height: 14px !important;
}

/* Specific section SVGs by utility class */
#attendance-details-drawer svg.w-3,
#attendance-drawer-body svg.w-3,
.stitch-drawer svg.w-3 {
  width: 12px !important;
  height: 12px !important;
  min-width: 12px !important;
  min-height: 12px !important;
  max-width: 12px !important;
  max-height: 12px !important;
}

#attendance-details-drawer svg.w-3\.5,
#attendance-drawer-body svg.w-3\.5,
.stitch-drawer svg.w-3\.5 {
  width: 14px !important;
  height: 14px !important;
  min-width: 14px !important;
  min-height: 14px !important;
  max-width: 14px !important;
  max-height: 14px !important;
}

#attendance-details-drawer svg.w-4,
#attendance-drawer-body svg.w-4,
.stitch-drawer svg.w-4,
.stitch-modal svg.w-4 {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
}

#attendance-details-drawer svg.w-5,
#attendance-drawer-body svg.w-5,
.stitch-drawer svg.w-5,
.stitch-modal svg.w-5,
#selfie-viewer-modal svg.w-5 {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  min-height: 20px !important;
  max-width: 20px !important;
  max-height: 20px !important;
}

#attendance-details-drawer svg.w-8,
#attendance-drawer-body svg.w-8,
.stitch-drawer svg.w-8 {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
}

/* Global Icon Utility Polyfills for Tailwind Classes */
.w-2 { width: 0.5rem !important; }
.h-2 { height: 0.5rem !important; }
.w-2\.5 { width: 0.625rem !important; }
.h-2\.5 { height: 0.625rem !important; }
.w-3 { width: 0.75rem !important; }
.h-3 { height: 0.75rem !important; }
.w-3\.5 { width: 0.875rem !important; }
.h-3\.5 { height: 0.875rem !important; }
.w-4 { width: 1rem !important; }
.h-4 { height: 1rem !important; }
.w-5 { width: 1.25rem !important; }
.h-5 { height: 1.25rem !important; }
.w-6 { width: 1.5rem !important; }
.h-6 { height: 1.5rem !important; }
.w-7 { width: 1.75rem !important; }
.h-7 { height: 1.75rem !important; }
.w-8 { width: 2rem !important; }
.h-8 { height: 2rem !important; }
.w-10 { width: 2.5rem !important; }
.h-10 { height: 2.5rem !important; }
.w-12 { width: 3rem !important; }
.h-12 { height: 3rem !important; }
.w-16 { width: 4rem !important; }
.h-16 { height: 4rem !important; }
.w-20 { width: 5rem !important; }
.h-20 { height: 5rem !important; }



