/* ==========================================================================
   Reports (staff, rp-) and customer Insights (ins-)
   ========================================================================== */

/* ---- Shared page bits ---- */
.rp-page { min-width: 0; }
.rp-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.rp-crumbs i { font-size: 10px; }
.rp-crumbs span { color: var(--text); font-weight: 700; }
.rp-small { font-size: 11.5px; margin: 6px 0 0; }
.rp-neg { color: var(--badFg) !important; }
.rp-live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--okFg); background: var(--okBg); border-radius: 14px; padding: 5px 11px; align-self: center; }

/* ---- Export dropdown ---- */
.rp-menu { position: relative; display: inline-block; }
.rp-menu > summary { list-style: none; cursor: pointer; }
.rp-menu > summary::-webkit-details-marker { display: none; }
.rp-menu .drop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; width: 290px; max-width: calc(100vw - 24px); background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 14px 34px color-mix(in srgb, var(--brand-navy) 18%, transparent); padding: 6px; }
.rp-menu .drop a { display: flex; gap: 11px; align-items: flex-start; padding: 9px 10px; border-radius: 6px; color: var(--text); }
.rp-menu .drop a:hover { background: #f1f6fc; }
.rp-menu .drop i { font-size: 19px; color: var(--blue); margin-top: 1px; }
.rp-menu .drop span { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.rp-menu .drop b { display: block; font-size: 13px; color: var(--text); }

/* ---- Filters ---- */
.rp-filters { display: flex; flex-direction: column; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; box-shadow: var(--shadow); border-top: 3px solid var(--navy2); }
.rp-quick { align-self: flex-start; max-width: 100%; }
.rp-quick a.on { background: var(--navy2); color: #fff; }
.rp-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; }
.rp-f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rp-f > span { font-size: 11px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: .04em; }
.rp-f .ct-input { min-width: 140px; max-width: 100%; }

/* ---- Saved views and schedule popovers ---- */
.rp-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.rp-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; min-width: 0; }
.rp-presets .lbl { font-weight: 700; color: var(--text2); margin-right: 2px; }
.rp-chip { display: inline-flex; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; max-width: 100%; }
.rp-chip a { padding: 4px 4px 4px 11px; font-weight: 700; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.rp-chip a.on { color: var(--blue); }
.rp-chip form { margin: 0; }
.rp-chip button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 4px 8px 4px 4px; font-size: 14px; line-height: 1; }
.rp-chip button:hover { color: var(--badFg); }
.rp-act-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.rp-pop { position: relative; }
.rp-pop > summary { list-style: none; cursor: pointer; }
.rp-pop > summary::-webkit-details-marker { display: none; }
.rp-popbody { position: absolute; left: 0; top: calc(100% + 6px); z-index: 40; width: 340px; max-width: calc(100vw - 24px); background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 14px 34px color-mix(in srgb, var(--brand-navy) 18%, transparent); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.rp-pop.right .rp-popbody { left: auto; right: 0; width: 420px; }
.rp-popbody .ct-row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rp-recips { border: 1px solid var(--line2); border-radius: 6px; padding: 8px 10px; margin: 0; max-height: 180px; overflow: auto; }
.rp-recips legend { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text2); padding: 0 4px; }
.rp-recips label { display: flex; align-items: center; gap: 6px; padding: 3px 0; font-size: 12.5px; }
.rp-recips small { margin-left: auto; }

/* ---- KPIs, charts, tables ---- */
.rp-kpis { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.rp-charts .ct-panel { margin: 0; height: 100%; }
.rp-chartpanel .ct-pbody { min-height: 120px; }
.rp-chartpanel svg { max-width: 100%; height: auto; }
.rp-zero { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4px; min-height: 160px; padding: 18px; color: var(--text2); background: repeating-linear-gradient(135deg, #f8fafc, #f8fafc 10px, #f3f6fa 10px, #f3f6fa 20px); border: 1px dashed #c9d5e1; border-radius: 6px; }
.rp-zero i { font-size: 26px; color: #8aa0b6; }
.rp-zero b { font-size: 13.5px; color: var(--text); }
.rp-zero span { font-size: 12px; color: var(--muted); max-width: 420px; }
.rp-tablepanel { margin: 0; }
.rp-tbl td .sub, .rp-tbl th .sub { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }
.rp-tbl td.wrap { white-space: normal; min-width: 180px; }
.rp-tbl tr.rp-section td { background: #f4f1e8; color: #6d5a26; font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.rp-tbl tfoot td { font-weight: 700; }
.rp-tbl .rp-zerorow td { white-space: normal; text-align: center; padding: 26px 14px; color: var(--text2); background: #fafcfe; }
.rp-tbl .rp-zerorow i { font-size: 18px; color: #8aa0b6; margin-right: 4px; vertical-align: -2px; }
.rp-tbl .rp-zerorow span { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.rp-rowacts { display: flex; gap: 4px; justify-content: flex-end; }
.rp-rowacts form { margin: 0; }
.rp-foot { background: #fff; border: 1px solid var(--line2); border-radius: 6px; padding: 12px 14px; font-size: 12px; color: var(--text2); }
.rp-foot p { margin: 0 0 6px; }
.rp-foot p:last-child { margin: 0; }
.rp-foot i { color: var(--blue); }
.rp-related { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.rp-related span { font-weight: 700; }
.rp-related a { font-weight: 700; }
.rp-related a i { font-size: 10px; }

/* ---- Catalogue ---- */
.rp-search { display: flex; flex-direction: column; gap: 10px; background: linear-gradient(120deg, var(--navy) 0%, #0d3266 100%); border-radius: 8px; padding: 18px; box-shadow: 0 6px 20px color-mix(in srgb, var(--brand-navy) 16%, transparent); }
.rp-searchbox { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 6px; padding: 0 14px; min-height: 46px; }
.rp-searchbox i { color: var(--muted); font-size: 16px; }
.rp-searchbox input { flex: 1; min-width: 0; border: 0; outline: 0; font: 15px var(--fb); color: var(--text); background: none; padding: 10px 0; }
.rp-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.rp-cats a { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: #dbe7f6; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); border-radius: 16px; padding: 5px 11px; }
.rp-cats a:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.rp-cats b { background: rgba(255, 255, 255, .16); border-radius: 9px; padding: 0 6px; font-size: 11px; }
.rp-group { scroll-margin-top: 80px; }
.rp-group > header { display: flex; align-items: center; gap: 12px; margin: 6px 0 10px; }
.rp-group > header .ic { width: 38px; height: 38px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--navy2); color: #e3c77d; font-size: 18px; }
.rp-group > header h2 { font-size: 17px; margin: 0; }
.rp-group > header p { margin: 1px 0 0; font-size: 12px; color: var(--muted); }
.rp-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
.rp-item { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s, transform .15s; min-width: 0; }
.rp-item:hover { border-color: #8db8e6; box-shadow: 0 8px 22px color-mix(in srgb, var(--brand-navy) 12%, transparent); transform: translateY(-1px); }
.rp-item-main { display: flex; gap: 12px; padding: 14px; color: var(--text); flex: 1; }
.rp-item-main:hover { color: var(--text); }
.rp-item-main .ic { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; background: #e8f1fc; color: var(--blue); font-size: 16px; }
.rp-item-main .tx { min-width: 0; }
.rp-item-main b { display: block; font-size: 14px; margin-bottom: 3px; }
.rp-item-main .tx > span { font-size: 12px; color: var(--muted); line-height: 1.4; }
.rp-item-acts { display: flex; align-items: center; gap: 4px; border-top: 1px solid var(--line2); padding: 6px 10px; background: #fafcfe; border-radius: 0 0 8px 8px; flex-wrap: wrap; }
.rp-item-acts .mode { font-size: 11px; color: var(--muted); font-weight: 700; margin-right: auto; }
.rp-item-acts a { font-size: 11.5px; font-weight: 700; padding: 3px 7px; border-radius: 4px; color: var(--text2); }
.rp-item-acts a:hover { background: #eaf2fb; color: var(--blue); }
.rp-mini { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line2); color: var(--text); }
.rp-mini:last-child { border-bottom: 0; }
.rp-mini > i:first-child { color: var(--blue); font-size: 16px; }
.rp-mini span { flex: 1; min-width: 0; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-mini b { display: block; color: var(--text); font-size: 13px; }
.rp-modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.rp-modules a { display: flex; gap: 10px; padding: 10px; border: 1px solid var(--line2); border-radius: 6px; color: var(--text); }
.rp-modules a:hover { border-color: #8db8e6; background: #f7fbff; }
.rp-modules i { font-size: 18px; color: var(--blue); }
.rp-modules span { font-size: 12px; color: var(--muted); }
.rp-modules b { display: block; font-size: 13px; color: var(--text); }

@media (max-width: 700px) {
    .rp-form { display: grid; grid-template-columns: 1fr 1fr; }
    .rp-f .ct-input { min-width: 0; width: 100%; }
    .rp-form .ct-btn { justify-content: center; }
    .rp-actions { flex-direction: column; align-items: stretch; }
    .rp-pop.right .rp-popbody, .rp-popbody { position: fixed; left: 12px; right: 12px; top: 70px; width: auto; max-height: calc(100vh - 90px); overflow: auto; }
    .rp-popbody .ct-row.two { grid-template-columns: 1fr; }
    .rp-items { grid-template-columns: 1fr; }
    .rp-search { padding: 12px; }
    .rp-quick { display: flex; width: 100%; }
    .rp-quick a { flex: 1 1 30%; justify-content: center; }
}

/* ==========================================================================
   Customer Insights (ins-)
   ========================================================================== */
.ins-tabs { display: flex; gap: 4px; overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 4px; box-shadow: var(--shadow); scrollbar-width: none; }
.ins-tabs::-webkit-scrollbar { display: none; }
.ins-tabs a { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 6px; font-weight: 700; font-size: 13px; color: var(--text2); white-space: nowrap; }
.ins-tabs a:hover { background: #f1f6fc; }
.ins-tabs a.on { background: var(--navy2); color: #fff; }
.ins-bar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px; }
.ins-bar .rp-form { flex: 1; }
.ins-export { display: flex; gap: 6px; flex-wrap: wrap; }
.ins-period { font-size: 12.5px; color: var(--text2); }
.ins-period b { color: var(--text); }
.ins-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 10px; align-items: stretch; }
.ins-grid > * { min-width: 0; margin: 0; }
.ins-8 { grid-column: span 8; } .ins-6 { grid-column: span 6; } .ins-4 { grid-column: span 4; } .ins-12 { grid-column: span 12; }
.ins-grid .ct-panel { height: 100%; }
.ins-grid svg { max-width: 100%; height: auto; }
.ins-list { list-style: none; margin: 0; padding: 0; }
.ins-list li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line2); min-width: 0; }
.ins-list li:last-child { border-bottom: 0; }
.ins-list .dot { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 15px; color: #fff; background: var(--c, #4a98f0); }
.ins-list .tx { flex: 1; min-width: 0; }
.ins-list .tx b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ins-list .tx span { display: block; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ins-list .amt { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 13px; }
.ins-list .amt small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
.ins-meter { height: 6px; background: #eef3f8; border-radius: 3px; overflow: hidden; margin-top: 5px; }
.ins-meter i { display: block; height: 100%; background: var(--c, #4a98f0); border-radius: 3px; }
.ins-zero { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4px; padding: 22px 14px; min-height: 150px; border: 1px dashed #c9d5e1; border-radius: 6px; background: #fafcfe; color: var(--text2); }
.ins-zero i { font-size: 24px; color: #8aa0b6; }
.ins-zero b { font-size: 13.5px; color: var(--text); }
.ins-zero span { font-size: 12px; color: var(--muted); max-width: 380px; }
.ins-tbl td.wrap { white-space: normal; }
.ins-up { color: #1a8a62; } .ins-down { color: #d6455f; }
.ins-hero { position: relative; overflow: hidden; border-radius: 10px; padding: 26px 26px 22px; color: #fff; background: radial-gradient(circle at 85% 10%, rgba(227, 199, 125, .35), transparent 40%), linear-gradient(125deg, var(--brand-navy) 0%, #0b2f61 55%, #134b8f 100%); box-shadow: 0 10px 28px color-mix(in srgb, var(--brand-navy) 25%, transparent); }
.ins-hero small { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #e3c77d; font-weight: 700; }
.ins-hero h2 { color: #fff; font: 700 30px/1.15 var(--fd); margin: 6px 0 4px; }
.ins-hero p { margin: 0; color: #c9d7ea; font-size: 13.5px; max-width: 640px; }
.ins-hero .yrs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.ins-hero .yrs a { color: #dbe7f6; border: 1px solid rgba(255, 255, 255, .25); border-radius: 14px; padding: 3px 11px; font-size: 12px; font-weight: 700; }
.ins-hero .yrs a.on { background: #e3c77d; border-color: #e3c77d; color: var(--brand-navy); }
.ins-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ins-fact { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px; box-shadow: var(--shadow); min-width: 0; }
.ins-fact i { font-size: 20px; color: var(--blue); }
.ins-fact b { display: block; font-size: 18px; margin: 6px 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ins-fact span { font-size: 12px; color: var(--muted); }
.ins-cal li .when { width: 50px; flex: none; text-align: center; border-radius: 6px; background: #eef4fb; padding: 4px 0; line-height: 1.1; }
.ins-cal li .when b { display: block; font-size: 16px; color: var(--navy2); }
.ins-cal li .when span { font-size: 10.5px; text-transform: uppercase; color: var(--muted); font-weight: 700; }

@media (max-width: 1100px) {
    .ins-8, .ins-6, .ins-4 { grid-column: span 12; }
    .ins-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .ins-hero { padding: 20px 16px; }
    .ins-hero h2 { font-size: 24px; }
    .ins-facts { grid-template-columns: 1fr 1fr; }
    .ins-fact b { font-size: 15px; }
    .ins-bar { flex-direction: column; align-items: stretch; }
}
