
/* ==================================================
   ABSENSI - WEEKLY REPORT
   ================================================== */

#absensi-page {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
  color: var(--text-primary, #1e293b);
}

#absensi-page .absensi-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 0;
}

#absensi-page .absensi-page-header h2 {
  margin: 0 0 6px;
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.035em;
}

#absensi-page .absensi-page-header p {
  margin: 0;
  color: var(--text-secondary, #64748b);
  font-size: 0.9rem;
  line-height: 1.6;
}

#absensi-page .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

#absensi-page .btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

#absensi-page .btn-primary {
  color: #fff;
  background: #256f46;
}

#absensi-page .btn-primary:hover:not(:disabled) {
  background: #1e5d3a;
}

#absensi-page .btn-secondary {
  color: #334155;
  background: #fff;
  border-color: #e2e8f0;
}

#absensi-page .btn-secondary:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #cbd5e1;
}

#absensi-page .btn i,
#absensi-page .btn svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

#absensi-page .absensi-weekly-section {
  min-width: 0;
  padding: 24px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 18px;
  box-shadow: 0 4px 18px rgb(15 23 42 / 3%);
}

#absensi-page .absensi-weekly-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

#absensi-page .absensi-weekly-header h3 {
  margin: 0 0 7px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

#absensi-page .absensi-weekly-header p {
  margin: 0;
  color: var(--text-secondary, #64748b);
  font-size: 0.85rem;
}

#absensi-page .absensi-weekly-navigation {
  display: flex;
  align-items: center;
  gap: 8px;
}

#absensi-page .absensi-weekly-navigation button {
  white-space: nowrap;
}

#absensi-page .absensi-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

#absensi-page .absensi-summary-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 18px;
  background: #f8fafc;
  border: 1px solid #edf1f5;
  border-radius: 14px;
}

#absensi-page .summary-label {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 500;
}

#absensi-page .absensi-summary-card strong {
  color: #1e293b;
  font-size: 1.65rem;
  font-weight: 750;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

#absensi-page .absensi-summary-card:nth-child(2) strong {
  color: #15803d;
}

#absensi-page .absensi-summary-card:nth-child(3) strong {
  color: #b45309;
}

#absensi-page .absensi-summary-card:nth-child(4) strong {
  color: #1d4ed8;
}

#absensi-page .absensi-summary-card:nth-child(5) strong {
  color: #b91c1c;
}

#absensi-page .absensi-filter-bar {
  display: grid;
  grid-template-columns: minmax(180px, 0.75fr) minmax(220px, 1.25fr);
  gap: 16px;
  margin-bottom: 20px;
}

#absensi-page .form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  margin: 0;
}

#absensi-page .form-group label {
  color: #475569;
  font-size: 0.82rem;
  font-weight: 600;
}

#absensi-page .form-group select,
#absensi-page .form-group input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  color: #1e293b;
  background: #fff;
  border: 1px solid #dbe3ec;
  border-radius: 10px;
  font: inherit;
  font-size: 0.875rem;
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

#absensi-page .form-group select:focus,
#absensi-page .form-group input:focus {
  border-color: #39845c;
  box-shadow: 0 0 0 3px rgb(46 139 87 / 12%);
}

#absensi-page .absensi-search-wrapper {
  position: relative;
  min-width: 0;
}

#absensi-page .absensi-search-wrapper > svg,
#absensi-page .absensi-search-wrapper > i {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 17px;
  height: 17px;
  color: #94a3b8;
  transform: translateY(-50%);
  pointer-events: none;
}

#absensi-page .absensi-search-wrapper input {
  padding-left: 38px;
}

#absensi-page #absensi-alert:not(.hidden) {
  margin-bottom: 16px;
  padding: 12px 14px;
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  font-size: 0.875rem;
  line-height: 1.5;
}

#absensi-page .absensi-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 150px;
  color: #64748b;
  font-size: 0.875rem;
}

#absensi-page .absensi-loading svg,
#absensi-page .absensi-loading i {
  width: 20px;
  height: 20px;
  animation: absensi-spin 1s linear infinite;
}

@keyframes absensi-spin {
  to {
    transform: rotate(360deg);
  }
}

#absensi-page .absensi-table-wrapper {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

#absensi-page .absensi-weekly-table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  font-size: 0.82rem;
}

#absensi-page .absensi-weekly-table th,
#absensi-page .absensi-weekly-table td {
  padding: 15px 12px;
  text-align: center;
  vertical-align: middle;
  border-bottom: 1px solid #edf1f5;
}

#absensi-page .absensi-weekly-table thead th {
  color: #475569;
  background: #f8fafc;
  font-size: 0.77rem;
  font-weight: 700;
  white-space: nowrap;
}

#absensi-page .absensi-weekly-table thead th:first-child,
#absensi-page .absensi-weekly-table tbody td:first-child {
  position: sticky;
  left: 0;
  text-align: left;
  border-right: 1px solid #edf1f5;
}

#absensi-page .absensi-weekly-table thead th:first-child {
  z-index: 2;
  min-width: 160px;
  background: #f8fafc;
}

#absensi-page .absensi-weekly-table tbody td:first-child {
  z-index: 1;
  min-width: 160px;
  color: #1e293b;
  background: #fff;
}

#absensi-page .absensi-weekly-table tbody tr:last-child td {
  border-bottom: 0;
}

#absensi-page .absensi-weekly-table tbody tr:hover td {
  background-color: #f8fafc;
}

#absensi-page .absensi-weekly-table tbody tr:hover td:first-child {
  background-color: #f8fafc;
}

#absensi-page .absensi-operator-name {
  font-weight: 650;
  white-space: nowrap;
}

#absensi-page .absensi-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 0.69rem;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
}

#absensi-page .absensi-status-hadir {
  color: #166534;
  background: #dcfce7;
  border-color: #bbf7d0;
}

#absensi-page .absensi-status-sakit {
  color: #92400e;
  background: #fef3c7;
  border-color: #fde68a;
}

#absensi-page .absensi-status-izin {
  color: #1d4ed8;
  background: #dbeafe;
  border-color: #bfdbfe;
}

#absensi-page .absensi-status-alpa {
  color: #b91c1c;
  background: #fee2e2;
  border-color: #fecaca;
}

#absensi-page .absensi-status-libur {
  color: #475569;
  background: #f1f5f9;
  border-color: #e2e8f0;
}

#absensi-page .absensi-status-belum {
  color: #6d28d9;
  background: #ede9fe;
  border-color: #ddd6fe;
}

#absensi-page .absensi-empty-state {
  padding: 36px 20px;
  color: #64748b;
  text-align: center;
}

#absensi-page #absensi-empty:not(.hidden) {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-height: 180px;
  justify-content: center;
}

#absensi-page #absensi-empty > svg,
#absensi-page #absensi-empty > i {
  width: 30px;
  height: 30px;
  color: #94a3b8;
}

#absensi-page #absensi-empty strong {
  color: #334155;
  font-size: 0.95rem;
}

#absensi-page #absensi-empty p {
  margin: 0;
  font-size: 0.85rem;
}

#absensi-page .absensi-table-note {
  margin: 16px 0 0;
  color: #64748b;
  font-size: 0.78rem;
  line-height: 1.6;
}

#absensi-page .absensi-manual-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 16px;
}

#absensi-page .absensi-manual-info {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

#absensi-page .absensi-manual-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  color: #166534;
  background: #dcfce7;
  border-radius: 12px;
}

#absensi-page .absensi-manual-icon svg {
  width: 22px;
  height: 22px;
}

#absensi-page .absensi-manual-info h3 {
  margin: 0 0 6px;
  color: #14532d;
  font-size: 0.95rem;
}

#absensi-page .absensi-manual-info p {
  margin: 0;
  color: #3f6950;
  font-size: 0.84rem;
  line-height: 1.6;
}

#absensi-page .hidden {
  display: none !important;
}

@media (max-width: 900px) {
  #absensi-page .absensi-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #absensi-page .absensi-weekly-section {
    padding: 20px;
  }
}

@media (max-width: 640px) {
  #absensi-page {
    gap: 18px;
  }

  #absensi-page .absensi-page-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  #absensi-page .absensi-page-header > button {
    width: 100%;
  }

  #absensi-page .absensi-weekly-section {
    padding: 16px 12px;
    border-radius: 14px;
  }

  #absensi-page .absensi-weekly-header {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
  }

  #absensi-page .absensi-weekly-navigation {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
  }

  #absensi-page .absensi-weekly-navigation button {
    min-width: 0;
    padding: 10px;
  }

  #absensi-page .absensi-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 20px;
  }

  #absensi-page .absensi-summary-card {
    gap: 10px;
    padding: 14px;
    border-radius: 12px;
  }

  #absensi-page .absensi-summary-card:first-child {
    grid-column: 1 / -1;
  }

  #absensi-page .absensi-summary-card strong {
    font-size: 1.45rem;
  }

  #absensi-page .absensi-filter-bar {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  #absensi-page .absensi-weekly-table th,
  #absensi-page .absensi-weekly-table td {
    padding: 12px 10px;
  }

  #absensi-page .absensi-weekly-table thead th:first-child,
  #absensi-page .absensi-weekly-table tbody td:first-child {
    min-width: 130px;
  }

  #absensi-page .absensi-manual-section {
    align-items: stretch;
    flex-direction: column;
    padding: 18px;
  }

  #absensi-page .absensi-manual-section > button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  #absensi-page .btn {
    transition: none;
  }

  #absensi-page .absensi-loading svg,
  #absensi-page .absensi-loading i {
    animation: none;
  }
}


/* Kartu rekap absensi khusus mobile */
#absensi-page .absensi-mobile-cards {
  display: none;
}

#absensi-page .absensi-operator-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 14px;
}

#absensi-page .absensi-operator-card-name {
  margin: 0;
  color: var(--text-primary, #1e293b);
  font-size: 1rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

#absensi-page .absensi-mobile-days {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

#absensi-page .absensi-mobile-day {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 10px;
}

#absensi-page .absensi-mobile-day-name {
  color: var(--text-secondary, #64748b);
  font-size: 0.8rem;
  font-weight: 600;
}

#absensi-page .absensi-mobile-day .absensi-status-badge {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  #absensi-page .absensi-table-wrapper {
    display: none !important;
  }

  #absensi-page .absensi-mobile-cards:not(.hidden) {
    display: grid;
    gap: 12px;
  }
}
