/* Page-specific styles: queue, exports, report, admin. Prefer app.css components. */

/* ---------- Tabs (admin tabs, report view jump links) ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line-strong); margin: 0 0 20px; }
.tabs a { padding: 9px 16px; margin-bottom: -1px; border: 1px solid transparent; border-radius: var(--radius-sm) var(--radius-sm) 0 0; color: var(--text-2); font-weight: 600; text-decoration: none; }
.tabs a:hover { background: var(--brand-50); color: var(--brand); }
.tabs a.active { background: var(--surface); color: var(--brand); border-color: var(--line-strong); border-bottom-color: var(--surface); box-shadow: inset 0 3px 0 var(--accent); }
@media (max-width: 560px) { .tabs { flex-wrap: nowrap; overflow-x: auto; } .tabs a { white-space: nowrap; padding: 9px 12px; } }

/* ---------- Call queue ---------- */
.ready-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; padding: 26px 24px; }
.ready-card h2 { font-size: 22px; margin-bottom: 4px; }
.how { list-style: none; margin: 0; padding: 6px 18px 14px; counter-reset: how; }
.how li { counter-increment: how; display: grid; grid-template-columns: 34px 1fr; gap: 0 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.how li:last-child { border-bottom: 0; }
.how li::before { content: counter(how); grid-row: span 2; width: 30px; height: 30px; border-radius: 50%; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; font-weight: 700; }
.how li span { color: var(--text-2); }

/* ---------- Call task ---------- */
.callee-name { font-size: 26px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.callee-name .pill { font-size: 13px; vertical-align: middle; margin-left: 4px; }
a.dial { color: var(--brand); text-decoration: none; }
a.dial:hover { text-decoration: underline; }
.facts dd.big { font-size: 26px; }
.task-cols .card { margin-bottom: 0; }
.task-cols { margin-bottom: 18px; }
fieldset.plain { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.plain legend { padding: 0; margin-bottom: 2px; }
.option > div { min-width: 0; }
.option { align-items: flex-start; }
.panel { border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius); padding: 16px; margin: 0 0 18px; }
.panel[hidden], .oc[hidden] { display: none; }
.panel label:last-child { margin-bottom: 0; }
.panel .check { margin-bottom: 0; }
.compact-row { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.errlist { margin: 4px 0 0; padding-left: 18px; }
.save-btn { min-width: 220px; }
@media (max-width: 560px) { .save-btn { width: 100%; } .callee-name { font-size: 22px; } .options { grid-template-columns: 1fr; } }

/* ---------- Exports ---------- */
.kind-cards .card { margin-bottom: 0; display: flex; flex-direction: column; }
.kind-cards .card-body { flex: 1; }
.kind-counts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.big-num { font-size: 34px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.big-num.ok { color: var(--ok); } .big-num.warnc { color: var(--warn); } .big-num.zero { color: var(--text-3); }
.kind-cards { margin-bottom: 18px; }
button:disabled { pointer-events: none; }

/* ---------- Report ---------- */
.datebar { display: flex; align-items: flex-end; gap: 8px; }
.datebar label { margin: 0; } .datebar input { margin-top: 3px; }

.breakdowns { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 18px; }
.breakdown h3 { margin-bottom: 6px; }
.subcard { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.subcard table { font-size: 13.5px; } .subcard td { padding: 7px 12px; }
.subcard p { padding: 10px 12px !important; }
.section-head[id], .card[id] { scroll-margin-top: 16px; }
@media (max-width: 640px) { .datebar { width: 100%; } .datebar label { flex: 1; } }

/* ---------- Admin ---------- */
.form-grid.wide { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.policy-list { margin: 0 0 16px; padding: 10px 14px 10px 32px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text-2); font-size: 13.5px; }
.policy-list li + li { margin-top: 4px; }
.save-bar { padding: 4px 0 12px; }
.tpl-text { min-width: 280px; max-width: 520px; font-size: 13px; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.inline-form { display: flex; gap: 6px; align-items: center; }
.inline-form input { margin: 0; min-width: 150px; }
.link-form { display: flex; gap: 6px; align-items: center; }
.link-form select { margin: 0; min-width: 130px; }
.filterbar { display: flex; flex-wrap: wrap; gap: 0 16px; align-items: flex-end; border-bottom: 1px solid var(--line); }
.filterbar label { margin-bottom: 0; min-width: 190px; }
.filterbar .filter-btn { display: flex; gap: 6px; }
.detail { max-width: 420px; overflow-wrap: anywhere; }
.counter { font-size: 13px; margin-bottom: 4px; }
.grid.kind-cards, .kind-cards { align-items: stretch; } .kind-cards .card { height: 100%; }

/* ---------- Message templates list ---------- */
.tpl-list { list-style: none; margin: 0; padding: 0; }
.tpl-row { display: grid; grid-template-columns: minmax(220px, 260px) minmax(0, 1fr) 200px; gap: 18px 24px; align-items: center; padding: 18px 22px; }
.tpl-row + .tpl-row { border-top: 1px solid var(--line); }
.tpl-row.is-off { background: var(--surface-2); }
.tpl-row.is-off .tpl-bubble { opacity: .7; }
.tpl-meta { display: grid; gap: 8px; }
.tpl-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tpl-bubble { max-width: none; white-space: pre-wrap; }
.tpl-side { display: grid; gap: 6px; justify-items: start; }
.tpl-side .btn { margin-top: 4px; }
.tpl-wname { font-family: var(--mono); font-size: 12.5px; font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 1100px) { .tpl-row { grid-template-columns: 1fr; } }
.btn.danger-text, button.danger-text { color: var(--bad); }
.btn.danger-text:hover, button.danger-text:hover { background: var(--bad-50); }
.detail { max-width: 560px; }
.kvp { display: inline-flex; gap: 5px; align-items: baseline; margin: 2px 10px 2px 0; font-size: 12.5px; color: var(--text-2); overflow-wrap: anywhere; }
.kvp b { font-weight: 600; color: var(--text-3); font-size: 11.5px; }

/* Call screen: the reason for the call, impossible to miss */
.why-call { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0; padding: 14px 22px; background: var(--brand); color: #fff; }
.why-call .why-label { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.why-call b { font: 700 19px/1.2 var(--display); }
.why-call span:last-child:not(.why-label) { color: #d3dcf7; font-size: 14px; flex-basis: 100%; }
