/* Dashboard: a left rail of sections and one content pane, on the home palette. */
.nav-right { position: relative; display: flex; align-items: center; gap: 10px; }
.btn.small { padding: 6px 14px; font-size: 14px; text-decoration: none; }
.account-menu { top: 48px; right: 0; left: auto; transform: none; min-width: 230px; }
.account-menu .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-size: 13px; color: var(--muted); }
.account-menu .who b { display: block; color: var(--text); font-size: 14px; }
.menu-item { display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; text-align: left; font-weight: 600; cursor: pointer; color: var(--text); }
.menu-item:hover { background: var(--bg); }
.menu-item.danger { color: var(--danger); }

.dash { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; max-width: 1180px; margin: 0 auto; padding: 28px max(20px, env(safe-area-inset-right, 0px)) 48px max(20px, env(safe-area-inset-left, 0px)); }
@media (max-width: 820px) { .dash { grid-template-columns: 1fr; gap: 16px; } }
.dash-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 16px; align-self: start; }
@media (max-width: 820px) { .dash-nav { flex-direction: row; overflow-x: auto; position: static; padding-bottom: 4px; } }
.dash-nav button { padding: 9px 12px; border: 0; border-radius: 10px; background: none; text-align: left; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.dash-nav button:hover { background: var(--surface); color: var(--text); }
.dash-nav button.sel { background: var(--surface); color: var(--blue); box-shadow: inset 3px 0 0 var(--blue); }
.dash-sep { height: 1px; background: var(--line); margin: 8px 4px; }
@media (max-width: 820px) { .dash-sep { display: none; } }
.dash-main { min-width: 0; }
.pane-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.pane-head h1 { margin: 0; font-size: 24px; }
.pane-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pane-actions .btn { text-decoration: none; }
.lead { margin: -6px 0 16px; color: var(--muted); }
.sub { margin: 26px 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.card h2.sub { margin-top: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.card label { display: block; margin: 12px 0 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.card label input, .card label select { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-weight: 400; color: var(--text); }
.grid3 { display: grid; grid-template-columns: 1fr 1.3fr .8fr; gap: 12px; }
@media (max-width: 640px) { .grid3 { grid-template-columns: 1fr; } }
.row-end { display: flex; justify-content: flex-end; margin-top: 14px; }

.pmr { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pmr h3 { margin: 0 0 4px; font-size: 17px; }
.pmr .mid { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }

.rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rows > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.rows > li.done { opacity: .6; }
.rows .t { font-weight: 700; overflow-wrap: anywhere; }
.rows .m { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.rows .b { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; grid-column: 1; }
.rows .acts { grid-row: 1 / span 3; grid-column: 2; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) { .rows > li { grid-template-columns: 1fr; } .rows .acts { grid-row: auto; grid-column: 1; justify-content: flex-start; } }
.rows .acts .btn, .rows .acts a { text-decoration: none; }
.empty-row { color: var(--muted); padding: 16px 4px; }
.tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; vertical-align: 2px; }
.tag.live { background: #fde2e2; color: #b42318; }
.tag.ai { background: color-mix(in srgb, var(--blue) 12%, transparent); color: var(--blue); }
.tag.admin { background: color-mix(in srgb, var(--orange) 20%, transparent); color: #8a5a00; }
.tag.off { background: var(--bg); color: var(--muted); }
.filter-row { margin-bottom: 12px; }
.note-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.note-card + .note-card { margin-top: 12px; }
.note-card h3 { margin: 0 0 2px; font-size: 17px; }
.note-card .m { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.note-card h4 { margin: 12px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.note-card p { margin: 0; line-height: 1.55; }
.note-card ul { margin: 0; padding-left: 20px; line-height: 1.55; }
.secret { font: 600 15px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--bg); border: 1px dashed var(--line); padding: 10px 12px; border-radius: 10px; user-select: all; overflow-wrap: anywhere; }

.card-h { margin: 22px 0 2px; font-size: 16px; }
.card-p { margin: 0; color: var(--muted); font-size: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
@media (max-width: 600px) { .grid2 { grid-template-columns: 1fr; } }
.card label.inline-check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); margin-top: 14px; }
.card label.inline-check input { width: 17px; height: 17px; margin: 0; }
.row-end { gap: 8px; }
.mail-log { list-style: none; margin: 14px 0 0; padding: 0; font-size: 12px; color: var(--muted); }
.mail-log li { padding: 3px 0; overflow-wrap: anywhere; }
.mail-log li.bad { color: #c62828; }
.reg-list { list-style: none; margin: 0 0 8px; padding: 0; max-height: 50vh; overflow: auto; }
.reg-list li { display: flex; align-items: center; gap: 6px; padding: 8px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.reg-list li .m { color: var(--muted); font-size: 13px; flex: 1; min-width: 180px; }

.media-row .t { display: flex; align-items: center; gap: 10px; }
.media-row .thumb { width: 64px; height: 36px; object-fit: cover; border-radius: 5px; background: #111; }
#dlg-body textarea.lyrics { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-family: inherit; font-size: 14px; line-height: 1.5; margin-top: 6px; resize: vertical; }
.modal:has(textarea.lyrics) { width: min(640px, calc(100vw - 32px)); }

/* Analytics */
.seg-mini { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.seg-mini button { border: 0; background: none; padding: 7px 12px; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg-mini button + button { border-left: 1px solid var(--line); }
.seg-mini button.sel { background: #eaf1fd; color: #1658d6; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.an-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.an-tile-l { font-size: 13px; color: var(--muted); font-weight: 600; }
.an-tile-v { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin: 2px 0; color: var(--text); }
.an-tile-s { font-size: 12px; color: var(--muted); }
.table-card .show-all { margin: 8px 14px 12px; }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; margin-bottom: 8px; }
.chart-card { margin: 0; padding: 14px 16px; position: relative; }
.chart-card figcaption { display: flex; flex-direction: column; margin-bottom: 6px; }
.chart-card figcaption span { font-size: 12px; color: var(--muted); }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: #e8eaef; stroke-width: 1; }
.chart .base { stroke: #c9ced8; stroke-width: 1; }
.chart .tick { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart .val { font-size: 12px; font-weight: 700; fill: var(--text); }
.chart .bar { fill: #2a78d6; }
.chart .hit { fill: transparent; }
.chart .hit:hover { fill: rgba(42, 120, 214, .06); }
.chart-card .tip { position: absolute; transform: translate(-50%, -100%); margin-top: 22px; padding: 6px 10px; border-radius: 8px; background: #0b0b0b; color: #fff; font-size: 12px; white-space: nowrap; pointer-events: none; }
.chart-table summary { cursor: pointer; font-size: 12px; color: var(--muted); margin-top: 6px; }
.table-card { padding: 0; overflow-x: auto; }
.an-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.an-table th, .an-table td { padding: 9px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.an-table th { font-size: 12px; color: var(--muted); font-weight: 600; }
.an-table .n { text-align: right; font-variant-numeric: tabular-nums; }
.an-table tr:last-child td { border-bottom: 0; }
.an-table .empty-cell { color: var(--muted); text-align: left; }

.qr-box { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 6px 0 4px; }
.qr-code { width: 200px; height: 200px; image-rendering: pixelated; border: 1px solid var(--line); border-radius: 8px; }
.qr-secret { font-size: 12px; color: var(--muted); text-align: center; overflow-wrap: anywhere; font-family: ui-monospace, monospace; }
.backup-codes { columns: 2; padding: 14px; border-radius: 10px; background: var(--bg); font: 15px/1.8 ui-monospace, monospace; text-align: center; }
.twostep-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 16px; border-radius: 12px; background: #fff7e0; border: 1px solid #f5d27a; font-weight: 600; }
.steps { margin: 0 0 6px; padding-left: 20px; color: var(--muted); font-size: 14px; line-height: 1.5; }

.card label textarea { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-family: inherit; font-size: 14px; font-weight: 400; color: var(--text); resize: vertical; }
.card label textarea.code { font-family: ui-monospace, monospace; font-size: 12px; }
.card label select { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font: inherit; font-weight: 400; }
.card-p a { overflow-wrap: anywhere; }
.ai-status { margin-right: auto; align-self: center; font-size: 13px; font-weight: 600; color: var(--muted); }
.ai-status.on { color: var(--ok); }
.ai-status.on::before { content: "● "; }

/* Attendance report */
.report-links { white-space: nowrap; font-size: 13px; }
.report-links a, .btn.link { color: var(--accent, #0b5cff); font-weight: 600; }
.btn.link { background: none; border: 0; padding: 0; min-height: 0; text-decoration: none; cursor: pointer; }
.btn.link:hover, .report-links a:hover { text-decoration: underline; }
.att-table { max-height: 55vh; overflow: auto; margin: 10px -6px 0; }
.prep-poll { display: grid; grid-template-columns: 1fr auto; gap: 6px 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.prep-poll textarea { grid-column: 1; font: inherit; resize: vertical; }
.prep-poll .btn { grid-column: 2; grid-row: 1; }
.prep-polls + .btn { margin-top: 10px; }

/* Team chat */
.nav-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 9px; background: var(--danger, #e02828); color: #fff; font-size: 11px; font-weight: 700; }
.chat-app { display: grid; grid-template-columns: 220px minmax(0, 1fr); padding: 0; height: min(70vh, 720px); overflow: hidden; }
.chat-channels { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-right: 1px solid var(--line); overflow-y: auto; background: var(--bg); }
.chat-ch { text-align: left; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-ch:hover { background: var(--surface); }
.chat-ch.sel { background: var(--surface); font-weight: 700; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.chat-ch.unread { font-weight: 700; }
.chat-ch.unread::after { content: ""; display: inline-block; width: 8px; height: 8px; margin-left: 8px; border-radius: 50%; background: var(--accent, #0b5cff); vertical-align: middle; }
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-head { display: flex; align-items: baseline; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.chat-head .muted { font-size: 13px; }
.chat-msgs { flex: 1; list-style: none; margin: 0; padding: 12px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.chat-who { display: flex; gap: 8px; align-items: baseline; font-size: 14px; }
.chat-who time { font-size: 12px; }
.chat-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.45; }
.chat-empty { color: var(--muted); margin: auto; }
.chat-send { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.chat-send textarea { flex: 1; resize: none; min-height: 40px; max-height: 140px; font: inherit; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; }
@media (max-width: 720px) {
  .chat-app { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); height: 78vh; }
  .chat-channels { flex-direction: row; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .chat-ch { flex: none; }
}
