:root{font-family:system-ui,-apple-system,sans-serif;color:#172c38;background:#eef3f5;font-size:15px}*{box-sizing:border-box}body{margin:0}header{padding:8px max(20px,calc((100vw - 1380px)/2));background:#102d3b;color:white;display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:48px}.header-left,.header-right{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.header-title-wrap{display:flex;flex-direction:column;justify-content:center;margin-right:4px}.header-title-wrap .eyebrow{font-size:9.5px;letter-spacing:1.5px;font-weight:700;color:#79cfbf;margin:0;line-height:1}.header-title-wrap h1{font-size:18px;margin:2px 0 0 0;line-height:1.2;font-weight:700;white-space:nowrap}h1{font-size:30px;margin:6px 0}h2{font-size:22px;margin-top:0}h3{margin-top:26px}p{line-height:1.6}.eyebrow{font-size:11px;letter-spacing:2px;font-weight:700;color:#79cfbf}nav,.inline{display:flex;gap:16px;align-items:center;flex-wrap:wrap}nav a{color:#dbeaf0;text-decoration:none}main{max-width:1260px;padding:28px 24px;margin:auto}.metrics{display:grid;grid-template-columns:repeat(4,1fr);gap:18px;margin-bottom:22px}.metrics article,.card{background:white;border:1px solid #dce5e9;border-radius:12px;padding:24px}.metrics span{display:block;font-size:12px;color:#627681}.metrics strong{display:block;font-size:30px;margin-top:10px}.metrics .small{font-size:19px}.card{margin:22px 0;scroll-margin-top:20px}.grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}label{display:block;font-size:13px;font-weight:600;margin:12px 0;color:#405b69}input,textarea,select{display:block;width:100%;padding:11px;border:1px solid #bdcdd4;border-radius:6px;background:#fbfdfe;color:#172c38;font:inherit;margin-top:6px}textarea{font:12px/1.5 ui-monospace,monospace;resize:vertical}.check{display:flex;align-items:center;gap:9px}.check input{width:auto;margin:0}button{border:0;border-radius:6px;padding:11px 16px;background:#087e74;color:white;font-weight:650;cursor:pointer}.secondary{background:#e7eff2;color:#294653}a{color:#087e74}td a{margin-right:12px}.scroll{overflow:auto;margin-top:20px}table{border-collapse:collapse;width:100%;font-size:13px}th{text-align:left;background:#f0f5f7;color:#526974;font-weight:600}td,th{padding:13px 12px;border-bottom:1px solid #e2e9ed;vertical-align:top}td{max-width:360px;overflow-wrap:anywhere}.muted,footer{color:#647c87;font-size:13px}.notice{padding:14px 18px;border-left:4px solid #087e74;background:#def2eb;border-radius:5px}.login{max-width:450px;margin:12vh auto;background:white;padding:36px;border-radius:14px}.login .eyebrow{color:#087e74}.login button{width:100%;margin-top:12px}footer{padding:15px 0 30px}@media(max-width:850px){header{display:block}.metrics,.grid{grid-template-columns:repeat(2,1fr)}nav{margin-top:20px}}@media(max-width:550px){.metrics,.grid{grid-template-columns:1fr}main{padding:16px}.card{padding:18px}header{padding:24px}h1{font-size:26px}}

.json{white-space:pre-wrap;overflow-wrap:anywhere;background:#f3f6f8;padding:16px;font:12px/1.6 monospace}details{padding:12px 0;border-bottom:1px solid #dce5e9}summary{cursor:pointer;font-weight:600}

.badge{padding:3px 8px;border-radius:12px;font-size:12px;font-weight:600;display:inline-block}
.badge-admin{background:#2a7b62;color:#fff}
.badge-viewer{background:#4a6572;color:#fff}
.matrix-table{width:max-content;min-width:100%;border-collapse:separate;border-spacing:0;font-size:12px}
.matrix-table th,.matrix-table td{padding:6px 6px;border-right:1px solid #d5e0e5;border-bottom:1px solid #d5e0e5;text-align:center;white-space:nowrap}
.matrix-table th{background:#f1f5f7;border-top:1px solid #d5e0e5}
.matrix-table th.matrix-col-emp,.matrix-table td.matrix-col-emp{text-align:left;padding:8px 12px;font-weight:600;position:sticky;left:0;background:#fff;z-index:3;width:220px;min-width:220px;max-width:220px;border-left:1px solid #d5e0e5}
.matrix-table th.matrix-col-emp{background:#f1f5f7;z-index:5}
.matrix-table th.matrix-col-dept,.matrix-table td.matrix-col-dept{text-align:left;padding:8px 12px;font-weight:600;position:sticky;left:220px;background:#fff;z-index:3;width:130px;min-width:130px;max-width:130px;border-right:2px solid #cbd5e1 !important;box-shadow:3px 0 6px -2px rgba(0,0,0,0.12)}
.matrix-table th.matrix-col-dept{background:#f1f5f7;z-index:5}
.matrix-table tr:hover td{background:#fafcfd}
.matrix-table tr:hover td.matrix-col-emp,.matrix-table tr:hover td.matrix-col-dept{background:#f1f5f9}
.matrix-table th[data-date]{min-width:110px;padding:7px 6px}
.matrix-day-cell{min-width:110px;padding:6px 8px !important;vertical-align:top}
.matrix-cell-status{font-weight:700;font-size:11px;line-height:1.2}
.matrix-cell-time{font-size:10.5px;color:#475569;font-family:ui-monospace,monospace;margin-top:3px;white-space:nowrap;letter-spacing:-0.2px}
.matrix-cell-ot{margin-top:4px;padding:2px 6px;border-radius:4px;background:#e0f2fe;color:#0369a1;font-size:10px;font-weight:700;white-space:nowrap;display:inline-block;border:1px solid #bae6fd}
.cell-present{background:#e6f4ea;color:#137333;font-weight:600}
.cell-late{background:#fef7e0;color:#b06000;font-weight:600}
.cell-absent{background:#fce8e6;color:#c5221f;font-weight:600}
.cell-off{background:#f1f3f4;color:#70757a}
.cell-holiday{background:#e8f0fe;color:#1a73e8;font-weight:600}
.cell-leave{background:#f3e8fd;color:#7b1fa2;font-weight:600}
.cell-na{color:#bbb}
.summary-col{background:#f8fafb;font-weight:bold;min-width:85px;padding:6px 10px !important}
.matrix-table th.summary-col{min-width:85px;font-size:11.5px}

.alert-box{background:#eff6ff;border:1px solid #bfdbfe;border-left:4px solid #3b82f6;border-radius:6px;padding:12px 16px;margin:12px 0;font-size:13px;color:#1e3a8a}
.batch-bar{display:flex;gap:12px;align-items:center;flex-wrap:wrap;background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;padding:12px 16px;margin:14px 0}.batch-bar select,.batch-bar input{width:auto;margin:0}
.badge-shift{background:#e0f2fe;color:#0369a1;padding:3px 8px;border-radius:6px;font-size:12px;font-weight:600}
.badge-shift-small{background:#e0f2fe;color:#0369a1;padding:2px 6px;border-radius:4px;font-size:10px;font-weight:600;display:inline-block;margin-top:2px}
.pill-days{background:#f1f5f9;color:#475569;padding:2px 6px;border-radius:4px;font-size:11px}
.badge-holiday-name{background:#f3e8ff;color:#7e22ce;padding:3px 8px;border-radius:6px;font-size:12px;font-weight:600}
.button-sl{background:#7c3aed;color:#fff;font-weight:650;border:0;border-radius:6px;padding:10px 16px;cursor:pointer}
.button-sl:hover{background:#6d28d9}
.inline-checks{display:flex;gap:16px;align-items:center;flex-wrap:wrap;margin:10px 0}
.inline-checks label{display:flex;align-items:center;gap:6px;font-size:13px;cursor:pointer;margin:0}
.small{padding:6px 12px;font-size:12px}

/* Left Tab Sidebar Layout (iVMS-4200 style) */
.app-layout{display:flex;min-height:calc(100vh - 48px);background:#f1f5f9}
.sidebar{width:260px;background:#0f172a;color:#94a3b8;display:flex;flex-direction:column;flex-shrink:0;border-right:1px solid #1e293b;box-shadow:2px 0 8px rgba(0,0,0,0.05)}
.sidebar-brand{padding:18px 20px;display:flex;align-items:center;gap:12px;border-bottom:1px solid #1e293b;background:#090d16}
.sidebar-brand .ivms-icon{font-size:24px}
.sidebar-title{display:block;font-size:11px;letter-spacing:1.5px;font-weight:700;color:#38bdf8}
.sidebar-sub{display:block;font-size:12px;color:#64748b}
.sidebar-nav{padding:8px 0;display:flex;flex-direction:column;gap:2px}
.sidebar-nav .tab-btn{display:flex;align-items:center;gap:12px;width:100%;padding:13px 20px;background:transparent;color:#94a3b8;border:0;border-left:4px solid transparent;text-align:left;font-size:13.5px;font-weight:550;cursor:pointer;text-decoration:none;border-radius:0;transition:all 0.15s ease}
.sidebar-nav .tab-btn:hover{background:#1e293b;color:#f8fafc}
.sidebar-nav .tab-btn.active{background:#1e293b;color:#38bdf8;border-left-color:#38bdf8;font-weight:650}
.tab-icon{font-size:16px;display:inline-block;width:20px;text-align:center}
.tab-text{flex:1}
.sidebar-nav .tab-link{color:#94a3b8}
.sidebar-nav .tab-link:hover{color:#38bdf8}
.content-area{flex:1;padding:24px 32px;overflow-y:auto;max-width:100%;min-width:0;margin:0}
.tab-pane{display:none}
.tab-pane.active{display:block;animation:fadeIn 0.15s ease-in-out}
@keyframes fadeIn{from{opacity:0;transform:translateY(3px)}to{opacity:1;transform:translateY(0)}}

/* Live Presence & ISAPI Control Badges */
.presence-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:14px;margin-bottom:20px}
.presence-card{background:#fff;border:1px solid #dce5e9;border-radius:10px;padding:16px;text-align:center}
.presence-card strong{display:block;font-size:26px;margin-top:6px}
.presence-card span{font-size:12px;color:#627681;font-weight:600}
.badge-inside{background:#dcfce7;color:#15803d;padding:3px 8px;border-radius:6px;font-size:12px;font-weight:700}
.badge-departed{background:#fef3c7;color:#b45309;padding:3px 8px;border-radius:6px;font-size:12px;font-weight:700}
.badge-absent{background:#fee2e2;color:#b91c1c;padding:3px 8px;border-radius:6px;font-size:12px;font-weight:700}
.badge-leave-tag{background:#f3e8ff;color:#7e22ce;padding:3px 8px;border-radius:6px;font-size:12px;font-weight:700}
.badge-quota{display:inline-block;padding:2px 6px;border-radius:4px;font-size:11px;font-weight:600;margin-right:4px}
.btn-isapi{display:inline-flex;align-items:center;gap:6px;padding:9px 15px;border-radius:6px;font-weight:600;font-size:13px;cursor:pointer}
.btn-isapi-sync{background:#0284c7;color:#fff}
.btn-isapi-sync:hover{background:#0369a1}
.btn-isapi-door{background:#ea580c;color:#fff}
.btn-isapi-door:hover{background:#c2410c}
.btn-isapi-users{background:#4f46e5;color:#fff}
.btn-isapi-users:hover{background:#4338ca}
@media(max-width:850px){.presence-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:850px){.app-layout{flex-direction:column}.sidebar{width:100%;flex-direction:row;overflow-x:auto;border-right:0;border-bottom:1px solid #1e293b;padding:0}.sidebar-brand{display:none}.sidebar-nav{flex-direction:row;padding:6px;gap:4px;width:max-content;flex-shrink:0}.sidebar-nav .tab-btn{border-left:0;border-bottom:3px solid transparent;padding:10px 14px;white-space:nowrap;font-size:12.5px}.sidebar-nav .tab-btn.active{border-bottom-color:#38bdf8}.content-area{padding:16px;margin:0}}

/* Interactive Holiday Calendar Styles */
.holiday-calendar-wrapper {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.holiday-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: #e2e8f0;
}
.cal-day {
  min-height: 85px;
  background: #ffffff;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  cursor: pointer;
  transition: all 0.12s ease;
  overflow: hidden;
}
.cal-day:hover {
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px #0284c7;
}
.cal-day-muted {
  background: #f8fafc;
  color: #94a3b8;
  opacity: 0.55;
}
.cal-day.is-today {
  background: #f0fdf4;
}
.cal-day.has-holiday {
  background: #fbf8ff;
}
.cal-day.is-weekend-sun {
  background: #fffbfa;
}
.cal-day.has-holiday.is-weekend-sun {
  background: #fdf4ff;
}
.cal-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.cal-day-num {
  font-weight: 700;
  font-size: 13px;
  color: #334155;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.today-circle {
  background: #0284c7;
  color: #ffffff !important;
}
.cal-hol-count {
  font-size: 10px;
  font-weight: 700;
  color: #7c3aed;
  background: #f3e8ff;
  border-radius: 8px;
  padding: 1px 5px;
}
.cal-day-events {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}
.cal-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 3px;
  line-height: 1.3;
}
.cal-badge-poya {
  background: #f3e8ff;
  color: #6b21a8;
  border: 1px solid #e9d5ff;
}
.cal-badge-mercantile {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}
.cal-badge-custom {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}
.cal-badge-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 768px) {
  .cal-day {
    min-height: 55px;
    padding: 3px 4px;
  }
  .cal-badge {
    font-size: 9.5px;
    padding: 1px 3px;
  }
  .cal-badge-text {
    display: none;
  }
}

/* =========================================================
   Auto-Disappearing Notices & Alerts
   ========================================================= */
#alert-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.notice {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-left: 4px solid #087e74;
  background: #def2eb;
  border-radius: 6px;
  color: #064e47;
  font-size: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: opacity 0.4s ease, transform 0.4s ease, max-height 0.4s ease, margin 0.4s ease, padding 0.4s ease;
  overflow: hidden;
}
.notice.notice-error {
  border-left-color: #dc2626;
  background: #fee2e2;
  color: #991b1b;
}
.notice.fading-out {
  opacity: 0;
  transform: translateY(-8px);
  max-height: 0;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-width: 0 !important;
}
.notice-text {
  flex: 1;
  margin-right: 12px;
}
.dismiss-alert {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: inherit;
  opacity: 0.65;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s, background 0.15s;
}
.dismiss-alert:hover {
  opacity: 1;
  background: rgba(0,0,0,0.06);
}

/* =========================================================
   Floating Toast Notifications (Bottom Right)
   ========================================================= */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  min-width: 300px;
  max-width: 440px;
  background: #1e293b;
  color: #ffffff;
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.35), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
  border-left: 4px solid #38bdf8;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
}
.toast.toast-show {
  transform: translateX(0);
  opacity: 1;
}
.toast.toast-exit {
  transform: translateX(120%);
  opacity: 0;
}
.toast.toast-scan {
  border-left-color: #10b981;
  background: #0f172a;
}
.toast-content {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast-icon {
  font-size: 18px;
  flex-shrink: 0;
}
.toast-text-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.toast-title {
  font-weight: 600;
  color: #f8fafc;
  line-height: 1.3;
}
.toast-sub {
  color: #94a3b8;
  font-size: 12px;
}
.toast-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
  border-radius: 4px;
}
.toast-close:hover {
  color: #ffffff;
  background: rgba(255,255,255,0.12);
}

/* =========================================================
   Scan Highlight Animation & Spinner
   ========================================================= */
@keyframes scanHighlight {
  0% {
    background-color: #fef08a;
  }
  100% {
    background-color: transparent;
  }
}
.scan-highlight-row {
  animation: scanHighlight 3.5s ease-out;
}

@keyframes spinInline {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.btn-spinner {
  display: inline-block;
  animation: spinInline 1s linear infinite;
  margin-right: 4px;
}

/* =========================================================
   Terminal Clock Mismatch Blinking Warning Styles
   ========================================================= */
@keyframes pulseBlinkWarning {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.012);
    box-shadow: 0 0 0 8px rgba(220, 38, 38, 0);
  }
}

@keyframes dotBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.25; transform: scale(0.8); }
}

.blinking-warning-bar {
  background: #fef2f2 !important;
  border: 1.5px solid #ef4444 !important;
  color: #991b1b !important;
  animation: pulseBlinkWarning 1.8s infinite ease-in-out;
}

.blinking-pulse {
  animation: pulseBlinkWarning 1.4s infinite ease-in-out;
  background-color: #fee2e2 !important;
  color: #b91c1c !important;
  border: 1.5px solid #ef4444 !important;
  font-weight: 700 !important;
  display: inline-block;
}

.blinking-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  background-color: #ef4444;
  border-radius: 50%;
  animation: dotBlink 1s infinite;
}

/* Language Switcher */
.lang-switch-container {
  display: inline-flex;
  align-items: center;
  background: #091a22;
  border: 1px solid #204152;
  border-radius: 20px;
  padding: 2px 4px;
  gap: 2px;
}
.lang-btn {
  background: transparent;
  color: #94a3b8;
  border: 0;
  border-radius: 14px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.2;
  transition: all 0.15s ease;
}
.lang-btn:hover {
  color: #fff;
}
.lang-btn.active {
  background: #087e74;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Technical Jargon Help Tooltips (?) */
.help-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  cursor: help;
  margin-left: 5px;
  vertical-align: middle;
  position: relative;
  transition: background 0.15s, color 0.15s;
  user-select: none;
  line-height: 1;
}
.help-tip:hover, .help-tip:focus {
  background: #0284c7;
  color: #ffffff;
  outline: none;
}
.help-tip .tooltip-text {
  visibility: hidden;
  opacity: 0;
  width: 290px;
  background-color: #0f172a;
  color: #f8fafc;
  text-align: left;
  border-radius: 7px;
  padding: 9px 13px;
  position: absolute;
  z-index: 9999;
  bottom: 135%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  border: 1px solid #334155;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: normal;
  text-transform: none;
}
.help-tip .tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -6px;
  border-width: 6px;
  border-style: solid;
  border-color: #0f172a transparent transparent transparent;
}
.help-tip:hover .tooltip-text, .help-tip:focus .tooltip-text {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}

/* Technical Jargon Direct Hover Label Tooltips (Hover over name/title without (?) badge) */
.hover-tip {
  position: relative;
  display: inline-block;
  cursor: help;
  border-bottom: 1px dotted #64748b;
  color: inherit;
  font-weight: inherit;
  transition: border-color 0.15s, color 0.15s;
}

.hover-tip:hover, .hover-tip:focus {
  border-bottom-color: #0284c7;
  color: #0284c7;
  outline: none;
}

.hover-tip .tooltip-text {
  visibility: hidden;
  opacity: 0;
  width: 290px;
  background-color: #0f172a;
  color: #f8fafc;
  text-align: left;
  border-radius: 7px;
  padding: 8px 12px;
  position: absolute;
  z-index: 9999;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.45;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  border: 1px solid #334155;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: normal;
  text-transform: none;
}

.hover-tip .tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -6px;
  border-width: 6px;
  border-style: solid;
  border-color: #0f172a transparent transparent transparent;
}

.hover-tip:hover .tooltip-text, .hover-tip:focus .tooltip-text {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}

/* Quick Preset Filter Buttons */
.report-preset-btn, .matrix-preset-btn {
  background: #ffffff;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
  line-height: 1.2;
}
.report-preset-btn:hover, .matrix-preset-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}
.report-preset-btn.active, .matrix-preset-btn.active {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.matrix-today-highlight {
  box-shadow: 0 0 0 2px #0284c7 inset !important;
  background-color: #e0f2fe !important;
  animation: pulseTodayCol 1.5s ease-in-out;
}
@keyframes pulseTodayCol {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* =========================================================
   System Health & Connection "Traffic Light" Status Pill
   ========================================================= */
.system-health-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  white-space: nowrap;
}

.system-health-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
}

.system-health-pill.status-green {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #ecfdf5;
}

.system-health-pill.status-green:hover {
  background: rgba(16, 185, 129, 0.25);
  border-color: #10b981;
}

.system-health-pill.status-amber {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fffbeb;
}

.system-health-pill.status-amber:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: #f59e0b;
}

.system-health-pill.status-red {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fef2f2;
}

.system-health-pill.status-red:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
}

.system-health-pill .pill-segment {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.system-health-pill .pill-sep {
  opacity: 0.5;
  font-size: 11px;
}

.system-health-pill .traffic-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 2px;
}

.system-health-pill .traffic-dot.green {
  background-color: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.system-health-pill .traffic-dot.amber {
  background-color: #f59e0b;
  box-shadow: 0 0 6px #f59e0b;
  animation: pulseAmberDot 2s infinite ease-in-out;
}

.system-health-pill .traffic-dot.red {
  background-color: #ef4444;
  box-shadow: 0 0 6px #ef4444;
  animation: pulseRedDot 1.5s infinite ease-in-out;
}

@keyframes pulseAmberDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

@keyframes pulseRedDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.25); }
}

/* =========================================================
   Actionable Empty States
   ========================================================= */
.empty-state-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 36px 20px;
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  margin: 14px 0;
  transition: all 0.2s ease;
}

.empty-state-container:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
}

.empty-state-icon {
  font-size: 40px;
  line-height: 1;
  margin-bottom: 12px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.06));
}

.empty-state-title {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 6px 0;
}

.empty-state-description {
  font-size: 13.5px;
  color: #64748b;
  max-width: 500px;
  margin: 0 auto 16px auto;
  line-height: 1.5;
}

.empty-state-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.empty-state-actions .button,
.empty-state-actions button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
}

/* Widescreen Timesheet Matrix Spreadsheet Rules */
#pane-matrix .card,
.matrix-card-wide {
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box;
}

body.page-matrix main,
main.matrix-page-wide {
  max-width: 98vw !important;
  width: 98% !important;
  padding: 18px 24px !important;
  margin: 0 auto !important;
}

.scroll {
  overflow-x: auto;
  overflow-y: visible;
  max-width: 100%;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #f1f5f9;
}

.scroll::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

.scroll::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 5px;
}

.scroll::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 5px;
}

.scroll::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* 1. Executive KPI Summary Cards */
.kpi-banner {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.kpi-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.08);
}
.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #f0fdf4;
  color: #15803d;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.kpi-content {
  flex: 1;
  min-width: 0;
}
.kpi-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kpi-value {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
  margin-top: 2px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.kpi-badge {
  font-size: 11px;
  font-weight: 700;
  background: #dcfce7;
  color: #15803d;
  padding: 2px 6px;
  border-radius: 4px;
}
.kpi-sub {
  display: block;
  font-size: 11px;
  color: #94a3b8;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 1200px) {
  .kpi-banner { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .kpi-banner { grid-template-columns: 1fr; }
}

/* 2. Timesheet Matrix Interactive Day Drawer / Popover */
.matrix-day-cell {
  cursor: pointer;
  transition: outline 0.1s ease, filter 0.1s ease;
}
.matrix-day-cell:hover {
  outline: 2px solid #38bdf8;
  outline-offset: -2px;
  filter: brightness(0.97);
}
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.day-modal-card {
  background: #ffffff;
  border-radius: 12px;
  width: 92%;
  max-width: 520px;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.2), 0 10px 10px -5px rgba(0,0,0,0.04);
  overflow: hidden;
  border: 1px solid #cbd5e1;
  transform: scale(0.96);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-overlay.active .day-modal-card {
  transform: scale(1);
}
.day-modal-header {
  background: #1e3a47;
  color: #ffffff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.day-modal-header h3 {
  margin: 0;
  font-size: 16px;
  color: #ffffff;
}
.day-modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.day-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 10px;
}
.day-timeline {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px 10px;
}
.timeline-point {
  text-align: center;
}
.timeline-point .tl-time {
  font-family: ui-monospace, monospace;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}
.timeline-point .tl-label {
  font-size: 11px;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 600;
  margin-top: 2px;
}
.day-modal-footer {
  padding: 12px 20px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* 3. Live Scan Logs Stream & Flash Animation */
.btn-stream-active {
  background: #dc2626 !important;
  color: #ffffff !important;
  border-color: #b91c1c !important;
}
@keyframes pulseDot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}
.stream-pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  animation: pulseDot 1.4s infinite;
  margin-right: 6px;
}
@keyframes flashRow {
  0% { background-color: #bbf7d0; }
  100% { background-color: transparent; }
}
.new-row-flash {
  animation: flashRow 2.5s ease-out;
}

/* 4. Global Quick-Search (Ctrl+K) */
.quick-search-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #192e3a;
  border: 1px solid #2d4c5c;
  color: #cbd5e1;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.quick-search-trigger:hover {
  background: #1e3a47;
  border-color: #38bdf8;
  color: #ffffff;
}
.quick-search-trigger kbd {
  background: #0f1c24;
  border: 1px solid #334d5c;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 10px;
  color: #94a3b8;
  font-family: inherit;
}
.spotlight-card {
  background: #ffffff;
  border-radius: 12px;
  width: 90%;
  max-width: 620px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.35);
  overflow: hidden;
  border: 1px solid #cbd5e1;
}
.spotlight-input-wrap {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid #e2e8f0;
  gap: 12px;
}
.spotlight-input {
  border: 0 !important;
  background: transparent !important;
  font-size: 16px !important;
  padding: 0 !important;
  margin: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  color: #0f172a !important;
  width: 100%;
}
.spotlight-results {
  max-height: 380px;
  overflow-y: auto;
  padding: 8px;
}
.spotlight-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.1s ease;
}
.spotlight-item:hover, .spotlight-item.selected {
  background: #f1f5f9;
}
.spotlight-item-title {
  font-weight: 600;
  font-size: 14px;
  color: #0f172a;
}
.spotlight-item-sub {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}
.spotlight-actions {
  display: flex;
  gap: 6px;
}

/* 5. Light Mode / Dark Mode Theme Switcher */
.theme-toggle-btn {
  background: #1e3a47;
  color: #ffffff;
  border: 1px solid #2a5061;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.theme-toggle-btn:hover {
  background: #254b5e;
  border-color: #38bdf8;
}

/* Dark Mode Theme Overrides */
[data-theme="dark"] body {
  background: #090e17 !important;
  color: #e2e8f0 !important;
}
[data-theme="dark"] .app-layout {
  background: #090e17 !important;
}
[data-theme="dark"] .content-area {
  background: #090e17 !important;
}
[data-theme="dark"] .card {
  background: #131d2e !important;
  border-color: #1e293b !important;
  color: #f1f5f9 !important;
}
[data-theme="dark"] .metrics article, [data-theme="dark"] .kpi-card {
  background: #131d2e !important;
  border-color: #1e293b !important;
  color: #f1f5f9 !important;
}
[data-theme="dark"] .kpi-value {
  color: #f8fafc !important;
}
[data-theme="dark"] .kpi-label, [data-theme="dark"] .kpi-sub {
  color: #94a3b8 !important;
}
[data-theme="dark"] table {
  color: #e2e8f0 !important;
}
[data-theme="dark"] th {
  background: #1a273b !important;
  color: #94a3b8 !important;
  border-bottom-color: #24354c !important;
}
[data-theme="dark"] td {
  border-bottom-color: #1e293b !important;
}
[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea {
  background: #0d1522 !important;
  color: #f1f5f9 !important;
  border-color: #24354c !important;
}
[data-theme="dark"] .matrix-table th.matrix-col-emp, [data-theme="dark"] .matrix-table td.matrix-col-emp {
  background: #131d2e !important;
  color: #f8fafc !important;
  border-color: #1e293b !important;
}
[data-theme="dark"] .matrix-table th.matrix-col-dept, [data-theme="dark"] .matrix-table td.matrix-col-dept {
  background: #131d2e !important;
  color: #f8fafc !important;
  border-color: #1e293b !important;
}
[data-theme="dark"] .matrix-table th {
  background: #1a273b !important;
  color: #94a3b8 !important;
  border-color: #24354c !important;
}
[data-theme="dark"] .summary-col {
  background: #162235 !important;
  color: #f8fafc !important;
}
[data-theme="dark"] .day-modal-card, [data-theme="dark"] .spotlight-card {
  background: #131d2e !important;
  border-color: #24354c !important;
  color: #f1f5f9 !important;
}
[data-theme="dark"] .day-timeline {
  background: #0d1522 !important;
  border-color: #1e293b !important;
}
[data-theme="dark"] .timeline-point .tl-time {
  color: #f8fafc !important;
}
[data-theme="dark"] .day-modal-footer, [data-theme="dark"] .spotlight-input-wrap {
  background: #0f1725 !important;
  border-color: #1e293b !important;
}
[data-theme="dark"] .spotlight-item:hover, [data-theme="dark"] .spotlight-item.selected {
  background: #1c2b42 !important;
}
[data-theme="dark"] .spotlight-item-title {
  color: #f8fafc !important;
}
[data-theme="dark"] .spotlight-input {
  color: #f8fafc !important;
}



/* =========================================================
   ENHANCED UI ANIMATION SUITE (4 CATEGORIES)
   ========================================================= */

/* CATEGORY 1: TACTILE & MICRO-INTERACTIONS */
button, .button, .btn, input[type="submit"], .btn-action, .theme-toggle-btn, .lang-btn, .btn-report-page {
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.16s ease, filter 0.15s ease, background-color 0.15s ease !important;
}
button:hover, .button:hover, .btn:hover, input[type="submit"]:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}
button:active, .button:active, .btn:active, input[type="submit"]:active {
  transform: scale(0.96) translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* KPI Card Elevation Lift */
.kpi-card, .metrics article {
  transition: transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.24s ease, border-color 0.2s ease !important;
}
.kpi-card:hover, .metrics article:hover {
  transform: translateY(-3.5px) scale(1.012) !important;
  box-shadow: 0 12px 24px -4px rgba(15, 23, 42, 0.08), 0 4px 8px -2px rgba(15, 23, 42, 0.04) !important;
  border-color: #38bdf8 !important;
}
.kpi-card:hover .kpi-icon {
  transform: scale(1.15) rotate(4deg);
}
.kpi-icon {
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Timesheet Matrix Cell Hover Focus & Glow */
.matrix-day-cell {
  transition: transform 0.14s ease, box-shadow 0.16s ease, outline 0.14s ease !important;
}
.matrix-day-cell:hover {
  transform: scale(1.04);
  z-index: 5;
  box-shadow: 0 6px 14px rgba(2, 132, 199, 0.22) !important;
  outline: 2px solid #0284c7 !important;
  outline-offset: -1px;
}
.matrix-emp-row {
  transition: background-color 0.14s ease;
}
.matrix-emp-row:hover {
  background-color: #f8fafc;
}

/* CATEGORY 2: LOADING & PROGRESS FEEDBACK */
/* Shimmering gradient animation for progress bars */
#preview-inline-bar, #dl-modal-bar, .progress-shimmer-active {
  background-image: linear-gradient(
    90deg,
    #0284c7 0%,
    #38bdf8 30%,
    #10b981 60%,
    #38bdf8 80%,
    #0284c7 100%
  ) !important;
  background-size: 200% 100% !important;
  animation: progressSweep 2s infinite linear !important;
}
@keyframes progressSweep {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Skeleton Loading Shimmer */
.skeleton-loader {
  display: inline-block;
  height: 14px;
  width: 80%;
  border-radius: 4px;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite linear;
}
@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Smooth Spring Modal Pop-In with Frosted Glass */
.modal-overlay {
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
  background: rgba(15, 23, 42, 0.45) !important;
  transition: opacity 0.26s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.day-modal-card, .modal-card, .spotlight-card {
  transform: scale(0.92) translateY(12px) !important;
  opacity: 0 !important;
  transition: transform 0.3s cubic-bezier(0.34, 1.45, 0.7, 1), opacity 0.22s ease !important;
}
.modal-overlay.active .day-modal-card,
.modal-overlay.active .modal-card,
.spotlight-overlay.active .spotlight-card {
  transform: scale(1) translateY(0) !important;
  opacity: 1 !important;
}

/* CATEGORY 3: LIVE BIOMETRIC & MONITORING ANIMATIONS */
/* Live Radar Ping Beacon */
.system-health-pill .traffic-dot.green {
  position: relative;
}
.system-health-pill .traffic-dot.green::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  margin-left: -4px;
  border-radius: 50%;
  background-color: #10b981;
  animation: radarRing 2s cubic-bezier(0, 0, 0.2, 1) infinite;
  pointer-events: none;
}
.live-beacon-pulse {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.live-beacon-pulse::before {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #22c55e;
  animation: radarRing 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
  z-index: 0;
}
@keyframes radarRing {
  0% { transform: scale(0.8); opacity: 0.9; }
  75%, 100% { transform: scale(2.8); opacity: 0; }
}

/* New real-time punch event sliding drop-in */
@keyframes dropInScanEvent {
  0% {
    opacity: 0;
    transform: translateY(-16px) scale(0.98);
    background-color: #dcfce7;
  }
  60% {
    transform: translateY(2px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    background-color: transparent;
  }
}
.scan-row-animate-entry {
  animation: dropInScanEvent 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* CATEGORY 4: ALERT & FEEDBACK NOTIFICATIONS */
/* Spring-bounce entrance for floating toasts */
.toast {
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease, box-shadow 0.25s ease !important;
  transform: translateX(120%) scale(0.92);
}
.toast.toast-show {
  transform: translateX(0) scale(1) !important;
  box-shadow: 0 16px 32px -4px rgba(15, 23, 42, 0.25), 0 6px 12px -2px rgba(15, 23, 42, 0.12) !important;
}
.toast.toast-exit {
  transform: translateX(120%) scale(0.9);
  opacity: 0 !important;
}

/* Copy-to-clipboard checkmark bounce */
@keyframes checkmarkBounce {
  0% { transform: scale(1); }
  40% { transform: scale(1.25); }
  70% { transform: scale(0.95); }
  100% { transform: scale(1); }
}
.btn-copy-success {
  animation: checkmarkBounce 0.4s ease-out;
  color: #10b981 !important;
  border-color: #10b981 !important;
}

[data-theme="dark"] .skeleton-loader {
  background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%) !important;
  background-size: 200% 100% !important;
}

/* One bounded scroll surface keeps headers and the horizontal bar accessible. */
.matrix-scroll {max-height:65vh;max-height:65dvh;overflow:scroll;position:relative;isolation:isolate;scrollbar-gutter:stable;margin-top:8px;overscroll-behavior:contain;}
.matrix-scroll:focus-visible {outline:3px solid #0284c7;outline-offset:2px;}
.matrix-scroll .matrix-table thead th {position:sticky;top:0;z-index:4;box-shadow:0 2px 2px #0002;}
.matrix-scroll .matrix-table thead th.matrix-col-emp,.matrix-scroll .matrix-table thead th.matrix-col-dept {z-index:6;}
.matrix-navigation {display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:16px;}
.matrix-navigation button:disabled {opacity:.45;cursor:default;}
.matrix-scroll .matrix-table .matrix-selected-column {box-shadow:inset 0 0 0 2px #0284c7;}
.matrix-scroll .matrix-selected-row .matrix-col-emp {box-shadow:inset 4px 0 #0284c7;}
@media(max-width:600px) {
 .matrix-scroll .matrix-table .matrix-col-emp {width:145px;min-width:145px;max-width:145px;white-space:normal;}
 .matrix-scroll .matrix-table .matrix-col-dept {width:85px;min-width:85px;max-width:85px;left:145px;white-space:normal;}
}
@media print {
 .matrix-scroll {max-height:none;overflow:visible;}
 .matrix-scroll .matrix-table th,.matrix-scroll .matrix-table td {position:static!important;}
 .matrix-table thead {display:table-header-group;}
 .matrix-navigation {display:none;}
}

/* Device activity drawer */
.event-panel {position:fixed;inset:0 0 0 auto;margin:0;width:min(1160px,96vw);height:100dvh;max-height:100dvh;max-width:100vw;padding:0;border:0;border-radius:20px 0 0 20px;background:#f6f8fc;color:#172c38;box-shadow:-16px 0 60px #102d3b33;overflow:auto;}
.event-panel::backdrop {background:#0f172a88;backdrop-filter:blur(3px);}
.event-panel-heading {position:sticky;top:0;z-index:3;display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:26px 28px;background:#102d3b;color:white;}
.event-panel-heading h2 {margin:5px 0;font-size:25px;}
.event-panel-heading p {margin:4px 0;color:#c5dce7;font-size:13px;}
.event-panel-heading .event-eyebrow {color:#79cfbf;font-size:10px;letter-spacing:1.8px;font-weight:700;}
.event-close {font-size:28px;padding:0 10px;background:#ffffff18;color:white;}
.event-panel-content {padding:22px 28px;}
.event-summary {display:flex;align-items:center;gap:14px;flex-wrap:wrap;font-size:12px;color:#526779;}
.event-tag {background:#fff0d6;color:#8b520c;padding:7px 10px;border-radius:20px;font-weight:700;}
.event-filters {display:grid;grid-template-columns:1.3fr 1fr 1fr 1.3fr auto auto;align-items:end;gap:10px;margin:20px 0;padding:16px;background:white;border:1px solid #dce5ee;border-radius:12px;}
.event-filters label {margin:0;min-width:0;}.event-filters input,.event-filters select {min-width:0;padding:9px;font-size:12px;}
.event-filters button {white-space:nowrap;padding:10px;}
.event-results-heading {display:flex;justify-content:space-between;align-items:center;}.event-results-heading h3 {margin:0;font-size:16px;}
.event-table-wrap {overflow:auto;max-height:58vh;border:1px solid #dce5ee;border-radius:12px;background:white;}
.event-table {min-width:730px;border-collapse:separate;border-spacing:0;}
.event-table th {position:sticky;top:0;z-index:1;background:#eef3f8;font-size:11px;text-transform:uppercase;letter-spacing:.5px;}
.event-table td {padding:14px 12px;font-size:12px;vertical-align:middle;}.event-table td small {display:block;margin-top:5px;color:#64748b;}
.event-code {font-family:ui-monospace,monospace;border:1px solid #d8e4f0;background:#edf4fb;border-radius:6px;padding:3px 7px;}
.event-reason {color:#835019;}.event-empty {text-align:center;padding:40px!important;color:#64748b;}
.event-detail {background:#f3f7fb;padding:16px;border-radius:8px;border-left:3px solid #087e74;}.event-detail h4{margin:0;}.event-detail p {margin:7px 0;}.event-detail pre {white-space:pre-wrap;overflow-wrap:anywhere;font-size:11px;}
.event-panel [hidden] {display:none!important;}
[data-theme="dark"] .event-panel {background:#16202e;color:#e2e8f0;}[data-theme="dark"] .event-filters,[data-theme="dark"] .event-table-wrap {background:#1e293b;border-color:#425168;}[data-theme="dark"] .event-detail,[data-theme="dark"] .event-table th {background:#253449;color:#e2e8f0;}[data-theme="dark"] .event-reason {color:#f6ca84;}
@media(max-width:850px) {.event-filters {grid-template-columns:1fr 1fr;}.event-panel-content {padding:16px;}.event-panel-heading {padding:20px 16px;}}
@media(prefers-reduced-motion:no-preference){.event-panel[open] {animation:event-panel-in .2s ease-out;}@keyframes event-panel-in {from{transform:translateX(40px);opacity:.5;}to{transform:translateX(0);opacity:1;}}}
.event-panel[open] {display:flex;flex-direction:column;overflow:hidden;}
.event-panel-heading {flex-shrink:0;position:relative;}
.event-panel-content {flex:1;min-height:0;display:flex;flex-direction:column;overflow:auto;}
.event-table-wrap {flex:1;min-height:180px;max-height:none;}
.event-filters {margin:14px 0;}
.event-help {margin-bottom:0;}
