/*
 * Analytics & Reports, Home, Dashboard, Scheduled Reports / Schedules (Phase 4).
 * Sizes measured from the 800px reference captures x 2.32 (PLAN.md §1).
 */

/* ---------------- Date range (036) ---------------- */
.daterange { display: inline-flex; align-items: center; gap: 4px; height: 36px; }
.daterange__preset { display: inline-flex; align-items: center; gap: 14px; white-space: nowrap; height: 26px; padding: 0 9px; border: 1px solid #D2D0CE; background: #fff; border-radius: 2px; color: var(--text-secondary); font-size: 14px; }
.daterange__preset svg.i { width: 9px; height: 9px; color: var(--text); }
.daterange__dates { border: 0; background: none; color: var(--text-secondary); font-size: 14px; padding: 0 4px 0 6px; display: inline-flex; gap: 8px; }
.daterange__cal { border: 0; background: none; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; color: var(--text); }
.daterange__cal svg.i { width: 19px; height: 19px; }
.daterange--boxed { background: #fff; padding: 0 12px 0 8px; height: 40px; }
.daterange__list { min-width: 196px; }
.daterange__pop .dropdown-list__item { padding: 9px 12px; font-size: 14px; }
.calrange { padding: 10px 14px 14px; background: #fff; }
.calrange__nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: -26px; position: relative; z-index: 1; }
.calrange__months { display: flex; gap: 26px; }
.calrange__title { text-align: center; font-weight: 600; font-size: 14px; height: 30px; line-height: 30px; }
.calrange__grid { display: grid; grid-template-columns: repeat(7, 36px); }
.calrange__dow { text-align: center; font-size: 12px; color: var(--text-secondary); height: 28px; line-height: 28px; }
.calrange__day { height: 34px; border: 0; background: none; font-size: 14px; color: var(--text); border-radius: 0; }
.calrange__day:hover { background: #EDEBE9; }
.calrange__day.is-in { background: #E2E2F6; }
.calrange__day.is-edge { background: var(--accent); color: #fff; }
.calrange__day.is-today { box-shadow: inset 0 0 0 1px var(--accent); }

/* ---------------- Charts ---------------- */
.chart { position: relative; width: 100%; height: 100%; min-height: 0; }
.chart__svg { display: block; overflow: visible; }
.chart__title { font-size: 17px; font-weight: 600; fill: var(--text); }
.chart__grid { stroke: #E1DFDD; stroke-width: 1; }
.chart__axis { stroke: #8A8886; stroke-width: 1; }
.chart__ylabel, .chart__xlabel { font-size: 12px; fill: #605E5C; }
.chart__legend { font-size: 13px; fill: #605E5C; }
.chart__line { fill: none; stroke-width: 2; }
.chart__dot { cursor: pointer; }
.chart__bar, .chart__slice { cursor: pointer; }
.chart__bar:hover, .chart__slice:hover { opacity: 0.85; }
.chart__center { fill: #C8C6C4; font-weight: 300; }
.chart__tip { position: absolute; z-index: 5; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,0.2); padding: 10px 14px; font-size: 12px; color: var(--text); pointer-events: none; white-space: nowrap; line-height: 17px; }
.chart__tip-value { font-weight: 700; font-size: 15px; margin-bottom: 2px; }
.nodata { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--text); font-weight: 600; font-size: 15px; }
.nodata svg.i { width: 20px; height: 20px; }
.nodata--inline { flex-direction: row; font-weight: 400; color: var(--text); }

/* ---------------- Report page layout (031, 038) ---------------- */
.page--report { height: auto; min-height: 100%; }
.page--report .page-header { flex: 0 0 auto; }
.report-chart { flex: 0 0 auto; padding: 0 0 4px; }
.report-body { flex: 1 0 auto; min-height: 420px; height: calc(100vh - var(--topbar-h) - var(--page-header-h) - 8px); }
.page--report:has(.report-chart) .report-body { height: calc(100vh - var(--topbar-h) - var(--page-header-h) - 470px); min-height: 420px; }
.report-extra { display: inline-flex; align-items: center; gap: 14px; margin-right: 18px; }
.report-picker { width: 362px; }
.report-picker .select__box { height: 34px; }
.report-picker--sm { width: 222px; }
.report-picker--sm .select__value { font-size: 13px; }
.grid__toolbar .daterange { margin-right: 2px; }
.cell-icon { display: inline-flex; color: var(--text); }
.cell-icon svg.i { width: 18px; height: 18px; }
tr.is-selected .cell-icon { color: #fff; }
.cell-icon--done { color: #237B4B; }
.cell-icon--missed { color: #C4314B; }
.cell-icon-btn { border: 0; background: none; color: var(--accent); width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 2px; }
.cell-icon-btn:hover:not(:disabled) { background: rgba(98,100,167,0.12); }
.cell-icon-btn:disabled { color: var(--text-muted); }
.cell-icon-btn svg.i { width: 18px; height: 18px; }
.tag-chip { display: inline-block; background: #EDEBE9; color: var(--text); padding: 1px 6px; margin-right: 4px; font-size: 14px; line-height: 20px; }
.mini-player { display: inline-flex; align-items: center; gap: 10px; width: 100%; cursor: pointer; }
.mini-player svg.i { width: 26px; height: 26px; color: var(--accent); background: #fff; border-radius: 50%; }
.mini-player__track { flex: 1; height: 3px; background: #D6D6D6; position: relative; border-radius: 2px; }
.mini-player__track span { position: absolute; left: 0; top: -5px; width: 13px; height: 13px; border-radius: 50%; background: var(--accent); }

/* Filters drawer (048) + applied-filter banner (049) */
.drawer.drawer--filters { width: 575px; background: #F3F2F1; border-bottom-color: var(--accent); }
.drawer--filters .drawer__header { padding: 34px 40px 12px 44px; }
.drawer--filters .drawer__title { font-size: 21px; }
.drawer--filters .drawer__body { padding: 8px 40px 20px 44px; }
.filters { display: flex; flex-direction: column; gap: 10px; }
.filters__row { display: flex; align-items: center; gap: 14px; background: #fff; padding: 10px 12px; min-height: 54px; }
.filters__label { width: 110px; flex: 0 0 110px; font-size: 14px; color: var(--text); }
.filters__control { flex: 1; min-width: 0; }
.filters__control .select__box { height: 32px; }
.filters__footer { display: flex; align-items: center; gap: 8px; width: 100%; }
.filters__share { width: 44px; padding: 0; justify-content: center; margin-left: auto; }
.filter-chips { display: flex; align-items: center; gap: 18px; background: #252423; color: #fff; min-height: 38px; padding: 0 12px; font-size: 14px; }
.filter-chips__chip { display: inline-flex; align-items: center; gap: 6px; }
.filter-chips__chip button, .filter-chips__clear { border: 0; background: none; color: #fff; display: inline-flex; align-items: center; gap: 6px; padding: 0; font-weight: 600; font-size: 14px; }
.filter-chips svg.i { width: 15px; height: 15px; }

/* Recordings expanded row (screenshots_2 #31) */
.rec-detail { display: grid; grid-template-columns: minmax(380px, 46%) 1fr; gap: 40px; padding: 18px 26px 18px 40px; align-items: center; background: #fff; }
.rec-detail__label { font-size: 14px; margin-bottom: 4px; }
.sentiment-strip { display: flex; flex-wrap: wrap; gap: 4px; padding: 10px; border: 1px solid #EDEBE9; min-height: 44px; }
.sentiment-strip__cell { width: 22px; height: 22px; border: 0; padding: 0; cursor: pointer; }
.sentiment-strip__cell.is-selected { outline: 2px solid #252423; outline-offset: 1px; }
.rec-detail__speaker, .rec-detail__phrase { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; }
.rec-detail__phrase svg.i { width: 20px; height: 20px; }
.avatar--contact { background: #8A8886; font-size: 10px; }
.handlers-mini { padding: 8px 26px 12px 92px; background: #FAF9F8; }
.handlers-mini .grid__table th, .handlers-mini .grid__table td { height: 34px; font-size: 13px; }

/* Interaction Details (042) */
.idet { padding-bottom: 24px; }
.idet__search { display: flex; align-items: center; gap: 26px; padding: 0 0 16px; border-bottom: 1px solid var(--border); }
.idet__search label { font-weight: 600; font-size: 14px; }
.idet__input { position: relative; width: 438px; }
.idet__input .input { height: 38px; width: 100%; padding-right: 36px; border-color: #E1DFDD; font-size: 14px; }
.idet__input .input-wrap__clear { position: absolute; right: 8px; top: 9px; border: 0; background: none; padding: 0; color: #605E5C; }
.idet__input .input-wrap__clear svg.i { width: 18px; height: 18px; }
.idet__facts { display: grid; grid-template-columns: 1fr 1fr 1fr; padding: 22px 0 16px; font-size: 14px; }
.idet__fact { height: 42px; }
.idet__fact b { font-weight: 600; }
.idet__link { color: var(--accent); }
.idet__tabs .tabs { margin-bottom: 18px; }
.idet__body { flex: 1; min-height: 480px; display: flex; flex-direction: column; }
.idet__body--split { flex-direction: row; gap: 22px; }
.idet__reclist { flex: 0 0 54%; display: flex; flex-direction: column; min-height: 480px; }
.idet__recview { flex: 1; background: #fff; padding: 22px 18px; min-height: 480px; overflow: auto; }
.idet__recbtns { display: flex; gap: 8px; margin-top: 14px; }
.transcript { margin-top: 26px; font-size: 14px; line-height: 22px; }
.transcript__line { display: grid; grid-template-columns: 74px 54px 1fr; }
.transcript__time { white-space: nowrap; }

/* Quality Management drawer (screenshots_2 #27) */
.drawer.drawer--qm { width: 1046px; background: #F3F2F1; }
.drawer--qm .drawer__header { padding: 44px 46px 8px; }
.drawer--qm .drawer__title { font-size: 27px; font-weight: 700; }
.drawer--qm .drawer__body { padding: 12px 46px 10px; }
.drawer--qm .drawer__footer { padding: 16px 46px 26px; }
.qm__player .aplayer { margin-bottom: 18px; }
.qm__cols { display: grid; grid-template-columns: 470px 1fr; gap: 24px; }
.qm__facts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; font-size: 15px; margin-bottom: 20px; }
.qm__facts b { font-weight: 600; }
.qm__wide { grid-column: 1 / -1; }
.qm__left .textarea { height: 418px !important; }
.qm__right { display: flex; flex-direction: column; min-height: 560px; }
.qm__right .tabs { background: #FAF9F8; }
.qm__tab-body { flex: 1; font-size: 15px; line-height: 21px; }
.qm__tab-body .transcript { margin-top: 0; }
.qm__summary { margin: 4px 0 0 4px; }
.qm__empty { color: var(--text-secondary); }
.qm__ai-note { align-self: flex-start; margin-top: 16px; border: 1px solid #F7D27E; background: #FFF9E8; color: #8A6100; font-size: 13px; padding: 3px 8px; }
.qm__footer { display: flex; gap: 14px; }
.tagbox { min-height: 38px; background: #fff; border: 1px solid #E1DFDD; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 4px 6px; cursor: text; }
.tagbox__chip { display: inline-flex; align-items: center; gap: 6px; background: #EDEBE9; padding: 3px 6px 3px 8px; font-size: 15px; }
.tagbox__chip button { border: 0; background: none; padding: 0; display: inline-flex; color: #605E5C; }
.tagbox__chip button svg.i { width: 11px; height: 11px; }
.tagbox__input { border: 0; outline: none; flex: 1; min-width: 80px; font-size: 14px; background: transparent; }
.tagbox--select { cursor: pointer; }
.tagbox__ph { color: var(--text-muted); font-size: 14px; padding-left: 4px; }

/* Agent Timeline (047-049, screenshots_2 #3) */
.timeline-page { min-height: calc(100vh - var(--topbar-h) - var(--page-header-h) - 8px); }
.timeline-page__bar { flex: 0 0 50px; }
.timeline-page__body { flex: 1; background: var(--page-bg); }
.timeline-empty { padding-top: 160px; text-align: center; font-weight: 700; color: #A19F9D; font-size: 26px; }
.timeline { position: relative; padding-top: 10px; user-select: none; }
.timeline__svg { display: block; }
.timeline__label { font-size: 12px; fill: #605E5C; }
.timeline__grid { stroke: #E1DFDD; }
.timeline__bar { cursor: pointer; }
.timeline__sel { fill: rgba(98,100,167,0.15); stroke: var(--accent); stroke-dasharray: 3 2; }
.timeline__tip-title { font-weight: 700; font-size: 17px; text-align: center; margin-bottom: 8px; }
.timeline__tip-v { font-weight: 700; font-size: 13px; }
.timeline__tip-v--big { font-size: 17px; }
.timeline__tip-k { font-size: 11px; margin-bottom: 6px; }

/* Wrapup Answers (050) */
.wrapup-top { background: #fff; margin-bottom: 0; }
.wrapup-top__bar { background: var(--band-bg); }
.wrapup-top__bar .icon-btn { width: 46px; }
.wrapup-top__chart { height: 280px; padding: 10px 20px; }

/* ---------------- Home / Dashboard (001, 002, 054-056) ---------------- */
.page--dash { height: auto; min-height: 100%; }
.header-ou { width: 227px; }
.header-ou .select__box { height: 40px; border-color: #fff; }
.btn-agent-panel { height: 34px; padding: 0 22px; font-weight: 600; }
.dash { padding-bottom: 24px; }
.dash--home { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; align-content: start; }
.dash--home .wcard { height: 494px; }
/* 002: the second row of cards is shorter than the first */
.dash--home .wcard:nth-child(n+3) { height: 285px; }
.dash__canvas { position: relative; }
.dash__canvas .wcard { position: absolute; }
.dash__canvas.is-editing .wcard__head { cursor: move; }
.wcard { background: #fff; display: flex; flex-direction: column; min-height: 0; }
.wcard__head { flex: 0 0 76px; display: flex; align-items: center; padding: 0 34px; border-bottom: 1px solid #EDEBE9; position: relative; }
.wcard__title { font-size: 19px; font-weight: 300; color: var(--text); }
.wcard__body { flex: 1; min-height: 0; padding: 18px 24px; position: relative; overflow: hidden; }
.wcard__filtered { position: absolute; right: 16px; top: 14px; color: #605E5C; }
.wcard__filtered svg.i { width: 15px; height: 15px; }
.wcard__tools { position: absolute; right: -2px; top: -12px; display: flex; z-index: 3; }
.wcard__tool { width: 26px; height: 22px; border: 0; color: #fff; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.wcard__tool svg.i { width: 13px; height: 13px; }
.wcard__tool--edit { background: #FFB822; color: #111; }
.wcard__tool--del { background: #F4516C; }
.wcard__resize { position: absolute; right: 0; bottom: 0; width: 16px; height: 16px; cursor: nwse-resize; background: linear-gradient(135deg, transparent 50%, #A19F9D 50%, #A19F9D 60%, transparent 60%, transparent 75%, #A19F9D 75%, #A19F9D 85%, transparent 85%); }
.wcard.is-dragging { opacity: 0.85; box-shadow: 0 6px 24px rgba(0,0,0,0.2); z-index: 10; }
.dash__actions { position: fixed; right: 18px; bottom: 14px; background: rgba(210,210,210,0.85); padding: 14px 16px; display: flex; gap: 14px; z-index: 50; border-radius: 4px; }
.btn-warning { background: #FFB822; color: #111; border-color: #FFB822; }
.btn-warning:hover { background: #F4AA00; }
.btn-danger { background: #F4516C; color: #fff; border-color: #F4516C; }
.btn-danger:hover { background: #E8384F; }
.btn-success { background: #34BFA3; color: #fff; border-color: #34BFA3; }
.btn-success:hover { background: #2CA189; }
.dash__gear svg.i { width: 20px; height: 20px; }
.leaderboard { height: 100%; overflow: auto; }
.leaderboard .grid__table th { height: 40px; }
.leaderboard .grid__table td { height: 62px; font-size: 16px; }
.leaderboard__trophy { color: #EAA300; margin-left: 30px; vertical-align: -3px; }
.leaderboard__trophy svg.i { width: 18px; height: 18px; }
.wgrid { height: 100%; overflow: auto; }
.wgrid .grid__table th { background: var(--band-bg); }
.wgrid__foot td { font-weight: 600; color: var(--text-secondary); border-top: 1px solid var(--grid-line); height: 46px; }
.agent-blocks { display: flex; flex-wrap: wrap; gap: 3px; height: 100%; align-content: stretch; }
.agent-blocks__b { flex-basis: 110px; min-height: 60px; color: #fff; padding: 8px 10px; display: flex; flex-direction: column; justify-content: space-between; font-size: 13px; cursor: default; }
.agent-blocks__b b { font-size: 20px; font-weight: 600; }
.wfilters { display: flex; flex-direction: column; gap: 4px; min-width: 520px; }
.wfilters > .check { margin-bottom: 8px; }

/* ---------------- Schedules / Scheduled Reports (095-097) ---------------- */
/* These two editors sit a little further in and a little narrower than other edit pages */
.sr-form { max-width: 763px; padding: 18px 0 0 18px; }
.sr-form > .check { display: flex; margin: 2px 0 20px; }
.sched__summary { margin: 2px 0 14px; font-size: 14px; }
.sched__tabs { display: flex; border-top: 1px solid var(--border); padding-top: 8px; }
.sched__tab { flex: 1; height: 40px; border: 0; background: none; font-weight: 600; color: #8A8886; font-size: 14px; border-bottom: 2px solid transparent; }
.sched__tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.sched__pane { min-height: 236px; padding-top: 12px; }
.sched__row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 14px; flex-wrap: wrap; }
.sched__row .select { width: 160px; }
.sched__days .check { margin-right: 6px; }
.sched__label { min-width: 52px; }
.sched__next { border-top: 1px solid var(--border); }
.sched__next-title { font-weight: 600; font-size: 14px; padding: 12px 6px; border-bottom: 1px solid var(--border); }
.sched__next-item { padding: 12px 6px; border-bottom: 1px solid var(--border); font-size: 14px; }
.report-params { margin-top: 10px; padding-top: 6px; border-top: 1px solid var(--border); }
.report-params__title { font-weight: 600; margin: 8px 0 12px; }
