:root {
  --green: #2d7a4f;
  --green-dark: #1f5b3a;
  --blue: #1677ff;
  --bg: #f4f7fb;
  --text: #25313d;
  --muted: #7b8794;
  --border: #dce4ef;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
}

button, input, select, textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

button.secondary {
  background: #eef3f9;
  color: var(--text);
}

button.warn {
  background: #f59f00;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  outline: none;
}

textarea {
  resize: vertical;
}

.hidden {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
}

.sidebar {
  background: #17212f;
  color: #fff;
  padding: 24px 18px;
}

.brand {
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 26px;
}

.nav button {
  width: 100%;
  margin-bottom: 10px;
  text-align: left;
  background: transparent;
  color: rgba(255,255,255,.78);
}

.nav button.active {
  background: rgba(255,255,255,.12);
  color: #fff;
}

.main {
  min-width: 0;
  padding: 24px;
}

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

.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: 0 8px 24px rgba(22, 40, 65, 0.06);
}

.panel-title {
  font-size: 18px;
  font-weight: 900;
  margin: 0 0 14px;
}

.grid {
  display: grid;
  gap: 14px;
}

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

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.student-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.student-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: #fbfdff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.student-name {
  font-weight: 800;
}

.student-no {
  color: var(--muted);
  font-size: 12px;
}

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

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

.login-card {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 18px 50px rgba(22, 40, 65, 0.12);
}

.login-card h1 {
  margin: 0 0 18px;
  font-size: 24px;
}

.form-row {
  margin-bottom: 12px;
}

.status-list {
  display: grid;
  gap: 8px;
  max-height: 300px;
  overflow: auto;
}

.status-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: #fbfdff;
  font-size: 14px;
}

.wallpaper-preview {
  min-height: 220px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: #f3f5f8 center / cover no-repeat;
}

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

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

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 14px;
  }
  .brand {
    margin-bottom: 12px;
  }
  .nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
  }
  .nav button {
    white-space: nowrap;
    margin: 0;
  }
  .main {
    padding: 14px;
  }
  .grid.cols-2,
  .grid.cols-3 {
    grid-template-columns: 1fr;
  }
}
