/* ===========================================================================
   Closed jobs trend popup (Jobs page → click a "closed jobs" card).
   =========================================================================== */

.ct-overlay {
    position: fixed; inset: 0; z-index: 3000; background: rgba(28, 20, 22, .5);
    display: flex; align-items: center; justify-content: center; padding: 24px;
    animation: ct-fade .16s ease-out;
}
@keyframes ct-fade { from { opacity: 0; } to { opacity: 1; } }

.ct-dialog {
    width: 100%; max-width: 1180px; max-height: 94vh; background: #fff; border-radius: 18px; overflow: hidden;
    display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
}

/* header */
.ct-top {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    background: var(--primary-color); color: #fff; padding: 16px 28px;
}
.ct-eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .06em; opacity: .75; }
.ct-title { margin: 3px 0 0; font-size: 1.45rem; font-weight: 800; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ct-chip { font-size: .8rem; font-weight: 700; background: rgba(255, 255, 255, .22); border-radius: 999px; padding: 3px 12px; }
.ct-close {
    display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; cursor: pointer;
    background: rgba(255, 255, 255, .12); color: #fff; border: 1px solid rgba(255, 255, 255, .45);
    border-radius: 12px; padding: 10px 18px; font-size: 1rem; font-weight: 600; font-family: inherit;
}
.ct-close:hover { background: rgba(255, 255, 255, .22); }
.ct-close .material-symbols-rounded { font-size: 20px; }

/* period / chart-type controls */
.ct-controls { padding: 14px 28px 12px; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 36px; background: #fff; }
.ct-group__label { font-size: .72rem; font-weight: 700; letter-spacing: .05em; color: #6b5f63; margin-bottom: 7px; }
.ct-controls .bud-tabs { flex-wrap: wrap; }
.ct-type-ico { font-size: 18px !important; }

/* chart + summary tiles */
.ct-body { padding: 14px 28px 20px; overflow-y: auto; background: #f6f4f2; border-top: 1px solid #ECE6E2; }
.ct-chart { background: #fff; border: 1px solid #e9e4e1; border-radius: 18px; padding: 10px 12px 6px; }
/* Fit the chart on screen: it never grows taller than the room left under the header, switches and tiles
   (the SVG keeps its proportions and is centred), but never gets squashed below a readable size. */
.ct-svg { display: block; width: 100%; height: auto; max-height: clamp(220px, calc(100vh - 400px), 420px); }
.ct-empty { padding: 60px 0; text-align: center; color: #8a8f99; }

.ct-grid { stroke: #e7e3e0; stroke-width: 1; stroke-dasharray: 4 5; }
.ct-axis { font-size: 14px; fill: #8a8f99; font-family: inherit; }
.ct-axis--cat { font-size: 15px; fill: #4b4145; }
.ct-val { font-size: 15px; font-weight: 700; fill: #1c1416; font-family: inherit; }
.ct-bar { fill: #0F7A4A; }
.ct-line { fill: none; stroke: #0F7A4A; stroke-width: 3.5; stroke-linejoin: round; stroke-linecap: round; }
.ct-dot { fill: #fff; stroke: #0F7A4A; stroke-width: 3; }

.ct-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.ct-tile { background: #fff; border: 1px solid #e9e4e1; border-radius: 14px; padding: 10px 16px 12px; }
.ct-tile__label { font-size: .72rem; font-weight: 700; letter-spacing: .05em; color: #6b5f63; }
.ct-tile__value { font-size: 1.7rem; font-weight: 800; color: #1c1416; line-height: 1.15; margin-top: 4px; }
.ct-tile__value.is-good { color: #0D6A40; }
.ct-tile__value.is-bad { color: #B42318; }
.ct-tile__note { font-size: .78rem; color: #8a8f99; margin-top: 3px; }

@media (max-width: 760px) {
    .ct-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ct-top, .ct-controls, .ct-body { padding-left: 16px; padding-right: 16px; }
    .ct-title { font-size: 1.15rem; }
}

.ct-spin { display: inline-block; width: 16px; height: 16px; margin-right: 10px; vertical-align: -3px; border: 2px solid #e1d6d9; border-top-color: var(--primary-color); border-radius: 50%; animation: ct-rot .8s linear infinite; }
@keyframes ct-rot { to { transform: rotate(360deg); } }
