/* ==========================================================================
   AppProTech Attendance & DMS — application styles (Bootstrap 5 based)
   ========================================================================== */

:root {
  --apt-sidebar-width: 260px;
  --apt-sidebar-bg: #0f172a;
  --apt-sidebar-color: #cbd5e1;
  --apt-sidebar-muted: #64748b;
  --apt-sidebar-active: #2563eb;
  --apt-body-bg: #f4f6fb;
  --apt-card-radius: 0.85rem;
  --apt-topbar-height: 64px;
  --bs-primary: #2563eb;
  --bs-primary-rgb: 37, 99, 235;
  --bs-link-color: #1d4ed8;
  --bs-link-color-rgb: 29, 78, 216;
}

html,
body {
  height: 100%;
}

body.app-body {
  background: var(--apt-body-bg);
  font-size: 0.925rem;
}

.btn-primary {
  --bs-btn-bg: #2563eb;
  --bs-btn-border-color: #2563eb;
  --bs-btn-hover-bg: #1d4ed8;
  --bs-btn-hover-border-color: #1d4ed8;
  --bs-btn-active-bg: #1e40af;
  --bs-btn-active-border-color: #1e40af;
}

/* ---------------------------------------------------------------- shell */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  background: var(--apt-sidebar-bg);
  color: var(--apt-sidebar-color);
}

@media (min-width: 992px) {
  .app-sidebar {
    width: var(--apt-sidebar-width);
    flex: 0 0 var(--apt-sidebar-width);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
  }

  /* Bootstrap's .offcanvas-lg sets a transparent !important background at
     this breakpoint; the sidebar keeps its own surface. */
  .app-sidebar.offcanvas-lg {
    background-color: var(--apt-sidebar-bg) !important;
  }

  /* Paint the sidebar column for the full page height (the sticky sidebar
     itself is one viewport tall). */
  .app-shell {
    background: linear-gradient(to right, var(--apt-sidebar-bg) var(--apt-sidebar-width), transparent var(--apt-sidebar-width));
  }
}

@media (max-width: 991.98px) {
  .app-sidebar.offcanvas-lg {
    --bs-offcanvas-width: var(--apt-sidebar-width);
    --bs-offcanvas-bg: var(--apt-sidebar-bg);
  }
}

/* Company logo on a white panel: the logo's dark-blue text needs a light
   background (the navigation below stays dark). */
.sidebar-logo {
  min-height: var(--apt-topbar-height);
  padding: 0.55rem 1rem;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}

.sidebar-logo img {
  display: block;
  width: 100%;
  max-width: 200px;
  height: auto;
}

.auth-logo {
  display: block;
  width: 100%;
  max-width: 240px;
  height: auto;
  margin-left: auto;
  margin-right: auto;
}

.topbar-logo {
  height: 32px;
  width: auto;
}

.sidebar-nav {
  padding: 1rem 0.75rem 2rem;
}

.sidebar-section {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--apt-sidebar-muted);
  padding: 1rem 0.75rem 0.4rem;
}

/* Section headers are accordion toggles (Bootstrap collapse): the chevron
   points down while the section is closed and up while it is open. */
.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.15rem;
  padding: 0.65rem 0.75rem;
  border: 0;
  border-radius: 0.55rem;
  background: transparent;
  font-weight: 600;
  text-align: left;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar-toggle:hover,
.sidebar-toggle:not(.collapsed) {
  color: #e2e8f0;
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-toggle:focus-visible {
  outline: 2px solid var(--apt-sidebar-active);
  outline-offset: 1px;
}

.sidebar-chevron {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.sidebar-toggle:not(.collapsed) .sidebar-chevron {
  transform: rotate(180deg);
}

.sidebar-group-items {
  padding: 0.15rem 0 0.4rem;
}

@media (prefers-reduced-motion: reduce) {
  .sidebar-chevron {
    transition: none;
  }
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.75rem;
  margin-bottom: 2px;
  border-radius: 0.55rem;
  color: var(--apt-sidebar-color);
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar-link i {
  font-size: 1.05rem;
  width: 1.25rem;
  text-align: center;
  opacity: 0.85;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.sidebar-link.active {
  background: var(--apt-sidebar-active);
  color: #fff;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.sidebar-link .badge {
  margin-left: auto;
}

.app-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-topbar {
  height: var(--apt-topbar-height);
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.25rem;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.app-content {
  flex: 1 1 auto;
  padding: 1.5rem;
}

@media (max-width: 575.98px) {
  .app-content {
    padding: 1rem 0.75rem;
  }
}

.app-footer {
  padding: 1rem 1.5rem;
  color: #94a3b8;
  font-size: 0.8rem;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: #e0e7ff;
  color: #3730a3;
  font-weight: 600;
  font-size: 0.8rem;
  flex: 0 0 auto;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-lg {
  width: 96px;
  height: 96px;
  font-size: 1.75rem;
}

/* ---------------------------------------------------------------- page */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.page-header h1 {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0;
}

.page-header .breadcrumb {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
}

.card {
  border: 1px solid #e8ebf2;
  border-radius: var(--apt-card-radius);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.card-header {
  background: #fff;
  border-bottom: 1px solid #eef0f5;
  border-top-left-radius: var(--apt-card-radius) !important;
  border-top-right-radius: var(--apt-card-radius) !important;
  font-weight: 600;
}

.stat-card .stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
}

.stat-card .stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
}

.stat-card .stat-label {
  color: #64748b;
  font-size: 0.8rem;
}

.form-label .required::after,
.form-label.required::after {
  content: ' *';
  color: #dc2626;
}

.table > :not(caption) > * > * {
  vertical-align: middle;
}

table.dataTable thead th {
  white-space: nowrap;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #475569;
  background: #f8fafc;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: end;
}

.filter-bar .form-control,
.filter-bar .form-select {
  min-width: 150px;
}

.detail-list dt {
  color: #64748b;
  font-weight: 500;
  font-size: 0.8rem;
}

.detail-list dd {
  margin-bottom: 0.85rem;
}

/* ------------------------------------------------------------- camera */
.camera-frame {
  position: relative;
  width: 100%;
  max-width: 520px;
  aspect-ratio: 4 / 3;
  margin: 0 auto;
  border-radius: 1rem;
  overflow: hidden;
  background: #0f172a;
}

.camera-frame video,
.camera-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-frame video.mirrored {
  transform: scaleX(-1);
}

.camera-frame .camera-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #cbd5e1;
  text-align: center;
  padding: 1rem;
}

.camera-frame .camera-guide {
  position: absolute;
  inset: 12% 22%;
  border: 2px dashed rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  pointer-events: none;
}

.live-clock {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.timeline-step {
  display: flex;
  gap: 0.75rem;
  padding-bottom: 1rem;
  position: relative;
}

.timeline-step::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 36px;
  bottom: 0;
  width: 2px;
  background: #e2e8f0;
}

.timeline-step:last-child::before {
  display: none;
}

.photo-thumb {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: 0.5rem;
  background: #e2e8f0;
}

/* --------------------------------------------------------------- auth */
.auth-body {
  min-height: 100vh;
  background: radial-gradient(circle at 10% 10%, #dbeafe 0, transparent 40%),
    radial-gradient(circle at 90% 90%, #ede9fe 0, transparent 40%), #f8fafc;
}

.auth-card {
  width: 100%;
  max-width: 430px;
  border-radius: 1.1rem;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
}

/* ------------------------------------------------------------- select2 */
.select2-container--bootstrap-5 .select2-selection {
  min-height: calc(1.5em + 0.75rem + 2px);
}

.is-invalid + .select2-container--bootstrap-5 .select2-selection {
  border-color: var(--bs-form-invalid-border-color);
}

/* --------------------------------------------------------- permissions */
.permission-module {
  border: 1px solid #e8ebf2;
  border-radius: 0.75rem;
  padding: 1rem;
  height: 100%;
}

.permission-module h6 {
  font-weight: 600;
}

/* --------------------------------------------------------------- misc */
.cursor-pointer {
  cursor: pointer;
}

/* Upper-case inputs (codes, PAN, IFSC) keep normal-case placeholders. */
.text-uppercase::placeholder {
  text-transform: none;
}

.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

pre.json-view {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 0.5rem;
  padding: 0.75rem;
  font-size: 0.78rem;
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

@media print {
  .app-sidebar,
  .app-topbar,
  .app-footer,
  .no-print {
    display: none !important;
  }
}

/* ---------------------------------------------------------- notifications */
.notification-menu {
  width: min(360px, calc(100vw - 1.5rem));
}

.notification-list {
  max-height: 380px;
  overflow-y: auto;
}

.notification-item {
  white-space: normal;
  border-bottom: 1px solid var(--bs-border-color-translucent);
}

.notification-item.is-unread {
  background: rgba(37, 99, 235, 0.06);
}

.notification-item .notification-message {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --------------------------------------------------------- activity feed */
.activity-feed {
  list-style: none;
  margin: 0;
  padding: 0;
}

.activity-feed li {
  display: flex;
  gap: 0.65rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--bs-border-color-translucent);
}

.activity-feed li:last-child {
  border-bottom: 0;
}

.activity-feed .activity-icon {
  flex: 0 0 2rem;
  height: 2rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
}
/* ------------------------------------------------------ shifts & roster */
.shift-chip {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  margin-right: 0.4rem;
  vertical-align: baseline;
}

.roster-wrap {
  max-height: 70vh;
}

.roster-table {
  font-size: 0.82rem;
  min-width: 860px;
}

.roster-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.roster-table .roster-name {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 190px;
  background: #fff;
}

.roster-table thead .roster-name {
  z-index: 3;
  background: #f8f9fa;
}

.roster-cell {
  position: relative;
  min-width: 96px;
  text-align: center;
  line-height: 1.25;
}

.roster-editable {
  cursor: pointer;
}

.roster-editable:hover,
.roster-editable:focus {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
}

.roster-off,
.roster-legend.roster-off {
  background: #e2e8f0;
  color: #334155;
}

.roster-holiday,
.roster-legend.roster-holiday {
  background: #fee2e2;
  color: #991b1b;
}

.roster-locked {
  opacity: 0.75;
}

.roster-today {
  background: #dbeafe !important;
}

.roster-pin {
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 0.7rem;
}

.roster-legend {
  display: inline-block;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 3px;
  margin-right: 0.35rem;
  vertical-align: text-bottom;
  border: 1px solid #cbd5e1;
}
/* ------------------------------------------------------ my schedule */
.schedule-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 0.5rem;
}

.schedule-day {
  border: 1px solid #e2e8f0;
  border-radius: 0.6rem;
  padding: 0.45rem 0.55rem;
  background: #fff;
  min-width: 0;
}

.schedule-day.schedule-off {
  background: #f1f5f9;
}

.schedule-day.schedule-holiday {
  background: #fee2e2;
  border-color: #fecaca;
}

.schedule-day.schedule-today {
  border: 2px solid #2563eb;
}
.roster-holiday-work {
  box-shadow: inset 0 -3px 0 #ef4444;
}
/* ------------------------------------------------------------ leave */
.leave-balance-card .fs-4 {
  line-height: 1.2;
}

.leave-calendar-grid {
  table-layout: fixed;
  min-width: 760px;
}

.leave-calendar-grid td {
  height: 104px;
  vertical-align: top;
  padding: 0.35rem;
}

.leave-cal-empty {
  background: #f8fafc;
}

.leave-cal-day.is-today {
  box-shadow: inset 0 0 0 2px #2563eb;
}

.leave-cal-num {
  font-weight: 600;
  font-size: 0.8rem;
  color: #475569;
}

.leave-cal-holiday {
  font-size: 0.72rem;
  color: #b91c1c;
  background: #fee2e2;
  border-radius: 0.3rem;
  padding: 0 0.3rem;
  margin: 0.1rem 0;
}

.leave-cal-chip {
  display: block;
  font-size: 0.72rem;
  line-height: 1.35;
  border-radius: 0.3rem;
  padding: 0 0.3rem;
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
}

.leave-cal-chip.is-approved {
  background: #dcfce7;
  color: #166534;
}

.leave-cal-chip.is-pending {
  background: #fef9c3;
  color: #854d0e;
}

/* ---------------------------------------------------------- payroll */
.payroll-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0;
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
}

.payroll-steps li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 150px;
  color: #64748b;
  font-size: 0.875rem;
  position: relative;
}

.payroll-steps li:not(:last-child)::after {
  content: "";
  flex: 1;
  height: 2px;
  background: #e2e8f0;
  margin: 0 0.5rem;
}

.payroll-step-dot {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  color: #475569;
  font-weight: 600;
  font-size: 0.8rem;
  flex: none;
}

.payroll-steps li.is-done { color: #15803d; }
.payroll-steps li.is-done .payroll-step-dot { background: #dcfce7; color: #15803d; }
.payroll-steps li.is-done:not(:last-child)::after { background: #86efac; }
.payroll-steps li.is-current { color: #1e3a8a; font-weight: 600; }
.payroll-steps li.is-current .payroll-step-dot { background: #2563eb; color: #fff; }

.payslip-card { max-width: 900px; }
.payslip-card table { width: 100%; border-collapse: collapse; }
.payslip-card .ps-head { text-align: center; }
.payslip-card .ps-logo { height: 64px; max-width: 100%; object-fit: contain; }
.payslip-card .ps-company-name { font-size: 1.15rem; font-weight: 700; color: #0f172a; }
.payslip-card .ps-address { margin-top: 0.35rem; font-size: 0.875rem; color: #475569; }
.payslip-card .ps-title { margin: 1rem 0 0.75rem; padding: 0.45rem; background: #1e3a8a; color: #fff; font-weight: 600; text-align: center; border-radius: 0.3rem; }
.payslip-card .ps-info th, .payslip-card .ps-info td,
.payslip-card .ps-days th, .payslip-card .ps-days td,
.payslip-card .ps-lines th, .payslip-card .ps-lines td { border: 1px solid #cbd5e1; padding: 0.4rem 0.5rem; font-size: 0.875rem; }
.payslip-card .ps-info th, .payslip-card .ps-days th, .payslip-card .ps-lines thead th, .payslip-card .ps-lines tfoot th { background: #f1f5f9; }
.payslip-card .ps-days, .payslip-card .ps-lines, .payslip-card .ps-net { margin-top: 0.75rem; }
.payslip-card .ps-days td, .payslip-card .ps-days th { text-align: center; }
.payslip-card .num { text-align: right; white-space: nowrap; }
.payslip-card .ps-note { color: #64748b; font-size: 0.75rem; }
.payslip-card .ps-net th, .payslip-card .ps-net td { border: 1px solid #1e3a8a; padding: 0.5rem; }
.payslip-card .ps-net th { background: #1e3a8a; color: #fff; }
.payslip-card .ps-net td.num { font-size: 1.1rem; font-weight: 700; }
.payslip-card .ps-words { font-style: italic; color: #334155; font-size: 0.875rem; }
.payslip-card .ps-foot { margin: 1rem 0 0; font-size: 0.75rem; color: #64748b; text-align: center; }

@media (max-width: 575.98px) {
  .payslip-card .card-body { padding: 0.75rem !important; }
  .payslip-card .ps-info th, .payslip-card .ps-info td { display: block; width: 100%; }
  .payslip-card .ps-days { font-size: 0.75rem; }
}

@media print {
  .payslip-card { border: 0; box-shadow: none; max-width: none; }
  .page-header, .breadcrumb { display: none !important; }
}

/* -------------------------------------------------------------- CRM */
.lead-stage-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.25rem 0;
}

.lead-stage-chip {
  flex: 0 1 auto;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  white-space: nowrap;
  border-left: 4px solid var(--stage-color, #64748b);
}

.lead-stage-chip:not(:disabled):hover { background: #f8fafc; border-color: var(--stage-color); }
.lead-stage-chip:disabled { opacity: 0.75; }
.lead-stage-chip.is-current { background: var(--stage-color, #2563eb); border-color: var(--stage-color, #2563eb); color: #fff; font-weight: 600; opacity: 1; }

.timeline { position: relative; }
.timeline-item { display: flex; gap: 0.75rem; padding-bottom: 1rem; position: relative; }
.timeline-item:not(:last-child)::before { content: ''; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: #e2e8f0; }
.timeline-icon { width: 32px; height: 32px; border-radius: 50%; background: #eef2ff; color: #3730a3; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.timeline-icon[style] { color: #fff; }
.timeline-body { min-width: 0; flex: 1; }

.kanban {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.75rem;
  align-items: flex-start;
  min-height: 60vh;
}

.kanban-column {
  flex: 0 0 272px;
  background: #f1f5f9;
  border-radius: 0.75rem;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 260px);
  transition: box-shadow 0.15s ease;
}

.kanban-column.is-drop-target { box-shadow: inset 0 0 0 2px #2563eb; }
.kanban-column-head { padding: 0.6rem 0.75rem; border-top: 4px solid #64748b; border-radius: 0.75rem 0.75rem 0 0; background: #fff; }
.kanban-cards { padding: 0.5rem; overflow-y: auto; display: flex; flex-direction: column; gap: 0.5rem; }
.kanban-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 0.6rem; padding: 0.55rem 0.65rem; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05); }
.kanban-card[draggable="true"] { cursor: grab; }
.kanban-card.is-dragging { opacity: 0.5; }
.kanban-empty { color: #94a3b8; font-size: 0.8rem; text-align: center; padding: 1rem 0; }

@media (max-width: 575.98px) {
  .kanban-column { flex-basis: 85vw; }
}

/* ---------------------------------------------------------------- Sales */
.text-prewrap { white-space: pre-wrap; }

.line-items-table td { padding: 0.4rem 0.35rem; }
.line-items-table textarea { resize: vertical; min-height: 2.4rem; }
.line-items-table .select2-container--bootstrap-5 .select2-selection { min-height: calc(1.5em + 0.5rem + 2px); padding-top: 0.2rem; padding-bottom: 0.2rem; font-size: 0.875rem; }

.doc-totals { max-width: 360px; margin-left: auto; }
.doc-totals > div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.2rem 0; font-size: 0.9rem; }
.doc-totals dt { font-weight: 400; color: #64748b; }
.doc-totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.doc-totals .doc-grand { border-top: 1px solid #cbd5e1; margin-top: 0.3rem; padding-top: 0.45rem; font-size: 1.05rem; }
.doc-totals .doc-grand dt, .doc-totals .doc-grand dd { font-weight: 700; color: inherit; }

/* -------------------------------------------------------------- Reports */
.report-card { transition: box-shadow 0.15s ease, transform 0.15s ease; }
.report-card:hover, .report-card:focus-visible { box-shadow: 0 0.5rem 1.25rem rgba(15, 23, 42, 0.08); transform: translateY(-1px); }
.report-card-icon {
  flex: 0 0 2.5rem; width: 2.5rem; height: 2.5rem; border-radius: 0.6rem;
  display: inline-flex; align-items: center; justify-content: center;
  background: #eff6ff; color: #2563eb; font-size: 1.15rem;
}
.report-chart { position: relative; height: 280px; }
.report-table { font-size: 0.85rem; }
.report-table thead th { white-space: nowrap; background: #f8fafc; position: sticky; top: 0; }
.report-table .num { font-variant-numeric: tabular-nums; }

@media print {
  .page-actions, .page-header .btn, .breadcrumb { display: none !important; }
  .report-chart-card { break-inside: avoid; }
  .report-table { font-size: 9pt; }
  .table-responsive { overflow: visible !important; }
}

/* --------------------------------------------------------- Global search */
.search-group + .search-group { margin-top: 1rem; }
.search-hit mark { padding: 0 0.1em; background: #fef08a; }
.topbar-search { max-width: 340px; }

/* ------------------------------------------------------- Dashboard inbox */
.inbox-item { padding: 0.45rem 0.6rem; border: 1px solid #e2e8f0; border-radius: 0.6rem; height: 100%; transition: background-color 0.15s ease; }
.inbox-item:hover, .inbox-item:focus-visible { background: #f8fafc; }
.inbox-count { min-width: 2rem; height: 2rem; padding: 0 0.4rem; border-radius: 0.5rem; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }

/* ------------------------------------------ Monthly attendance register */
.register-wrap { max-height: 72vh; }
/* Separate borders: collapsed borders do not travel with the sticky columns. */
.register-table { font-size: 0.8rem; border-collapse: separate; border-spacing: 0; }
.register-table > :not(caption) > * > * { padding: 0.3rem 0.4rem; border-width: 0 1px 1px 0; }
.register-table > thead > tr > * { border-top-width: 1px; }
.register-table > :not(caption) > tr > :first-child { border-left-width: 1px; }
.register-table thead th {
  position: sticky; top: 0; z-index: 3;
  background: #4472c4; color: #fff; text-align: center; vertical-align: middle;
  font-weight: 600; white-space: nowrap; border-color: #8ea9db;
}
.register-table thead th.is-sunday { background: #2f5597; }
.register-table thead th.is-today { box-shadow: inset 0 -3px 0 #fbbf24; }
.register-table .reg-day { min-width: 2.15rem; padding-left: 0.1rem !important; padding-right: 0.1rem !important; line-height: 1.05; }
.register-table .reg-day small { font-size: 0.65rem; font-weight: 400; opacity: 0.85; }
.register-table .reg-code { white-space: nowrap; }
.register-table .reg-name { min-width: 10rem; max-width: 14rem; position: sticky; left: 0; z-index: 2; background: #fff; box-shadow: inset -1px 0 0 #adb5bd; }
.register-table .reg-desig { min-width: 8rem; max-width: 12rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.register-table thead .reg-code, .register-table thead .reg-name { z-index: 4; background: #4472c4; }
.register-table .reg-sum { text-align: center; min-width: 3.4rem; white-space: nowrap; }
.register-table thead .reg-sum { background: #305496; }
.register-table .reg-pct { min-width: 5.5rem; }
.register-table tbody tr:hover > .reg-code,
.register-table tbody tr:hover > .reg-name,
.register-table tbody tr:hover > .reg-desig,
.register-table tbody tr:hover > .reg-sum { background: #eef2f7; }
@media (min-width: 768px) {
  .register-table .reg-code { position: sticky; left: 0; z-index: 2; background: #fff; }
  /* attendance-register.js sets the code column's width here */
  .register-table .reg-name { left: var(--reg-name-left, 7rem); }
}
.reg-cell { position: relative; text-align: center; font-weight: 600; font-size: 0.72rem; padding: 0 !important; height: 1.9rem; color: #111827; }
.reg-cell a { display: block; line-height: 1.9rem; color: inherit; text-decoration: none; }
.reg-cell a:hover, .reg-cell a:focus-visible { outline: 2px solid #1e3a8a; outline-offset: -2px; }
.tone-present { background: #00b050 !important; }
.tone-half { background: #92d050 !important; }
.tone-absent, .tone-lop { background: #ff0000 !important; }
.tone-leave { background: #ff9999 !important; }
.tone-weekoff { background: #ffff00 !important; }
.tone-holiday { background: #9bc2e6 !important; }
.tone-none { background: #d9d9d9 !important; }
.reg-cell.is-preview { font-style: italic; box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.55); outline: 1px dashed #fff; outline-offset: -3px; }
.reg-cell.is-planned { opacity: 0.55; font-style: italic; }
.reg-cell.is-late::after,
.reg-chip.is-late::after {
  content: ""; position: absolute; top: 0; right: 0;
  border-style: solid; border-width: 0 7px 7px 0; border-color: transparent #7c2d12 transparent transparent;
}
.reg-chip {
  position: relative; display: inline-block; min-width: 2.1rem; padding: 0.1rem 0.3rem; margin-right: 0.35rem;
  border: 1px solid #bfbfbf; border-radius: 3px; text-align: center; font-weight: 700; font-size: 0.7rem; color: #111827;
}
@media print {
  @page { size: A4 landscape; margin: 8mm; }
  .register-card { border: 0; box-shadow: none; }
  .register-wrap { max-height: none; overflow: visible !important; }
  .register-table { font-size: 6.5pt; }
  .register-table thead th, .register-table .reg-code, .register-table .reg-name { position: static; }
  .register-table .reg-desig { max-width: none; }
  .register-table, .reg-cell, .reg-chip, .register-table thead th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .reg-cell { height: auto; font-size: 6.5pt; }
  .reg-cell a { line-height: 1.4; }
}

/* ---------------------------------------------------------- File viewer */
.file-viewer .modal-content { background: #525659; }
.file-viewer-header { background: var(--bs-body-bg); border-bottom: 1px solid var(--bs-border-color); padding: 0.5rem 0.75rem; flex-wrap: wrap; }
.file-viewer-body { overflow: auto; -webkit-overflow-scrolling: touch; }
.file-viewer-stage { min-height: 100%; padding: 16px; display: flex; flex-direction: column; align-items: center; }
.file-viewer-pages { gap: 12px; }
.file-viewer-page-box { flex: 0 0 auto; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45); }
.file-viewer-page-box canvas { display: block; width: 100%; height: 100%; }
.file-viewer-image { display: block; max-width: 100%; height: auto; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45); }
.file-viewer-message { margin: auto; max-width: 440px; padding: 2rem 1.5rem; text-align: center; background: var(--bs-body-bg); border-radius: 0.5rem; }
.file-viewer-message > .bi { font-size: 2.5rem; }
.file-viewer-page { width: 4.25rem; text-align: center; }
.file-viewer-zoom { min-width: 4.25rem; }
.file-viewer-docx { align-self: stretch; overflow-x: auto; }
.file-viewer-docx .apt-docx-wrapper { background: transparent; padding: 0 0 16px; }
.file-viewer-docx section.apt-docx { margin-left: auto; margin-right: auto; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45); }
.file-viewer-sheet { align-self: stretch; padding: 0.75rem; background: var(--bs-body-bg); border-radius: 0.5rem; }
.file-viewer-sheet-table { max-height: calc(100vh - 175px); }
.file-viewer-sheet-table table { font-size: inherit; }
.file-viewer-sheet-table td { white-space: nowrap; max-width: 420px; overflow: hidden; text-overflow: ellipsis; }
.file-viewer-sheet-table thead th { position: sticky; top: 0; z-index: 2; background: var(--bs-tertiary-bg); text-align: center; font-weight: 600; }
.file-viewer-sheet-table tbody th { position: sticky; left: 0; z-index: 1; background: var(--bs-tertiary-bg); color: var(--bs-secondary-color); font-weight: 500; text-align: right; }
@media (max-width: 575.98px) {
  .file-viewer-stage { padding: 8px; }
  .file-viewer-toolbar { width: 100%; justify-content: flex-end; }
}
