.atm-attendance-app {
  width: 50%;
  max-width: 1180px;
  margin: 2.5rem auto;
  padding: 2rem;
  background-color: #f7f9f4;
  border: 1px solid #d9dfd0;
  border-radius: 12px;
  box-shadow: 0 18px 32px rgba(40, 58, 40, 0.08);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.atm-attendance-app--wide {
  width: 100%;
  max-width: none;
}

.atm-attendance-app--wide .atm-attendance-list {
  overflow-x: visible;
}

.atm-attendance-app--wide .atm-grade-table {
  min-width: 100%;
  table-layout: fixed;
}

.atm-attendance-app--wide .atm-grade-table th,
.atm-attendance-app--wide .atm-grade-table td {
  word-break: break-word;
}

.atm-attendance-form {
  display: flex;
  flex-direction: column;
  gap: 2.2rem;
}

.atm-step[hidden] {
  display: none !important;
}

.atm-step h2 {
  margin: 0 0 0.75rem;
  font-size: 1.35rem;
  color: #1f331f;
}

.atm-step-subtitle {
  margin: 0 0 1.4rem;
  color: #4c624c;
  font-size: 0.96rem;
}

.atm-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.atm-field label {
  font-weight: 600;
  color: #2f3f2f;
}

.atm-field--inline {
  flex-direction: row;
  align-items: center;
  gap: 1rem;
}

.atm-field--inline label {
  flex: 0 0 180px;
  margin: 0;
}

.atm-field--inline input {
  flex: 1 1 auto;
}

.atm-field input,
.atm-field select {
  font-size: 1rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid #c4cbbd;
  border-radius: 6px;
  background-color: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.atm-field input:focus,
.atm-field select:focus,
.atm-input:focus,
.atm-select:focus {
  border-color: #2f7a2f;
  box-shadow: 0 0 0 2px rgba(47, 122, 47, 0.18);
  outline: none;
}

.atm-field--range .atm-field__range-controls {
  display: grid;
  grid-template-columns: auto min-content auto;
  align-items: center;
  gap: 0.6rem;
}

.atm-field--range input[type="date"] {
  width: 100%;
}

.atm-field__range-separator {
  font-size: 1.3rem;
  color: #4c624c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
}

.atm-field__hint {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: #5a6b5a;
}

.atm-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.atm-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.4rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background-color: #e5ecdc;
  color: #1d2e1d;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.atm-button:hover {
  background-color: #d7e4c6;
}

.atm-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.atm-button--primary {
  background-color: #2f7a2f;
  color: #ffffff;
}

.atm-button--primary:hover {
  background-color: #256025;
}

.atm-session-summary {
  border: 1px solid #c3ccb7;
  border-radius: 10px;
  background-color: #f2f6eb;
  padding: 1rem 1.25rem;
  margin-bottom: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.atm-session-summary__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #1f331f;
}

.atm-session-summary__rows {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
}

.atm-session-summary__row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.atm-session-summary__label {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #506350;
}

.atm-session-summary__value {
  font-size: 0.96rem;
  color: #1f2e1f;
  min-height: 1.1rem;
}

.atm-attendance-list {
  border: 1px solid #cbd5be;
  border-radius: 10px;
  background-color: #ffffff;
  padding: 1.1rem 1.3rem;
  overflow-x: auto;
}

.atm-attendance-stats {
  border: 1px solid #cbd5be;
  border-radius: 10px;
  background-color: #f5f8ef;
  padding: 1rem 1.25rem;
  margin: 1.5rem auto 0;
  max-width: 620px;
}

.atm-attendance-stats__title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: #1f331f;
  text-align: center;
}

.atm-attendance-stats__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, max-content));
  justify-content: center;
  gap: 0.5rem 2.5rem;
  margin: 0 auto;
  align-items: center;
}

.atm-attendance-stats__list dt {
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #4f644f;
  margin: 0;
  grid-column: 1;
}

.atm-attendance-stats__list dd {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #223322;
  grid-column: auto;
  text-align: left;
  padding-left: 0.4rem;
}

.atm-attendance-stats__notice {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: #4f644f;
}

.atm-grade-table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
  background-color: #ffffff;
}

.atm-grade-table thead th {
  background: linear-gradient(180deg, #e9efe0 0%, #dbe7cb 100%);
  border: 1px solid #c1ccb2;
  color: #253725;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.01em;
  padding: 0.65rem 0.75rem;
  text-align: center;
  text-transform: uppercase;
}

.atm-grade-table thead tr:first-child th {
  font-size: 0.92rem;
  text-transform: none;
}

.atm-grade-table thead th.atm-col--narrow,
.atm-grade-table thead th.atm-col--signed,
.atm-grade-table thead th.atm-col--ta {
  text-align: center;
}

.atm-grade-table thead th.atm-col--medium,
.atm-grade-table thead th.atm-col--wide {
  text-align: left;
}

.atm-grade-table tbody td {
  border: 1px solid #d7ddd1;
  padding: 0.45rem 0.6rem;
  font-size: 0.94rem;
  color: #2b382b;
}

.atm-grade-table tbody td:first-child,
.atm-grade-table tbody td:nth-child(2),
.atm-grade-table tbody td:last-child,
.atm-grade-table tbody td:nth-last-child(2) {
  text-align: center;
}

.atm-grade-table tbody tr:nth-child(even) {
  background-color: #f5f7f0;
}

.atm-grade-table tbody tr:hover {
  background-color: #eef3e6;
}

.atm-input,
.atm-select {
  width: 100%;
  border: 1px solid #c3c9bd;
  border-radius: 5px;
  background-color: #fbfcf9;
  font-size: 0.9rem;
  padding: 0.35rem 0.45rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.atm-input {
  text-align: center;
}

.atm-input--control {
  text-align: left;
}

.atm-input--attendance {
  text-align: center;
}

.atm-select {
  padding-right: 1.8rem;
  background-image: linear-gradient(45deg, transparent 50%, #2f7a2f 50%), linear-gradient(135deg, #2f7a2f 50%, transparent 50%), linear-gradient(to right, #fbfcf9, #fbfcf9);
  background-position: calc(100% - 1.1rem) calc(50% - 0.25rem), calc(100% - 0.75rem) calc(50% - 0.25rem), 100% 0;
  background-size: 0.45rem 0.45rem, 0.45rem 0.45rem, 2.5rem 100%;
  background-repeat: no-repeat;
  appearance: none;
}

.atm-cell--center {
  text-align: center;
}

.atm-messages {
  min-height: 1.5rem;
  font-weight: 600;
  color: #1f331f;
}

.atm-messages--error {
  color: #b23a34;
}

.atm-messages--success {
  color: #237a4a;
}

@media (max-width: 1024px) {
  .atm-attendance-app {
    margin: 1.8rem auto;
    padding: 1.75rem;
  }
}

@media (max-width: 768px) {
  .atm-attendance-app {
    padding: 1.5rem;
  }

  .atm-session-summary__rows {
    grid-template-columns: 1fr;
  }

  .atm-attendance-list {
    padding: 0.9rem;
  }
}

@media (max-width: 640px) {
  .atm-attendance-form {
    gap: 1.6rem;
  }

  .atm-step h2 {
    font-size: 1.2rem;
  }

  .atm-field--range .atm-field__range-controls {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .atm-field__range-separator {
    display: none;
  }
}
