/* ============================================
   ADMIN DASHBOARD — scoped to .dash-page so it
   never leaks into other AdminLTE screens.
   ============================================ */

.dash-page {
  font-family: 'Inter', 'Source Sans Pro', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: #1c231b;
}

/* ---------- Hero banner ---------- */

.dash-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  border-radius: 16px;
  padding: 30px 32px;
  margin-bottom: 22px;
  background: radial-gradient(circle at 15% 20%, #2c5a17 0%, #16330c 60%, #0d2308 100%);
  color: #fff;
  box-shadow: 0 14px 34px rgba(15, 40, 10, 0.22);
}

.dash-hero-glow {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(360px circle at 88% 10%, rgba(163, 209, 57, 0.28), transparent 60%),
    radial-gradient(300px circle at 8% 95%, rgba(118, 198, 43, 0.20), transparent 60%);
  pointer-events: none;
  animation: dashGlowDrift 14s ease-in-out infinite alternate;
}

@keyframes dashGlowDrift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-2%, 2%) scale(1.05); }
}

.dash-hero-main {
  position: relative;
  z-index: 1;
  min-width: 240px;
}

.dash-hero-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  margin: 0 0 8px;
}

.dash-hero-title {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -.3px;
  margin: 0 0 6px;
  color: #fff;
}

.dash-hero-sub {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.75);
  margin: 0;
}

.dash-hero-stat {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  padding: 14px 22px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.dash-hero-ring {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: conic-gradient(#a3d139 calc(var(--pct, 0) * 1%), rgba(255, 255, 255, 0.15) 0);
}

.dash-hero-ring-inner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #16330c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

.dash-hero-stat-value {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.dash-hero-stat-label {
  display: block;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 2px;
}

/* ---------- KPI grid ---------- */

.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 22px;
}

/* Column-count modifiers - kept as classes (not inline styles) so the
   responsive collapse below still applies; an inline style would win over
   the media query and never collapse on phones. */
.dash-kpi-grid--2 { grid-template-columns: repeat(2, 1fr); }
.dash-kpi-grid--3 { grid-template-columns: repeat(3, 1fr); }

.dash-kpi {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid #eef1ec;
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 3px 14px rgba(20, 30, 15, 0.05);
  transition: transform .15s ease, box-shadow .15s ease;
}

.dash-kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(20, 30, 15, 0.10);
}

.dash-kpi-icon {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
}

.dash-kpi-icon--aqua  { background: linear-gradient(135deg, #4fb3e8, #2f8fd1); }
.dash-kpi-icon--green { background: linear-gradient(135deg, #97dd4d, #5aa621); }
.dash-kpi-icon--amber { background: linear-gradient(135deg, #f0c060, #d19a2f); }
.dash-kpi-icon--rose  { background: linear-gradient(135deg, #f0806e, #d1462f); }

.dash-kpi-value {
  display: block;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.3px;
  line-height: 1.15;
  color: #151b13;
}

.dash-kpi-label {
  display: block;
  font-size: 12px;
  color: #838f83;
  margin-top: 2px;
}

/* ---------- Generic card ---------- */

.dash-card {
  background: #fff;
  border: 1px solid #eef1ec;
  border-radius: 14px;
  box-shadow: 0 3px 14px rgba(20, 30, 15, 0.05);
  margin-bottom: 22px;
  overflow: hidden;
}

.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #f2f4f0;
}

.dash-card-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14.5px;
  font-weight: 700;
  color: #1c231b;
  margin: 0;
}

.dash-card-title i {
  color: #5aa621;
  font-size: 13px;
}

.dash-card-tag {
  font-size: 11px;
  font-weight: 600;
  color: #5aa621;
  background: #f0f8e8;
  border-radius: 20px;
  padding: 3px 10px;
}

.dash-card-body {
  padding: 18px 20px;
}

.dash-view-all {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #5aa621;
  text-decoration: none;
  padding: 15px 20px;
  border-top: 1px solid #f2f4f0;
  transition: background-color .15s ease;
}

.dash-view-all:hover, .dash-view-all:focus {
  color: #3d7a17;
  text-decoration: none;
  background-color: #f7faf5;
}

.dash-card-body.no-padding {
  padding: 0;
}

/* ---------- Activity list (mobile-safe - flex rows, never needs a
   horizontal scrollbar the way a <table> with several columns would on a
   narrow phone screen) ---------- */

.dash-activity-list {
  padding: 6px 20px 10px;
  min-height: 96px;
}

.dash-activity-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid #f6f8f5;
}

.dash-activity-item:last-child {
  border-bottom: none;
}

.dash-activity-item .dash-avatar {
  flex: none;
}

/* min-width:0 lets a flex child shrink below its content's natural width -
   without it the browser refuses to shrink title/sub past their text
   length, which is what was pushing dash-activity-end (amount + status
   pill) onto its own unaligned line on narrow phones. flex:1 1 0 (no fixed
   basis) means this always takes exactly the space left over after the
   avatar and the end block claim theirs, so the row itself never wraps -
   the name/sub truncate with an ellipsis instead. */
.dash-activity-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 0;
}

.dash-activity-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #1c231b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-activity-sub {
  font-size: 12px;
  color: #8a958a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-activity-end {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  font-size: 13px;
  white-space: nowrap;
}

@media (max-width: 400px) {
  .dash-activity-end {
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
  }
}

.dash-activity-list .dash-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  color: #aeb8ac;
  padding: 26px 20px;
  min-height: 96px;
}

.dash-activity-list .dash-empty i {
  font-size: 22px;
  color: #c3cec1;
}

.dash-activity-list .dash-empty span {
  font-size: 13px;
}

.dash-kpi--link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.dash-kpi--link:hover {
  text-decoration: none;
  color: inherit;
}

/* ---------- Charts ---------- */

.dash-chart-wrap {
  position: relative;
  height: 260px;
}

.dash-chart-wrap--sm {
  height: 128px;
  width: 128px;
  flex: none;
}

/* ---------- Attendance ---------- */

.dash-attendance-summary {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid #f2f4f0;
}

.dash-attendance-legend {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.dash-legend-item {
  font-size: 13px;
  color: #6b7a6d;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dash-legend-item b {
  color: #1c231b;
  font-size: 14px;
}

.dash-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dash-legend-dot--present { background: #5aa621; }
.dash-legend-dot--absent { background: #e4e9e2; }

.dash-legend-pct {
  margin-left: auto;
  font-size: 22px;
  font-weight: 700;
  color: #2c5a17;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.dash-legend-pct small {
  font-size: 11px;
  font-weight: 500;
  color: #9aa79a;
}

.dash-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

@media (max-width: 420px) {
  .dash-table {
    min-width: 420px;
  }
}

.dash-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: #9aa79a;
  padding: 0 4px 10px;
  border-bottom: 1px solid #f2f4f0;
}

.dash-table td {
  padding: 10px 4px;
  border-bottom: 1px solid #f6f8f5;
  color: #3c463c;
  vertical-align: middle;
}

.dash-table tr:last-child td {
  border-bottom: none;
}

.dash-table .dash-muted {
  color: #aeb8ac;
}

.dash-table .dash-empty {
  text-align: center;
  color: #aeb8ac;
  padding: 26px 4px;
}

.dash-emp-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dash-avatar {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #eef8e6;
  color: #4b7a1f;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Net pay feature cards ---------- */

.dash-pay-card {
  display: flex;
  align-items: center;
  gap: 16px;
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 14px;
  color: #fff;
}

.dash-pay-card:last-child {
  margin-bottom: 0;
}

.dash-pay-card--aqua { background: linear-gradient(135deg, #3aa0e6 0%, #2a75ad 100%); }
.dash-pay-card--green { background: linear-gradient(135deg, #7fc93c 0%, #3d7a17 100%); }

.dash-pay-icon {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
}

.dash-pay-label {
  display: block;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 3px;
}

.dash-pay-value {
  display: block;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.2px;
}

/* ---------- FY summary ---------- */

.dash-fy-total {
  font-size: 22px;
  font-weight: 700;
  color: #151b13;
  margin: 0 0 4px;
}

.dash-fy-sub {
  font-size: 12.5px;
  color: #838f83;
  margin: 0 0 16px;
}

.dash-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dash-chip {
  font-size: 12px;
  font-weight: 600;
  color: #3c463c;
  background: #f6f8f5;
  border: 1px solid #eef1ec;
  border-radius: 20px;
  padding: 6px 12px;
}

.dash-chip b {
  color: #2c5a17;
  font-weight: 700;
}

/* ---------- Quick-action pills (dashboard shortcuts to less-obvious admin-only screens) ---------- */

.dash-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: -6px 0 22px;
}

.dash-action-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: #fff;
  border: 1px solid #e4e9e2;
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 13.5px;
  color: #2c463c;
  box-shadow: 0 2px 8px rgba(20, 30, 15, .05);
  transition: transform .15s ease, box-shadow .15s ease;
}

.dash-action-pill:hover, .dash-action-pill:focus {
  color: #2c463c;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(20, 30, 15, .1);
}

.dash-action-pill i {
  font-size: 16px;
  color: #5aa621;
}

.dash-action-pill .dash-action-badge {
  background: #fdecec;
  color: #b3261e;
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 700;
}

/* ---------- GPS status chip (before Punch In/Out) ---------- */

.epx-gps-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 14px;
  border: 1px solid transparent;
  transition: background-color .15s ease, border-color .15s ease;
  user-select: none;
}

.epx-gps-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
}

.epx-gps-status.epx-gps-checking { background: #f2f4f0; color: #6b7a6d; border-color: #e4e9e2; }
.epx-gps-status.epx-gps-checking .epx-gps-dot { background: #9aa79a; animation: epxGpsPulse 1.1s ease-in-out infinite; }

.epx-gps-status.epx-gps-on { background: #eef8e6; color: #2c5a17; border-color: #d7ecc3; }
.epx-gps-status.epx-gps-on .epx-gps-dot { background: #5aa621; box-shadow: 0 0 0 3px rgba(90, 166, 33, .18); }

.epx-gps-status.epx-gps-off { background: #fdecec; color: #b3261e; border-color: #f6cfcf; }
.epx-gps-status.epx-gps-off .epx-gps-dot { background: #d1462f; box-shadow: 0 0 0 3px rgba(209, 70, 47, .18); }

@keyframes epxGpsPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

/* ---------- Pending Sync (offline attendance queue) ---------- */

.dash-card--pending-sync {
  border-color: #f5d59a;
  background: #fffaf0;
}

.dash-card--pending-sync .dash-card-header {
  border-bottom-color: #f5e2b8;
}

.dash-card--pending-sync .dash-card-title i {
  color: #c98a1c;
}

.dash-pending-sync-note {
  margin: 0 0 8px;
  color: #7a5a10;
  font-size: 12.5px;
}

.dash-card--pending-sync .dash-activity-list {
  padding-top: 0;
}

.dash-card--pending-sync .dash-activity-item:last-child {
  border-bottom: none;
}

/* ---------- Team On Leave (employee dashboard) ---------- */

.dash-team-body {
  padding: 16px 20px;
}

.dash-team-empty {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #9aa79a;
  font-size: 13px;
}

.dash-team-empty-icon {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #f0f8e8;
  color: #5aa621;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.dash-team-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.dash-team-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fdf8f0;
  border: 1px solid #f5e8d0;
  border-radius: 12px;
  padding: 10px 14px;
  flex: 1 1 240px;
  min-width: 220px;
}

.dash-team-chip .dash-avatar {
  background: #fbead0;
  color: #a8721a;
}

.dash-team-chip-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dash-team-chip-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #1c231b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-team-chip-sub {
  font-size: 11.5px;
  color: #8a958a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Grid layout helpers ---------- */

.dash-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

/* ---------- Responsive ---------- */

@media (max-width: 991px) {
  .dash-kpi-grid, .dash-kpi-grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .dash-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .dash-hero {
    padding: 24px 20px;
    flex-direction: column;
    align-items: flex-start;
  }

  .dash-hero-stat {
    width: 100%;
    box-sizing: border-box;
  }

  .dash-hero-title {
    font-size: 21px;
  }

  .dash-kpi-grid, .dash-kpi-grid--2, .dash-kpi-grid--3 {
    grid-template-columns: 1fr;
  }

  .dash-attendance-summary {
    flex-direction: column;
    align-items: flex-start;
  }

  .dash-legend-pct {
    margin-left: 0;
  }

  .dash-chart-wrap {
    height: 220px;
  }
}
