/* =====================================================
   PD Checklists — brand stylesheet
   API palette + traffic-light tokens
   ===================================================== */

:root {
  /* Brand palette */
  --teal:        #0b7a83;
  --teal-dark:   #075058;
  --yellow:      #ffd23f;
  --ink:         #1f2933;
  --muted:       #6b7280;
  --bg:          #f5f7f8;

  /* Traffic lights */
  --green:       #2e9e5b;
  --amber:       #e8a13a;
  --grey:        #c2c8cf;

  /* Structural */
  --radius:      8px;
  --radius-sm:   5px;
  --shadow:      0 1px 3px rgba(0,0,0,.10), 0 1px 8px rgba(0,0,0,.06);
  --max-w:       760px;
  --gap:         1.25rem;
}

/* ─── Reset & base ─────────────────────────────────── */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
}

/* ─── Header ───────────────────────────────────────── */

.site-header {
  background: var(--teal);
  color: #fff;
  padding: 1.25rem 1rem 1rem;
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -.01em;
}

.signout-link {
  color: rgba(255,255,255,.85);
  font-size: .875rem;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 1px solid rgba(255,255,255,.4);
  padding-bottom: 1px;
}

.signout-link:hover {
  color: #fff;
  border-color: #fff;
}

.site-intro {
  max-width: var(--max-w);
  margin: .5rem auto 0;
  font-size: .9rem;
  color: rgba(255,255,255,.85);
}

/* ─── Main layout ──────────────────────────────────── */

.main-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

/* ─── Sign-in panel ────────────────────────────────── */

.panel {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  margin-top: 1rem;
  max-width: 440px;
}

.panel-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--teal-dark);
  margin-bottom: .5rem;
}

.panel-desc {
  color: var(--muted);
  font-size: .9rem;
  margin-bottom: 1.25rem;
}

.signin-form {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.signin-sent {
  margin-top: 1rem;
  background: #edf7f1;
  border-left: 4px solid var(--green);
  padding: .85rem 1rem;
  border-radius: var(--radius-sm);
  color: #1a5c37;
  font-size: .9rem;
}

/* ─── Cards ────────────────────────────────────────── */

.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: var(--gap);
  overflow: hidden;
}

.add-card {
  padding: 1.25rem 1.5rem 1.5rem;
  margin-bottom: 2rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--teal-dark);
  margin-bottom: 1rem;
}

/* ─── Add-course form ──────────────────────────────── */

.add-course-form {
  display: flex;
  flex-direction: column;
  gap: .85rem;
}

.form-row-split {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}

.form-col {
  flex: 1;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

/* ─── Form fields ──────────────────────────────────── */

.field-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.field-input {
  font-family: inherit;
  font-size: .95rem;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid #d1d5db;
  border-radius: var(--radius-sm);
  padding: .6rem .75rem;
  width: 100%;
  transition: border-color .15s;
  appearance: auto;
}

.field-input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(11,122,131,.15);
}

/* ─── Buttons ──────────────────────────────────────── */

.btn {
  font-family: inherit;
  font-size: .92rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  padding: .65rem 1.25rem;
  cursor: pointer;
  transition: background .15s, transform .08s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
}

.btn:active {
  transform: scale(.98);
}

.btn-primary {
  background: var(--teal);
  color: #fff;
  align-self: flex-start;
}

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

/* ─── Course list ──────────────────────────────────── */

.course-list {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.course-list .muted {
  color: var(--muted);
  padding: .5rem 0;
}

/* ─── Course header button ─────────────────────────── */

.course-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem .75rem;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  padding: 1rem 1.25rem;
  font-family: inherit;
  color: var(--ink);
  transition: background .12s;
  min-height: 56px;
}

.course-head:hover {
  background: #f0fafa;
}

.course-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--teal-dark);
  flex: 1 1 auto;
  min-width: 140px;
}

.course-meta {
  font-size: .82rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ─── Traffic light bar ────────────────────────────── */

.bar {
  display: inline-flex;
  align-items: center;
  height: 8px;
  width: 100px;
  border-radius: 99px;
  overflow: hidden;
  background: var(--grey);
  flex-shrink: 0;
}

.seg {
  height: 100%;
  transition: width .3s ease;
  min-width: 0;
}

.seg.green  { background: var(--green); }
.seg.amber  { background: var(--amber); }
.seg.grey   { background: var(--grey); }

.count {
  font-size: .8rem;
  color: var(--muted);
  white-space: nowrap;
  margin-left: .4rem;
}

/* ─── Item list ────────────────────────────────────── */

.items {
  border-top: 1px solid #e5e7eb;
  padding: .25rem 0 .5rem;
}

.item {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: .4rem .6rem;
  padding: .7rem 1.25rem;
  border-bottom: 1px solid #f0f2f3;
  font-size: .9rem;
}

.item:last-of-type {
  border-bottom: none;
}

/* ─── Status dot ───────────────────────────────────── */

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: .3rem;
}

.dot.green  { background: var(--green); }
.dot.amber  { background: var(--amber); }
.dot.grey   { background: var(--grey); }

/* ─── Item fields ──────────────────────────────────── */

.item .title {
  flex: 1 1 180px;
  color: var(--ink);
}

.item .muted {
  font-size: .8rem;
  color: var(--muted);
  flex-basis: 100%;
}

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem;
  margin-left: auto;
}

.actions select,
.actions button {
  font-family: inherit;
  font-size: .82rem;
  border: 1.5px solid #d1d5db;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  padding: .35rem .65rem;
  cursor: pointer;
  min-height: 36px;
  transition: border-color .12s;
}

.actions select:focus,
.actions button:focus {
  outline: none;
  border-color: var(--teal);
}

.actions button {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
  font-weight: 600;
}

.actions button:hover {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
}

.actions button.remind {
  background: #fff;
  color: var(--teal);
  border-color: var(--teal);
}

.actions button.remind:hover {
  background: #f0fafa;
}

/* ─── Assign box ───────────────────────────────────── */

.assign-box {
  flex-basis: 100%;
  margin-top: .4rem;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  background: #f8fffe;
  border: 1.5px solid #b2dfe3;
  border-radius: var(--radius-sm);
  padding: .75rem;
}

.assign-box input {
  font-family: inherit;
  font-size: .88rem;
  border: 1.5px solid #d1d5db;
  border-radius: var(--radius-sm);
  padding: .45rem .65rem;
  flex: 1 1 160px;
  min-width: 120px;
  background: #fff;
  color: var(--ink);
}

.assign-box input:focus {
  outline: none;
  border-color: var(--teal);
}

.assign-send {
  font-family: inherit;
  font-size: .88rem;
  font-weight: 600;
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: .45rem 1rem;
  cursor: pointer;
  min-height: 36px;
  white-space: nowrap;
}

.assign-send:hover {
  background: var(--teal-dark);
}

/* ─── Add task inline form ─────────────────────────── */

.add-item {
  display: flex;
  gap: .5rem;
  padding: .75rem 1.25rem .85rem;
  border-top: 1px solid #f0f2f3;
  flex-wrap: wrap;
}

.add-item input {
  font-family: inherit;
  font-size: .9rem;
  flex: 1 1 180px;
  border: 1.5px solid #d1d5db;
  border-radius: var(--radius-sm);
  padding: .5rem .75rem;
  background: #fff;
  color: var(--ink);
  min-height: 38px;
}

.add-item input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(11,122,131,.12);
}

.add-item button {
  font-family: inherit;
  font-size: .9rem;
  font-weight: 600;
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: .5rem 1.1rem;
  cursor: pointer;
  min-height: 38px;
  white-space: nowrap;
}

.add-item button:hover {
  background: var(--teal-dark);
}

/* ─── Course head row (expand + remove side by side) ─ */

.course-head-row {
  display: flex;
  align-items: stretch;
}

.course-head-row .course-head {
  flex: 1 1 auto;
}

/* ─── Remove course / remove task — low-emphasis ───── */

.course-remove {
  flex-shrink: 0;
  background: none;
  border: none;
  font-family: inherit;
  font-size: .8rem;
  color: var(--muted);
  cursor: pointer;
  padding: .5rem .9rem;
  white-space: nowrap;
  align-self: center;
  border-radius: var(--radius-sm);
  transition: color .12s, background .12s;
}

.course-remove:hover {
  color: #b91c1c;
  background: #fef2f2;
}

.del-item {
  font-family: inherit;
  font-size: .8rem;
  color: var(--muted);
  background: none;
  border: 1.5px solid #e5e7eb;
  border-radius: var(--radius-sm);
  padding: .28rem .6rem;
  cursor: pointer;
  min-height: 32px;
  transition: color .12s, border-color .12s, background .12s;
}

.del-item:hover {
  color: #b91c1c;
  border-color: #fca5a5;
  background: #fef2f2;
}

/* ─── Item layout — vertical stack ─────────────────── */

.item {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  padding: .7rem 1.25rem;
  border-bottom: 1px solid #f0f2f3;
  font-size: .9rem;
}

.item:last-of-type {
  border-bottom: none;
}

.item-main {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .3rem .6rem;
}

.item-main .dot {
  flex-shrink: 0;
  margin-top: .3rem;
  align-self: flex-start;
}

.item-main .title {
  flex: 1 1 160px;
  color: var(--ink);
}

.item-main .muted {
  font-size: .8rem;
  color: var(--muted);
  flex-basis: 100%;
}

/* ─── Item controls — flex row, wraps on mobile ─────── */

.item-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem .5rem;
}

.item-controls select,
.item-controls button {
  font-family: inherit;
  font-size: .82rem;
  border: 1.5px solid #d1d5db;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  padding: .28rem .6rem;
  cursor: pointer;
  min-height: 32px;
  transition: border-color .12s;
}

.item-controls select:focus,
.item-controls button:focus {
  outline: none;
  border-color: var(--teal);
}

.item-controls .status {
  min-width: 80px;
}

.item-controls button.assign,
.item-controls button.remind {
  background: #fff;
  color: var(--teal);
  border-color: var(--teal);
  font-weight: 600;
}

.item-controls button.assign:hover,
.item-controls button.remind:hover {
  background: #f0fafa;
}

/* Due label + compact date input */

.due {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .8rem;
  color: var(--muted);
  white-space: nowrap;
}

.due-date {
  font-family: inherit;
  font-size: .8rem;
  border: 1.5px solid #d1d5db;
  border-radius: var(--radius-sm);
  padding: .2rem .4rem;
  background: #fff;
  color: var(--ink);
  min-height: 30px;
  max-width: 140px;
}

.due-date:focus {
  outline: none;
  border-color: var(--teal);
}

/* ─── Notes textarea — compact, unobtrusive ─────────── */

.notes {
  font-family: inherit;
  font-size: .85rem;
  color: var(--ink);
  background: #fafafa;
  border: 1.5px solid #e5e7eb;
  border-radius: var(--radius-sm);
  padding: .5rem .65rem;
  width: 100%;
  min-height: 2.8em;
  height: 2.8em;
  resize: vertical;
  line-height: 1.45;
  transition: border-color .15s, height .1s;
}

.notes:focus {
  outline: none;
  border-color: var(--teal);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(11,122,131,.1);
}

/* ─── Person dropdown in assign box ─────────────────── */

.o-person {
  font-family: inherit;
  font-size: .88rem;
  border: 1.5px solid #d1d5db;
  border-radius: var(--radius-sm);
  padding: .45rem .65rem;
  flex: 1 1 180px;
  min-width: 140px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  min-height: 36px;
}

.o-person:focus {
  outline: none;
  border-color: var(--teal);
}

/* ─── Utility ──────────────────────────────────────── */

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

/* ─── Mobile ───────────────────────────────────────── */

@media (max-width: 520px) {
  .site-header {
    padding: 1rem .75rem .85rem;
  }

  .main-content {
    padding: 1rem .75rem 2.5rem;
  }

  .panel {
    padding: 1.5rem 1.1rem;
  }

  .add-card {
    padding: 1rem 1.1rem 1.25rem;
  }

  .course-head {
    padding: .85rem 1rem;
  }

  .item {
    padding: .65rem 1rem;
  }

  .actions {
    margin-left: 0;
    flex-basis: 100%;
  }

  .bar {
    width: 72px;
  }
}
