/* Kay 프로젝트 현황. Same look as the KayNote admin page (src/admin.css there). */
:root {
  --bg: #ffffff;
  --bg-soft: #f4f5f8;
  --bg-hover: #e6e8ee;
  --text: #1d2129;
  --text-soft: #6b7280;
  --border: #d9dce3;
  --accent: #3b6fd9;
  --ok: #1f9d55;
  --warn: #d98a00;
  --bad: #d64545;
  --bar: #c4cad6;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17191e;
    --bg-soft: #22252c;
    --bg-hover: #2f333c;
    --text: #e6e8ec;
    --text-soft: #9aa1ad;
    --border: #3a3f49;
    --accent: #6b95ec;
    --ok: #3cc47c;
    --warn: #f0b429;
    --bad: #f06a6a;
    --bar: #4a505c;
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, "Segoe UI", "Malgun Gothic", sans-serif; }

.adm { max-width: 1120px; margin: 0 auto; padding: 24px 16px 48px; font-size: 14px; }
.adm-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.adm-head h1 { margin: 0; font-size: 22px; letter-spacing: -0.02em; }
.adm-head h1 span { font-weight: 400; color: var(--text-soft); }
.adm-who { display: flex; align-items: center; gap: 8px; color: var(--text-soft); font-size: 13px; flex-wrap: wrap; }
.adm-btn { border: 1px solid var(--border); background: var(--bg); color: var(--text); border-radius: 8px; padding: 5px 12px; font: inherit; cursor: pointer; }
.adm-btn:hover { background: var(--bg-hover); }
.adm-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; padding: 8px 18px; }
.adm-btn:disabled { opacity: 0.6; cursor: default; }
.adm-msg { padding: 48px 0; text-align: center; color: var(--text-soft); }
.adm-msg.error { padding: 12px; color: var(--bad); }
.adm-dim { color: var(--text-soft); font-size: 12px; }

/* overview */
.ov { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 12px; margin-bottom: 8px; }
.ov a { text-decoration: none; color: inherit; background: var(--bg-soft); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; border-left: 4px solid var(--ok); }
.ov a.warn { border-left-color: var(--warn); }
.ov a.bad { border-left-color: var(--bad); }
.ov a:hover { background: var(--bg-hover); }
.ov b { font-size: 16px; }
.ov small { color: var(--text-soft); font-size: 12px; }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.badge.warn { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
.badge.bad { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); }
.reasons { margin: 0; padding-left: 16px; font-size: 12px; color: var(--text-soft); }

/* project */
.proj { margin-top: 28px; scroll-margin-top: 12px; }
.proj-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.proj-head h2 { margin: 0; font-size: 19px; }
.proj-head a { color: var(--accent); font-size: 13px; margin-left: auto; }
.svcs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.svc { font-size: 12px; padding: 3px 9px; border-radius: 6px; background: var(--bg-soft); display: inline-flex; align-items: center; gap: 6px; }
.svc::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.svc.bad::before { background: var(--bad); }
.svc.unknown::before { background: var(--text-soft); }

.adm-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.adm-card { background: var(--bg-soft); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.adm-card > span { color: var(--text-soft); font-size: 13px; }
.adm-card > b { font-size: 26px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.adm-card > small { color: var(--text-soft); font-size: 12px; }
.adm-card.warn > b { color: var(--warn); }
.adm-card.bad > b { color: var(--bad); }
.adm-meter { position: relative; height: 8px; border-radius: 4px; background: var(--bg-hover); margin: 6px 0 4px; }
.adm-meter i { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: var(--accent); min-width: 2px; }
.adm-card.warn .adm-meter i { background: var(--warn); }
.adm-card.bad .adm-meter i { background: var(--bad); }

.sub-head { margin: 18px 0 8px; font-size: 13px; font-weight: 600; color: var(--text-soft); letter-spacing: 0.02em; }
.app-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 12px; }
.app-cards .adm-card > b { font-size: 24px; }
.days { display: flex; align-items: stretch; gap: 3px; height: 110px; }
.day { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pair { flex: 1; display: flex; align-items: flex-end; gap: 1px; border-bottom: 1px solid var(--bg-hover); }
.pair i { flex: 1; border-radius: 2px 2px 0 0; }
.pair i.active { background: var(--accent); }
.pair i.signups { background: #f0b429; }
.day small { height: 16px; font-size: 10.5px; color: var(--text-soft); text-align: center; white-space: nowrap; overflow: visible; }
.adm-legend .active::before { background: var(--accent); }
.adm-legend .signups::before { background: #f0b429; }
details.users summary { display: flex; align-items: baseline; gap: 8px; cursor: pointer; list-style: none; }
details.users summary::-webkit-details-marker { display: none; }
details.users summary::before { content: "▸"; color: var(--text-soft); }
details.users[open] summary::before { content: "▾"; }
details.users summary h3 { margin: 0; }
details.users .adm-table-wrap { margin-top: 10px; }
details.users td { white-space: nowrap; }
.adm-panel { min-width: 0; margin-top: 12px; background: var(--bg-soft); border-radius: 12px; padding: 14px 16px; }
.adm-panel h3 { margin: 0 0 10px; font-size: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid2 > .adm-panel { min-width: 0; margin-top: 12px; }

.adm-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-soft); margin-bottom: 6px; }
.adm-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; background: var(--bar); }
.adm-legend .err::before { background: var(--bad); }
.adm-legend b { color: var(--text); font-weight: 600; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 90px; border-bottom: 1px solid var(--bg-hover); }
.bars div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; min-width: 0; }
.bars i { display: block; background: var(--bar); border-radius: 2px 2px 0 0; }
.bars i.err { background: var(--bad); border-radius: 0; }
.bars-x { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--text-soft); margin-top: 3px; }

.adm-table-wrap { overflow-x: auto; }
.adm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.adm-table th { text-align: left; font-weight: 500; color: var(--text-soft); padding: 6px 8px; border-bottom: 1px solid var(--bg-hover); white-space: nowrap; }
.adm-table td { padding: 7px 8px; border-bottom: 1px solid var(--bg-hover); vertical-align: top; }
.adm-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.adm-table code { font-size: 12px; word-break: break-all; }
.ok-t { color: var(--ok); }
.bad-t { color: var(--bad); }
.adm-login { padding: 64px 0; text-align: center; color: var(--text-soft); }

@media (max-width: 760px) {
  .adm-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .adm-card > b { font-size: 21px; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .adm-table td:first-child { white-space: nowrap; }
}
