/* Customer dashboard: notice, quick actions, eight flat stat tiles, panels and chart helpers (cdb- prefix). */

/* Stat tiles: flat solid colours, white text, line icon on the right, faint ring pattern. */
.cdb-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.cdb-stat { --bg: #ff7189; position: relative; overflow: hidden; display: flex; flex-direction: column; min-height: 118px; padding: 16px 70px 14px 18px; border-radius: 6px; background: var(--bg); color: #fff; box-shadow: 0 3px 10px rgba(18, 45, 72, .14); transition: transform .15s, box-shadow .15s; min-width: 0; }
.cdb-stat::before, .cdb-stat::after { content: ""; position: absolute; border-radius: 50%; border: 18px solid rgba(255, 255, 255, .09); pointer-events: none; }
.cdb-stat::before { width: 150px; height: 150px; right: -58px; top: -62px; }
.cdb-stat::after { width: 92px; height: 92px; right: 34px; bottom: -64px; border-width: 12px; border-color: rgba(255, 255, 255, .07); }
a.cdb-stat:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(18, 45, 72, .22); }
.cdb-stat small { font-size: 13px; font-weight: 700; letter-spacing: .01em; opacity: .97; }
.cdb-stat strong { font-size: 26px; line-height: 1.1; font-weight: 700; letter-spacing: -.02em; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cdb-stat em { font-style: normal; font-size: 12px; margin-top: auto; padding-top: 10px; opacity: .95; line-height: 1.35; }
.cdb-stat small, .cdb-stat strong, .cdb-stat em { position: relative; z-index: 1; text-shadow: 0 1px 1px rgba(0, 0, 0, .14); }
.cdb-stat .ico { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 34px; line-height: 1; opacity: .92; z-index: 1; }
.cdb-c1 { --bg: #f7657f; }   /* coral */
.cdb-c2 { --bg: #4a98f0; }   /* bright blue */
.cdb-c3 { --bg: #1fc1a7; }   /* turquoise */
.cdb-c4 { --bg: #f5a93b; }   /* amber */
.cdb-c5 { --bg: #8270ee; }   /* violet */
.cdb-c6 { --bg: #3d55c4; }   /* indigo */
.cdb-c7 { --bg: #26b07e; }   /* green */
.cdb-c8 { --bg: #ef6b4a; }   /* orange-red */
.cdb-c9 { --bg: #0e9aa7; }   /* teal */

/* Six-month totals under a chart */
.cdb-mini { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line2); }
.cdb-mini div { min-width: 0; background: var(--panel2); border: 1px solid #dde5ed; border-radius: 4px; padding: 7px 9px; }
.cdb-mini span { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cdb-mini b { display: block; font-size: 14.5px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cdb-mini b.in { color: #1a8a62; } .cdb-mini b.out { color: #d6455f; }

/* Chart row */
.cdb-charts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: stretch; }
.cdb-charts > .ct-panel { min-width: 0; display: flex; flex-direction: column; margin: 0; }
.cdb-charts > .ct-panel > .ct-pbody { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.cdb-chart .db-legend { justify-content: center; }
.cdb-vgrid { stroke-dasharray: 2 4; }
.cdb-rowlabel { font-weight: 700; fill: #3d5166; }
.cdb-track { fill: #eef3f8; }
.cdb-barval { font-weight: 700; fill: #2f4559; }
.cdb-barval.in { fill: #fff; }
.db-legend i.cdb-dash { height: 3px; width: 16px; border-radius: 0; background: repeating-linear-gradient(90deg, var(--c) 0 5px, transparent 5px 8px); }
.cdb-foot { margin: 0; font-size: 11.5px; color: var(--muted); }
.cdb-subhead { font-size: 11.5px; font-weight: 700; color: #3d5166; text-transform: uppercase; letter-spacing: .03em; margin-top: 4px; }
.cdb-page .db-hbars.thin .row { padding: 2px 0; }


.cdb-narrow { display: none; }

@media (max-width: 1100px) {
    .cdb-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cdb-charts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .cdb-charts > .ct-panel:last-child { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
    .cdb-wide { display: none; }
    .cdb-narrow { display: block; }
    .cdb-charts { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
    .cdb-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .cdb-stat { min-height: 96px; padding: 12px 12px 10px; }
    .cdb-stat strong { font-size: 18px; }
    .cdb-stat .ico { display: none; }
    .cdb-stat::before, .cdb-stat::after { display: none; }
    .cdb-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .cdb-note { flex-wrap: wrap; }
    .cdb-mini { grid-template-columns: minmax(0, 1fr); }
}


/* Notice above the tiles (identity check and similar). */
.cdb-note { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 6px; border: 1px solid var(--line); border-left: 4px solid #d99a06; background: var(--panel, #fff); min-width: 0; }
.cdb-note.info { border-left-color: #1a7fe0; } .cdb-note.bad { border-left-color: #d6334b; }
.cdb-note > i { font-size: 24px; color: var(--muted); flex: none; }
.cdb-note > div { flex: 1; min-width: 0; }
.cdb-note p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }

/* Quick actions */
.cdb-actions { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.cdb-actions a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel, #fff); color: var(--text); text-decoration: none; font-size: 12.5px; font-weight: 600; min-width: 0; text-align: center; }
.cdb-actions a:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.cdb-actions i { font-size: 20px; color: var(--brand-primary); }
.cdb-actions span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
@media (max-width: 900px) { .cdb-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Lists of decisions, documents and messages */
.cdb-list { list-style: none; margin: 0; padding: 0; }
.cdb-list li { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-top: 1px solid var(--line2); min-width: 0; }
.cdb-list li:first-child { border-top: 0; }
.cdb-list li > div { flex: 1; min-width: 0; }
.cdb-list li b, .cdb-list li small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cdb-list li small { font-size: 12px; color: var(--muted); }
.cdb-list li.unread b { color: var(--brand-primary); }
.cdb-list .ic { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #eef3f8; color: #5b6f84; }
.cdb-list .ic.ok { background: #e3f6ee; color: #12a079; } .cdb-list .ic.bad { background: #fde8eb; color: #d6334b; }
.cdb-list .ic.warn { background: #fdf3dc; color: #b07d05; } .cdb-list .ic.info { background: #e4f0ff; color: #1a7fe0; }
.cdb-list .st { flex: none; }

/* Identity and security checklist */
.cdb-checks { list-style: none; margin: 10px 0 0; padding: 0; }
.cdb-checks li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line2); font-size: 13px; }
.cdb-checks li:first-child { border-top: 0; }
.cdb-checks li span { flex: 1; min-width: 0; }
.cdb-checks li.ok i { color: #12a079; } .cdb-checks li.todo i { color: #b0bccb; }
.cdb-checks b { font-size: 12.5px; }

/* Tables on the customer dashboard */
.cdb-act .cdb-in { color: #1a8a62; font-weight: 700; }
.cdb-bal .sub, .cdb-act .sub { display: block; font-size: 12px; color: var(--muted); }
