/* Rewards, Rewards Insights and Link Insights: the layout pieces shop.css does
   not carry. Cards, tables, tiles, badges and buttons still come from shop.css;
   this file only spaces them and gives card headers a subtitle line.

   🔴 shop.css gives .data-card no margin, so cards stacked in .main-content
   touched edge to edge. .ins-page spaces every direct child instead of each
   card carrying its own inline margin. */

.ins-page { display: flex; flex-direction: column; gap: 20px; }
.ins-page > .stats-row { margin-bottom: 0; }
/* JS-filled hosts (free-code card, ledger) stay empty for most shops and must
   not leave a gap where nothing renders. */
.ins-page > :empty { display: none; }

.ins-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .ins-grid { grid-template-columns: minmax(0, 1fr); } }

/* Card header: title with its explanation underneath, actions on the right. */
.ins-head { min-width: 0; flex: 1 1 260px; }
.ins-sub { font-size: 12.5px; color: var(--text-3); margin-top: 3px; line-height: 1.45; }
.ins-body { padding: 18px 20px; }
.ins-table { overflow-x: auto; }
.ins-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* Tile footnote, under .stat-value. */
.ins-note { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.ins-note.warn { color: var(--orange); font-weight: 600; }

/* Table cells. Names read as names (not underlined browser links), phones as
   a quiet secondary action. */
.ins-name { color: var(--text-1); font-weight: 600; text-decoration: none; }
a.ins-name:hover { color: var(--primary); }
.ins-phone { color: var(--text-2); text-decoration: none; white-space: nowrap; }
a.ins-phone:hover { color: var(--primary); }
.ins-muted { color: var(--text-3); }
.ins-small { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.ins-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ins-strong { font-weight: 700; }
.ins-up { color: var(--primary); font-weight: 700; }
.ins-late { color: var(--red); font-weight: 700; }
/* shop.css colours every .data-table cell text-1, which outranks a bare class. */
.data-table td.ins-muted { color: var(--text-3); }
.data-table td.ins-phone { color: var(--text-2); }
.data-table td.ins-up { color: var(--primary); }
.ins-right, .data-table th.ins-right, .data-table td.ins-right { text-align: right; }
.ins-table .row-actions { justify-content: flex-end; }

/* A compact empty state for a card body. shop.css's .empty-state is sized for a
   whole page (56px of padding) and swamps a half-width card. */
.ins-empty { padding: 28px 20px; color: var(--text-3); font-size: 13px; text-align: center; line-height: 1.5; }
.ins-empty i { display: block; font-size: 20px; margin-bottom: 8px; opacity: 0.55; }

/* Chart legend and small print under a chart. */
.ins-legend { display: flex; gap: 18px; margin-top: 12px; font-size: 12.5px; color: var(--text-2); flex-wrap: wrap; }
.ins-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.ins-fine { font-size: 12px; color: var(--text-3); margin-top: 12px; line-height: 1.5; }

/* A one-line page notice above the tiles (programme off, free codes). */
.ins-banner { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 16px 20px; }
.ins-banner-icon { width: 42px; height: 42px; border-radius: 11px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 17px; background: rgba(23,175,165,0.12); color: var(--primary); }
.ins-banner-text { flex: 1; min-width: 220px; }
.ins-banner-title { font-family: 'Inter Tight', sans-serif; font-size: 15px; font-weight: 700; color: var(--text-1); letter-spacing: -0.01em; }
.data-card.ins-accent { border-color: var(--primary); }

/* Rows that open a slide panel (the portal's list → panel flow, as on Suppliers
   and Projects). The chevron says "there is more behind this row". */
.data-table tr.ins-click { cursor: pointer; transition: background-color 0.12s; }
.data-table tr.ins-click:hover { background: var(--row-hover, rgba(23,175,165,0.06)); }
.ins-chev, .data-table td.ins-chev, .data-table th.ins-chev { width: 28px; text-align: right; color: var(--text-3); font-size: 11px; }
.data-table tr.ins-click:hover td.ins-chev { color: var(--primary); }
button.stat-card.ins-tile-btn { font: inherit; color: inherit; text-align: center; cursor: pointer; width: 100%; transition: border-color 0.12s, box-shadow 0.12s; }
button.stat-card.ins-tile-btn:hover { border-color: var(--primary); }
.ins-tile-go { font-size: 11.5px; color: var(--primary); font-weight: 600; margin-top: 6px; }

/* Progress toward a reward, in a table cell or a panel. */
.ins-prog { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.ins-prog-track { flex: 1; height: 6px; border-radius: 3px; background: var(--bg-raised); overflow: hidden; }
.ins-prog-fill { height: 100%; border-radius: 3px; background: var(--primary); }
.ins-prog-txt { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }

/* Slide-panel content (inside createSourceDrawer's body). Same vocabulary as the
   supplier panel: mini stats, uppercase section titles with a count, row cards. */
.inp { padding: 18px 20px 28px; }
.inp-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.inp-top .inp-meta { flex: 1; min-width: 0; font-size: 12.5px; color: var(--text-3); }
.inp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-bottom: 20px; }
.inp-stat { background: var(--bg-raised); border: 1px solid var(--border); border-radius: 10px; padding: 11px 12px; }
.inp-stat-n { font-family: 'Inter Tight', 'Inter', sans-serif; font-size: 19px; font-weight: 800; letter-spacing: -0.02em; color: var(--text-1); line-height: 1.15; font-variant-numeric: tabular-nums; }
.inp-stat-l { font-size: 10.5px; font-weight: 600; color: var(--text-3); margin-top: 3px; }
.inp-sec { margin-bottom: 22px; }
.inp-sec-title { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-3); margin-bottom: 10px; }
.inp-count { background: var(--bg-raised); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; font-size: 10.5px; color: var(--text-2); letter-spacing: 0; }
.inp-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; margin-bottom: 7px; color: inherit; text-decoration: none; background: transparent; width: 100%; text-align: left; font: inherit; }
a.inp-row:hover, button.inp-row:hover { border-color: var(--border-2); box-shadow: var(--shadow-sm); cursor: pointer; }
.inp-row-main { flex: 1; min-width: 0; }
/* portal.css makes every .btn-primary full width under 480px, which crushed the
   reward name in a row down to one word per line. A button in a row stays its size. */
.inp-row .btn { width: auto; flex-shrink: 0; }
.inp-row-title { font-size: 13.5px; font-weight: 600; color: var(--text-1); }
.inp-row-sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.inp-row-right { text-align: right; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.inp-row-val { font-family: 'Inter Tight', 'Inter', sans-serif; font-size: 13.5px; font-weight: 700; color: var(--text-1); }
.inp-row-val.up { color: var(--primary); }
.inp-empty { padding: 14px; text-align: center; color: var(--text-3); font-size: 12.5px; border: 1px dashed var(--border); border-radius: 9px; }
.inp-callout { background: var(--bg-raised); border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 20px; }
.inp-callout-title { font-size: 13.5px; font-weight: 700; color: var(--text-1); margin-bottom: 4px; }
.inp-callout-sub { font-size: 12.5px; color: var(--text-3); line-height: 1.5; }
.inp-callout .btn { margin-top: 12px; }
.inp-form { display: grid; grid-template-columns: 110px 1fr auto; gap: 8px; align-items: center; }
.inp-in { width: 100%; padding: 9px 11px; border: 1px solid var(--border-2, var(--border)); border-radius: 8px; background: transparent; color: inherit; font-size: 13.5px; font-family: inherit; }
.inp-hint { font-size: 11.5px; color: var(--text-3); margin-top: 6px; line-height: 1.45; }
.inp-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; letter-spacing: 1px; }
.inp-loading { padding: 40px 20px; text-align: center; color: var(--text-3); font-size: 13px; }
@media (max-width: 480px) { .inp-form { grid-template-columns: 1fr; } }

/* Phone: four full-width tiles pushed every list a screen and a half down.
   Two across, tighter, and header buttons drop to their icons. */
@media (max-width: 480px) {
    .ins-page > .stats-row { grid-template-columns: 1fr 1fr; gap: 10px; }
    .ins-page .stat-card { padding: 14px 10px; }
    .ins-page .stat-icon { width: 34px; height: 34px; font-size: 14px; margin-bottom: 10px; }
    .ins-page .stat-value { font-size: 21px; }
    .ins-page .ins-note { font-size: 11px; }
    .ins-btn-label { display: none; }
    .ins-banner .btn { width: 100%; }
}
