/* Shared app components, used by the signed-in app and the staff console.
   Class names match the helpers in js/ui.js. */

.page-header { display: grid; gap: 10px; margin-bottom: clamp(20px, 3vw, 32px); }
.page-header-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 20px; }
.page-header-text { display: grid; gap: 6px; min-width: 0; }
.page-title { font-size: clamp(1.7rem, 3.4vw + 0.4rem, 2.5rem); line-height: 1.16; letter-spacing: -0.03em; font-weight: 700; overflow-wrap: anywhere; }
.page-title:focus { outline: none; }
.page-sub { color: var(--text-2); max-width: 640px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; width: fit-content; color: var(--text-2); font-weight: 600; font-size: 0.92rem; text-decoration: none; padding: 4px 8px 4px 2px; border-radius: 10px; }
.back-link:hover { color: var(--text); }
.back-link .icon { width: 18px; height: 18px; }

.panel { padding: clamp(18px, 3vw, 26px); display: grid; gap: 16px; align-content: start; min-width: 0; }
.panel-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 16px; }
.panel-title { font-size: 1.15rem; font-weight: 650; letter-spacing: -0.015em; }
.panel-sub { font-size: 0.9rem; margin-top: 2px; }

.empty { display: grid; justify-items: center; gap: 10px; text-align: center; padding: clamp(32px, 7vw, 64px) var(--gutter); }
.empty .muted { max-width: 440px; }
.empty-icon { width: 64px; height: 64px; border-radius: 22px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); margin-bottom: 6px; }
.empty-icon.bad { background: var(--danger-bg); color: var(--danger); }
.empty .btn { margin-top: 8px; }

.skeleton-list { display: grid; gap: 12px; }
.skeleton { height: 76px; border-radius: 20px; background: linear-gradient(100deg, var(--sunken) 30%, var(--line) 50%, var(--sunken) 70%) 0 0 / 220% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -120% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

.kv { display: grid; grid-template-columns: minmax(96px, max-content) 1fr; gap: 10px 20px; margin: 0; }
.kv dt { color: var(--text-3); font-size: 0.9rem; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.typed-actions { margin-top: 6px; }
.pchip { font-weight: 650; letter-spacing: -0.01em; }
.pn-five9 { font-weight: 800; letter-spacing: -0.045em; }
.pn-genesys { font-weight: 500; }
.pn-cxone { font-weight: 700; }
.pn-ringcx { font-weight: 300; }
.pn-twilio { font-weight: 600; letter-spacing: -0.02em; }

/* tables: horizontal scroll on narrow screens */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-2); }
.tbl { width: 100%; border-collapse: collapse; font-size: 0.93rem; min-width: 640px; }
.tbl th, .tbl td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl th { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); background: var(--sunken); white-space: nowrap; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--sunken); }
.tbl a { font-weight: 600; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }

.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.stack-sm > * + * { margin-top: 8px; }
.grid-2 { display: grid; gap: 16px; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.grid-3 { display: grid; gap: 16px; }
@media (min-width: 900px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.panel { grid-template-columns: minmax(0, 1fr); } .panel > * { min-width: 0; }

/* ---------- design v2 overrides (docs/DESIGN-DIRECTION.md): no gradients, no glow, no glass, hairlines ---------- */
.skeleton { border-radius: var(--r-m); }
/* design v2 */
.page-title { font-family: var(--font-display); font-weight: 560; letter-spacing: -0.028em; }
.tbl th { letter-spacing: 0; text-transform: none; font-weight: 500; font-size: 0.82rem; background: transparent; }
