/*
Status token reference:
Present/success: Present, Approved, Closed, Resolved, Paid
Absent/danger: Absent, Rejected, Force Checkout, Disabled QR
Late/warning: Late, Pending, Half Day
Leave/info: On Leave, WFH
Neutral/secondary: Draft, Not Started, Disabled
*/
:root {
  --mws-primary: #2753d8;
  --mws-primary-dark: #17338d;
  --mws-accent: #0b9f89;
  --mws-ink: #111827;
  --mws-muted: #647084;
  --mws-line: #e4e9f2;
  --mws-bg: #f4f6fa;
  --mws-surface: #ffffff;
  --mws-radius: 8px;
  --mws-shadow: 0 16px 42px rgba(17, 24, 39, .09);
  --mws-soft-shadow: 0 6px 18px rgba(17, 24, 39, .055);
}

* { letter-spacing: 0; }
body {
  min-height: 100vh;
  background: var(--mws-bg);
  color: var(--mws-ink);
  font-family: "Poppins", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
}
a { text-decoration: none; }
.app-header {
  height: 70px;
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid rgba(226, 232, 240, .9);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 1030;
  box-shadow: 0 1px 0 rgba(17, 24, 39, .03);
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--mws-ink); }
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--mws-primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 10px 22px rgba(39, 83, 216, .24);
}
.brand small { display: block; color: var(--mws-muted); font-size: 12px; margin-top: -2px; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.topbar-search {
  width: min(44vw, 520px);
  height: 42px;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--mws-line);
  border-radius: 10px;
  background: #f8fafc;
  color: var(--mws-muted);
}
.topbar-search input { border: 0; outline: 0; background: transparent; flex: 1; color: var(--mws-ink); }
.topbar-search kbd { border: 1px solid #d9e0ec; background: #fff; color: #718096; box-shadow: none; font-size: 11px; }
.portal-chip,
.timezone-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  color: var(--mws-muted);
  background: #f6f8fc;
  border: 1px solid var(--mws-line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.portal-chip.admin { color: #17338d; background: #eef3ff; border-color: #d9e4ff; }
.portal-chip.employee { color: #075f55; background: #e9fbf6; border-color: #c9f1e7; }
.icon-btn {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--mws-line);
  background: #fff;
  color: var(--mws-ink);
  border-radius: 10px;
}
.icon-btn:hover, .profile-btn:hover, .btn-light:hover { border-color: #cdd6e5; background: #f8fafc; }
.profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--mws-line);
  background: #fff;
  border-radius: 999px;
  padding: 5px 12px 5px 5px;
  font-weight: 700;
}
.avatar {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #dfe8ff;
  color: var(--mws-primary-dark);
  font-weight: 600;
  flex: 0 0 auto;
}
.avatar-sm { width: 30px; height: 30px; font-size: 12px; }
.avatar-lg { width: 120px; height: 120px; font-size: 34px; }
.app-sidebar {
  position: fixed;
  top: 70px;
  bottom: 0;
  left: 0;
  width: 286px;
  background: #101828;
  color: #d6deef;
  padding: 18px 14px;
  z-index: 1020;
  overflow-y: auto;
  box-shadow: 10px 0 30px rgba(15, 23, 42, .18);
}
.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: 10px;
  background: rgba(255, 255, 255, .045);
}
.sidebar-profile strong { display: block; color: #fff; font-size: 13px; }
.sidebar-profile small { display: block; color: #9aa8bf; font-size: 12px; }
.sidebar-section { color: #8ea0ba; text-transform: uppercase; font-size: 11px; font-weight: 600; padding: 10px 12px; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  color: #cbd5e1;
  border-radius: 8px;
  margin-bottom: 4px;
  position: relative;
  font-weight: 650;
}
.sidebar-nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar-nav a.active {
  background: var(--mws-primary);
  color: #fff;
  box-shadow: 0 10px 22px rgba(39, 83, 216, .22);
}
.sidebar-nav a.active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 9px;
  bottom: 9px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: #0e69d8;
}
.sidebar-nav i { width: 22px; text-align: center; font-size: 16px; }
.app-main { margin-left: 286px; padding: 100px 30px 34px; }
.page-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}
.page-title h1 { font-size: 28px; margin: 2px 0 5px; font-weight: 600; color: #0f172a; }
.page-kicker { color: var(--mws-primary); font-size: 12px; font-weight: 600; text-transform: uppercase; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.breadcrumb { margin-bottom: 0; font-size: 13px; }
.card {
  border: 1px solid rgba(226, 232, 240, .95);
  border-radius: 10px;
  box-shadow: var(--mws-soft-shadow);
  background: rgba(255, 255, 255, .98);
}
.card-header {
  background: #fff;
  border-bottom: 1px solid var(--mws-line);
  font-weight: 600;
  padding: 15px 18px;
  color: #172033;
}
.card-body { padding: 18px; }
.info-card {
  height: 100%;
  overflow: hidden;
  position: relative;
}
.info-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--mws-primary);
}
.info-card.tone-success::before { background: #198754; }
.info-card.tone-warning::before { background: #ffc107; }
.info-card.tone-info::before { background: #0dcaf0; }
.info-card.tone-danger::before { background: #dc3545; }
.info-card .card-body { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 118px; }
.stat-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; flex: 0 0 auto; }
.stat-icon.primary { color: var(--mws-primary); background: #e7edff; }
.stat-icon.success { color: #198754; background: #e7f5ec; }
.stat-icon.warning { color: #9a6700; background: #fff4d5; }
.stat-icon.info { color: #087990; background: #dff6fb; }
.stat-icon.danger { color: #dc3545; background: #fde7e9; }
.stat-value { font-size: 29px; line-height: 1.05; font-weight: 600; margin-top: 8px; }
.stat-label { color: var(--mws-muted); font-size: 12px; font-weight: 600; text-transform: uppercase; }
.table { vertical-align: middle; }
.table > :not(caption) > * > * { padding: .92rem .9rem; }
.table thead th {
  color: #526071;
  background: #f8fafc;
  border-bottom: 1px solid var(--mws-line);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 600;
}
.table tbody tr:hover { background: #f8fbff; }
.action-group { display: inline-flex; gap: 6px; }
.btn {
  border-radius: 8px;
  font-weight: 600;
}
.btn-primary {
  background: var(--mws-primary);
  border-color: var(--mws-primary);
  box-shadow: 0 10px 18px rgba(39, 83, 216, .18);
}
.btn-primary:hover { filter: brightness(.98); transform: translateY(-1px); }
.btn-light { border-color: var(--mws-line); background: #fff; }
.btn-icon { width: 36px; height: 36px; display: inline-grid; place-items: center; padding: 0; }
.badge { border-radius: 999px; padding: .48em .72em; font-weight: 600; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  border-radius: 999px;
  background: #f0f4fa;
  border: 1px solid #e2e8f0;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
}
.progress { height: 8px; background: #e9edf5; }
.progress-bar { background: var(--mws-primary); }
.notification-menu { width: 340px; padding: 0; overflow: hidden; }
.notification-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--mws-line); }
.notification-head a { font-size: 12px; }
.notification-row { display: flex; gap: 12px; padding: 12px 14px; color: var(--mws-ink); border-bottom: 1px solid #f0f2f7; }
.notification-row span { display: grid; line-height: 1.25; }
.notification-row small { color: var(--mws-muted); margin-top: 3px; }
.notification-empty { padding: 28px; text-align: center; color: var(--mws-muted); }
.notification-empty i { display: block; font-size: 28px; margin-bottom: 8px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding-left: 24px; margin-bottom: 15px; }
.timeline li::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--mws-primary); position: absolute; left: 0; top: 6px; }
.timeline small { color: var(--mws-muted); display: block; }
.auth-page {
  background: #f7f9fd;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-card {
  width: min(100%, 450px);
  box-shadow: var(--mws-shadow);
  border: 1px solid rgba(255, 255, 255, .75);
}
.camera-shell { aspect-ratio: 16 / 10; background: #111827; border-radius: 8px; display: grid; place-items: center; color: #cbd5e1; position: relative; overflow: hidden; }
.qr-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-box { width: min(72%, 330px); aspect-ratio: 1; border: 2px solid rgba(255,255,255,.8); border-radius: 8px; position: relative; z-index: 2; }
.qr-reader {
  width: 100%;
  min-height: 100%;
  background: #111827;
}
.qr-reader video {
  object-fit: cover;
}
.qr-reader__dashboard_section_swaplink,
.qr-reader__status_span {
  color: #fff !important;
}
.scan-box::after { content: ""; position: absolute; left: 10%; right: 10%; top: 18%; height: 2px; background: #22c55e; animation: scan 1.8s infinite alternate ease-in-out; }
@keyframes scan { from { transform: translateY(0); } to { transform: translateY(190px); } }
.selfie-guide { width: 210px; height: 210px; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }
.selfie-video { transform: scaleX(-1); }
.selfie-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}
.face-guide {
  z-index: 2;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 600;
  text-align: center;
}
.face-guide span {
  transform: translateY(140px);
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(17, 24, 39, .72);
}
.face-guide.detected {
  border-color: #22c55e;
}
.face-guide.detected span {
  background: #198754;
}
.face-guide.rejected {
  border-color: #dc3545;
}
.face-guide.rejected span {
  background: #dc3545;
}
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.day-cell { min-height: 72px; border: 1px solid var(--mws-line); border-radius: 8px; background: #fff; padding: 8px; font-size: 13px; }
.day-cell.present { border-color: #95d5ac; background: #effaf3; }
.day-cell.late { border-color: #ffd86a; background: #fff9e7; }
.day-cell.leave { border-color: #8bd3e6; background: #eaf9fc; }
.day-cell.absent { border-color: #f0a0a8; background: #fff0f2; }
.dropzone { border: 1.5px dashed #b8c3d9; border-radius: 10px; padding: 20px; text-align: center; background: #f8fafc; cursor: pointer; transition: .16s ease; }
.dropzone:hover { border-color: var(--mws-primary); background: #f5f8ff; }
.file-chip { display: inline-flex; gap: 7px; align-items: center; margin: 6px 6px 0 0; padding: 7px 10px; border: 1px solid var(--mws-line); border-radius: 999px; background: #fff; font-size: 13px; }
.message-item { border-left: 4px solid transparent; }
.message-item.unread { border-left-color: var(--mws-primary); font-weight: 700; background: #f8fbff; }
.chat-thread { display: grid; gap: 12px; }
.bubble { max-width: 78%; padding: 12px 14px; border-radius: 8px; background: #eef2f7; }
.bubble.admin, .bubble.me { margin-left: auto; background: #e7edff; }
.settings-nav .nav-link { color: var(--mws-ink); border-radius: 8px; text-align: left; }
.settings-nav .nav-link.active { background: var(--mws-primary); color: #fff; }
.permission-table th, .permission-table td { text-align: center; white-space: nowrap; }
.qr-thumb { width: 54px; height: 54px; background: #111827; border: 6px solid #fff; box-shadow: 0 0 0 1px var(--mws-line), inset 12px 0 0 #fff, inset -12px 0 0 #fff; }
.skeleton { overflow: hidden; background: #edf1f7; position: relative; border-radius: 6px; height: 16px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: rgba(255,255,255,.55); animation: shimmer 1.4s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }
.sidebar-backdrop { display: none; }
.form-control, .form-select {
  border-color: #dbe3ef;
  border-radius: 8px;
  min-height: 42px;
}
.form-control:focus, .form-select:focus {
  border-color: var(--mws-primary);
  box-shadow: 0 0 0 .2rem rgba(39, 83, 216, .12);
}
.form-label { color: #3b4658;   ; font-size: 13px; }
.dropdown-menu, .modal-content, .offcanvas {
  border: 1px solid var(--mws-line);
  border-radius: 10px;
  box-shadow: var(--mws-shadow);
}
.filter-card .card-body { background: #fbfcff; border-radius: 10px; }
.nav-tabs .nav-link, .nav-pills .nav-link { font-weight: 600; }
.nav-tabs .nav-link.active { color: var(--mws-primary); border-bottom-color: var(--mws-primary); }
.executive-banner {
  border: 1px solid rgba(39, 83, 216, .16);
  background: #ffffff;
  border-radius: 12px;
  box-shadow: var(--mws-soft-shadow);
  padding: 20px;
}
.executive-banner h2 { margin: 0 0 6px; font-size: 21px; font-weight: 600; }
.executive-banner p { color: var(--mws-muted); margin: 0; }
.banner-metrics { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.mini-metric {
  min-width: 120px;
  padding: 12px;
  background: rgba(255, 255, 255, .78);
  border: 1px solid rgba(226, 232, 240, .9);
  border-radius: 10px;
}
.mini-metric strong { display: block; font-size: 19px; }
.mini-metric span { color: var(--mws-muted); font-size: 12px; font-weight: 600; text-transform: uppercase; }
.attendance-focus {
  border: 0;
  overflow: hidden;
  background: #111827;
  color: #fff;
  box-shadow: 0 18px 44px rgba(17, 24, 39, .22);
}
.attendance-focus .card-body { padding: 28px; }
.attendance-focus .text-muted { color: #c6d2e6 !important; }
.attendance-focus .display-5 { font-variant-numeric: tabular-nums; }
.attendance-focus .btn-outline-danger { color: #fecdd3; border-color: rgba(254, 205, 211, .45); }
.attendance-focus .btn-outline-danger:hover { color: #111827; background: #fecdd3; }
.attendance-focus .badge { box-shadow: 0 0 0 1px rgba(255,255,255,.12) inset; }
.test-qr-box {
  width: 182px;
  min-height: 206px;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--mws-line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--mws-soft-shadow);
}
.test-qr-box img {
  width: 148px;
  height: 148px;
  object-fit: contain;
}
.test-qr-box span {
  color: var(--mws-ink);
  font-weight: 600;
}
.qr-result {
  display: grid;
  place-items: center;
  gap: 10px;
  font-weight: 600;
}
.qr-result i {
  font-size: 52px;
}
.qr-result.error {
  color: #fecdd3;
}

@media (max-width: 991.98px) {
  .app-sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .app-sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.show { display: block; position: fixed; inset: 70px 0 0; background: rgba(15, 23, 42, .42); z-index: 1010; }
  .app-main { margin-left: 0; padding: 92px 16px 24px; }
  .timezone-pill { display: none; }
  .page-title { flex-direction: column; }
  .page-actions { justify-content: flex-start; }
  .banner-metrics { justify-content: flex-start; margin-top: 16px; }
}

@media (max-width: 575.98px) {
  .app-header { padding: 0 12px; }
  .brand small, .brand strong { display: none; }
  .notification-menu { width: calc(100vw - 24px); }
  .calendar-grid { gap: 5px; }
  .day-cell { min-height: 54px; padding: 5px; }
  .camera-shell { aspect-ratio: 3 / 4; }
  .bubble { max-width: 92%; }
}

@media print {
  .app-header, .app-sidebar, .page-title .btn, .action-group, .btn, .sidebar-backdrop { display: none !important; }
  .app-main { margin: 0; padding: 0; }
  .card { box-shadow: none; border-color: #bbb; }
}
/* Sidebar Smooth Transitions */
.app-sidebar {
  width: 260px; /* Default width */
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-main,
.app-footer {
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sidebar Toggle Icon Styling (No BG, Plain, Attractive Hover) */
#sidebarToggle {
  background: transparent !important;
  border: none !important;
  color: inherit;
  padding: 6px 8px;
  border-radius: 6px;
  transition: color 0.2s ease, transform 0.2s ease;
}

#sidebarToggle:hover {
  color: var(--bs-primary, #0d6efd);
  transform: scale(1.1);
}

#sidebarToggle:focus {
  box-shadow: none !important;
}

/* Increased Width & Layout for Mini Sidebar State */
body.sidebar-mini .app-sidebar {
  width: 85px !important; /* Increased width for mini state */
}

body.sidebar-mini .app-sidebar .sidebar-profile {
  padding: 15px 10px;
  justify-content: center;
}

body.sidebar-mini .app-sidebar .sidebar-profile strong,
body.sidebar-mini .app-sidebar .sidebar-profile small,
body.sidebar-mini .app-sidebar .sidebar-section,
body.sidebar-mini .app-sidebar span {
  display: none !important;
}

body.sidebar-mini .app-main,
body.sidebar-mini .app-footer {
  margin-left: 85px !important;
}

body.sidebar-mini .app-sidebar .sidebar-nav a {
  justify-content: center;
  padding: 14px 0;
  margin: 4px 10px;
  border-radius: 8px;
}

body.sidebar-mini .sidebar-nav a.active {
     background: none!important; /* Remove the left border indicator */
    color: #fdb201;
    box-shadow: none!important; /* Remove the shadow */
}

body.sidebar-mini .app-sidebar .sidebar-nav a i {
  font-size: 1.4rem;
  margin: 0;
}