* { box-sizing: border-box; }

body {
  margin: 0;
  background: #fff;
  color: #171717;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a { color: #3179a8; text-underline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(30px, 6vw, 42px); line-height: 1; }
h2 { margin-bottom: 12px; font-size: 21px; }
h3 { margin-bottom: 6px; font-size: 16px; }

.container { max-width: 1000px; margin: 36px auto; padding: 0 22px; }
.login-page { max-width: 480px; margin-top: 11vh; }
.card, .panel { border: 1px solid #c8ddeb; border-radius: 12px; background: #fff; box-shadow: 0 2px 7px rgb(42 92 131 / 7%); }
.card { padding: 22px; }
.panel { padding: 16px; }
.eyebrow, .brand { margin-bottom: 6px; color: #4b7fa5; font-size: 12px; font-weight: 600; letter-spacing: .11em; text-transform: uppercase; }
.intro, .muted { color: #607b92; line-height: 1.5; }

.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 26px; padding-bottom: 18px; border-bottom: 1px solid #c8ddeb; }
.topbar .brand { margin-bottom: 3px; }
.topbar-user { margin: 5px 0 0; color: #66829a; font-size: 13px; overflow-wrap: anywhere; }
.topbar nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 14px; }
.topbar nav a { font-size: 14px; font-weight: 500; }

label { display: block; margin: 16px 0 6px; font-size: 14px; font-weight: 500; }
input, select, textarea { width: 100%; padding: 10px 11px; border: 1px solid #acc9dd; border-radius: 7px; background: #fff; color: inherit; font: inherit; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #3d82b2; box-shadow: 0 0 0 3px rgb(61 130 178 / 18%); outline: 0; }
input[type="checkbox"] { width: auto; }
button, .button-link { display: inline-block; margin-top: 16px; padding: 10px 14px; border: 1px solid #3d82b2; border-radius: 7px; background: #3d82b2; color: #fff; cursor: pointer; font: inherit; font-weight: 600; text-decoration: none; }
button:hover:not(:disabled), .button-link:hover { background: #2e6e9c; }
button:disabled { opacity: .55; cursor: not-allowed; }
.secondary-button, .button-link.secondary { border-color: #acc9dd; background: #fff; color: #2b5a7d; }
.danger-button { border-color: #963e39; background: #963e39; }
.text-button { margin: 0; padding: 0; border: 0; background: transparent; color: #3179a8; text-decoration: underline; text-underline-offset: 3px; }
.actions, .button-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.actions > *, .button-row > * { margin-top: 0; }
.button-row { margin-top: 18px; }

.msg { min-height: 1.2em; margin: 12px 0 0; color: #9b2922; font-size: 14px; }
.msg:not(:empty), .flash { padding: 10px 12px; border: 1px solid #e5b8b4; border-radius: 7px; background: #fff6f5; }
.flash { margin-bottom: 16px; border-color: #bad9cb; background: #f0faf4; color: #215e43; font-size: 14px; }

.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.page-heading h1 { margin: 0; }
.section { margin-top: 28px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.metric { padding: 14px; border-radius: 9px; background: #e7f3fc; }
.metric strong, .metric span { display: block; }
.metric strong { margin-top: 3px; font-size: 22px; }
.metric span { color: #5d7e98; font-size: 13px; }

.list { display: flex; flex-direction: column; gap: 10px; }
.item { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: start; padding: 15px; border: 1px solid #c8ddeb; border-radius: 9px; background: #fff; }
.item-main { min-width: 0; }
.item-title { color: #203a54; font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.item-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 6px; color: #607b92; font-size: 13px; }
.item-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.item-actions a, .item-actions button { font-size: 13px; }
.chip { display: inline-block; padding: 3px 7px; border-radius: 999px; background: #e7f3fc; color: #3779a5; font-size: 12px; font-weight: 500; }
.chip.overdue { background: #f9dfda; color: #8f3028; }
.chip.today { background: #f8ebbd; color: #7a5700; }
.chip.done { background: #d7eadc; color: #236442; }
.chip.paused { background: #e4e4e4; color: #5d6260; }
.empty { padding: 22px; border: 1px dashed #bdccc6; border-radius: 9px; color: #5f6d69; text-align: center; }
.details { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: #43524e; line-height: 1.45; }
.back-link { display: inline-block; margin-bottom: 14px; font-size: 14px; font-weight: 500; }
.form-card { max-width: 680px; }
.check-label { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.check-label input { flex: 0 0 auto; }
.check-label .inline-notice { flex-basis: 100%; margin: 0 0 0 24px; }
.inline-notice { margin: 12px 0 0; color: #596a66; font-size: 13px; }
.help-button { width: 20px; height: 20px; margin: 0; padding: 0; border-color: #9ba5ad; border-radius: 50%; background: #fff; color: #4f5a63; font-size: 12px; font-weight: 600; line-height: 1; }
.help-button:hover:not(:disabled) { border-color: #1687b8; background: #e7f3fc; color: #08709e; }

@media (max-width: 650px) {
  .container { margin: 20px auto; padding: 0 15px; }
  .topbar { flex-direction: column; }
  .topbar nav { justify-content: flex-start; }
  .grid, .summary-grid { grid-template-columns: 1fr; }
  .item { grid-template-columns: 1fr; }
  .item-actions { justify-content: flex-start; }
}

.card,
.panel,
.item,
.metric {
  border-color: #a8dff1;
  background: #fff;
}

h1,
h2,
h3,
p,
label,
.intro,
.muted,
.item-title,
.item-meta,
.details {
  color: #171717;
}

input,
select,
textarea {
  border-color: #9bd8ee;
  color: #171717;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #1687b8;
  box-shadow: 0 0 0 3px rgb(22 135 184 / 20%);
}

button,
.button-link {
  border-color: #1687b8;
  background: #1687b8;
}

button:hover:not(:disabled),
.button-link:hover {
  background: #08709e;
}

.container { max-width: 900px; }
.card, .panel, .item, .metric { border-color: #c8ccd1; border-radius: 5px; background: #fff; box-shadow: none; }
a, .text-button { color: #36c; }
