:root {
  --ink: #18212f;
  --muted: #627085;
  --line: #d9e0ea;
  --surface: #ffffff;
  --page: #f4f7fb;
  --primary: #244e73;
  --primary-dark: #183b58;
  --accent: #0f766e;
  --danger: #b42318;
  --success: #137333;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}


.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-box {
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.login-brand {
  margin-bottom: 18px;
}

.login-note {
  color: var(--muted);
}

a {
  color: inherit;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  white-space: nowrap;
}

.brand strong {
  color: var(--primary);
  font-size: 22px;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

nav a {
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
}

nav a.active,
nav a:hover {
  color: var(--primary);
  background: #e9f0f7;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto 48px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 30px;
}

h2 {
  font-size: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.button,
button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  text-decoration: none;
}

.button.primary,
button.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

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

.button.ghost {
  background: transparent;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.metric,
.panel,
.form-section,
.search-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metric {
  padding: 20px;
}

.metric span {
  display: block;
  color: var(--muted);
}

.metric strong {
  display: block;
  margin-top: 8px;
  color: var(--primary);
  font-size: 34px;
}

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

.dashboard-grid.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.below {
  margin-top: 16px;
}

.panel {
  padding: 18px;
}

.table-wrap {
  margin-top: 14px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

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

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

.num {
  text-align: right;
}

.empty {
  color: var(--muted);
}

.alert {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
}

.alert.success {
  border-color: #b7dfc2;
  color: var(--success);
  background: #eef8f0;
}

.alert.error {
  border-color: #f2b8b5;
  color: var(--danger);
  background: #fff1f0;
}

.admission-form {
  display: grid;
  gap: 16px;
}

.form-section {
  padding: 18px;
}

.form-section h2 {
  margin-bottom: 16px;
}

.form-grid,
.search-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stack-form {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.search-form {
  align-items: end;
  margin-bottom: 18px;
  padding: 18px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid #c7d0dc;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

textarea {
  resize: vertical;
}

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

.wide {
  grid-column: span 2;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  margin-top: 22px;
}

.check-line input {
  width: auto;
  min-height: auto;
}

.form-actions,
.search-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.form-actions {
  justify-content: flex-end;
}

.error-text {
  color: var(--danger);
  font-weight: 700;
}

.wide-table table {
  min-width: 900px;
}

@media (max-width: 900px) {
  .app-header,
  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-grid,
  .dashboard-grid.two-col,
  .metric-grid,
  .form-grid,
  .search-form {
    grid-template-columns: 1fr;
  }

  .wide {
    grid-column: auto;
  }
}
