/* The dashboard. Sidebar on wide screens, a scrolling tab strip on phones. */
.preview-note { background: rgba(245, 184, 61, 0.12); border-bottom: 1px solid rgba(245, 184, 61, 0.35); color: #f8d58a; font-size: 14px; }
.preview-note .wrap { padding-top: 10px; padding-bottom: 10px; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.preview-note b { color: var(--warn); }

.dash { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: calc(100vh - 110px); }
.dash-side { border-right: 1px solid var(--line); padding: 20px 14px; display: grid; gap: 18px; align-content: start; position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; }
.server-pick { display: grid; gap: 6px; }
.server-pick label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 0 6px; }
.select, .input, .textarea {
  width: 100%; min-height: 44px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
}
.textarea { padding: 10px 12px; min-height: 90px; resize: vertical; line-height: 1.45; }
.select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.input::placeholder, .textarea::placeholder { color: #7d849c; }
.dash-nav { display: grid; gap: 2px; }
.dash-nav button { all: unset; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 15px; cursor: pointer; }
.dash-nav button:hover { background: var(--panel); color: var(--text); }
.dash-nav button[aria-current="true"] { background: var(--panel-2); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.dash-nav button:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); flex: none; }
.dot.on { background: var(--good); }

.dash-main { padding: 28px 28px 120px; display: grid; gap: 22px; align-content: start; min-width: 0; }
.dash-main > header { display: grid; gap: 6px; }
.dash-main > header h1 { font-size: clamp(28px, 4vw, 38px); }
.dash-main > header p { color: var(--muted); max-width: 64ch; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: grid; gap: 14px; min-width: 0; }
.card h2 { font-size: 21px; }
.card > p, .card .help { color: var(--muted); font-size: 15px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }

.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 6px; }
.tile .k { font-size: 13px; color: var(--muted); font-weight: 600; }
.tile .v { font-family: var(--display); font-size: 26px; font-weight: 600; display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; letter-spacing: .03em; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.good { color: var(--good); background: rgba(62, 207, 142, .12); }
.pill.off { color: var(--muted); background: rgba(169, 176, 198, .12); }
.pill.warn { color: var(--warn); background: rgba(245, 184, 61, .12); }
.pill.bad { color: var(--bad); background: rgba(255, 107, 107, .12); }

.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.row:first-of-type { border-top: 0; }
.row .label { display: grid; gap: 2px; min-width: 0; }
.row .label b { font-weight: 700; }
.row .label span { color: var(--muted); font-size: 14px; }
.inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 15px; }
.inline .input, .inline .select { width: auto; min-width: 0; }
.num { width: 80px !important; text-align: center; font-variant-numeric: tabular-nums; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 12px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.tag .role-dot { width: 10px; height: 10px; border-radius: 50%; }
.tag button { all: unset; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.tag button:hover { background: var(--line); color: var(--text); }
.tag button:focus-visible { outline: 2px solid var(--accent); }
.add-row { display: flex; gap: 8px; }
.add-row .input, .add-row .select { flex: 1; min-width: 0; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; position: relative; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table-wrap.cases table { min-width: 640px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; background: var(--panel); }
tr:last-child td { border-bottom: 0; }
td.n { font-variant-numeric: tabular-nums; color: var(--muted); }
.icon-btn { all: unset; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.icon-btn:hover { background: var(--panel-2); color: var(--bad); }
.icon-btn:focus-visible { outline: 3px solid var(--accent); }

.radio-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.radio-card { position: relative; border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 4px; cursor: pointer; }
.radio-card input { position: absolute; opacity: 0; }
.radio-card b { font-size: 15px; }
.radio-card span { color: var(--muted); font-size: 13px; }
.radio-card:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.radio-card:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; font-size: 14px; }
.error { color: var(--bad); font-size: 14px; }
.ok-text { color: var(--good); font-size: 14px; }

.panel-preview { background: var(--ink); border-radius: 12px; padding: 14px; display: grid; gap: 10px; }
.panel-preview .btns { display: flex; flex-wrap: wrap; gap: 6px; }
.panel-preview .btns span { background: #3a4060; border-radius: 8px; padding: 6px 12px; font-size: 14px; font-weight: 600; }

.case-cards { display: none; gap: 10px; }
.case-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 6px; font-size: 15px; }
.case-card .top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.case-card .meta { color: var(--muted); font-size: 13px; }

.savebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--panel-2); border-top: 1px solid var(--line); }
.savebar[hidden] { display: none; }
.savebar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 68px; padding-top: 10px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
.savebar p { font-weight: 700; }
.savebar div { display: flex; gap: 8px; }

@media (max-width: 900px) {
  .dash { grid-template-columns: minmax(0, 1fr); }
  .dash-side { position: sticky; top: 64px; z-index: 6; height: auto; border-right: 0; border-bottom: 1px solid var(--line); background: var(--ink); padding: 12px 16px; gap: 10px; }
  .server-pick label { display: none; }
  .dash-nav { display: flex; overflow-x: auto; gap: 4px; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  .dash-nav button { flex: none; padding: 9px 12px; }
  .dash-nav button[aria-current="true"] { box-shadow: inset 0 -3px 0 var(--accent); }
  .dash-main { padding: 22px 16px 120px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .radio-cards { grid-template-columns: minmax(0, 1fr); }
  .table-wrap.cases { display: none; }
  .case-cards { display: grid; }
  .row { align-items: flex-start; }
  .savebar p { font-size: 14px; }
}

/* grid children must be allowed to shrink, or wide tables push the page sideways on phones */
.card > *, .dash-main > *, .grid-2 > *, .panel-preview > * { min-width: 0; }

/* Sign-in and other full screens, and who's signed in. */
.dash-screen { grid-column: 1 / -1; display: grid; gap: 14px; align-content: start; justify-items: start; max-width: 640px; margin: 0 auto; padding: 72px 20px; }
.dash-screen h1 { font-size: clamp(28px, 4vw, 38px); }
.dash-screen p { color: var(--muted); }
.dash-screen .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.account { display: flex; align-items: center; gap: 10px; padding: 0 6px; min-width: 0; }
.account img { border-radius: 50%; flex: none; }
.account span { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btns span button { all: unset; cursor: pointer; margin-left: 8px; padding: 2px 4px; color: var(--muted); }
.btns span button:hover { color: var(--text); }
.btns span button:focus-visible { outline: 3px solid var(--accent); }
