/* =========================================================
   pages/reports.css
   ---------------------------------------------------------
   Teacher attendance exports and responsive register filters.
   ========================================================= */

.nn-reports {
  display: grid;
  gap: 16px;
}

.nn-reports__head {
  padding: 24px;
}

.nn-reports__head h1 {
  margin: 0;
  color: #0f172a;
  font-size: clamp(1.75rem, 2vw, 2.1rem);
  font-weight: 750;
  letter-spacing: -0.035em;
}

.nn-reports__head p {
  margin: 8px 0 0;
}

/* Filter panel */

.nn-reports__filters {
  padding: 18px;
}

.nn-reports__grid {
  display: grid;
  grid-template-columns:
    minmax(150px, 0.85fr)
    minmax(220px, 1.55fr)
    minmax(220px, 1.55fr)
    minmax(170px, 0.9fr);
  gap: 14px;
  align-items: start;
}

.nn-reports__filters label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.nn-reports__filters label > span:first-child {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
}

.nn-reports__filters select,
.nn-reports__filters input[type="date"] {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  box-sizing: border-box;
  padding: 0 12px;
  border: 1px solid #d8dee6;
  border-radius: 9px;
  background: #fff;
  color: #111827;
  font-size: 0.9rem;
}

.nn-reports__filters select:focus,
.nn-reports__filters input[type="date"]:focus {
  outline: none;
  border-color: #0f9fa8;
  box-shadow: 0 0 0 3px rgba(15, 159, 168, 0.1);
}

.nn-reports__filters select:disabled,
.nn-reports__filters input[type="date"]:disabled {
  border-color: #e5e7eb;
  background: #f6f7f8;
  color: #9ca3af;
  cursor: not-allowed;
}

.nn-report-student-field.is-disabled,
.nn-report-term-field.is-disabled,
.nn-report-date-field.is-disabled {
  opacity: 0.72;
}

.nn-report-field-help {
  min-height: 16px;
  color: #7c8798;
  font-size: 0.72rem;
  line-height: 1.25;
}

/* Term/date row */

.nn-report-term-field {
  grid-column: 1 / span 2;
}

.nn-report-date-field {
  min-width: 0;
}

.nn-report-date-wrap {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}

.nn-report-date-wrap input[type="date"] {
  display: block;
  width: 100%;
  padding-right: 40px;
  appearance: none;
  -webkit-appearance: none;
}

.nn-report-date-wrap::after {
  content: "\f133";
  position: absolute;
  top: 50%;
  right: 13px;
  transform: translateY(-50%);
  color: #64748b;
  font-family: "Font Awesome 6 Free";
  font-size: 0.9rem;
  font-weight: 400;
  pointer-events: none;
}

.nn-report-date-field.is-disabled .nn-report-date-wrap::after {
  color: #b8c0cc;
}

.nn-report-date-wrap input[type="date"]::-webkit-calendar-picker-indicator {
  position: absolute;
  right: 0;
  width: 40px;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.nn-report-date-wrap input[type="date"]:disabled::-webkit-calendar-picker-indicator {
  cursor: not-allowed;
}

/* Actions/status */

.nn-reports__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e5e7eb;
}

.nn-reports__autoNote {
  margin: 0;
  color: #64748b;
  font-size: 0.8rem;
}

.nn-reports__actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 15px;
  line-height: 1;
}



/* Filter row alignment */

.nn-reports__grid > label {
  align-self: start;
}

.nn-reports__filters label > span:first-child {
  display: flex;
  align-items: flex-end;
  min-height: 16px;
}

.nn-reports__filters select,
.nn-reports__filters input[type="date"] {
  height: 40px;
}

.nn-report-field-help {
  display: block;
  min-height: 16px;
  margin: 0;
}


.nn-reports__actionButtons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap;
}

.nn-reports__resetButton {
  background: #fff;
  border-color: #d8dee6;
  color: #475569;
}

.nn-reports__resetButton:hover,
.nn-reports__resetButton:focus-visible {
  background: #f8fafc;
  border-color: #bfc7d1;
  color: #111827;
  text-decoration: none;
}

/* Preview */

.nn-reports__preview {
  padding: 18px;
}

.nn-reports__previewHead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.nn-reports__previewHead h2 {
  margin: 0;
  color: #111827;
  font-size: 1rem;
  font-weight: 750;
}

.nn-reports__previewHead p {
  margin: 6px 0 0;
  font-size: 0.82rem;
}

.nn-reports__tableWrap {
  overflow-x: auto;
}

.nn-reports__table {
  width: 100%;
  border-collapse: collapse;
}

.nn-reports__table th,
.nn-reports__table td {
  padding: 9px 8px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}

.nn-reports__table th {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  vertical-align: bottom;
}

.nn-reports__table td {
  color: #1f2937;
  font-size: 0.82rem;
  vertical-align: top;
}

.nn-reports__table tbody tr:last-child td {
  border-bottom: 0;
}

/* Closures */

.nn-reports__closures {
  margin: 12px 0 16px;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 0.82rem;
}

.nn-reports__closures ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.nn-reports__closures li {
  margin: 3px 0;
}

/* Tablet / iPad */

@media (max-width: 1100px) {
  .nn-reports__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nn-report-term-field {
    grid-column: span 1;
  }
}

/* Phone */

@media (max-width: 767px) {
  .nn-reports__head,
  .nn-reports__filters,
  .nn-reports__preview {
    padding: 14px;
  }

  .nn-reports__grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .nn-report-term-field {
    grid-column: span 1;
  }

  .nn-reports__actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .nn-reports__actions .btn {
    width: 100%;
  }

  .nn-reports__previewHead {
    display: grid;
  }

  .nn-reports__table th,
  .nn-reports__table td {
    white-space: nowrap;
  }
}


/* PDF / CSV export buttons */

.nn-reports__downloadButtons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap;
}

@media (max-width: 767px) {
  .nn-reports__downloadButtons {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .nn-reports__downloadButtons .btn {
    width: 100%;
  }
}

@media (max-width: 767px) {
  .nn-reports__actionButtons,
  .nn-reports__downloadButtons {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .nn-reports__actionButtons .btn,
  .nn-reports__downloadButtons .btn {
    width: 100%;
  }
}
