/**
 * Employee dashboard – no header; logo in sidebar (large); view label + Logout in main top bar.
 */
.employee-dashboard {
  display: flex;
  flex-wrap: wrap;
  min-height: 100vh;
  background: #f0f0f0;
}

/* Sidebar – logo at top (double size), then view toggle (manager) + nav */
.hr-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid #e0e0e0;
  padding-top: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.hr-sidebar-logo {
  padding: 1.35rem 1rem;
  text-align: center;
  background: #fff;
}

.hr-sidebar-logo-img {
  display: block;
  height: 96px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  margin: 0 auto;
}

/* View toggle in sidebar (Manager only) – line only below */
.hr-sidebar-view-toggle {
  display: flex;
  gap: 6px;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #eee;
}

.hr-sidebar .nav {
  padding: 1rem 0.75rem;
  flex: 1;
}

.hr-sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 4px;
  border-radius: 0 8px 8px 0;
  color: #333;
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}

.hr-sidebar .nav-link:hover {
  background: #f5f5f5;
  color: var(--hr-primary, #00573C);
}

.hr-sidebar .nav-link.active {
  background: #f0f5f3;
  color: var(--hr-primary, #00573C);
  border-left: 3px solid var(--hr-primary);
}

.hr-sidebar .nav-link i {
  color: #666;
  font-size: 1.1rem;
}

.hr-sidebar .nav-link:hover i,
.hr-sidebar .nav-link.active i {
  color: var(--hr-primary, #00573C);
}

/* Main content – top bar (view label + Logout) then outlet */
.hr-main {
  flex: 1;
  padding-top: 0;
  padding-left: 0;
  padding-right: 0;
  padding-bottom: 1rem;
  min-width: 0;
  background: #f0f0f0;
  display: flex;
  flex-direction: column;
}

/* Edge-to-edge in the main column; outlet keeps its own margin for the content card */
.hr-main-topbar {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  flex-shrink: 0;
  flex-wrap: wrap;
  row-gap: 0.5rem;
  column-gap: 0.75rem;
  width: 100%;
  box-sizing: border-box;
}

.hr-view-label {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: var(--hr-primary, #00573C);
  min-width: 0;
  overflow-wrap: anywhere;
}

.hr-main-topbar .btn-outline-secondary {
  border-color: var(--hr-primary);
  color: var(--hr-primary);
  border-radius: 8px;
  font-family: 'Josefin Sans', sans-serif;
  font-size: 0.875rem;
}

.hr-main-topbar .btn-outline-secondary:hover {
  background-color: var(--hr-primary);
  color: #fff;
}

.hr-outlet {
  flex: 1;
  min-width: 0;
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem 2rem;
  margin: 1rem;
  min-height: 400px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  font-size: clamp(0.9375rem, 0.88rem + 0.22vw, 1.0625rem);
}

/* Section cards on dashboard home */
.hr-section-card {
  background: var(--hr-panel);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(0, 87, 60, 0.08);
}

.hr-section-card h3 {
  font-family: 'Josefin Sans', sans-serif;
  font-size: 1.1rem;
  color: var(--hr-primary);
  margin-bottom: 0.5rem;
}

.hr-section-card p {
  color: var(--hr-muted);
  margin: 0;
  font-size: 0.95rem;
}

.hr-dashboard-greeting {
  padding: 0.25rem 0;
}

.hr-dashboard-greeting-text {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--hr-primary, #00573C);
}

.hr-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 1rem;
}

.hr-kpi-card {
  background: #fff;
  border: 1px solid rgba(0, 87, 60, 0.12);
  border-radius: 10px;
  padding: 0.85rem 1rem;
}

.hr-kpi-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.hr-kpi-label {
  font-size: 0.82rem;
  color: var(--hr-muted, #6c757d);
}

.hr-kpi-icon {
  color: var(--hr-primary, #00573C);
}

.hr-kpi-value {
  font-family: 'Josefin Sans', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--hr-primary, #00573C);
}

.hr-week-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.hr-week-day-card {
  background: #fff;
  border: 1px solid rgba(0, 87, 60, 0.12);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
}

.hr-week-day-title {
  font-weight: 600;
  color: var(--hr-primary, #00573C);
}

.hr-week-day-subtitle {
  font-size: 0.8rem;
  color: var(--hr-muted, #6c757d);
}

.hr-week-day-card {
  position: relative;
}

.hr-week-absent-cell {
  cursor: help;
}

.hr-week-absent-hint {
  font-size: 0.7rem;
  color: var(--hr-muted, #6c757d);
  font-weight: normal;
}

.hr-week-absent-tooltip {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 100%;
  margin-bottom: 6px;
  z-index: 10;
  min-width: 140px;
  max-width: 220px;
  padding: 8px 10px;
  background: #333;
  color: #fff;
  font-size: 0.8rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.hr-week-absent-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -6px;
  border: 6px solid transparent;
  border-top-color: #333;
}

.hr-week-absent-tooltip-title {
  font-weight: 600;
  margin-bottom: 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.hr-week-absent-tooltip-list {
  margin: 0;
  padding-left: 1rem;
  max-height: 120px;
  overflow-y: auto;
}

.hr-dashboard-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hr-dashboard-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(0, 87, 60, 0.1);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
}

/* Dashboard entry (week cal + sidebar) */
.hr-dash-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.hr-dash-range-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Dashboard range bar: presets + date picker inline */
/* Team overview as a distinct section */
.db-team-overview-section {
  margin-top: 2rem;
  padding-top: 1.75rem;
  border-top: 1px solid #e2e8f0;
}
.db-section-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 1rem 0;
}
.db-range-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.db-range-bar .btn-group {
  flex-wrap: wrap;
}
.db-range-custom {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.db-range-custom input[type="date"] {
  width: 130px;
  font-size: 0.78rem;
}
.db-range-sep {
  color: #94a3b8;
  font-size: 0.8rem;
}

.hr-dash-loading {
  padding: 2rem;
  text-align: center;
}

.hr-dash-layout {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin-top: 0.5rem;
}

.hr-dash-main {
  flex: 1;
  min-width: 0;
}

.hr-dash-aside {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

@media (max-width: 991px) {
  .hr-dash-layout {
    flex-direction: column;
  }
  .hr-dash-aside {
    width: 100%;
  }
}

/* Week calendar (main area) */
.hr-dash-week-cal {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.hr-dash-week-cal-header {
  padding: 0.85rem 1.25rem;
  font-size: 0.95rem;
  color: #555;
  border-bottom: 1px solid #eee;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hr-dash-week-cal-pager {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hr-dash-week-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: #ececec;
  border-bottom: 1px solid #ececec;
}

.hr-dash-week-cal-weekday {
  padding: 0.4rem 0.5rem;
  background: #f4f4f4;
  font-size: 0.72rem;
  text-transform: uppercase;
  color: #7b7b7b;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.hr-dash-week-cal-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: #ececec;
}

.hr-dash-week-cal-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: #ececec;
}

.hr-dash-week-cal-day {
  position: relative;
  min-width: 0;
  min-height: 100px;
  padding: 0.75rem;
  background: #fafafa;
  overflow: hidden;
  box-sizing: border-box;
}

.hr-dash-week-cal-day--out {
  background: #f2f2f2;
}

.hr-dash-week-cal-day--weekend {
  background: #f6f6f6;
}

.hr-dash-week-cal-day--holiday {
  background: rgba(0, 87, 60, 0.05);
}

.hr-dash-week-cal-day-empty {
  font-size: 0.8rem;
  color: #b0b0b0;
  margin-top: 0.45rem;
}

.hr-dash-week-cal-day--today {
  background: rgba(0, 87, 60, 0.06);
  border-left: 3px solid var(--hr-primary, #00573C);
  margin-left: -1px;
  z-index: 1;
}

.hr-dash-week-cal-day-head {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.hr-dash-week-cal-day-num {
  font-size: 1rem;
  font-weight: 600;
  color: #333;
}

.hr-dash-week-cal-day-month {
  font-size: 0.72rem;
  color: #888;
  text-transform: uppercase;
  font-weight: 600;
}

.hr-dash-week-cal-day-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.hr-dash-week-cal-stat {
  font-size: 0.8rem;
  color: #555;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hr-dash-week-cal-stat-label {
  margin-right: 0.35rem;
}

.hr-dash-week-cal-stat-value {
  font-weight: 600;
  color: var(--hr-primary, #00573C);
}

.hr-dash-week-cal-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.74rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
  max-width: 100%;
  width: fit-content;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.25;
  hyphens: auto;
}

.hr-dash-week-cal-badge--weekend {
  background: #f2f2f2;
  color: #6b6b6b;
  border: 1px solid #ddd;
}

.hr-dash-week-cal-badge--holiday {
  background: rgba(0, 87, 60, 0.1);
  color: var(--hr-primary, #00573C);
  border: 1px solid rgba(0, 87, 60, 0.2);
}

.hr-dash-week-cal-view-btn {
  align-self: flex-start;
  margin-top: 0.15rem;
  border: 1px solid #d8d8d8;
  border-radius: 6px;
  background: #fff;
  color: #555;
  font-size: 0.78rem;
  padding: 0.2rem 0.45rem;
}

.hr-dash-week-cal-view-btn:hover {
  background: #f5f5f5;
}

/* Sidebar: mini calendar */
.hr-dash-mini-cal-wrap {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.hr-dash-mini-cal {
  text-align: center;
}

.hr-dash-mini-cal-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.75rem;
}

.hr-dash-mini-cal-dow {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
  margin-bottom: 4px;
}

.hr-dash-mini-cal-dow-cell {
  font-size: 0.65rem;
  color: #888;
  text-transform: uppercase;
}

.hr-dash-mini-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
}

.hr-dash-mini-cal-day {
  font-size: 0.8rem;
  padding: 4px 0;
  color: #333;
  border-radius: 4px;
}

.hr-dash-mini-cal-day--empty {
  color: transparent;
}

.hr-dash-mini-cal-day--today {
  background: var(--hr-primary, #00573C);
  color: #fff;
  font-weight: 600;
}

/* Sidebar: pending approvals (agenda-style) */
.hr-dash-sidebar {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.hr-dash-sidebar-section {
  padding: 1rem;
}

.hr-dash-sidebar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.hr-dash-sidebar-title {
  font-size: 1rem;
  font-weight: 600;
  color: #333;
  margin: 0;
}

.hr-dash-sidebar-link {
  background: none;
  border: none;
  font-size: 0.85rem;
  color: var(--hr-primary, #00573C);
  cursor: pointer;
  padding: 0;
  text-decoration: none;
}

.hr-dash-sidebar-link:hover {
  text-decoration: underline;
}

.hr-dash-sidebar-empty {
  font-size: 0.9rem;
  color: #888;
  margin: 0;
}

.hr-dash-agenda {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 400px;
  overflow-y: auto;
}

.hr-dash-agenda-item {
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid #eee;
  background: #fafafa;
  transition: background 0.15s, border-color 0.15s;
}

.hr-dash-agenda-item:hover {
  background: #f5f5f5;
  border-color: #e0e0e0;
}

.hr-dash-agenda-item-main {
  margin-bottom: 0.5rem;
}

.hr-dash-agenda-item-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: #333;
}

.hr-dash-agenda-item-meta {
  font-size: 0.8rem;
  color: #666;
}

.hr-dash-agenda-item-type {
  color: #888;
}

.hr-dash-agenda-item-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.hr-dash-agenda-btn {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 500;
}

.hr-dash-agenda-btn--approve {
  background: var(--hr-primary, #00573C);
  color: #fff;
  border-color: var(--hr-primary, #00573C);
}

.hr-dash-agenda-btn--approve:hover {
  filter: brightness(1.08);
}

.hr-dash-agenda-btn--reject {
  background: #fff;
  color: #666;
  border-color: #ddd;
}

.hr-dash-agenda-btn--reject:hover {
  background: #f8f8f8;
  border-color: #ccc;
}

/* Holiday allowance summary (placeholder) */
.hr-allowance-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.75rem;
}

.hr-allowance-item {
  background: #fff;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid #e9ecef;
  min-width: 120px;
}

.hr-allowance-item .label {
  font-size: 0.8rem;
  color: var(--hr-muted);
}

.hr-allowance-item .value {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 600;
  color: var(--hr-primary);
  font-size: 1.1rem;
}

/* Allowance overview table – readable, not Excel-like */
.hr-allowance-table-wrap {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(0, 87, 60, 0.12);
  background: #fff;
}

.hr-allowance-table {
  margin: 0;
  font-size: 0.95rem;
  font-family: 'Josefin Sans', sans-serif;
  color: var(--hr-text, #333);
}

.hr-allowance-table thead {
  background: var(--hr-primary, #00573C);
  color: #fff;
}

.hr-allowance-table thead th {
  font-weight: 600;
  padding: 12px 16px;
  border: none;
  font-size: 0.9rem;
}

.hr-allowance-table tbody tr {
  transition: background 0.15s ease;
}

.hr-allowance-table tbody tr:nth-child(even) {
  background: rgba(0, 87, 60, 0.04);
}

.hr-allowance-table tbody tr:hover {
  background: rgba(0, 87, 60, 0.08);
}

.hr-allowance-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0, 87, 60, 0.08);
  vertical-align: middle;
}

.hr-allowance-table tbody tr:last-child td {
  border-bottom: none;
}

.hr-allowance-table .hr-allowance-name {
  font-weight: 500;
  color: var(--hr-primary, #00573C);
}

.hr-allowance-table .hr-allowance-remaining {
  font-weight: 600;
  color: var(--hr-primary, #00573C);
}

/* Settings – employee overrides list (matches panel, not plain white) */
.hr-settings-employee-list {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(0, 87, 60, 0.12);
  background: rgba(255, 255, 255, 0.6);
}

.hr-settings-employee-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(0, 87, 60, 0.08);
  background: rgba(255, 255, 255, 0.5);
  transition: background 0.15s ease;
  font-family: 'Josefin Sans', sans-serif;
}

.hr-settings-employee-row:last-child {
  border-bottom: none;
}

.hr-settings-employee-row:hover {
  background: rgba(0, 87, 60, 0.06);
}

.hr-settings-employee-row .hr-settings-employee-name {
  font-weight: 500;
  color: var(--hr-text, #333);
  min-width: 0;
  overflow-wrap: anywhere;
}

.hr-settings-employee-row .btn {
  border-radius: 8px;
  font-weight: 500;
}

/* Override modal – more spacious and aligned with dashboard style */
.hr-override-modal .modal-content {
  border-radius: 14px;
  border: 1px solid rgba(0, 87, 60, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.hr-override-modal .modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(0, 87, 60, 0.1);
  background: var(--hr-panel, #F8F5F0);
  border-radius: 14px 14px 0 0;
}

.hr-override-modal .modal-title {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 600;
  color: var(--hr-primary, #00573C);
  font-size: 1.15rem;
}

.hr-override-modal .modal-body {
  padding: 1.5rem 1.75rem;
  background: #fff;
}

.hr-override-modal .form-section {
  margin-bottom: 1.5rem;
}

.hr-override-modal .form-section:last-of-type {
  margin-bottom: 0;
}

.hr-override-modal .form-section-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--hr-primary, #00573C);
  margin-bottom: 0.75rem;
  display: block;
}

.hr-override-modal .form-control {
  border-radius: 8px;
  border-color: rgba(0, 87, 60, 0.2);
}

.hr-override-modal .form-control:focus {
  border-color: var(--hr-primary, #00573C);
  box-shadow: 0 0 0 0.2rem rgba(0, 87, 60, 0.15);
}

.hr-override-modal .modal-footer {
  padding: 1rem 1.5rem 1.25rem;
  border-top: 1px solid rgba(0, 87, 60, 0.08);
  background: var(--hr-panel, #F8F5F0);
  border-radius: 0 0 14px 14px;
}

@media (max-width: 767px) {
  .employee-dashboard {
    flex-direction: column;
  }

  .hr-sidebar {
    width: 100%;
    padding-top: 0;
    min-height: auto;
    border-right: none;
    border-bottom: 1px solid #e0e0e0;
  }

  .hr-sidebar-logo-img {
    height: 72px;
  }

  .hr-main {
    padding-top: 0;
  }

  .hr-outlet {
    margin: 0.5rem;
    padding: 1rem;
  }
}

/* ── Dashboard KPI strip ── */
.db-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.db-kpi {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 0.9rem 1rem;
  min-width: 0;
}
.db-kpi--clickable {
  cursor: pointer;
  transition: background 0.12s;
}
.db-kpi--clickable:hover { background: #fafbfc; }
.db-kpi-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.db-kpi-icon--team { background: #eff6ff; color: #3b82f6; }
.db-kpi-icon--present { background: #ecfdf5; color: #059669; }
.db-kpi-icon--absent { background: #fef2f2; color: #dc2626; }
.db-kpi-icon--pending { background: #fffbeb; color: #d97706; }
.db-kpi-icon--annual { background: #f3f4f6; color: #4b5563; }
.db-kpi-body { flex: 1; min-width: 0; }
.db-kpi-val {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.2;
}
.db-kpi-label {
  font-size: 0.67rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.db-kpi-sub {
  font-size: 0.66rem;
  color: #ef4444;
  font-weight: 500;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.db-kpi-arrow { color: #cbd5e1; font-size: 0.8rem; flex-shrink: 0; }
@media (max-width: 991px) {
  .db-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .db-kpis { grid-template-columns: minmax(0, 1fr); }
}

.db-kpis--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 991px) {
  .db-kpis--three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
  .db-kpis--three { grid-template-columns: minmax(0, 1fr); }
}

/* ── Pending requests panel (leave + overtime, above team overview on dashboard) ── */
.db-pending-section {
  min-width: 0;
  margin-top: 0.5rem;
  margin-bottom: 0.25rem;
}

/* Full-width attendance roster under team overview heading */
.db-main-cal-full {
  min-width: 0;
  width: 100%;
}
.db-main-cal-full--refreshing {
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.15s;
}

/* ── Pending requests (below calendar on team overview) ── */
.db-pending {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}
.db-pending-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid #f1f5f9;
}
.db-pending-title { font-size: 0.75rem; font-weight: 700; color: #374151; }
.db-pending-link {
  font-size: 0.68rem; font-weight: 600; color: #2563eb;
  background: none; border: none; cursor: pointer; padding: 0;
}
.db-pending-link:hover { text-decoration: underline; }
.db-pending-empty {
  font-size: 0.75rem; color: #94a3b8; padding: 1.2rem 0.85rem; margin: 0; text-align: center;
}
.db-pending-list { display: flex; flex-direction: column; }
.db-pending-item {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.55rem 0.85rem; border-bottom: 1px solid #f3f4f6;
  cursor: pointer; transition: background 0.1s;
}
.db-pending-item:last-child { border-bottom: none; }
.db-pending-item:hover { background: #f8fafc; }
.db-pending-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.db-pending-item-meta { display: flex; align-items: center; gap: 0.35rem; min-width: 0; flex-wrap: nowrap; }
.db-pending-item-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: #1e293b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.db-pending-item-meta .badge { flex-shrink: 0; }
.db-pending-item-date { font-size: 0.66rem; color: #6b7280; }
.db-pending-item-arrow { color: #cbd5e1; font-size: 0.72rem; flex-shrink: 0; }

/* Pending strip: grid of compact cards (shown above team overview) */
.db-pending--below .db-pending-head {
  padding: 0.65rem 1rem;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
}
.db-pending--below .db-pending-title {
  font-size: 0.8rem;
}
.db-pending--below .db-pending-empty {
  padding: 1rem 1rem 1.15rem;
}
.db-pending--below .db-pending-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0.5rem;
  padding: 0.75rem 1rem 1rem;
}
.db-pending--below .db-pending-item {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  margin: 0;
  background: #fafbfc;
}
.db-pending--below .db-pending-item:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.db-pending--below .db-pending-item:last-child {
  border-bottom: 1px solid #e5e7eb;
}

/* ── Attendance Calendar (ac) ── */
.ac {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}
.ac-empty {
  padding: 2rem; text-align: center; color: #94a3b8; font-size: 0.82rem;
}
.ac-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid #f1f5f9;
}
.ac-title {
  font-size: 0.82rem; font-weight: 700; color: #1e293b;
  min-width: 0;
  flex: 1 1 12rem;
  overflow-wrap: anywhere;
}
.ac-show-btn {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.12s;
  flex-shrink: 0;
}
.ac-show-btn:hover { border-color: #cbd5e1; }
.ac-show-btn--on {
  background: #f0fdf4;
  color: #15803d;
  border-color: #86efac;
}
.ac-dow {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  background: #f8fafc;
  border-bottom: 1px solid #eef1f5;
}
.ac-dow-cell {
  padding: 0.35rem 0;
  text-align: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ac-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.ac-cell {
  min-width: 0;
  min-height: 84px;
  padding: 0.35rem 0.4rem;
  border-right: 1px solid #f1f5f9;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-x: hidden;
  overflow-y: auto;
  box-sizing: border-box;
}
.ac-cell:nth-child(7n) { border-right: none; }
.ac-cell--out { background: #fafbfc; min-height: 48px; }
.ac-cell--wknd { background: #f9fafb; }
.ac-cell--hol { background: #fffdf5; }
.ac-cell--today { background: #eff6ff; }
.ac-cell-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1px;
}
.ac-num {
  font-size: 0.72rem; font-weight: 600; color: #94a3b8; line-height: 1;
}
.ac-num--today {
  background: #2563eb; color: #fff;
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 0.68rem;
}
.ac-ratio {
  font-size: 0.6rem; font-weight: 700; color: #94a3b8; letter-spacing: -0.02em;
}
.ac-ratio--ok { color: #22c55e; }
.ac-hol {
  font-size: 0.58rem; color: #a16207; background: #fef9c3;
  padding: 0.08rem 0.3rem; border-radius: 3px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; align-self: flex-start;
}
.ac-allin {
  font-size: 0.72rem;
  font-weight: 600;
  color: #16a34a;
  line-height: 1.25;
}
.ac-names-group {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}
.ac-name {
  display: block;
  width: 100%;
  box-sizing: border-box;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.2rem 0.35rem;
  border-radius: 4px;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
  text-align: left;
}
.ac-name--absent {
  color: #dc2626;
  background: #fef2f2;
}
.ac-name--future {
  color: #9333ea;
  background: #faf5ff;
}
.ac-name--present {
  color: #15803d;
  background: #f0fdf4;
}

/* Employee overview (dashboard home) */
.employee-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
}

.employee-overview-grid--holidays {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.employee-overview-card--upcoming {
  grid-column: span 7;
}

.employee-overview-grid--pending {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.employee-overview-grid--pending .employee-overview-card {
  grid-column: span 4;
}

.employee-overview-grid--overtime {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.employee-overview-card--overtime-total {
  grid-column: span 5;
}

.employee-overview-grid--working {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.employee-overview-grid--working .employee-overview-card {
  grid-column: span 6;
}

.employee-overview-section {
  margin-bottom: 1rem;
}

.employee-overview-section-title {
  font-family: 'Josefin Sans', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--hr-primary, #00573C);
  margin: 0 0 0.65rem;
}

.employee-overview-card {
  background: #fff;
  border: 1px solid rgba(0, 87, 60, 0.14);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  min-height: 128px;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.employee-overview-title {
  font-size: 0.82rem;
  color: var(--hr-muted, #6c757d);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.employee-overview-value {
  font-family: 'Josefin Sans', sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--hr-primary, #00573C);
  line-height: 1.25;
}

.employee-overview-value--small {
  font-size: 1.08rem;
}

.employee-overview-subtle {
  font-size: 0.8rem;
  color: var(--hr-muted, #6c757d);
}

.employee-overview-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.employee-overview-list-item {
  background: rgba(0, 87, 60, 0.05);
  border: 1px solid rgba(0, 87, 60, 0.12);
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #30404a;
}

.employee-overview-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.employee-status-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.22rem 0.62rem;
  font-size: 0.74rem;
  font-weight: 600;
  border: 1px solid #d9dee3;
  background: #f6f8fa;
  color: #3f4a53;
  line-height: 1.2;
}

.employee-status-chip--pending {
  border-color: #d9dee3;
  background: #f6f8fa;
  color: #3f4a53;
}

.employee-status-chip--approved {
  border-color: #d9dee3;
  background: #f6f8fa;
  color: #3f4a53;
}

.employee-status-chip--rejected {
  border-color: #d9dee3;
  background: #f6f8fa;
  color: #3f4a53;
}

.employee-overview-meta--compact {
  gap: 0.65rem;
  font-size: 0.8rem;
  color: #495057;
}

.employee-range-calendar {
  border: 1px solid rgba(0, 87, 60, 0.14);
  border-radius: 12px;
  padding: 0.85rem;
  background: #fff;
}

.employee-range-calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.employee-range-title {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 700;
  color: var(--hr-primary, #00573C);
}

.employee-range-subtle {
  margin-top: 0.3rem;
  margin-bottom: 0.6rem;
  font-size: 0.8rem;
  color: var(--hr-muted, #6c757d);
}

.employee-range-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.55rem;
  min-width: 0;
}

.employee-range-day {
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  padding: 0.55rem 0.6rem;
  background: #ffffff;
  min-height: 106px;
}

.employee-range-day--out {
  opacity: 0.55;
}

.employee-range-day--weekend {
  background: #f7f8fa;
  border-color: #e2e6ea;
}

.employee-range-day--offday {
  background: #f3f5f8;
  border-color: #d9dfe6;
}

.employee-range-day--holiday {
  background: #fff8e8;
  border-color: #f2dfb6;
}

.employee-range-day--today {
  border-color: var(--hr-primary, #00573C);
  box-shadow: inset 0 0 0 1px rgba(0, 87, 60, 0.16);
}

.employee-range-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
}

.employee-range-day-head > span {
  color: #6c757d;
  font-weight: 600;
}

.employee-range-day-head > strong {
  color: #2f3b44;
  font-size: 0.8rem;
}

.employee-range-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.14rem 0.48rem;
  margin-right: 0.25rem;
  margin-bottom: 0.25rem;
  border: 1px solid transparent;
}

.employee-range-badge--holiday {
  background: #fff3cd;
  border-color: #ffe69c;
  color: #7a5a00;
}

.employee-range-badge--leave {
  background: #cff4fc;
  border-color: #b6effb;
  color: #055160;
}

.employee-range-badge--ot {
  background: #d1e7dd;
  border-color: #badbcc;
  color: #0f5132;
}

.employee-range-worked {
  margin-top: 0.25rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #344450;
}

.employee-range-worked--muted {
  color: #77828e;
  font-weight: 500;
}

.employee-mini-calendars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.85rem;
}

.employee-mini-calendar {
  background: #fff;
  border: 1px solid rgba(0, 87, 60, 0.14);
  border-radius: 12px;
  padding: 0.85rem;
}

.employee-mini-calendar-title {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 700;
  color: var(--hr-primary, #00573C);
  margin-bottom: 0.5rem;
}

.employee-mini-calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
  font-size: 0.7rem;
  color: #6c757d;
  text-align: center;
  margin-bottom: 0.25rem;
}

.employee-mini-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
}

.employee-mini-calendar-day {
  position: relative;
  height: 34px;
  border-radius: 6px;
  border: 1px solid #ececec;
  font-size: 0.72rem;
  color: #2f2f2f;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fbfbfb;
}

.employee-mini-calendar-day--empty {
  border: none;
  background: transparent;
}

.employee-mini-calendar-day--today {
  border-color: var(--hr-primary, #00573C);
  background: rgba(0, 87, 60, 0.08);
  font-weight: 700;
}

.employee-mini-calendar-markers {
  position: absolute;
  left: 50%;
  bottom: 3px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.employee-dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  display: inline-block;
}

.employee-dot--hours {
  background: #0d6efd;
}

.employee-dot--leave {
  background: #d97706;
}

.employee-dot--ot {
  background: #198754;
}

@media (max-width: 640px) {
  .ac-cell { min-height: 64px; padding: 0.25rem; }
  .ac-name { font-size: 0.64rem; padding: 0.15rem 0.3rem; }
  .ac-allin { font-size: 0.64rem; }
  .employee-overview-card {
    min-height: 112px;
  }
  .employee-mini-calendar-day {
    height: 30px;
  }
  .employee-overview-grid--holidays,
  .employee-overview-grid--pending,
  .employee-overview-grid--overtime,
  .employee-overview-grid--working {
    grid-template-columns: minmax(0, 1fr);
  }
  .employee-overview-card--upcoming,
  .employee-overview-card--overtime-status,
  .employee-overview-card--overtime-total,
  .employee-overview-grid--pending .employee-overview-card,
  .employee-overview-grid--working .employee-overview-card {
    grid-column: span 1;
  }
  .employee-range-calendar {
    overflow-x: auto;
  }
  .employee-range-days {
    min-width: 700px;
  }
}
