/* Colengo Design System values, as in the "prlink Monitor" design canvas. Geomanist (the
   system's display face) is licensed and not served here; the stack falls back to Open Sans. */
:root {
  --ink: #191919;
  --ink-2: #3D3D3D;
  --ink-3: #4C4C4C;
  --ink-4: #666666;
  --line: #E5E5E5;
  --field: #B2B2B2;
  --ground: #F4F6FE;
  --surface: #FFFFFF;
  --primary: #2355F0;
  --link: #1C40C3;
  --link-hover: #0F2A8A;
  --warn-ink: #7A4A00;
  --warn-line: #F5A623;
  --display: Geomanist, 'Open Sans', system-ui, sans-serif;
  --body: 'Open Sans', system-ui, sans-serif;
  --shadow: 0 1px 2px rgba(25, 25, 25, .06);
}

* { box-sizing: border-box; }
/* `hidden` must win over the display rules below (.empty, .warn are flex). */
[hidden] { display: none !important; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--body); }
a { color: var(--link); }
a:hover { color: var(--link-hover); }
code { font-size: 13px; }
button, input, select { font: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.page { min-height: 100vh; padding: 32px 24px 48px; }
.wrap { max-width: 1360px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }

/* Header */
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.head-text { display: flex; flex-direction: column; gap: 4px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--primary); }
.eyebrow.grey { color: var(--ink-4); }
h1 { margin: 0; font-family: var(--display); font-weight: 500; font-size: 32px; line-height: 40px; letter-spacing: -1px; }
.sub { font-size: 14px; color: var(--ink-3); }
.head-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.checked { font-size: 13px; color: var(--ink-3); }
.days select { min-height: 44px; padding: 0 12px; border: 1px solid var(--field); border-radius: 8px; background: var(--surface); color: var(--ink); }
.refresh { font-size: 14px; font-weight: 600; min-height: 44px; padding: 0 18px; border-radius: 8px; border: none; background: var(--primary); color: #FFFFFF; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.refresh:disabled { opacity: .6; cursor: progress; }

.error { background: #FFE6E6; color: #A30000; border-radius: 8px; padding: 12px 16px; font-size: 14px; }

/* Summary */
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.card { background: var(--surface); border-radius: 12px; padding: 18px 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; }
.card-label { font-size: 13px; color: var(--ink-3); }
.card-num { font-family: var(--display); font-size: 32px; line-height: 40px; font-weight: 500; }
.card-num.open { color: var(--link); }
.card-note { font-size: 12px; color: var(--ink-4); }
.card.mis { outline: 2px solid var(--warn-line); outline-offset: -2px; }
.card.mis .card-label { color: var(--warn-ink); font-weight: 600; }
.card.mis .card-num { color: var(--warn-ink); }

/* Filters */
.links { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px 20px; }
.search { display: flex; flex-direction: column; gap: 4px; flex: 1 1 260px; max-width: 360px; }
.search span { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.search input { font-size: 14px; min-height: 40px; padding: 0 12px; border: 1px solid var(--field); border-radius: 8px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; align-self: flex-end; }
.chip { font-size: 13px; font-weight: 600; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--field); background: var(--surface); color: var(--ink); cursor: pointer; }
.chip:hover { border-color: var(--primary); }
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #FFFFFF; }
.shown { margin-left: auto; align-self: flex-end; font-size: 13px; color: var(--ink-3); min-height: 36px; display: flex; align-items: center; }

/* Badges */
.b { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; line-height: 20px; font-weight: 600; white-space: nowrap; }
.b-open { background: #E9EEFD; color: var(--link); }
.b-done { background: #EDEDED; color: var(--ink-2); }
.b-up { background: #E5F6E5; color: #1A6318; }
.b-down { background: #FFE6E6; color: #A30000; }
.b-paused { background: #FFF0D6; color: var(--warn-ink); }
.b-missing { background: #FFFFFF; color: #A30000; border: 1px dashed #A30000; padding: 1px 9px; }
.b-removed { background: transparent; color: var(--ink-4); padding-left: 0; }
.b-sync { background: transparent; color: var(--ink-2); padding-left: 0; }
.b-mis { background: #FFE9C7; color: var(--warn-ink); }
.dot { width: 8px; height: 8px; border-radius: 999px; background: currentColor; flex: none; }

/* Table (desktop) */
.table-box { border-top: 1px solid var(--line); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 1040px; }
th { font-size: 12px; font-weight: 600; color: var(--ink-3); text-align: left; padding: 10px 14px; white-space: nowrap; background: var(--ground); }
th.col-task { width: 34%; }
th.num, td.num { text-align: right; }
td { padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
tr.mis td { background: #FFF8EC; }
tr.sel td { background: #E9EEFD; }
.task-line { display: flex; align-items: center; gap: 8px; }
.task-name { font-weight: 600; text-decoration: none; line-height: 20px; }
.attempt { font-size: 11px; font-weight: 600; color: var(--ink-3); background: #EDEDED; border-radius: 4px; padding: 0 6px; line-height: 18px; white-space: nowrap; }
.small { font-size: 11px; color: var(--ink-4); margin-top: 2px; }
.section { font-size: 12px; color: var(--ink-4); margin-top: 2px; }
.link-cell a { font-size: 13px; white-space: nowrap; }
.created { white-space: nowrap; color: var(--ink-2); }
.uptime { white-space: nowrap; font-variant-numeric: tabular-nums; }
.view { font-size: 13px; font-weight: 600; min-height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--field); background: var(--surface); color: var(--ink); cursor: pointer; }
.view:hover { border-color: var(--primary); color: var(--primary); }

/* Cards (phone) */
.cards { display: none; flex-direction: column; gap: 12px; padding: 0 16px 16px; }
.lcard { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.lcard.mis { background: #FFF8EC; }
.lcard-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.lcard-top .task-name { font-size: 15px; }
.lcard-link { font-size: 13px; word-break: break-all; }
.lcard-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; color: var(--ink-2); }
.lcard .view { align-self: flex-start; min-height: 44px; }
.mis-note { background: #FFF3DF; color: #5C3800; border-radius: 8px; padding: 8px 10px; font-size: 12px; }

.empty { padding: 48px 20px; text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center; font-size: 14px; color: var(--ink-3); }
.empty-title { font-family: var(--display); font-size: 20px; font-weight: 500; color: var(--ink); }

.legend { font-size: 12px; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 8px 24px; }

/* Details dialog */
dialog { width: 100%; max-width: 560px; max-height: calc(100vh - 32px); border: none; border-radius: 16px; padding: 0; box-shadow: 0 12px 32px rgba(25, 25, 25, .24); color: var(--ink); }
dialog::backdrop { background: rgba(25, 25, 25, .45); }
.dlg { padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.dlg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.dlg-title { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
h2 { margin: 0; font-family: var(--display); font-size: 22px; line-height: 28px; font-weight: 500; }
.dlg-links { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; }
.dlg-links a { display: inline-flex; align-items: center; gap: 6px; word-break: break-all; }
.close { flex: none; width: 44px; height: 44px; border-radius: 8px; border: 1px solid var(--field); background: var(--surface); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.dlg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile { background: var(--ground); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.tile-label { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.tile-note { font-size: 12px; color: var(--ink-2); word-break: break-word; }
.match { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.match-label { font-weight: 600; }
.warn { background: #FFF3DF; border-radius: 8px; padding: 12px; display: flex; gap: 10px; color: #5C3800; font-size: 13px; }
.warn svg { flex: none; }
.attempts { display: flex; flex-direction: column; gap: 8px; }
.attempts-title, .teams-title { font-size: 13px; font-weight: 600; }
#sel-attempts { display: flex; flex-direction: column; gap: 8px; }
.att { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); }
.att-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--ink); }
.teams { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.teams-row { display: flex; justify-content: space-between; gap: 12px; }
.ids { font-size: 12px; color: var(--ink-4); word-break: break-all; }

/* Phone: cards instead of the table, as on the design's Mobile board. */
@media (max-width: 720px) {
  .page { padding: 20px 16px 32px; }
  h1 { font-size: 24px; line-height: 32px; letter-spacing: -.5px; }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card { padding: 12px 14px; }
  .card-num { font-size: 26px; line-height: 32px; }
  .card-note { display: none; }
  .filters { padding: 16px; }
  .search { max-width: none; }
  .search input, .chip { min-height: 44px; }
  .shown { margin-left: 0; }
  .table-box { display: none; }
  .cards { display: flex; }
  .head-actions { width: 100%; }
  .checked { flex-basis: 100%; }
  .days { flex: 1; }
  .days select { width: 100%; }
  .refresh-label { display: none; }
  .refresh { padding: 0 13px; }
  .dlg-grid { grid-template-columns: 1fr; }
}
