/* styles.css — project-management-os app skin. Layout + app-specific components only;
   tokens/fonts/components come from /design (library/design). Tokens only — no raw hex. */

:root { --side: 264px; }

/* ---------------- app shell ---------------- */
.app { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto;
  border-right: 1px solid var(--line); padding: 20px 16px;
  display: flex; flex-direction: column; gap: 24px; background: var(--page);
}
.brand { display: flex; flex-direction: column; gap: 6px; }
.brand .logo { font-size: 25px; line-height: 1.1; overflow-wrap: anywhere; }
.quick-h, .nav-h {
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--t5); margin-bottom: 9px;
}
.quick { display: flex; flex-direction: column; gap: 6px; }
.qa {
  font-family: var(--sans); font-size: 12.5px; font-weight: 500; letter-spacing: -0.01em;
  color: var(--t1); background: transparent; text-align: left;
  border: 1px solid var(--line2); border-radius: var(--r-ctl); padding: 8px 10px;
  transition: border-color .12s, background .12s;
}
.qa:hover { border-color: var(--t3); background: var(--panel); }

.nav { display: flex; flex-direction: column; gap: 1px; }
.nav a {
  padding: 8px 10px; font-size: 13px; font-weight: 500; color: var(--t2);
  border-left: 2px solid transparent; border-radius: 0 var(--r-ctl) var(--r-ctl) 0;
}
.nav a:hover { background: var(--panel); color: var(--t1); }
.nav a.active { border-left-color: var(--t1); background: var(--panel); color: var(--t1); font-weight: 600; }
.nav .badge {
  float: right; font-family: var(--mono); font-size: 10px; font-weight: 500;
  color: var(--page); background: var(--t1); border-radius: var(--r-ctl);
  padding: 1px 6px; min-width: 18px; text-align: center;
}

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

/* ---------------- section header ---------------- */
.head { margin-bottom: 18px; }
.head h1 { font-size: 24px; }
.head .accent { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--t3); } /* the one serif accent per surface */
.callout {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 11px 14px; margin: 12px 0 18px;
  font-size: 12.5px; line-height: 1.5; color: var(--t3); max-width: 900px;
}
.callout .i { font-family: var(--mono); color: var(--t4); }
.callout b { font-family: var(--mono); font-weight: 500; color: var(--t1); }
.subtabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.subtab {
  padding: 9px 16px; margin-bottom: -1px; border: 0; background: none;
  border-bottom: 2px solid transparent;
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--t4);
}
.subtab:hover { color: var(--t2); }
.subtab.active { color: var(--t1); border-bottom-color: var(--t1); }
.sec-h {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--t4); margin: 26px 0 12px;
}

/* ---------------- metrics (a count is a word the machine says) ---------------- */
.metrics { display: flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; margin-bottom: 22px; max-width: 900px; }
.metric { padding: 12px 20px; border-right: 1px solid var(--line); flex: 1; min-width: 120px; }
.metric:last-child { border-right: 0; }
.metric .k { font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--t4); }
.metric .v { font-family: var(--mono); font-size: 21px; font-weight: 600; letter-spacing: -0.02em; margin-top: 6px; }
.metric .overdue-n { font-size: 12px; color: var(--t3); }
.db-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 8px; }
.db-card { border: 1px solid var(--line); border-radius: var(--r-card); padding: 14px; display: block; transition: border-color .12s, background .12s; }
.db-card:hover { border-color: var(--t4); background: var(--panel); }
.db-card .n { font-family: var(--mono); font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.db-card .l { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--t4); margin-top: 8px; }

/* ---------------- pipeline lanes (dashboard summary) ---------------- */
.lanes { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; }
.lane { flex: 1; min-width: 150px; border: 1px solid var(--line); border-radius: var(--r-card); padding: 12px 14px; background: var(--page); }
.lane.terminal { opacity: .62; }
.lane-h {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--t2);
}
.lane-n { font-family: var(--mono); font-size: 22px; font-weight: 600; margin-top: 10px; }
.lane-v { font-family: var(--mono); font-size: 11px; color: var(--t4); margin-top: 2px; }

/* ---------------- tables: status marks + row actions ---------------- */
.st { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 11.5px; color: var(--t2); white-space: nowrap; }
.st .dot { width: 8px; height: 8px; }
.rowlink:hover { text-decoration: underline; }
td.acts { text-align: right; white-space: nowrap; }
td.acts .btn { margin-left: 5px; }

/* ---------------- timeline ---------------- */
.timeline { border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px 18px; max-width: 980px; }
.tl-scale { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--t5); margin-bottom: 12px; }
.tl-row { display: grid; grid-template-columns: 280px 1fr; align-items: center; gap: 14px; padding: 7px 0; border-top: 1px solid var(--line); }
.tl-name { display: flex; align-items: center; gap: 8px; font-size: 12.5px; min-width: 0; }
.tl-name .dot { width: 8px; height: 8px; flex: none; }
.tl-name a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-name a:hover { text-decoration: underline; }
.tl-track { position: relative; height: 14px; background: var(--panel); border-radius: var(--r-ctl); overflow: hidden; }
.tl-bar { position: absolute; top: 3px; bottom: 3px; border-radius: 2px; background: var(--t1); }
.tl-bar.to_do { background: transparent; border: 1.5px solid var(--t1); }      /* hollow = dormant */
.tl-bar.in_progress { background: var(--t4); }                                  /* half-ink = in motion */
.tl-today { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--t3); }

/* ---------------- calendar ---------------- */
.cal-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.cal-head h3 { font-size: 16px; }
.cal-nav { display: flex; gap: 6px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.cal .dow {
  font-family: var(--mono); font-size: 9.5px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--t5);
  padding: 8px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); background: var(--panel);
}
.cal .cell { min-height: 96px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 6px; }
.cal .cell:nth-child(7n), .cal .dow:nth-child(7n) { border-right: 0; }
.cal .cell:nth-last-child(-n+7) { border-bottom: 0; }
.cal .cell.out { background: var(--panel); }
.cal .dnum { font-family: var(--mono); font-size: 11px; color: var(--t5); }
.cal .cell.today .dnum { background: var(--t1); color: var(--page); padding: 2px 5px; border-radius: 50%; }
.cal .ev {
  margin-top: 5px; border: 1px solid var(--line2); border-radius: var(--r-ctl);
  padding: 3px 6px; font-family: var(--mono); font-size: 10px; line-height: 1.3;
  background: var(--page); display: block; transition: border-color .12s, background .12s;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal .ev:hover { border-color: var(--t3); background: var(--panel); }

/* ---------------- inbox ---------------- */
.inbox { display: flex; flex-direction: column; gap: 9px; max-width: 860px; }
.inbox-item {
  display: flex; gap: 13px; align-items: center;
  border: 1px solid var(--line); border-radius: var(--r-card); padding: 11px 14px;
  transition: border-color .12s, background .12s;
}
.inbox-item:hover { border-color: var(--t4); }
.inbox-item.overdue { border-color: var(--t3); background: var(--panel); }
.inbox-item .body { flex: 1; min-width: 0; }
.inbox-item h4 { font-size: 13.5px; }
.inbox-item p { margin: 3px 0 0; font-family: var(--mono); font-size: 11px; color: var(--t4); }

/* ---------------- detail page ---------------- */
.detail { max-width: 920px; }
.crumb { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--t4); margin-bottom: 14px; }
.crumb a:hover { color: var(--t1); }
.detail-head { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 18px; }
.detail-head .dicon {
  width: 40px; height: 40px; border: 1px solid var(--line); border-radius: var(--r-card); flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 17px; color: var(--t3); background: var(--panel);
}
.detail-head h1 { font-size: 22px; }
.props { display: grid; grid-template-columns: 170px 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; margin-bottom: 26px; }
.props .pk {
  padding: 9px 13px; border-bottom: 1px solid var(--line); background: var(--panel);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--t4);
}
.props .pv { padding: 9px 13px; border-bottom: 1px solid var(--line); font-size: 13px; }
.props .pk:last-of-type, .props .pv:last-of-type { border-bottom: 0; }
.rel { margin-bottom: 24px; }
.rel h3 {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--t2);
  border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 11px;
  display: flex; justify-content: space-between;
}
.rel h3 .c { color: var(--t5); }
.relchips { display: flex; flex-wrap: wrap; gap: 7px; }
.relchip {
  border: 1px solid var(--line2); border-radius: var(--r-ctl); padding: 6px 11px;
  font-size: 12.5px; display: inline-flex; gap: 7px; align-items: center;
  transition: border-color .12s, background .12s;
}
.relchip:hover { border-color: var(--t3); background: var(--panel); }
.relchip .ic { color: var(--t5); }

/* ---------------- modal form layout ---------------- */
#modal-form { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.modal-submit { margin-top: 4px; justify-content: center; }
