:root {
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-soft: #eef6f2;
  --ink: #1c2520;
  --muted: #657169;
  --line: #dbe4dd;
  --teal: #0f8f7a;
  --teal-dark: #0b6f61;
  --orange: #df7b32;
  --red: #c94a4a;
  --shadow: 0 20px 60px rgba(28, 37, 32, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(15, 143, 122, 0.08), transparent 320px),
    var(--bg);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  line-height: 1.6;
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(219, 228, 221, 0.86);
  background: rgba(246, 247, 244, 0.92);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--teal);
  color: #ffffff;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1rem;
  line-height: 1.2;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links a {
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.94rem;
  padding: 8px 10px;
}

.nav-links a:hover {
  background: var(--surface-soft);
  color: var(--teal-dark);
}

main {
  width: 100%;
}

.app-section {
  padding: 52px clamp(18px, 4vw, 56px);
}

.app-section {
  min-height: calc(100vh - 75px);
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 28px;
  align-items: end;
  max-width: 1180px;
  margin: 0 auto 28px;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 8px;
  color: var(--orange);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 760px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.2rem, 5vw, 4.6rem);
  line-height: 1;
  letter-spacing: 0;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.metrics div {
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 12px 32px rgba(28, 37, 32, 0.05);
}

.metrics span {
  display: block;
  color: var(--teal-dark);
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  font-weight: 850;
  line-height: 1.1;
}

.metrics small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 700;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.form-panel {
  display: grid;
  gap: 10px;
  padding: 22px;
}

.table-panel {
  min-width: 0;
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.panel-header h2 {
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.25;
}

.state-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #fff2e8;
  color: #99531f;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 6px 10px;
}

label {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--ink);
  outline: none;
  padding: 10px 12px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input:focus,
select:focus {
  border-color: rgba(15, 143, 122, 0.72);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(15, 143, 122, 0.12);
}

.button-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 10px;
}

.btn {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 850;
  padding: 10px 14px;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn.primary {
  background: var(--teal);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(15, 143, 122, 0.22);
}

.btn.primary:hover {
  background: var(--teal-dark);
}

.btn.ghost,
.btn.compact {
  border-color: var(--line);
  background: #ffffff;
  color: var(--ink);
}

.btn.ghost:hover,
.btn.compact:hover {
  border-color: rgba(15, 143, 122, 0.4);
  background: var(--surface-soft);
}

.btn.compact {
  min-height: 38px;
  white-space: nowrap;
}

.btn.danger {
  border-color: rgba(201, 74, 74, 0.2);
  background: #fff5f5;
  color: var(--red);
}

.table-header,
.toolbar {
  padding: 22px 22px 0;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding-bottom: 18px;
}

#status-message {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.table-wrap {
  position: relative;
  width: 100%;
  overflow-x: auto;
  border-top: 1px solid var(--line);
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}

th {
  background: #f1f7f4;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

td {
  color: var(--ink);
  font-size: 0.94rem;
}

tbody tr:hover {
  background: #fbfcfa;
}

.student-name {
  display: grid;
  gap: 2px;
}

.student-name strong {
  line-height: 1.25;
}

.student-name small {
  color: var(--muted);
}

.status-badge {
  display: inline-flex;
  min-width: 64px;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 850;
  padding: 5px 9px;
}

.status-aktif {
  background: #e6f7ef;
  color: #11613e;
}

.status-cuti {
  background: #fff2e8;
  color: #99531f;
}

.status-lulus {
  background: #eaf1ff;
  color: #315a9e;
}

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

.row-actions .btn {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 0.82rem;
}

.empty-state {
  display: grid;
  gap: 4px;
  min-height: 180px;
  place-content: center;
  padding: 32px;
  text-align: center;
  color: var(--muted);
}

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

code {
  font-family: "Cascadia Code", "Courier New", monospace;
  font-size: 0.94em;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px clamp(18px, 4vw, 56px);
  background: #1c2520;
  color: #f6f7f4;
  font-size: 0.92rem;
}

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

}

@media (max-width: 680px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .app-section {
    padding: 34px 16px;
  }

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

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

  #status-message {
    white-space: normal;
  }

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

  footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
