:root {
  --navy: #003265;
  --navy-2: #073b73;
  --navy-3: #0d2a4d;
  --red: #ed1328;
  --red-dark: #c90f20;
  --ink: #0d1f31;
  --muted: #5b7086;
  --faint: #8a9bad;
  --line: #dce6ef;
  --bg: #f4f7fa;
  --card: #ffffff;
  --green: #1c7c45;
  --amber: #9a6100;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", "PT Astra Sans", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}
a { color: var(--navy); text-decoration: none; }
button { font: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { font-size: 9px; font-weight: 700; letter-spacing: .14em; color: var(--red); text-transform: uppercase; }

/* ------------------------------------------------------------------ login */
.login-page {
  min-height: 100vh;
  background:
    linear-gradient(rgba(0, 32, 65, .94), rgba(0, 32, 65, .94)),
    url("/static/assets/symbol-white.svg") repeat,
    var(--navy);
  background-size: auto, 110px 110px, auto;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-wrap { width: min(420px, 100%); }
.login-brand { text-align: center; margin-bottom: 20px; }
.login-brand img { width: 190px; height: auto; }
.login-brand div { margin-top: 8px; color: rgba(255, 255, 255, .65); font-size: 9px; letter-spacing: .18em; }
.login-card {
  background: #fff;
  border-radius: 18px;
  padding: 30px 30px 24px;
  box-shadow: 0 30px 70px rgba(0, 18, 38, .4);
  display: grid;
  gap: 12px;
}
.login-card h1 { margin: 2px 0 2px; font-size: 24px; color: var(--navy); }
.login-card p { margin: 0 0 6px; font-size: 11px; }
.login-card label { display: grid; gap: 5px; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.login-card input {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--ink);
  background: #fbfdff;
}
.login-card input:focus { outline: 2px solid rgba(0, 50, 101, .18); border-color: var(--navy); }
.login-error { min-height: 16px; color: var(--red-dark); font-size: 11px; }
.login-note { color: var(--faint); font-size: 10px; }
.login-foot { text-align: center; color: rgba(255, 255, 255, .5); font-size: 9px; margin-top: 16px; letter-spacing: .1em; }

/* ------------------------------------------------------------------ кнопки */
.btn {
  border: 1px solid transparent;
  border-radius: 9px;
  height: 34px;
  padding: 0 14px;
  font-size: 11.5px;
  font-weight: 650;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background .15s, border-color .15s, transform .05s;
  background: #eef3f8;
  color: var(--navy);
}
.btn:hover { background: #e2ebf4; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-dark); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--navy); }
.btn.ghost:hover { background: #f0f5fa; }
.btn.small { height: 28px; padding: 0 10px; font-size: 10px; }
.btn.wide { width: 100%; height: 42px; font-size: 12px; }
.icon-btn {
  width: 32px; height: 32px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}
.icon-btn:hover { background: #f1f6fb; }

/* ------------------------------------------------------------------- каркас */
.portal { display: grid; grid-template-columns: 258px 1fr; min-height: 100vh; }
.side {
  background:
    linear-gradient(rgba(0, 40, 80, .92), rgba(0, 32, 65, .97)),
    url("/static/assets/symbol-white.svg") repeat;
  background-size: auto, 92px 92px;
  color: #fff;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}
.brand { padding: 22px 20px 14px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.brand-logo { width: 172px; height: auto; display: block; }
.brand-sub { margin-top: 7px; color: rgba(255, 255, 255, .55); font-size: 8px; font-weight: 700; letter-spacing: .18em; }
.side-scroll { flex: 1; overflow: auto; padding: 12px 10px 10px; }
.side-label { color: rgba(255, 255, 255, .42); font-size: 8px; font-weight: 700; letter-spacing: .18em; padding: 4px 10px 8px; }
.tree { display: grid; gap: 1px; }
.tree-loading { color: rgba(255,255,255,.55); font-size: 11px; padding: 10px; }
.tree-node { display: grid; }
.tree-row {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  border-radius: 8px;
  padding: 4px 7px;
  color: rgba(255, 255, 255, .82);
  cursor: pointer;
  font-size: 11.5px;
  border: 0;
  background: transparent;
  text-align: left;
  width: 100%;
}
.tree-row:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.tree-row.active { background: #fff; color: var(--navy); font-weight: 650; }
.tree-row .tw { width: 12px; color: rgba(255,255,255,.5); font-size: 9px; flex: 0 0 12px; }
.tree-row.active .tw { color: var(--navy); }
.tree-row .tn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-row .tc { margin-left: auto; font-size: 9px; color: rgba(255,255,255,.45); }
.tree-row.active .tc { color: var(--muted); }
.tree-children { margin-left: 10px; border-left: 1px solid rgba(255, 255, 255, .1); padding-left: 3px; }
.tree-fired { margin: 8px 10px 0; color: #ffb3bb; background: transparent; border: 1px dashed rgba(255, 120, 130, .35); border-radius: 8px; font-size: 10px; padding: 7px; cursor: pointer; }
.side-foot { padding: 12px 14px 16px; border-top: 1px solid rgba(255, 255, 255, .1); display: grid; gap: 8px; }
.user-card { display: flex; align-items: center; gap: 9px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.16); color: #fff; display: grid; place-items: center; font-size: 10px; font-weight: 700; }
.user-name { font-size: 11.5px; font-weight: 650; color: #fff; }
.user-role { font-size: 9px; color: rgba(255,255,255,.55); }
.side-link { background: transparent; border: 0; color: rgba(255,255,255,.65); font-size: 10.5px; text-align: left; cursor: pointer; padding: 3px 0; }
.side-link:hover { color: #fff; }
.side-link.danger { color: #ffb3bb; }
.side form { margin: 0; }

.main { min-width: 0; padding: 20px 24px 28px; }
.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.crumbs { color: var(--faint); font-size: 10px; letter-spacing: .04em; }
.top h1 { margin: 4px 0 0; font-size: 26px; color: var(--navy); letter-spacing: -.01em; }
.top-right { display: flex; gap: 7px; align-items: center; }

/* --------------------------------------------------------------- фильтры */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 11px;
  margin-bottom: 14px;
}
.periods { display: flex; background: #f0f4f8; border-radius: 8px; padding: 2px; }
.periods button { border: 0; background: transparent; color: var(--muted); height: 27px; padding: 0 12px; border-radius: 6px; cursor: pointer; font-size: 11px; }
.periods button.active { background: #fff; color: var(--navy); font-weight: 700; box-shadow: 0 1px 3px rgba(0, 30, 60, .12); }
.date-nav { display: flex; align-items: center; gap: 4px; }
.date-nav input { border: 1px solid var(--line); border-radius: 8px; height: 30px; padding: 0 7px; font-size: 11px; color: var(--ink); background: #fff; }
.type-filter { margin-left: auto; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; }
.type-filter select { height: 30px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 0 8px; font-size: 11px; color: var(--ink); }

/* ------------------------------------------------------------------ контент */
.error { background: #fff1f2; border: 1px solid #f3c9cc; color: #7a1b22; border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 11.5px; }
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 13px; min-width: 0; }
.kpi-value { font-size: 24px; font-weight: 750; color: var(--navy); letter-spacing: -.02em; line-height: 1.05; }
.kpi-value small { font-size: 10px; font-weight: 600; color: var(--faint); }
.kpi-label { margin-top: 5px; color: var(--muted); font-size: 9.5px; text-transform: uppercase; letter-spacing: .07em; }
.kpi-foot { margin-top: 4px; font-size: 9.5px; color: var(--faint); }
.grid { display: grid; gap: 12px; margin-bottom: 12px; }
.grid.two { grid-template-columns: 1.35fr 1fr; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 15px 16px; min-width: 0; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.panel-head h2 { margin: 4px 0 0; font-size: 15px; color: var(--navy); }
.chip { display: inline-flex; align-items: center; height: 21px; padding: 0 8px; border-radius: 999px; background: #eef3f8; color: var(--muted); font-size: 9.5px; font-weight: 650; }
.chip.red { background: #fde8e9; color: var(--red-dark); }
.chip.green { background: #e5f6ec; color: var(--green); }
.hint { font-size: 9px; color: var(--faint); }

/* график */
.chart { min-height: 190px; }
.chart svg { width: 100%; height: 190px; display: block; }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .gridline { stroke: #eef3f8; }
.chart text { fill: var(--faint); font-size: 8px; }
.chart .line { fill: none; stroke: var(--navy); stroke-width: 2.2; }
.chart .area { fill: rgba(0, 50, 101, .08); }
.chart .dot { fill: var(--red); }
.chart-empty { min-height: 190px; display: grid; place-items: center; color: var(--faint); font-size: 11px; }

.type-bars { display: grid; gap: 12px; padding-top: 3px; }
.type-row { display: grid; grid-template-columns: 88px 1fr 76px; align-items: center; gap: 9px; }
.type-name { font-size: 11px; color: var(--ink); }
.type-track { height: 10px; background: #eef3f8; border-radius: 99px; overflow: hidden; }
.type-fill { display: block; height: 100%; border-radius: 99px; background: var(--navy); }
.type-fill.incoming { background: #2b6cb0; }
.type-fill.outgoing { background: #4a8fbe; }
.type-fill.work { background: var(--red); }
.type-meta { font-size: 9.5px; color: var(--muted); text-align: right; white-space: nowrap; }
.type-note { margin-top: 4px; font-size: 9px; color: var(--faint); }

.division-bars { display: grid; gap: 9px; }
.div-row { display: grid; grid-template-columns: 126px 1fr 74px; align-items: center; gap: 8px; }
.div-name { font-size: 10.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.div-track { height: 8px; background: #eef3f8; border-radius: 99px; overflow: hidden; }
.div-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--navy), #2b6cb0); border-radius: 99px; }
.div-meta { font-size: 9px; color: var(--muted); text-align: right; white-space: nowrap; }

/* календарь */
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-dow { text-align: center; font-size: 8px; color: var(--faint); padding: 2px 0 4px; text-transform: uppercase; letter-spacing: .08em; }
.cal-day { min-height: 44px; border: 1px solid #edf3f8; border-radius: 7px; padding: 4px 5px; cursor: pointer; background: #fbfdff; display: grid; align-content: space-between; }
.cal-day:hover { border-color: #b9cede; }
.cal-day.empty { visibility: hidden; }
.cal-day.today { outline: 2px solid rgba(237, 19, 40, .35); }
.cal-day.active { border-color: var(--navy); background: #eef4fb; }
.cal-num { font-size: 9.5px; color: var(--muted); }
.cal-calls { font-size: 12px; font-weight: 700; color: var(--navy); }
.cal-score { font-size: 8px; color: var(--faint); }
.cal-score.good { color: var(--green); }
.cal-score.bad { color: var(--red-dark); }

/* таблица агентов */
.agents-panel { padding-bottom: 10px; }
.legend { max-width: 460px; text-align: right; font-size: 9px; color: var(--faint); }
.table-wrap { overflow: auto; }
.agents-table { width: 100%; border-collapse: collapse; }
.agents-table th { text-align: left; font-size: 8.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); font-weight: 700; padding: 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.agents-table td { padding: 8px; border-bottom: 1px solid #eef3f8; font-size: 10.5px; color: var(--ink); white-space: nowrap; }
.agents-table tr:hover td { background: #fafdff; }
.agents-table .name { font-weight: 650; color: var(--navy); }
.agents-table .sub { display: block; font-size: 8.5px; color: var(--faint); font-weight: 400; margin-top: 1px; }
.score { display: inline-flex; min-width: 28px; height: 20px; align-items: center; justify-content: center; border-radius: 6px; font-size: 10px; font-weight: 700; background: #eef3f8; color: var(--navy); }
.score.good { background: #e5f6ec; color: var(--green); }
.score.mid { background: #fff3dc; color: var(--amber); }
.score.bad { background: #fde8e9; color: var(--red-dark); }
.initiative { display: inline-flex; align-items: center; gap: 6px; }
.initiative-bar { width: 52px; height: 5px; border-radius: 99px; background: #eef3f8; overflow: hidden; }
.initiative-bar span { display: block; height: 100%; background: var(--red); }
.initiative b { font-size: 10px; color: var(--navy); }
.fired-block { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; }
.fired-toggle { border: 0; background: transparent; color: var(--muted); font-size: 10.5px; cursor: pointer; width: 100%; text-align: left; padding: 6px 2px; }
.fired-toggle .chev { float: right; }
.fired-body { padding: 4px 0 8px; }

/* настройки */
.settings { display: grid; gap: 12px; }
.schedule-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; margin: 10px 0 14px; }
.check { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--ink); }
.check input { accent-color: var(--navy); width: 15px; height: 15px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.status { margin-top: 10px; font-size: 11px; color: var(--green); min-height: 16px; }
.exports-list { display: grid; gap: 4px; }
.export-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 2px; border-bottom: 1px solid #eef3f8; font-size: 11px; }
.export-row a { font-weight: 650; }
.export-meta { color: var(--faint); font-size: 9px; }

.foot { display: flex; justify-content: space-between; gap: 10px; color: var(--faint); font-size: 9px; margin-top: 16px; padding: 10px 2px 0; border-top: 1px solid var(--line); }
.toast { position: fixed; right: 18px; bottom: 18px; background: var(--navy); color: #fff; border-radius: 9px; padding: 10px 14px; font-size: 11px; box-shadow: 0 12px 30px rgba(0, 20, 40, .28); z-index: 50; }
.toast.error { background: var(--red-dark); }

@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid.two { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .portal { grid-template-columns: 1fr; }
  .side { position: relative; height: auto; }
  .side-scroll { max-height: 240px; }
  .main { padding: 16px 12px 22px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top h1 { font-size: 21px; }
  .schedule-grid { grid-template-columns: 1fr; }
}

.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.week-day { border: 1px solid #edf3f8; border-radius: 8px; padding: 8px 7px; background: #fbfdff; cursor: pointer; display: grid; gap: 3px; min-height: 64px; }
.week-day:hover { border-color: #b9cede; }
.week-day.today { outline: 2px solid rgba(237, 19, 40, .3); }
.week-day .wd { font-size: 8px; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; }
.week-day .wn { font-size: 17px; font-weight: 750; color: var(--navy); }
.week-day .ws { font-size: 8.5px; color: var(--faint); }
.week-day .wc { font-size: 9px; color: var(--muted); }

.export-kind { height: 34px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); padding: 0 8px; font-size: 11px; }

.crumbs button { border: 0; background: transparent; color: var(--faint); cursor: pointer; padding: 0; font-size: inherit; }
.crumbs button:hover { color: var(--navy); text-decoration: underline; }
.ai-panel { margin-bottom: 12px; }
.ai-text { font-size: 12px; line-height: 1.65; color: var(--ink); white-space: pre-wrap; }
.ai-text .ai-placeholder { color: var(--muted); }
.ai-source { margin-top: 7px; color: var(--faint); font-size: 9px; }
.ai-panel.loading #ai-run { opacity: .55; pointer-events: none; }
.calls-pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 2px 2px; flex-wrap: wrap; }
.calls-page-range { color: var(--muted); font-size: 9.5px; }
.calls-page-range strong { color: var(--ink); }
.calls-page-controls { display: flex; align-items: center; gap: 4px; }
.calls-page-note { font-size: 9px; color: var(--faint); padding: 0 4px; }
.page-btn { min-width: 25px; height: 25px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--muted); font-size: 9.5px; cursor: pointer; padding: 0 6px; }
.page-btn:hover { border-color: var(--navy); color: var(--navy); }
.page-btn.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.page-btn:disabled { opacity: .4; cursor: default; }
.page-arrow { padding: 0 8px; }

.calls-panel { margin-bottom: 12px; }
.agents-table tr.agent-link, .agents-table tr.call-link { cursor: pointer; }
.agents-table tr.agent-link:hover td, .agents-table tr.call-link:hover td { background: #f5f9fd; }
.call-summary { max-width: 430px; white-space: normal !important; color: var(--muted); font-size: 10px; }
.call-view { display: block; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; margin-bottom: 10px; }
.back-link:hover { color: var(--navy); }
.call-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.call-page-head h1 { margin: 4px 0 2px; font-size: 25px; color: var(--navy); }
.call-score { width: 92px; height: 82px; border: 1px solid var(--line); border-radius: 12px; display: grid; place-items: center; align-content: center; background: #fff; }
.call-score b { font-size: 28px; color: var(--navy); line-height: 1; }
.call-score span { font-size: 9px; color: var(--faint); }
.call-section { margin-top: 12px; }
.call-section h3 { margin: 4px 0 9px; font-size: 14px; color: var(--navy); }
.call-summary-full { margin: 8px 0; font-size: 12px; line-height: 1.55; }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.criteria { display: grid; gap: 7px; margin-top: 7px; }
.criterion { display: grid; grid-template-columns: 140px 1fr 44px; gap: 8px; align-items: center; font-size: 10px; color: var(--muted); }
.criterion-bar { height: 5px; border-radius: 99px; background: #eef3f8; overflow: hidden; display: block; }
.criterion-bar span { display: block; height: 100%; background: var(--navy); border-radius: 99px; }
.criterion b { text-align: right; color: var(--ink); font-size: 10px; }
.rec-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid #eef3f8; font-size: 11px; }
.rec-item:last-child { border-bottom: 0; }
.rec-num { width: 20px; height: 20px; border-radius: 50%; background: #fde8e9; color: var(--red-dark); display: grid; place-items: center; font-size: 9px; font-weight: 700; flex: 0 0 20px; }
.rec-detail { margin-top: 3px; color: var(--muted); font-size: 10.5px; line-height: 1.45; }
.alarm-line { padding: 6px 0; border-bottom: 1px solid #eef3f8; font-size: 11px; color: #7a1b22; }
.transcript { max-height: 480px; overflow: auto; margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.turn { font-size: 11px; line-height: 1.5; padding: 4px 0; border-bottom: 1px dashed #eef3f8; }
.turn-time { color: var(--faint); font-size: 9px; margin-right: 6px; }
.turn.agent b { color: var(--navy); }
.turn.client b { color: var(--muted); }

.side-nav { display: grid; gap: 2px; padding: 8px 12px 4px; }
.side-nav a { color: rgba(255,255,255,.72); font-size: 11px; padding: 7px 9px; border-radius: 7px; }
.side-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.side-nav a.active { background: #fff; color: var(--navy); font-weight: 650; }
.management { display: block; }
.mgmt-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.mgmt-head h1 { margin: 4px 0 2px; font-size: 26px; color: var(--navy); }
.mgmt-actions { display: flex; gap: 7px; }
.bars-chart { display: grid; gap: 9px; margin-top: 4px; }
.bar-row { display: grid; grid-template-columns: 48px 1fr 54px; gap: 8px; align-items: center; }
.bar-label { font-size: 10px; color: var(--muted); }
.bar-track { height: 14px; border-radius: 4px; background: #eef3f8; overflow: hidden; }
.bar-track span { display: block; height: 100%; background: var(--navy); border-radius: 4px; }
.bar-meta { text-align: right; font-size: 9.5px; color: var(--faint); }
.radar-wrap { display: grid; place-items: center; min-height: 230px; }
.radar-wrap svg { width: 100%; max-width: 390px; height: 240px; }
.radar-wrap text { fill: var(--muted); font-size: 8px; }
.radar-wrap .radar-grid { fill: none; stroke: var(--line); stroke-width: 1; }
.radar-wrap .radar-shape { fill: rgba(0,50,101,.13); stroke: var(--navy); stroke-width: 2; }
.radar-wrap .radar-prev { fill: none; stroke: #b7c9da; stroke-width: 1.2; stroke-dasharray: 3 3; }
.funnel { display: grid; gap: 8px; }
.funnel-row { display: grid; grid-template-columns: 150px 1fr 64px; gap: 8px; align-items: center; }
.funnel-label { font-size: 10.5px; color: var(--ink); }
.funnel-track { height: 22px; background: #eef3f8; border-radius: 5px; overflow: hidden; }
.funnel-track span { display: block; height: 100%; background: linear-gradient(90deg, var(--navy), #2b6cb0); }
.funnel-meta { font-size: 9.5px; color: var(--muted); text-align: right; }
.heatmap { display: grid; grid-template-columns: 28px 1fr; gap: 6px; margin-top: 4px; overflow: auto; }
.heatmap-days { display: grid; grid-template-rows: repeat(7, 20px); gap: 3px; padding-top: 20px; }
.heatmap-days span { font-size: 8px; color: var(--faint); text-align: right; }
.heatmap-main { display: grid; gap: 3px; }
.heatmap-hours { display: grid; grid-template-columns: repeat(13, 1fr); gap: 3px; font-size: 8px; color: var(--faint); }
.heatmap-grid { display: grid; grid-template-columns: repeat(13, 1fr); gap: 3px; }
.heat-cell { height: 20px; border-radius: 3px; background: #f1f6fa; position: relative; }
.heat-cell[title] { cursor: default; }
.scatter-wrap { min-height: 250px; display: grid; place-items: center; }
.scatter-wrap svg { width: 100%; height: 270px; }
.scatter-wrap text { fill: var(--faint); font-size: 8px; }
.scatter-wrap .axis-line { stroke: var(--line); }
.scatter-wrap .dot { fill: rgba(237,19,40,.7); stroke: #fff; stroke-width: 1; }
.scatter-wrap .dot-good { fill: rgba(28,124,69,.75); }
.risk-list { display: grid; gap: 8px; margin-top: 5px; }
.risk-item { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid #eef3f8; padding-bottom: 5px; font-size: 10.5px; }
.risk-item b { color: var(--ink); }
.quality-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 6px; }
.quality-item { background: #f7fafc; border: 1px solid #eef3f8; border-radius: 9px; padding: 10px; }
.quality-value { font-size: 21px; font-weight: 750; color: var(--navy); }
.quality-label { font-size: 9px; color: var(--muted); margin-top: 3px; }
.mgmt-empty { padding: 30px; text-align: center; color: var(--muted); }

.am-upload-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin: 10px 0 12px; }
.am-upload-row label.btn { cursor: pointer; }
.material-list { display: grid; gap: 6px; }
.material-row { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.material-row:hover { border-color: var(--line-strong); }
.material-ico { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 7px; background: #eef4f9; font-size: 13px; flex: 0 0 27px; }
.material-main { flex: 1; min-width: 0; }
.material-name { font-size: 11px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.material-meta { margin-top: 2px; font-size: 9px; color: var(--faint); }
.material-download { display: inline-flex; align-items: center; height: 27px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--navy); font-size: 9px; font-weight: 650; white-space: nowrap; }
.material-download:hover { background: #eef5fb; }
