:root {
  --ink: #14213d;
  --muted: #667085;
  --background: #f3f6fa;
  --panel: #ffffff;
  --primary: #1d4ed8;
  --primary-dark: #153aa1;
  --present: #16856b;
  --late: #c36a09;
  --absent: #c33d58;
  --line: #dce3ee;
  --shadow: 0 14px 34px rgba(23, 42, 78, 0.09);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--background);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 10px;
  padding: 0.78rem 1rem;
  color: white;
  background: var(--primary);
  font-weight: 750;
  cursor: pointer;
}

button:hover {
  background: var(--primary-dark);
}

button.secondary {
  color: var(--primary);
  background: #e8efff;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  padding: 2rem max(5vw, 1.25rem);
  color: white;
  background: linear-gradient(125deg, #102a65, #1d4ed8 62%, #3f7aee);
}

.hero h1 {
  margin: 0.1rem 0 0.25rem;
  font-size: clamp(2rem, 5vw, 3.2rem);
}

.hero p {
  margin: 0;
  color: #dfe9ff;
}

.eyebrow {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  color: var(--primary);
}

.hero .eyebrow {
  color: #aecdff;
}

main {
  width: min(1240px, 93vw);
  margin: 1.5rem auto 3rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.summary-card,
.card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.summary-card {
  padding: 1rem;
  border-radius: 14px;
  color: var(--muted);
}

.summary-card strong {
  display: block;
  margin-top: 0.25rem;
  color: var(--ink);
  font-size: 1.55rem;
}

.summary-card.present strong {
  color: var(--present);
}

.summary-card.late strong {
  color: var(--late);
}

.summary-card.absent strong {
  color: var(--absent);
}

.card {
  border-radius: 18px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 0.7fr) minmax(620px, 1.8fr);
  gap: 1rem;
}

.form-card,
.records-card,
.class-summary {
  padding: 1.25rem;
}

.section-heading h2 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
}

label {
  display: block;
  margin: 0 0 0.35rem;
  font-size: 0.84rem;
  font-weight: 750;
}

input,
select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0.74rem;
  color: var(--ink);
  background: white;
}

input:focus,
select:focus {
  outline: 3px solid #dce8ff;
  border-color: var(--primary);
}

.form-card input,
.form-card select {
  margin-bottom: 0.78rem;
}

.form-card button {
  width: 100%;
  margin-top: 0.2rem;
}

.message {
  min-height: 1.1rem;
  margin: 0.5rem 0 0;
  color: var(--absent);
  font-size: 0.82rem;
}

.message.success {
  color: var(--present);
}

.records-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
}

.filters {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 0.6rem;
  min-width: 430px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.72rem 0.5rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.status-badge {
  display: inline-block;
  min-width: 66px;
  padding: 0.3rem 0.5rem;
  border-radius: 999px;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 800;
}

.status-present {
  color: #08725b;
  background: #ddf6ee;
}

.status-late {
  color: #a55300;
  background: #fff0d9;
}

.status-absent {
  color: #aa2942;
  background: #ffe5eb;
}

.delete-button {
  padding: 0.42rem 0.6rem;
  color: var(--absent);
  background: #fff0f3;
}

.empty-state {
  display: grid;
  gap: 0.25rem;
  padding: 3rem 1rem;
  text-align: center;
  color: var(--muted);
}

.empty-state strong {
  color: var(--ink);
}

.class-summary {
  margin-top: 1rem;
}

.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.class-item {
  padding: 0.9rem;
  border-radius: 12px;
  background: #f6f8fc;
}

.class-item span {
  color: var(--muted);
  font-size: 0.82rem;
}

.class-item strong {
  display: block;
  margin-top: 0.22rem;
}

footer {
  padding: 1.25rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}

@media (max-width: 980px) {
  .summary-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .hero,
  .records-heading {
    flex-direction: column;
    align-items: stretch;
  }

  .summary-grid,
  .breakdown-grid,
  .filters {
    grid-template-columns: 1fr;
  }

  .filters {
    min-width: 0;
  }
}
