.page { display: none; }
.page.active { display: block; }

:root {
  --bg:         #0f1117;
  --surface:    #161b27;
  --surface2:   #1e2535;
  --surface3:   #242d40;
  --border:     rgba(255,255,255,0.07);
  --border2:    rgba(255,255,255,0.13);
  --text:       #e8eaf0;
  --muted:      #6b7280;
  --muted2:     #9ca3af;
  --accent:     #6366f1;
  --accent-dim: rgba(99,102,241,0.12);
  --green:      #22c55e;
  --yellow:     #eab308;
  --red:        #ef4444;
  --green-dim:  rgba(34,197,94,0.12);
  --yellow-dim: rgba(234,179,8,0.12);
  --red-dim:    rgba(239,68,68,0.12);
  --gray-dim:   rgba(107,114,128,0.15);
  --r:          12px;
  --r-sm:       8px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text);
  min-height: 100vh; display: flex; font-size: 14px; line-height: 1.5;
}

/* SIDEBAR */
.sidebar {
  width: 220px; min-height: 100vh; background: var(--surface);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  padding: 20px 12px; position: fixed; top: 0; left: 0; bottom: 0; z-index: 10;
}
.logo { display: flex; align-items: center; gap: 10px; padding: 8px 12px 20px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.logo-icon { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: white; }
.logo-name { font-size: 13px; font-weight: 600; letter-spacing: -0.2px; }
.logo-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.nav-label { font-size: 10px; font-weight: 600; color: var(--muted); letter-spacing: 0.8px; text-transform: uppercase; padding: 0 12px; margin-bottom: 6px; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 8px 12px; border-radius: var(--r-sm); color: var(--muted2); font-size: 13px; cursor: pointer; transition: all 0.15s; margin-bottom: 2px; text-decoration: none; }
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: var(--accent-dim); color: #a5b4fc; font-weight: 500; }
.nav-item svg { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.7; }
.nav-item.active svg { opacity: 1; }
.nav-section { margin-top: 20px; }
.sidebar-footer { margin-top: auto; padding: 12px; border-top: 1px solid var(--border); }
.user-chip { display: flex; align-items: center; gap: 9px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #8b5cf6); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: white; flex-shrink: 0; }
.user-info-name { font-size: 12px; font-weight: 500; }
.user-info-role { font-size: 11px; color: var(--muted); }

/* MAIN LAYOUT */
.main { margin-left: 220px; flex: 1; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; padding: 14px 28px; border-bottom: 1px solid var(--border); background: var(--bg); position: sticky; top: 0; z-index: 9; gap: 12px; }
.topbar-title { font-size: 15px; font-weight: 600; flex: 1; }
.topbar-title span { color: var(--muted); font-weight: 400; }
.content { padding: 24px 28px; }

/* DATE PILLS */
.date-pills { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 3px; }
.date-pill { padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 500; color: var(--muted2); cursor: pointer; transition: all 0.15s; }
.date-pill.active { background: var(--surface2); color: var(--text); }
.date-custom { display: flex; align-items: center; gap: 7px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 6px 12px; font-size: 12px; color: var(--muted2); cursor: pointer; transition: all 0.15s; position: relative; }
.date-custom:hover { border-color: var(--border2); }
.date-custom svg { width: 14px; height: 14px; }

/* MANAGER PILLS */
.manager-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.manager-label { font-size: 12px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.manager-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.manager-pill { display: flex; align-items: center; gap: 7px; padding: 5px 12px 5px 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 100px; font-size: 12px; color: var(--muted2); cursor: pointer; transition: all 0.15s; text-decoration: none; }
.manager-pill:hover { border-color: var(--border2); color: var(--text); }
.manager-pill.active { background: var(--accent-dim); border-color: rgba(99,102,241,0.4); color: #a5b4fc; }
.pill-avatar { width: 20px; height: 20px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #8b5cf6); display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; color: white; }

/* SCORE BLOCKS (Manager Tab) */
.score-blocks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }
.score-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 20px; position: relative; overflow: hidden; transition: all 0.2s; cursor: pointer; }
.score-block::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.score-block.sales::before { background: linear-gradient(90deg, #6366f1, #8b5cf6); }
.score-block.second::before { background: linear-gradient(90deg, #eab308, #f59e0b); }
.score-block.followup::before { background: linear-gradient(90deg, #6b7280, #9ca3af); }
.score-block:hover { transform: translateY(-2px); border-color: var(--border2); }
.score-block.active { border-color: rgba(99,102,241,0.5); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
.sb-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.sb-type { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.sb-verdict { display: flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 100px; font-size: 11px; font-weight: 600; }
.verdict-dot { width: 5px; height: 5px; border-radius: 50%; }
.sb-score-row { display: flex; align-items: baseline; gap: 5px; margin-bottom: 4px; }
.sb-score-big { font-size: 40px; font-weight: 300; font-family: 'DM Mono', monospace; letter-spacing: -2px; line-height: 1; }
.sb-score-max { font-size: 16px; color: var(--muted); font-family: 'DM Mono', monospace; }
.sb-calls { font-size: 12px; color: var(--muted2); margin-bottom: 14px; }
.sb-bar-wrap { background: var(--surface2); border-radius: 100px; height: 5px; margin-bottom: 8px; overflow: hidden; }
.sb-bar { height: 100%; border-radius: 100px; transition: width 0.8s cubic-bezier(.16,1,.3,1); }
.bar-accent { background: linear-gradient(90deg, #6366f1, #8b5cf6); }
.bar-yellow2 { background: linear-gradient(90deg, #eab308, #f59e0b); }
.bar-gray { background: linear-gradient(90deg, #6b7280, #9ca3af); }
.sb-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.sb-meet { display: flex; align-items: center; gap: 4px; margin-top: 10px; font-size: 12px; color: var(--muted2); }
.sb-meet strong { color: var(--text); }

/* --- SUMMARY SPECIFIC STYLES --- */

/* TYPE CARDS (Summary Tab) */
.type-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }
.type-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 20px; position: relative; overflow: hidden; cursor: pointer; transition: all 0.2s; }
.type-card:hover { border-color: var(--border2); transform: translateY(-2px); }
.type-card.active { border-color: rgba(99,102,241,0.5); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
.type-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.type-card.sales::before { background: linear-gradient(90deg, #6366f1, #8b5cf6); }
.type-card.second::before { background: linear-gradient(90deg, #eab308, #f59e0b); }
.type-card.followup::before { background: linear-gradient(90deg, #6b7280, #9ca3af); }
.tc-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.tc-name { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.tc-badge { padding: 2px 8px; border-radius: 100px; font-size: 11px; font-weight: 600; }
.tc-score { font-size: 32px; font-weight: 300; font-family: 'DM Mono', monospace; letter-spacing: -1px; line-height: 1; color: var(--text); }
.tc-max { font-size: 14px; color: var(--muted); }
.tc-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 10px; }

/* CHART */
.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 20px; margin-bottom: 24px; }
.chart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.chart-title { font-size: 13px; font-weight: 600; color: var(--text); }
.chart-legend { display: flex; gap: 14px; }
.legend-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted2); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.chart-area { height: 300px; position: relative; }

/* RANKING TABLE */
.ranking-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; margin-bottom: 24px; }
.ranking-header { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.ranking-title { font-size: 13px; font-weight: 600; }
.ranking-table { width: 100%; border-collapse: collapse; }
.ranking-table th { text-align: left; padding: 10px 20px; font-size: 10px; font-weight: 600; color: var(--muted); letter-spacing: 0.5px; text-transform: uppercase; border-bottom: 1px solid var(--border); background: rgba(255,255,255,0.01); cursor: pointer; transition: color 0.15s; }
.ranking-table th:hover { color: var(--text); }
.ranking-table td { padding: 12px 20px; font-size: 13px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.ranking-table tr.data-row { cursor: pointer; transition: background 0.1s; }
.ranking-table tr.data-row:hover td { background: rgba(255,255,255,0.02); }
.rank-num { font-family: 'DM Mono', monospace; font-size: 12px; color: var(--muted); font-weight: 600; }
.rank-name { font-weight: 500; color: var(--text); }
.rank-score { font-family: 'DM Mono', monospace; font-size: 14px; font-weight: 600; }
.rank-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 5px; font-size: 11px; font-weight: 600; }

/* MODULES STATS (Summary) */
.modules-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 24px; }
.mod-stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; }
.mod-stat-name { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 8px; }
.mod-stat-score { font-size: 28px; font-weight: 300; font-family: 'DM Mono', monospace; letter-spacing: -1px; line-height: 1; color: var(--text); }
.mod-stat-max { font-size: 13px; color: var(--muted); }
.mod-stat-bar-wrap { background: var(--surface2); border-radius: 100px; height: 4px; margin-top: 10px; overflow: hidden; }
.mod-stat-bar { height: 100%; border-radius: 100px; }
.bar-green { background: var(--green); }
.bar-yellow { background: var(--yellow); }
.bar-red { background: var(--red); }

/* PROBLEM ZONES */
.problem-zones { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 24px; }
.problem-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; cursor: pointer; transition: all 0.15s; }
.problem-card:hover { border-color: var(--border2); transform: translateY(-1px); }
.problem-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.problem-name { font-size: 13px; font-weight: 600; color: var(--text); }
.problem-icon { font-size: 18px; }
.problem-score { font-size: 22px; font-weight: 300; font-family: 'DM Mono', monospace; color: var(--red); }
.problem-desc { font-size: 11px; color: var(--muted2); line-height: 1.6; }
.problem-managers { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 11px; color: var(--muted); }

/* HEATMAP */
.heatmap-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 20px; margin-bottom: 24px; }
.heatmap-desc { font-size: 12px; color: var(--muted2); margin-bottom: 16px; line-height: 1.6; }
.heatmap-table { width: 100%; border-collapse: collapse; }
.heatmap-table th { text-align: left; padding: 10px 16px; font-size: 10px; font-weight: 600; color: var(--muted); letter-spacing: 0.5px; text-transform: uppercase; border-bottom: 1px solid var(--border); background: rgba(255,255,255,0.01); }
.heatmap-table th:first-child { text-align: left; }
.heatmap-table th:not(:first-child) { text-align: center; }
.heatmap-table td { padding: 10px 16px; font-size: 13px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.heatmap-table td:first-child { font-weight: 500; color: var(--text); }
.heatmap-table td:not(:first-child) { text-align: center; }
.heatmap-cell { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.hm-val { font-family: 'DM Mono', monospace; font-size: 12px; color: var(--text); }
.hm-bar-wrap { width: 60px; height: 4px; background: rgba(255,255,255,0.05); border-radius: 100px; overflow: hidden; }
.hm-bar { height: 100%; background: var(--accent); border-radius: 100px; transition: width 0.5s ease; }
/* --- END SUMMARY --- */

/* COMMON MODULES GRID & CARD */
.section-label { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 0.6px; text-transform: uppercase; margin-bottom: 12px; }
.modules-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 24px; }
.mod-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; cursor: pointer; transition: all 0.2s; position: relative; }
.mod-card:hover { border-color: var(--border2); transform: translateY(-1px); }
.mod-card.expanded { border-color: rgba(99,102,241,0.4); border-bottom-left-radius: 0; border-bottom-right-radius: 0; }

.mod-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.mod-name { font-size: 13px; font-weight: 500; color: var(--text); }
.mod-chip { width: 26px; height: 26px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; font-family: 'DM Mono', monospace; }

/* Chip Colors */
.chip-2 { background: var(--green-dim); color: var(--green); }
.chip-1 { background: var(--yellow-dim); color: var(--yellow); }
.chip-0 { background: var(--red-dim); color: var(--red); }
.chip-na { background: var(--surface2); color: var(--muted); }

.mod-value { font-size: 26px; font-weight: 300; font-family: 'DM Mono', monospace; letter-spacing: -1px; line-height: 1; }
.mod-max { font-size: 14px; color: var(--muted); }

/* Sparkline & Bars */
.sparkline { height: 30px; margin: 10px 0; }
.sparkline svg { width: 100%; height: 100%; overflow: visible; }
.mod-bar-wrap { background: var(--surface2); border-radius: 100px; height: 4px; overflow: hidden; }
.mod-bar { height: 100%; border-radius: 100px; }
/* .bar-green/yellow/red already defined above */
.bar-gray { background: var(--muted); opacity: 0.5; }
.mod-expand-arrow { position: absolute; bottom: 8px; right: 10px; font-size: 10px; color: var(--muted); transition: transform 0.2s; }
.mod-card.expanded .mod-expand-arrow { transform: rotate(180deg); color: var(--accent); }

/* MODULE DETAILS (Dropdown) */
.mod-detail { display: none; background: var(--surface2); border: 1px solid rgba(99,102,241,0.4); border-top: none; border-radius: 0 0 var(--r) var(--r); padding: 16px; margin-bottom: 12px; animation: slideDown 0.2s ease; }
.mod-detail.open { display: block; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

.traffic-light { display: flex; gap: 8px; margin-bottom: 14px; }
.tl-item { flex: 1; padding: 10px 12px; border-radius: var(--r-sm); display: flex; flex-direction: column; gap: 2px; }
.tl-item.green { background: var(--green-dim); }
.tl-item.yellow { background: var(--yellow-dim); }
.tl-item.red { background: var(--red-dim); }
.tl-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
.tl-item.green .tl-label { color: var(--green); }
.tl-item.yellow .tl-label { color: var(--yellow); }
.tl-item.red .tl-label { color: var(--red); }
.tl-val { font-size: 18px; font-weight: 600; font-family: 'DM Mono', monospace; color: var(--text); }
.tl-sub { font-size: 10px; color: var(--muted2); }

.coverage-title { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 8px; }
.coverage-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ctag { display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 6px; background: var(--surface3); border: 1px solid var(--border); font-size: 11px; color: var(--muted2); }
.ctag.hit { border-color: rgba(34,197,94,0.3); color: var(--green); background: var(--green-dim); }
.ctag-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.ctag-count { font-family: 'DM Mono', monospace; font-size: 10px; font-weight: 600; }

/* CALLS TABLE */
.calls-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.calls-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.calls-title { font-size: 13px; font-weight: 600; }
.calls-count { font-size: 12px; color: var(--muted); background: var(--surface2); padding: 2px 8px; border-radius: 100px; }
.calls-filter { display: flex; gap: 5px; }
.filter-btn { padding: 4px 10px; background: transparent; border: 1px solid var(--border); border-radius: 6px; font-size: 11px; font-weight: 500; color: var(--muted2); cursor: pointer; transition: all 0.12s; font-family: 'DM Sans', sans-serif; }
.filter-btn:hover { color: var(--text); border-color: var(--border2); }
.filter-btn.active { background: var(--surface2); border-color: var(--border2); color: var(--text); }

.calls-table { width: 100%; border-collapse: collapse; }
.calls-table th { text-align: left; padding: 9px 18px; font-size: 10px; font-weight: 600; color: var(--muted); letter-spacing: 0.5px; text-transform: uppercase; border-bottom: 1px solid var(--border); background: rgba(255,255,255,0.01); }
.calls-table td { padding: 12px 18px; font-size: 13px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.calls-table .data-row { cursor: pointer; transition: background 0.1s; }
.calls-table .data-row:hover td { background: rgba(255,255,255,0.02); }

.type-tag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 5px; font-size: 11px; font-weight: 500; }
.tag-sales { background: rgba(99,102,241,0.15); color: #a5b4fc; }
.tag-second { background: rgba(234,179,8,0.15); color: #fcd34d; }
.tag-followup { background: rgba(107,114,128,0.2); color: #9ca3af; }

.score-cell { display: flex; align-items: center; gap: 7px; }
.score-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dot-high { background: var(--green); box-shadow: 0 0 5px var(--green); }
.dot-mid { background: var(--yellow); }
.dot-low { background: var(--red); }
.score-num { font-family: 'DM Mono', monospace; font-size: 13px; font-weight: 500; }

.mc-row { display: flex; gap: 3px; }
.mc { width: 20px; height: 20px; border-radius: 5px; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; font-family: 'DM Mono', monospace; position: relative; cursor: default; }
.mc[data-tip]:hover::after { content: attr(data-tip); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 6px; padding: 4px 8px; background: var(--surface2); color: var(--text); font-size: 11px; font-weight: 500; font-family: 'Inter', sans-serif; white-space: nowrap; border-radius: 6px; pointer-events: none; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.mc-na { background: var(--surface2); color: var(--muted); font-size: 9px; }

/* MODALS */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.75); backdrop-filter: blur(4px); z-index: 100; align-items: center; justify-content: center; animation: fadeIn 0.2s ease; }
.modal-overlay.open { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Issue Modal (List) */
.modal-list { background: var(--surface); border: 1px solid var(--border2); border-radius: var(--r); width: 600px; max-height: 80vh; display: flex; flex-direction: column; animation: slideUp 0.25s ease; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-title { font-size: 15px; font-weight: 600; }
.modal-close { width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center; background: transparent; border: none; color: var(--muted2); cursor: pointer; font-size: 18px; transition: all 0.15s; }
.modal-close:hover { background: var(--surface2); color: var(--text); }
.modal-body { padding: 16px 24px; overflow-y: auto; }

.issue-item { padding: 14px; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--r-sm); margin-bottom: 10px; cursor: pointer; transition: all 0.15s; }
.issue-item:hover { border-color: var(--border2); background: var(--surface3); }
.issue-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.issue-date { font-size: 11px; font-family: 'DM Mono', monospace; color: var(--muted); }
.issue-badge { padding: 2px 7px; border-radius: 5px; font-size: 10px; font-weight: 600; }
.issue-full { display: flex; flex-direction: column; gap: 8px; }
.issue-field { font-size: 12px; color: var(--muted2); line-height: 1.6; }
.issue-field strong { color: var(--text); font-weight: 600; margin-right: 6px; }

/* Full Call Modal */
.modal-full { background: var(--bg); border: 1px solid var(--border2); border-radius: var(--r); width: 95vw; max-width: 900px; height: 90vh; display: flex; flex-direction: column; animation: slideUp 0.25s ease; }
.call-detail-grid { padding: 20px 28px; overflow-y: auto; flex: 1; }
.call-main { display: flex; flex-direction: column; gap: 12px; max-width: 800px; }

.call-meta-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; }
.call-meta-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 12px; }
.call-meta-row:last-child { margin-bottom: 0; }
.call-meta-label { color: var(--muted); }
.call-meta-val { color: var(--text); font-weight: 500; }
.call-audio-link { color: var(--accent); font-weight: 500; text-decoration: none; transition: color 0.15s; }

.transcript-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 20px; }
.transcript-title { font-size: 13px; font-weight: 600; margin-bottom: 12px; color: var(--text); }
.transcript-text { font-size: 12px; color: var(--muted2); line-height: 1.7; max-height: 400px; overflow-y: auto; }
.transcript-line { margin-bottom: 10px; }
.transcript-speaker { font-weight: 600; color: var(--text); margin-right: 6px; }
.transcript-text mark { background: rgba(99,102,241,0.2); color: var(--text); padding: 2px 4px; border-radius: 3px; font-style: normal; position: relative; cursor: default; }
.transcript-text mark[data-tip]:hover::after { content: attr(data-tip); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 6px; padding: 4px 10px; background: var(--surface2); color: var(--text); font-size: 11px; font-weight: 500; font-family: 'Inter',sans-serif; white-space: nowrap; border-radius: 6px; pointer-events: none; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,.3); }

.module-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; }
.module-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.module-card-name { font-size: 12px; font-weight: 600; color: var(--text); }
.module-card-score { padding: 2px 8px; border-radius: 5px; font-size: 11px; font-weight: 700; font-family: 'DM Mono', monospace; }
.module-card-quote { font-size: 11px; color: var(--muted2); line-height: 1.6; font-style: italic; border-left: 2px solid var(--border2); padding-left: 10px; margin-bottom: 8px; }
.quote-subtype { display: block; font-style: normal; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--accent); margin-bottom: 2px; opacity: 0.8; }
.module-card-status { font-size: 11px; font-weight: 500; display: flex; align-items: center; gap: 4px; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.anim { animation: fadeUp 0.35s ease both; }
.anim-1 { animation-delay: 0.05s; }
.anim-2 { animation-delay: 0.1s; }
.anim-3 { animation-delay: 0.15s; }
.anim-4 { animation-delay: 0.2s; }

/* ================= FLATPICKR CUSTOMIZATION ================= */
.flatpickr-calendar {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--r) !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5) !important;
    font-family: 'DM Sans', sans-serif !important;
}
.flatpickr-calendar.arrowTop:before, .flatpickr-calendar.arrowTop:after {
    border-bottom-color: var(--border) !important;
}
.flatpickr-calendar.arrowTop:after {
    border-bottom-color: var(--surface) !important;
}
.flatpickr-calendar.arrowBottom:before, .flatpickr-calendar.arrowBottom:after {
    border-top-color: var(--border) !important;
}
.flatpickr-calendar.arrowBottom:after {
    border-top-color: var(--surface) !important;
}
.flatpickr-months {
    background: var(--surface) !important;
    border-bottom: 1px solid var(--border) !important;
    border-radius: var(--r) var(--r) 0 0 !important;
    padding: 10px 0;
}
.flatpickr-current-month {
    font-size: 14px !important;
    padding: 0 !important;
}
.flatpickr-current-month .flatpickr-monthDropdown-months {
    background: var(--surface) !important;
    font-weight: 600 !important;
}
.flatpickr-current-month .flatpickr-monthDropdown-months:hover {
    background: var(--surface2) !important;
}
.flatpickr-current-month input.cur-year {
    font-weight: 600 !important;
}
.flatpickr-month {
    color: var(--text) !important;
    fill: var(--text) !important;
}
.flatpickr-weekdays {
    background: var(--surface) !important;
}
.flatpickr-weekday {
    color: var(--muted) !important;
    font-weight: 600 !important;
    font-size: 11px !important;
    text-transform: uppercase !important;
}
.flatpickr-day {
    color: var(--text) !important;
    border-radius: 6px !important;
    font-size: 13px !important;
}
.flatpickr-day:hover, .flatpickr-day.prevMonthDay:hover, .flatpickr-day.nextMonthDay:hover, .flatpickr-day:focus {
    background: var(--surface2) !important;
    border-color: var(--border2) !important;
}
.flatpickr-day.selected, .flatpickr-day.startRange, .flatpickr-day.endRange,
.flatpickr-day.selected.inRange, .flatpickr-day.startRange.inRange, .flatpickr-day.endRange.inRange,
.flatpickr-day.selected:focus, .flatpickr-day.startRange:focus, .flatpickr-day.endRange:focus,
.flatpickr-day.selected:hover, .flatpickr-day.startRange:hover, .flatpickr-day.endRange:hover,
.flatpickr-day.selected.prevMonthDay, .flatpickr-day.startRange.prevMonthDay, .flatpickr-day.endRange.prevMonthDay,
.flatpickr-day.selected.nextMonthDay, .flatpickr-day.startRange.nextMonthDay, .flatpickr-day.endRange.nextMonthDay {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
    box-shadow: none !important;
}
.flatpickr-day.inRange, .flatpickr-day.prevMonthDay.inRange, .flatpickr-day.nextMonthDay.inRange,
.flatpickr-day.today.inRange, .flatpickr-day.prevMonthDay.today.inRange, .flatpickr-day.nextMonthDay.today.inRange,
.flatpickr-day:hover.inRange, .flatpickr-day.prevMonthDay:hover.inRange, .flatpickr-day.nextMonthDay:hover.inRange,
.flatpickr-day.today:hover.inRange, .flatpickr-day.prevMonthDay.today:hover.inRange, .flatpickr-day.nextMonthDay.today:hover.inRange {
    background: var(--accent-dim) !important;
    border-color: transparent !important;
    color: var(--text) !important;
    box-shadow: -5px 0 0 var(--accent-dim), 5px 0 0 var(--accent-dim) !important;
}
.flatpickr-day.today {
    border-color: var(--border) !important;
}
.flatpickr-day.today:hover {
    background: var(--surface2) !important;
    color: var(--text) !important;
}
.flatpickr-day.flatpickr-disabled, .flatpickr-day.flatpickr-disabled:hover {
    color: var(--muted2) !important;
    opacity: 0.3 !important;
}
.flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay {
    color: var(--muted) !important;
}
.flatpickr-next-month svg, .flatpickr-prev-month svg {
    fill: var(--muted) !important;
}
.flatpickr-next-month:hover svg, .flatpickr-prev-month:hover svg {
    fill: var(--text) !important;
}

/* ==========================================
   БИЛЛИНГ
   ========================================== */

/* KPI карточки */
.billing-summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.billing-summary-grid .sum-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 18px; position: relative; overflow: hidden; }
.billing-summary-grid .sum-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--accent), #8b5cf6); }
.sum-label { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 10px; }
.sum-value { font-size: 32px; font-weight: 300; font-family: 'DM Mono', monospace; letter-spacing: -1px; color: var(--text); line-height: 1; }
.sum-sub { font-size: 12px; color: var(--muted2); margin-top: 6px; }

/* Итоговый блок */
.billing-total-card { background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(139,92,246,0.15)); border: 1px solid rgba(99,102,241,0.3); border-radius: var(--r); padding: 24px; margin-bottom: 24px; }
.billing-total-label { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 0.6px; text-transform: uppercase; margin-bottom: 10px; }
.billing-total-value { font-size: 48px; font-weight: 300; font-family: 'DM Mono', monospace; letter-spacing: -2px; color: var(--accent); line-height: 1; }
.billing-total-breakdown { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.1); }
.billing-total-item-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.billing-total-item-val { font-family: 'DM Mono', monospace; font-size: 16px; font-weight: 600; color: var(--text); }

/* Детализация */
.billing-breakdown-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 20px; margin-bottom: 24px; }
.billing-breakdown-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 16px; }
.billing-breakdown-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.billing-breakdown-row:last-child { border-bottom: none; }
.billing-breakdown-row.billing-breakdown-total { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 6px; }
.billing-breakdown-key { font-size: 13px; color: var(--muted2); }
.billing-breakdown-val { font-family: 'DM Mono', monospace; font-size: 14px; font-weight: 600; color: var(--text); }
.billing-breakdown-accent { color: var(--accent) !important; }

/* Тарифы */
.billing-pricing-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; margin-bottom: 24px; }
.billing-pricing-header { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.billing-pricing-title { font-size: 13px; font-weight: 600; }
.billing-pricing-table { width: 100%; border-collapse: collapse; }
.billing-pricing-table th { text-align: left; padding: 10px 20px; font-size: 10px; font-weight: 600; color: var(--muted); letter-spacing: 0.5px; text-transform: uppercase; border-bottom: 1px solid var(--border); background: rgba(255,255,255,0.01); }
.billing-pricing-table td { padding: 12px 20px; font-size: 13px; border-bottom: 1px solid var(--border); color: var(--muted2); }
.billing-pricing-table tr:last-child td { border-bottom: none; }
.billing-pricing-table td:last-child { text-align: right; font-family: 'DM Mono', monospace; font-weight: 600; color: var(--text); }

/* ==========================================
   TABLE SORTING
   ========================================== */

/* Sortable column headers */
th.sortable {
    position: relative;
    padding-right: 24px !important;
}

/* Sort icons container */
.sort-icons {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 1px;
    opacity: 0.3;
    transition: opacity 0.2s;
}

th.sortable:hover .sort-icons {
    opacity: 0.6;
}

/* Individual icons */
.sort-icon-up,
.sort-icon-down {
    color: var(--muted);
    transition: color 0.2s;
}

/* Active state - ascending (upper triangle green) */
.sort-icons.asc .sort-icon-up {
    color: var(--green);
    opacity: 1;
}

.sort-icons.asc .sort-icon-down {
    color: var(--muted);
    opacity: 0.3;
}

/* Active state - descending (lower triangle blue) */
.sort-icons.desc .sort-icon-up {
    color: var(--muted);
    opacity: 0.3;
}

.sort-icons.desc .sort-icon-down {
    color: var(--accent);
    opacity: 1;
}

/* Active column overall visibility */
.sort-icons.asc,
.sort-icons.desc {
    opacity: 1 !important;
}

/* ── DEPT SWITCHER ── */
.dept-switcher { margin-bottom: 14px; padding: 0 4px; }
.dept-label { font-size: 10px; font-weight: 600; color: var(--muted); letter-spacing: 0.8px; text-transform: uppercase; padding: 0 8px; margin-bottom: 6px; }
.dept-select { width: 100%; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 7px 10px; font-size: 12px; font-weight: 500; color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: space-between; transition: all 0.15s; }
.dept-select:hover { border-color: var(--border2); }
.dept-select svg { width: 12px; height: 12px; color: var(--muted); flex-shrink: 0; }
.dept-dropdown { background: var(--surface2); border: 1px solid var(--border2); border-radius: var(--r-sm); overflow: hidden; margin-top: 4px; display: none; }
.dept-dropdown.open { display: block; }
.dept-option { padding: 8px 12px; font-size: 12px; cursor: pointer; transition: background 0.1s; display: flex; align-items: center; gap: 8px; }
.dept-option:hover { background: var(--surface3); }
.dept-option.active { color: #a5b4fc; }
.dept-option .dept-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

/* ── MODE SWITCHER (demo) ── */
.mode-switcher { margin: 0 4px 14px; padding: 8px; background: rgba(99,102,241,0.08); border: 1px solid rgba(99,102,241,0.2); border-radius: var(--r-sm); }
.mode-label { font-size: 9px; font-weight: 600; color: var(--muted); letter-spacing: 0.8px; text-transform: uppercase; margin-bottom: 6px; padding: 0 2px; }
.mode-btns { display: flex; gap: 3px; }
.mode-btn { flex: 1; padding: 4px 0; border-radius: 5px; font-size: 10px; font-weight: 600; color: var(--muted); cursor: pointer; text-align: center; transition: all 0.15s; border: none; background: transparent; font-family: 'DM Sans', sans-serif; }
.mode-btn:hover { color: var(--muted2); background: rgba(255,255,255,0.04); }
.mode-btn.active { background: var(--accent-dim); color: #a5b4fc; }

/* ── VERTICAL MODE ── */
.vertical-alldepts { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.vertical-dept-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.vertical-dept-header { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.vertical-dept-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.vertical-dept-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.vertical-dept-meta { font-size: 11px; color: var(--muted); }
.vertical-dept-body { padding: 16px 18px; }
.vertical-modules { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.vertical-mod-row { display: flex; align-items: center; gap: 10px; }
.vertical-mod-name { font-size: 12px; color: var(--muted2); width: 110px; flex-shrink: 0; }
.vertical-mod-bar-wrap { flex: 1; height: 5px; background: var(--surface2); border-radius: 100px; overflow: hidden; }
.vertical-mod-bar { height: 100%; border-radius: 100px; }
.vertical-mod-val { font-size: 12px; font-family: 'DM Mono', monospace; width: 40px; text-align: right; flex-shrink: 0; }
.vertical-dept-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; border-top: 1px solid var(--border); margin-top: 4px; }
.vertical-drill { font-size: 12px; cursor: pointer; transition: opacity 0.15s; }
.vertical-drill:hover { opacity: 0.7; }

/* ── ALL DEPTS PAGE ── */
.alldepts-table-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; margin-bottom: 24px; }
.alldepts-table { width: 100%; border-collapse: collapse; }
.alldepts-table th { text-align: left; padding: 10px 20px; font-size: 10px; font-weight: 600; color: var(--muted); letter-spacing: 0.5px; text-transform: uppercase; border-bottom: 1px solid var(--border); background: rgba(255,255,255,0.01); }
.alldepts-table th:not(:first-child) { text-align: right; }
.alldepts-table td { padding: 13px 20px; font-size: 13px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.alldepts-table td:not(:first-child) { text-align: right; font-family: 'DM Mono', monospace; font-weight: 500; }
.alldepts-table tr.data-row { cursor: pointer; transition: background 0.1s; }
.alldepts-table tr.data-row:hover td { background: rgba(255,255,255,0.025); }
.alldepts-table tr.total-row td { background: rgba(99,102,241,0.06); font-weight: 600; border-top: 1px solid rgba(99,102,241,0.2); }
.dept-name-cell { display: flex; align-items: center; gap: 10px; }
.dept-color-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dept-name-text { font-weight: 500; }
.dept-name-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.score-bar-cell { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.score-bar-wrap { width: 80px; height: 4px; background: var(--surface2); border-radius: 100px; overflow: hidden; }
.score-bar-fill { height: 100%; border-radius: 100px; background: var(--accent); }

/* ── PERIOD SELECTOR ── */
.period-selector { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 3px; }
.period-btn { padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 500; color: var(--muted2); cursor: pointer; transition: all 0.15s; border: none; background: transparent; font-family: 'DM Sans', sans-serif; }
.period-btn.active { background: var(--surface2); color: var(--text); }

/* ── EXPORT BUTTON ── */
.export-btn { display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 6px 12px; font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 500; color: var(--muted2); cursor: pointer; transition: all 0.15s; white-space: nowrap; }
.export-btn svg { width: 14px; height: 14px; }
.export-btn:hover { border-color: rgba(99,102,241,0.4); color: #a5b4fc; background: rgba(99,102,241,0.08); }

/* ── EXPORT MODAL ── */
.export-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 200; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.export-overlay.open { opacity: 1; pointer-events: auto; }
.export-modal { background: var(--surface); border: 1px solid var(--border2); border-radius: 16px; width: 400px; box-shadow: 0 24px 64px rgba(0,0,0,0.6); transform: translateY(12px) scale(0.98); transition: transform 0.25s ease, opacity 0.25s ease; opacity: 0; }
.export-overlay.open .export-modal { transform: translateY(0) scale(1); opacity: 1; }
.export-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 16px; border-bottom: 1px solid var(--border); }
.export-modal-title { font-size: 14px; font-weight: 600; }
.export-modal-close { width: 26px; height: 26px; border-radius: 6px; background: var(--surface2); border: 1px solid var(--border); color: var(--muted2); display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 16px; }
.export-modal-close:hover { background: var(--surface3); color: var(--text); }
.export-modal-body { padding: 20px; display: flex; flex-direction: column; gap: 18px; }
.export-field-label { font-size: 10px; font-weight: 600; color: var(--muted); letter-spacing: 0.6px; text-transform: uppercase; margin-bottom: 8px; }
.export-date-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.export-date-input { background: var(--surface2); border: 1px solid var(--border2); border-radius: var(--r-sm); padding: 8px 11px; font-family: 'DM Mono', monospace; font-size: 12px; color: var(--text); text-align: center; width: 100%; outline: none; cursor: pointer; }
.export-date-sep { font-size: 12px; color: var(--muted); text-align: center; }
.export-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.export-check-item { display: flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: var(--r-sm); border: 1px solid var(--border); cursor: pointer; transition: all 0.15s; }
.export-check-item.checked { border-color: rgba(99,102,241,0.4); background: rgba(99,102,241,0.08); }
.export-checkbox { width: 14px; height: 14px; border-radius: 3px; border: 1.5px solid var(--border); flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.export-check-item.checked .export-checkbox { background: var(--accent); border-color: var(--accent); }
.export-check-icon { width: 8px; height: 8px; stroke: white; display: none; }
.export-check-item.checked .export-check-icon { display: block; }
.export-check-label { font-size: 12px; color: var(--muted2); white-space: nowrap; }
.export-check-item.checked .export-check-label { color: var(--text); }
.export-fmt-row { display: flex; gap: 6px; }
.export-fmt-btn { padding: 6px 14px; border-radius: var(--r-sm); border: 1px solid var(--border); font-size: 12px; color: var(--muted2); cursor: pointer; font-family: 'DM Mono', monospace; background: none; }
.export-fmt-btn.active { border-color: rgba(99,102,241,0.4); background: rgba(99,102,241,0.08); color: #a5b4fc; }
.export-modal-footer { display: flex; align-items: center; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); }
.export-summary-text { font-size: 11px; color: var(--muted); flex: 1; }
.export-summary-text span { color: var(--muted2); }
.export-btn-cancel { padding: 8px 14px; border-radius: var(--r-sm); border: 1px solid var(--border); background: none; font-family: 'DM Sans', sans-serif; font-size: 13px; color: var(--muted2); cursor: pointer; }
.export-btn-cancel:hover { background: var(--surface2); }
.export-btn-go { padding: 8px 18px; border-radius: var(--r-sm); border: none; background: var(--accent); color: white; font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.export-btn-go:hover { opacity: 0.9; }

/* ── RETRO ── */
.comparison-header { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.comp-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 18px; position: relative; overflow: hidden; }
.comp-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--accent), #8b5cf6); }
.comp-label { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 10px; }
.comp-values { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.comp-now { font-size: 28px; font-weight: 300; font-family: 'DM Mono', monospace; letter-spacing: -1px; }
.comp-was { font-size: 13px; color: var(--muted); font-family: 'DM Mono', monospace; }
.comp-delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; padding: 2px 6px; border-radius: 4px; }
.delta-up { background: var(--green-dim); color: var(--green); }
.delta-down { background: var(--red-dim); color: var(--red); }
.delta-neutral { background: rgba(255,255,255,0.05); color: var(--muted); }
.insights { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 24px; }
.insight-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; }
.insight-card.positive { border-left: 3px solid var(--green); }
.insight-card.negative { border-left: 3px solid var(--red); }
.insight-title { font-size: 12px; font-weight: 600; margin-bottom: 8px; }
.insight-item { font-size: 12px; color: var(--muted2); line-height: 1.5; margin-bottom: 6px; }
.insight-item strong { color: var(--text); font-weight: 600; }
.retro-table-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; margin-bottom: 24px; }
.retro-table-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.retro-table-title { font-size: 13px; font-weight: 600; }
.sort-hint { font-size: 11px; color: var(--muted); }
.retro-table { width: 100%; border-collapse: collapse; }
.retro-table th { text-align: left; padding: 10px 16px; font-size: 10px; font-weight: 600; color: var(--muted); letter-spacing: 0.5px; text-transform: uppercase; border-bottom: 1px solid var(--border); background: rgba(255,255,255,0.01); }
.retro-table th:not(:first-child):not(:nth-child(2)) { text-align: center; }
.retro-table td { padding: 12px 16px; font-size: 13px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.retro-table td:not(:first-child):not(:nth-child(2)) { text-align: center; }
.retro-table tr.data-row { cursor: pointer; transition: background 0.1s; }
.retro-table tr.data-row:hover td { background: rgba(255,255,255,0.02); }
.manager-name { font-weight: 500; }
.trend-icon { font-size: 16px; margin-right: 4px; }
.metric-cell { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.metric-val { font-family: 'DM Mono', monospace; font-size: 13px; font-weight: 500; }
.metric-delta { font-size: 11px; font-weight: 600; }

/* ── BILLING ── */
.breakdown-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 20px; margin-bottom: 16px; }
.breakdown-title { font-size: 13px; font-weight: 600; margin-bottom: 16px; }
.breakdown-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.breakdown-row:last-child { border-bottom: none; }
.breakdown-key { font-size: 13px; color: var(--muted2); }
.breakdown-val { font-family: 'DM Mono', monospace; font-size: 14px; font-weight: 600; }

/* ── ROLES ── */
.role-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #8b5cf6); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: white; flex-shrink: 0; }

/* ── CHART TOOLTIP ── */
.chart-tooltip { position: absolute; background: var(--surface2); border: 1px solid var(--border2); border-radius: 6px; padding: 6px 10px; font-size: 12px; pointer-events: none; display: none; z-index: 10; white-space: nowrap; }
.chart-tooltip-date { color: var(--muted); font-size: 11px; margin-bottom: 2px; }
.chart-tooltip-val { color: var(--text); font-weight: 600; font-family: 'DM Mono', monospace; }

/* ── LOADING ── */
.loading-spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--border2); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay { display: flex; align-items: center; justify-content: center; padding: 40px; gap: 10px; color: var(--muted); font-size: 13px; }

/* ── ALLDEPTS VERTICAL VIEW ── */
.alldepts-dept-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.alldepts-dept-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; }
.alldepts-dept-name { font-size: 15px; font-weight: 700; color: var(--text); }
.alldepts-dept-total { font-size: 12px; color: var(--muted); font-family: 'DM Mono', monospace; }
.alldepts-dept-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 16px; }
.alldepts-types-row { display: flex; gap: 12px; }
.alldepts-type-cell { flex: 1; background: var(--surface2); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.alldepts-type-label { font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.alldepts-type-count { font-size: 12px; color: var(--muted2); }
.alldepts-type-score { font-size: 20px; font-weight: 700; font-family: 'DM Mono', monospace; color: var(--text); }
.alldepts-mgr-title { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.alldepts-mgr-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.alldepts-mgr-row:last-child { border-bottom: none; }
.alldepts-mgr-rank { width: 20px; text-align: center; font-weight: 700; color: var(--muted); font-size: 12px; }
.alldepts-mgr-name { flex: 1; color: var(--text); }
.alldepts-mgr-score { font-family: 'DM Mono', monospace; font-weight: 600; }
.alldepts-mgr-calls { font-size: 12px; color: var(--muted); }

/* ── RECLASSIFY ── */
.type-tag-wrap { position: relative; display: inline-block; }
.reclassify-badge { cursor: pointer; transition: filter 0.15s; }
.type-tag-wrap:hover .reclassify-badge { filter: brightness(1.15); }
/* Dropdown открывается через CSS :hover — нет зазора, нет мерцания */
.reclassify-dropdown { display: none; position: absolute; top: 100%; left: 0; padding-top: 6px; z-index: 200; }
.reclassify-dropdown-inner { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 4px; min-width: 130px; box-shadow: 0 4px 16px rgba(0,0,0,0.3); }
.type-tag-wrap:hover .reclassify-dropdown { display: block; }
.reclassify-dropdown.open { display: block; }
.rclassify-option { padding: 7px 12px; font-size: 13px; color: var(--text); border-radius: 6px; cursor: pointer; white-space: nowrap; }
.rclassify-option:hover { background: var(--surface3); }
.rcl-icon { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: rgba(99,102,241,0.15); color: var(--accent); font-size: 11px; margin-left: 4px; cursor: default; vertical-align: middle; }
.rcl-icon[data-tip]:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); padding: 4px 8px; background: var(--surface2); color: var(--text); font-size: 11px; font-weight: 500; font-family: 'Inter', sans-serif; white-space: nowrap; border-radius: 6px; pointer-events: none; z-index: 200; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.rcl-chevron { font-size: 10px; margin-left: 3px; opacity: 0.7; line-height: 1; }
.scoring-pending { display: inline-block; font-size: 12px; margin-left: 4px; vertical-align: middle; animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* ── RECLASSIFY: manager request button & pending dot ── */
.rcl-request-btn { background: none; border: none; padding: 0 0 0 5px; font-size: 13px; color: var(--accent); cursor: pointer; opacity: 0.4; transition: opacity 0.15s; vertical-align: middle; line-height: 1; }
.rcl-request-btn:hover:not(:disabled) { opacity: 1; }
.rcl-request-btn:disabled { opacity: 0.2; cursor: default; }
.rcl-pending-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #f59e0b; margin-left: 4px; vertical-align: middle; flex-shrink: 0; }
/* dropdown option (fixed typo from .rclassify-option) */
.rcl-option { padding: 7px 12px; font-size: 13px; color: var(--text); border-radius: 6px; cursor: pointer; white-space: nowrap; }
.rcl-option:hover { background: var(--surface3); }

/* ── RECLASSIFY REQUEST MODAL ── */
#requestRclModal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 500; align-items: center; justify-content: center; }
#requestRclModal.open { display: flex; }
.rcl-modal-box { background: var(--surface); border: 1px solid var(--border2); border-radius: 12px; width: 100%; max-width: 440px; box-shadow: 0 12px 40px rgba(0,0,0,0.4); overflow: hidden; }
.rcl-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); font-size: 15px; font-weight: 600; color: var(--text); }
.rcl-modal-close { background: none; border: none; color: var(--muted); font-size: 16px; cursor: pointer; padding: 2px 6px; border-radius: 4px; line-height: 1; }
.rcl-modal-close:hover { background: var(--surface2); color: var(--text); }
.rcl-modal-body { padding: 20px; display: flex; flex-direction: column; gap: 4px; }
.rcl-modal-info { font-size: 13px; color: var(--muted2); background: var(--surface2); border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; line-height: 1.7; }
.rcl-modal-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }
.rcl-options { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.rcl-radio { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--border); cursor: pointer; font-size: 13px; color: var(--text); transition: border-color 0.15s, background 0.15s; }
.rcl-radio:hover { background: var(--surface2); border-color: var(--border2); }
.rcl-radio input[type="radio"] { accent-color: var(--accent); cursor: pointer; }
.rcl-textarea { width: 100%; min-height: 80px; margin-top: 8px; padding: 10px 12px; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 13px; font-family: inherit; resize: vertical; box-sizing: border-box; transition: border-color 0.15s; }
.rcl-textarea:focus { outline: none; border-color: var(--accent); }
.rcl-modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.rcl-btn-secondary { padding: 8px 16px; border: 1px solid var(--border); background: none; color: var(--muted2); border-radius: 8px; font-size: 13px; cursor: pointer; transition: background 0.15s; }
.rcl-btn-secondary:hover { background: var(--surface2); }
.rcl-btn-primary { padding: 8px 18px; border: none; background: var(--accent); color: #fff; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; transition: opacity 0.15s; }
.rcl-btn-primary:hover:not(:disabled) { opacity: 0.85; }
.rcl-btn-primary:disabled { opacity: 0.4; cursor: default; }

/* ── RECLASSIFY LOG PAGE ── */
.rcl-log-section-title { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.7px; margin: 24px 0 12px; }
.rcl-log-section-title:first-child { margin-top: 0; }
.rcl-log-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rcl-log-table th { padding: 8px 12px; text-align: left; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); }
.rcl-log-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
.rcl-log-table tr:last-child td { border-bottom: none; }
.rcl-log-table tr:hover td { background: var(--surface2); }
.rcl-log-callid { font-family: 'DM Mono', monospace; font-size: 12px; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.rcl-badge-pending { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; background: rgba(245,158,11,0.15); color: #f59e0b; }
.rcl-badge-approved { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; background: rgba(34,197,94,0.15); color: #22c55e; }
.rcl-badge-rejected { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; background: rgba(239,68,68,0.12); color: #ef4444; }
.rcl-approve-btn { padding: 4px 12px; border: none; background: rgba(34,197,94,0.15); color: #22c55e; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; transition: background 0.15s; }
.rcl-approve-btn:hover { background: rgba(34,197,94,0.3); }
.rcl-reject-btn { padding: 4px 12px; border: none; background: rgba(239,68,68,0.1); color: #ef4444; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; transition: background 0.15s; margin-left: 6px; }
.rcl-reject-btn:hover { background: rgba(239,68,68,0.22); }
.rcl-empty { text-align: center; padding: 32px; color: var(--muted); font-size: 13px; }
.rcl-load-more-btn { padding: 9px 24px; border: 1px solid var(--border2); background: var(--surface); color: var(--muted2); border-radius: 8px; font-size: 13px; font-family: inherit; cursor: pointer; transition: all 0.15s; }
.rcl-load-more-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); background: rgba(99,102,241,0.08); }
.rcl-load-more-btn:disabled { opacity: 0.5; cursor: default; }
.rcl-undo-wrap { display: inline-block; margin-left: 6px; vertical-align: middle; }
.rcl-undo-btn { padding: 1px 6px; border: 1px solid var(--border2); background: transparent; color: var(--muted); border-radius: 4px; font-size: 12px; cursor: pointer; line-height: 1.4; transition: all 0.15s; }
.rcl-undo-btn:hover { border-color: var(--accent); color: var(--accent); }
.rcl-undo-select { padding: 2px 6px; border: 1px solid var(--border2); background: var(--surface); color: var(--text); border-radius: 4px; font-size: 12px; font-family: inherit; cursor: pointer; }
