:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #637083;
  --line: #d8dee8;
  --panel: #ffffff;
  --soft: #f5f7fb;
  --teal: #0f766e;
  --blue: #2563eb;
  --rose: #be123c;
  --amber: #b45309;
  --green: #15803d;
  --shadow: 0 18px 50px rgba(23, 32, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--soft);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button,
select,
input,
textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
}

button {
  min-height: 40px;
  padding: 0 14px;
  border-color: transparent;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
}

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

input,
select,
textarea {
  width: 100%;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
}

textarea {
  resize: vertical;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  background: var(--soft);
  padding: 24px;
}

.login-card {
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 360px;
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.login-card label {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.login-error {
  margin: 0;
  color: var(--rose);
  font-size: 0.86rem;
}

.quick-logins {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.quick-logins p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.8rem;
}

.quick-logins button {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.auth-switch {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
  text-align: center;
}

.auth-switch button {
  min-height: auto;
  padding: 0;
  background: none;
  border: none;
  color: var(--blue);
  font-weight: 700;
  cursor: pointer;
}

.form-success {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--green);
  font-size: 0.86rem;
}

.identity-panel {
  display: grid;
  gap: 6px;
  margin-bottom: -6px;
}

.identity-panel span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.82rem;
}

.identity-panel button {
  margin-top: 6px;
  background: rgba(255, 255, 255, 0.12);
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px;
  background: #101820;
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: #2dd4bf;
  color: #0f172a;
  font-weight: 800;
}

.brand span,
.role-picker,
.trust-panel span {
  color: rgba(255, 255, 255, 0.68);
}

.role-picker {
  margin-bottom: -14px;
  font-size: 0.82rem;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-list a {
  color: #fff;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 6px;
}

.nav-list a:hover,
.nav-list a:focus {
  background: rgba(255, 255, 255, 0.12);
}

.trust-panel {
  display: grid;
  gap: 6px;
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
}

main {
  min-width: 0;
  padding: 28px;
}

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

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1;
}

h2 {
  margin-bottom: 0;
  font-size: 1.08rem;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.session-chip,
.policy-badge,
.metric span {
  color: var(--muted);
  font-size: 0.84rem;
}

.session-chip,
.policy-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  background: #fff;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

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

.metric {
  padding: 16px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 1.7rem;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: 16px;
}

.panel {
  padding: 18px;
}

.span-2 {
  grid-row: span 2;
}

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

.message-list,
.feed-list {
  display: grid;
  gap: 10px;
}

.message {
  padding: 12px;
  border-left: 4px solid var(--blue);
  background: #f8fafc;
  border-radius: 6px;
}

.message.staff {
  border-left-color: var(--teal);
}

.message.parent {
  border-left-color: var(--blue);
}

.message strong,
.feed-item strong {
  display: block;
  margin-bottom: 5px;
}

.message time,
.feed-item time {
  color: var(--muted);
  font-size: 0.8rem;
}

.composer,
.feed-form {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.composer label,
.feed-form label {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.feed-item {
  padding: 12px;
  border-radius: 6px;
  background: #f8fafc;
}

.feed-item.meal {
  border-left: 4px solid var(--amber);
}

.feed-item.nap {
  border-left: 4px solid var(--blue);
}

.feed-item.milestone {
  border-left: 4px solid var(--green);
}

.attendance-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.attendance-actions button:nth-child(1) {
  background: var(--green);
}

.attendance-actions button:nth-child(2) {
  background: var(--blue);
}

.attendance-actions button:nth-child(3) {
  background: var(--rose);
}

.report {
  display: grid;
  gap: 10px;
}

.report-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.span-full {
  grid-column: 1 / -1;
}

.temp-password-banner {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: #ecfdf5;
  border: 1px solid var(--green);
  border-radius: 8px;
}

.temp-password-banner p {
  margin: 0;
  font-size: 0.86rem;
}

.temp-password-banner code {
  padding: 8px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.95rem;
  user-select: all;
}

.user-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 20px;
}

.user-form .form-row {
  display: grid;
  gap: 6px;
}

.user-form label {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.user-form button {
  background: var(--teal);
}

.form-error {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--rose);
  font-size: 0.86rem;
}

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

.user-table th,
.user-table td {
  padding: 10px 8px;
  text-align: left;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

.user-table th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  border-top: none;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }

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

@media (max-width: 640px) {
  main,
  .sidebar {
    padding: 18px;
  }

  .topbar,
  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .status-grid {
    gap: 10px;
  }

  .attendance-actions {
    grid-template-columns: 1fr;
  }

  .user-form {
    grid-template-columns: 1fr;
  }
}
