:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --border: #e3e0d8;
  --text: #1f1d1a;
  --muted: #6b6660;
  --accent: #2f5d50;
  --accent-hover: #26493f;
  --danger: #a8352b;
  --radius: 10px;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 ui-sans-serif, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

a { color: var(--accent); }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; }
.muted { color: var(--muted); }
.optional, .hint { color: var(--muted); font-weight: 400; font-size: 0.85rem; }
.hint { display: block; margin-top: 0.3rem; }

/* header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.bar {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.bar-wide { max-width: 62rem; }
.brand { font-weight: 650; text-decoration: none; color: var(--text); letter-spacing: -0.01em; }
.nav { display: flex; align-items: center; gap: 1.1rem; }
.nav a, .link-button { color: var(--muted); text-decoration: none; font-size: 0.94rem; }
.nav a:hover, .link-button:hover { color: var(--text); }

.page { max-width: 46rem; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.page-wide { max-width: 62rem; }

h1 { font-size: 1.7rem; letter-spacing: -0.02em; margin: 0 0 0.3rem; }
h2 { font-size: 1.1rem; margin: 2rem 0 0.75rem; }
.card h2 { margin-top: 0; }
h3 { font-size: 1.02rem; margin: 0 0 0.25rem; }

/* cards + forms */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 1.5rem 0;
}
.card-narrow { max-width: 24rem; margin: 3rem auto; }
.card-quiet { background: transparent; margin-top: 2.5rem; }
.card hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }

.stack { display: flex; flex-direction: column; gap: 1rem; align-items: stretch; }
.stack button { align-self: flex-start; }
.row { display: flex; gap: 1rem; flex-wrap: wrap; }
.row > label { flex: 1 1 12rem; }

label { display: block; font-size: 0.9rem; font-weight: 550; }
input, textarea {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.55rem 0.7rem;
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
}
input:not([type="file"]) { height: 2.6rem; line-height: 1.4; }
input[type="file"] { padding: 0.45rem; }
textarea { resize: vertical; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

button, .button {
  font: inherit;
  font-size: 0.94rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button:hover, .button:hover { border-color: var(--muted); }
.primary, .primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.primary:hover { background: var(--accent-hover); }
.danger-button { color: var(--danger); border-color: #e0c4c1; }
.danger-button:hover { border-color: var(--danger); }

.inline { display: inline; }
.link-button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
  font-size: 0.94rem;
}
.link-button.danger { color: var(--danger); }

/* alerts */
.alert {
  padding: 0.7rem 0.9rem;
  border-radius: 7px;
  margin: 0 0 1rem;
  font-size: 0.93rem;
  border: 1px solid;
}
.alert-error { background: #fcf1ef; border-color: #edd2ce; color: #7d2a22; }
.alert-success { background: #eef5f1; border-color: #cfe3d8; color: #23503f; }
.alert-notice { background: #fdf6e6; border-color: #ecdcb4; color: #6b5320; }

/* assignments */
.assignments { list-style: none; padding: 0; margin: 1rem 0 0; }
.assignment {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 0.75rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
}
.assignment-main { min-width: 14rem; flex: 1; }
.assignment-actions { display: flex; align-items: center; gap: 1rem; }
.desc { margin: 0.35rem 0; color: var(--muted); font-size: 0.94rem; }
.meta {
  margin: 0.5rem 0 0;
  font-size: 0.83rem;
  color: var(--muted);
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}
.due { font-weight: 600; }
.due-past { color: var(--danger); }
.due-today { color: #9a6a12; }
.due-upcoming { color: var(--accent); }

.empty {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--muted);
  margin-top: 1rem;
}
.empty p { margin: 0; }

/* table */
.table { width: 100%; border-collapse: collapse; margin-top: 1rem; background: var(--surface); }
.table th, .table td {
  text-align: left;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.94rem;
}
.table thead th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }

.tag {
  font-size: 0.75rem;
  background: #fdf6e6;
  border: 1px solid #ecdcb4;
  color: #6b5320;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
}

.breadcrumb { margin: 0 0 1rem; font-size: 0.9rem; }
.breadcrumb a { text-decoration: none; }

@media (max-width: 34rem) {
  .assignment-actions { width: 100%; }
  .bar { padding: 0.8rem 1rem; }
  .nav { gap: 0.85rem; }
}
