/* Report It — app-specific styles (on top of the shared design system). */

/* ── Hub card grid ─────────────────────────────────────────────────────── */
.ri-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
.ri-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: .35rem;
    position: relative;
    min-height: 120px;
    padding: 1.1rem 1.2rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-left: 5px solid var(--brand);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: var(--text);
    text-decoration: none;
    transition: transform .12s, box-shadow .12s, border-color .12s;
}
.ri-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
    border-left-color: var(--accent);
}
.ri-card__label { font-weight: 700; font-size: 1.1rem; color: var(--brand-dark); }
.ri-card__blurb { font-size: .85rem; color: var(--text-muted); line-height: 1.35; }
.ri-card__ext {
    position: absolute; top: .7rem; right: .8rem;
    font-size: 1rem; color: var(--text-muted);
}
.ri-card--phone { border-left-color: #b02a37; }
.ri-card--alert { border-left-color: #856404; }
.ri-card--chat  { border-left-color: #0a3622; }

/* ── Compensation preview (reporter form + admin) ──────────────────────── */
.comp-preview {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--brand-light);
    padding: .9rem 1rem;
    margin-top: .5rem;
}
.comp-preview h4 { margin: 0 0 .5rem; font-size: .95rem; color: var(--brand-dark); }
.comp-line {
    display: flex; justify-content: space-between; gap: 1rem;
    padding: .3rem 0; border-bottom: 1px dashed var(--border); font-size: .92rem;
}
.comp-line:last-of-type { border-bottom: none; }
.comp-line__amt { font-weight: 700; white-space: nowrap; }
.comp-total {
    display: flex; justify-content: space-between; gap: 1rem;
    margin-top: .5rem; padding-top: .5rem; border-top: 2px solid var(--brand);
    font-weight: 700; color: var(--brand-dark);
}
.comp-note { font-size: .8rem; color: var(--text-muted); margin-top: .4rem; }

/* ── Attendee rows on the reporter form ────────────────────────────────── */
.attendee-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .5rem;
    align-items: start;
    padding: .6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: .5rem;
    background: #fff;
}
.attendee-row__main { display: flex; flex-direction: column; gap: .4rem; }
.attendee-row__order {
    font-size: .78rem; font-weight: 700; color: var(--brand-dark);
    text-transform: uppercase; letter-spacing: .03em;
}
.btn-remove {
    background: none; border: none; color: var(--danger);
    font-size: 1.2rem; cursor: pointer; line-height: 1; padding: .2rem .4rem;
}

/* ── Status chips list (my calls) ──────────────────────────────────────── */
.call-list { list-style: none; padding: 0; margin: 1rem 0 0; }
.call-list__item {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
    padding: .8rem 1rem; border: 1px solid var(--border);
    border-radius: var(--radius-sm); margin-bottom: .5rem; background: var(--card-bg);
}
.call-list__item a { text-decoration: none; color: var(--brand-dark); font-weight: 600; }
.call-list__meta { font-size: .82rem; color: var(--text-muted); }

/* ── Key/value definition lists ────────────────────────────────────────── */
.kv { margin: 0; }
.kv > div {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: .5rem 1rem;
    padding: .4rem 0;
    border-bottom: 1px solid var(--border);
}
.kv > div:last-child { border-bottom: none; }
.kv dt { font-weight: 600; color: var(--text-muted); margin: 0; }
.kv dd { margin: 0; }
@media (max-width: 520px) {
    .kv > div { grid-template-columns: 1fr; gap: .1rem; }
}

.muted { color: var(--text-muted); }

/* ── Admin extras (not in shared design system) ────────────────────────── */
.admin-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem;
}
.admin-head h1 { font-size: 1.4rem; margin: 0; color: var(--brand-dark); }

.panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.sidebar-nav .sidebar-section {
    font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
    color: rgba(255,255,255,.5); padding: .6rem .9rem .2rem; font-weight: 700;
}

/* Filter bar on list pages */
.filter-bar {
    display: flex; flex-wrap: wrap; gap: .5rem; align-items: end;
    margin-bottom: 1rem; padding: .8rem; background: var(--card-bg);
    border: 1px solid var(--border); border-radius: var(--radius);
}
.filter-bar .form-group { margin: 0; }
.filter-bar label { font-size: .75rem; color: var(--text-muted); display: block; margin-bottom: .2rem; }
.filter-bar select, .filter-bar input { min-width: 140px; }

/* Timeline feed */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
    padding: .6rem 0 .6rem 1rem; border-left: 3px solid var(--border);
    margin-left: .3rem;
}
.timeline li + li { margin-top: .2rem; }
.timeline__meta { font-size: .78rem; color: var(--text-muted); }
.timeline__kind {
    display: inline-block; font-size: .68rem; text-transform: uppercase;
    letter-spacing: .04em; font-weight: 700; color: var(--brand);
    background: var(--brand-light); border-radius: 10px; padding: 1px 8px; margin-right: .4rem;
}

/* Editable comp amount inputs */
.amt-input { max-width: 90px; text-align: right; }

/* Stat card spans → stacked (shared CSS assumes block children) */
.stat-card__value, .stat-card__label { display: block; }

/* ── Flow builder canvas (.qm- wrap/toolbar, .nl- nodes/links/editor) ──── */
.qm-toolbar {
    display: flex; gap: .5rem; align-items: center; flex-wrap: wrap;
    margin-bottom: .6rem;
}
.qm-wrap {
    position: relative; overflow: hidden;
    border: 1px solid var(--border); border-radius: var(--radius);
    background:
        linear-gradient(90deg, rgba(0,94,133,.05) 1px, transparent 1px) 0 0 / 24px 24px,
        linear-gradient(rgba(0,94,133,.05) 1px, transparent 1px) 0 0 / 24px 24px,
        #fbfcfe;
    min-height: 420px; touch-action: none;
}
.qm-canvas { position: absolute; left: 0; top: 0; width: 6000px; height: 4000px; }
.qm-edges { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.qm-edges .nl-hit  { fill: none; stroke: transparent; stroke-width: 14; pointer-events: stroke; cursor: pointer; }
.qm-edges .nl-line { fill: none; stroke: var(--brand); stroke-width: 2; opacity: .65; }
.qm-edges .nl-temp { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 5 4; }
.qm-edges .nl-linkx {
    opacity: 0; pointer-events: none; font: 700 15px sans-serif;
    fill: #b02a37; cursor: pointer; text-anchor: middle; dominant-baseline: middle;
}
.qm-edges .nl-linkg:hover .nl-line  { opacity: 1; stroke-width: 3; }
.qm-edges .nl-linkg:hover .nl-linkx { opacity: 1; pointer-events: auto; }

.nl-node {
    position: absolute; width: 210px; background: #fff;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    box-shadow: var(--shadow); cursor: grab; user-select: none;
    font-size: .82rem; padding: .45rem .55rem .5rem; touch-action: none;
}
.nl-node:active { cursor: grabbing; }
.nl-node.nl-start { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(0,94,133,.25); }
.nl-node.nl-info    { border-left: 4px solid #856404; }
.nl-node.nl-outcome { border-left: 4px solid #1a8c4e; }
.nl-node.nl-q       { border-left: 4px solid var(--brand); }
.nl-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .2rem; }
.nl-kind {
    font-size: .62rem; text-transform: uppercase; letter-spacing: .04em;
    font-weight: 700; color: var(--text-muted);
}
.nl-startchip {
    font-size: .6rem; font-weight: 800; color: #fff; background: var(--brand);
    border-radius: 8px; padding: 1px 6px;
}
.nl-title { font-weight: 600; line-height: 1.25; margin-bottom: .3rem; word-wrap: break-word; }
.nl-ans {
    display: flex; justify-content: space-between; align-items: center;
    padding: .12rem 0; border-top: 1px dashed var(--border);
}
.nl-anslabel { font-size: .74rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nl-port {
    flex: 0 0 auto; width: 13px; height: 13px; margin-left: .4rem;
    border-radius: 50%; background: #fff; border: 2px solid var(--brand);
    cursor: crosshair; touch-action: none;
}
.nl-port:hover { background: var(--accent); border-color: var(--accent); }

.nl-edit-float {
    position: absolute; top: 16px; right: 16px; width: 320px; max-width: calc(100% - 32px);
    max-height: 86%; overflow: auto; z-index: 200;
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-md); padding: .9rem 1rem;
}
.nl-edit-float[hidden] { display: none; }
.nl-edit-float h3 { margin: 0 0 .6rem; font-size: 1rem; color: var(--brand-dark); }
.nl-edit-float .form-label { margin-top: .5rem; }
.qm-wrap:fullscreen { background-color: #fbfcfe; }

.ri-card--inbox { border-left-color: var(--accent); }

/* ── Print (claim form) ────────────────────────────────────────────────── */
@media print {
    .app-header, .app-footer, .no-print { display: none !important; }
    .app-main { max-width: none; margin: 0; padding: 0; }
    body { background: #fff; }
}
