/* Prodav.ai — интерфейс отдела продаж */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --surface-3: #eef1f5;
  --border: #e3e7ee;
  --border-strong: #d3d9e3;
  --text: #1c2333;
  --text-2: #5b6577;
  --text-3: #8a93a3;
  --primary: #2563eb;
  --primary-600: #1d4ed8;
  --primary-soft: #eaf0ff;
  --green: #0ca678;
  --green-soft: #e7f7f1;
  --orange: #e8590c;
  --orange-soft: #fff1e6;
  --red: #d64545;
  --red-soft: #fdecec;
  --yellow: #f5b301;
  --purple: #7a5af8;
  --shadow-sm: 0 1px 2px rgba(20, 30, 50, .05);
  --shadow: 0 8px 24px rgba(20, 30, 50, .08);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar: 236px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
}

html[data-theme="dark"] {
  --bg: #0e1420;
  --surface: #151d2b;
  --surface-2: #1a2332;
  --surface-3: #202a3b;
  --border: #263247;
  --border-strong: #32405a;
  --text: #e8edf6;
  --text-2: #9fabc0;
  --text-3: #74819a;
  --primary: #5b8cff;
  --primary-600: #4a7bf0;
  --primary-soft: #1b2a4a;
  --green-soft: #103129;
  --orange-soft: #33231a;
  --red-soft: #351d1f;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 12px 32px rgba(0, 0, 0, .4);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--text-2); }
.tiny { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.spacer { flex: 1; }
.nowrap { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.center { text-align: center; }

/* ------------------------------------------------------------- boot / login */
.boot {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
  background: var(--bg); z-index: 50;
}
.boot-logo {
  width: 54px; height: 54px; border-radius: 16px; background: var(--primary);
  color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 24px;
}
.boot-logo span { color: #bfdbfe; }
.boot-text { color: var(--text-2); font-size: 13px; }

.login {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr;
  background: var(--surface);
}
.login-visual {
  position: relative; overflow: hidden; color: #fff; padding: 48px;
  display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(900px 520px at 85% -10%, rgba(96, 165, 250, .55), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(14, 165, 233, .4), transparent 55%),
    linear-gradient(145deg, #0b1b3a 0%, #13306b 46%, #1d4ed8 100%);
}
.login-visual::after {
  content: ""; position: absolute; inset: 0; opacity: .16;
  background-image: linear-gradient(rgba(255,255,255,.5) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.5) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 60% 40%, #000, transparent 72%);
}
.login-brand { position: relative; z-index: 1; font-weight: 700; font-size: 20px; display: flex; align-items: center; gap: 10px; }
.login-copy { position: relative; z-index: 1; max-width: 540px; }
.login-copy h1 { font-size: clamp(30px, 3.4vw, 46px); line-height: 1.1; letter-spacing: -.02em; margin: 0 0 18px; }
.login-copy p { font-size: 16px; line-height: 1.6; color: #dbeafe; max-width: 480px; }
.login-points { list-style: none; padding: 0; margin: 30px 0 0; display: grid; gap: 12px; }
.login-points li { display: flex; gap: 12px; align-items: center; color: #eff6ff; font-size: 14px; }
.login-points span { color: #93c5fd; font-variant-numeric: tabular-nums; font-size: 12px; }
.login-foot { position: relative; z-index: 1; color: #bfdbfe; font-size: 12px; }
.login-panel { display: grid; place-items: center; padding: 32px; }
.login-form { width: min(380px, 100%); display: grid; gap: 14px; }
.login-form h2 { margin: 0; font-size: 26px; letter-spacing: -.02em; }
.login-form .muted { margin: -6px 0 8px; }
.login-mobile-brand { display: none; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; margin-bottom: 10px; }
.login-hint { font-size: 12px; color: var(--text-3); text-align: center; margin-top: 4px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; background: var(--primary);
  color: #fff; display: inline-grid; place-items: center; font-weight: 800; font-size: 17px;
}
.brand-mark span { color: #bfdbfe; }
.login-mobile-brand .brand-mark { width: 32px; height: 32px; border-radius: 9px; }

/* ------------------------------------------------------------------ forms */
.field { display: grid; gap: 6px; }
.field > span { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
input, select, textarea {
  width: 100%; min-height: 40px; padding: 9px 12px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); outline: none; transition: border .15s, box-shadow .15s;
}
textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%),
  linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.form-error {
  background: var(--red-soft); color: var(--red); border-radius: 8px;
  padding: 9px 11px; font-size: 13px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

/* ----------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); font-weight: 500; transition: background .15s, border .15s, transform .05s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); border-color: var(--primary-600); }
.btn-soft { background: var(--primary-soft); border-color: transparent; color: var(--primary); }
.btn-soft:hover { background: color-mix(in srgb, var(--primary-soft) 70%, var(--primary) 8%); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(.95); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-sm { min-height: 32px; padding: 5px 10px; font-size: 12.5px; }
.btn-lg { min-height: 46px; font-size: 15px; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.icon-btn {
  width: 36px; height: 36px; padding: 0; border-radius: 9px; display: inline-grid;
  place-items: center; border: 1px solid transparent; background: transparent; color: var(--text-2);
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.danger:hover { background: var(--red-soft); color: var(--red); }

/* ------------------------------------------------------------------ shell */
.shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 30;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 18px 12px 14px;
}
.sidebar-top { padding: 0 6px 18px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.1; }
.brand-copy b { font-size: 16px; letter-spacing: -.02em; }
.brand-copy small { color: var(--text-3); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; margin-top: 3px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border-radius: 8px; color: var(--text-2); font-weight: 500; font-size: 13.5px;
  transition: background .15s, color .15s; position: relative;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); }
.nav-icon { width: 20px; height: 20px; display: inline-grid; place-items: center; flex: none; }
.nav-icon svg { width: 19px; height: 19px; }
.nav-badge {
  margin-left: auto; font-size: 11px; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 20px; background: var(--surface-3); color: var(--text-2);
  display: grid; place-items: center; font-variant-numeric: tabular-nums;
}
.nav-item.active .nav-badge { background: rgba(37, 99, 235, .14); color: var(--primary); }
.sidebar-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.user-card {
  display: flex; align-items: center; gap: 9px; padding: 9px;
  border-top: 1px solid var(--border); margin-top: 6px; cursor: pointer;
}
.user-card:hover { background: var(--surface-2); border-radius: 8px; }
.user-card .avatar { flex: none; }
.user-card .user-meta { min-width: 0; }
.user-card .user-meta b { display: block; font-size: 13px; font-weight: 600; }
.user-card .user-meta span { font-size: 11px; color: var(--text-3); }

.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: inline-grid;
  place-items: center; font-size: 11px; font-weight: 700; color: #fff;
  background: #64748b; flex: none; letter-spacing: .01em;
}
.avatar.lg { width: 38px; height: 38px; font-size: 13px; }
.avatar.sm { width: 24px; height: 24px; font-size: 9.5px; }

.main { margin-left: var(--sidebar); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; min-height: 64px;
  display: flex; align-items: center; gap: 14px; padding: 12px 28px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid transparent;
}
.topbar h1 { font-size: 20px; letter-spacing: -.02em; margin: 0; font-weight: 650; }
.topbar .sub { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.page-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.view { padding: 8px 28px 32px; flex: 1; }

.search-box { position: relative; }
.search-box svg {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-3); pointer-events: none;
}
.search-box input { padding-left: 34px; min-width: 220px; background: var(--surface); }
.topbar select, .board-toolbar select, .transcript-tools select { width: auto; }
.menu-toggle { display: none; }

/* ------------------------------------------------------------------ common */
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px;
  border-radius: 6px; background: var(--surface-3); color: var(--text-2);
  font-size: 11.5px; font-weight: 500; white-space: nowrap;
}
.chip.blue { background: var(--primary-soft); color: var(--primary); }
.chip.green { background: var(--green-soft); color: var(--green); }
.chip.orange { background: var(--orange-soft); color: var(--orange); }
.chip.red { background: var(--red-soft); color: var(--red); }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); display: inline-block; }
.dot.green { background: var(--green); }
.dot.red { background: var(--red); }
.dot.orange { background: var(--orange); }
.dot.gray { background: var(--text-3); }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 20px;
  background: var(--surface-3); color: var(--text-2); font-size: 11px;
  display: inline-grid; place-items: center;
}
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
}
.card-title { font-size: 14px; font-weight: 650; margin: 0 0 4px; letter-spacing: -.01em; }
.section-title {
  font-size: 12px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-3); font-weight: 650; margin: 22px 0 10px;
}
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 60px 20px; color: var(--text-3); text-align: center;
}
.empty-state svg { width: 46px; height: 46px; opacity: .5; }
.empty-state b { color: var(--text-2); font-size: 15px; font-weight: 600; }
.empty-state p { margin: 0; font-size: 13px; max-width: 380px; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.hr-soft { border: 0; border-top: 1px dashed var(--border); margin: 14px 0; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong);
  border-top-color: var(--primary); animation: spin .7s linear infinite; flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 8px;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.progress { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--primary); border-radius: 6px; transition: width .3s; }

/* ------------------------------------------------------------------ board */
.board-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.board {
  display: flex; gap: 14px; align-items: flex-start; overflow-x: auto;
  padding-bottom: 18px; scroll-snap-type: x proximity;
}
.board-column {
  width: 286px; min-width: 286px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  display: flex; flex-direction: column; max-height: calc(100vh - 176px);
  scroll-snap-align: start;
}
.column-top { height: 3px; border-radius: 12px 12px 0 0; background: var(--col-color, var(--text-3)); }
.column-head {
  display: flex; align-items: center; gap: 8px; padding: 12px 12px 10px;
}
.column-head h3 { font-size: 13px; font-weight: 650; margin: 0; letter-spacing: -.01em; }
.column-head .count { color: var(--text-3); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.column-head .add { margin-left: auto; }
.column-body {
  padding: 6px 8px 10px; overflow-y: auto; display: flex; flex-direction: column;
  gap: 8px; background: var(--surface-2); border-top: 1px solid var(--border);
  border-radius: 0 0 11px 11px; min-height: 60px;
}
.column-body.drag-over { background: var(--primary-soft); outline: 1px dashed var(--primary); outline-offset: -4px; }
.column-new { padding: 4px 8px 10px; }
.task-card {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--priority-color, transparent);
  border-radius: 9px; padding: 10px 11px; box-shadow: var(--shadow-sm);
  cursor: grab; transition: box-shadow .15s, transform .1s, border-color .15s;
}
.task-card:hover { box-shadow: var(--shadow); border-color: var(--border-strong); }
.task-card:active { cursor: grabbing; }
.task-card.dragging { opacity: .45; transform: rotate(1deg); }
.task-title { font-size: 13px; font-weight: 550; line-height: 1.35; margin-bottom: 6px; word-break: break-word; }
.task-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.task-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.task-tag {
  font-size: 10.5px; padding: 2px 6px; border-radius: 5px;
  background: var(--primary-soft); color: var(--primary); font-weight: 500;
}
.task-foot { display: flex; align-items: center; gap: 6px; margin-top: 9px; color: var(--text-3); font-size: 11px; }
.task-foot .due { display: inline-flex; align-items: center; gap: 4px; }
.task-foot .due.overdue { color: var(--red); font-weight: 600; }
.task-foot .due.today { color: var(--orange); font-weight: 600; }
.task-foot svg { width: 13px; height: 13px; }
.task-foot .comments { display: inline-flex; align-items: center; gap: 3px; margin-left: auto; }
.quick-add {
  width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px;
  border: 1px dashed var(--border-strong); background: transparent;
  color: var(--text-3); font-size: 12.5px; display: flex; align-items: center; gap: 6px;
}
.quick-add:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.quick-add svg { width: 15px; height: 15px; }

/* ------------------------------------------------------------------ notes */
.notes-layout {
  display: grid; grid-template-columns: 318px minmax(0, 1fr); gap: 16px;
  align-items: start; min-height: calc(100vh - 120px);
}
.notes-list-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  display: flex; flex-direction: column; max-height: calc(100vh - 108px); overflow: hidden;
}
.notes-list-head { padding: 12px; border-bottom: 1px solid var(--border); display: grid; gap: 10px; }
.notes-list-head .search-box input { min-width: 0; width: 100%; min-height: 36px; }
.folder-row { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.folder-chip {
  border: 1px solid var(--border); background: var(--surface); border-radius: 20px;
  padding: 4px 9px; font-size: 11.5px; color: var(--text-2); white-space: nowrap;
}
.folder-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.notes-list { overflow-y: auto; padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.note-item {
  padding: 10px; border-radius: 8px; cursor: pointer; display: grid; gap: 3px;
  border: 1px solid transparent;
}
.note-item:hover { background: var(--surface-2); }
.note-item.active { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 20%, transparent); }
.note-item-title { font-size: 13px; font-weight: 550; display: flex; gap: 6px; align-items: center; }
.note-item-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-item-meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-3); flex-wrap: wrap; }
.note-item-sum { font-size: 11.5px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.note-detail { display: flex; flex-direction: column; gap: 0; min-width: 0; }
.note-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; min-height: calc(100vh - 108px);
}
.note-head { padding: 18px 20px 0; }
.note-back { display: none; }
.note-head-top { display: flex; align-items: flex-start; gap: 12px; }
.note-head h2 { font-size: 19px; letter-spacing: -.02em; margin: 0 0 4px; line-height: 1.25; }
.note-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--text-3); font-size: 12px; }
.note-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.note-tabs {
  display: flex; gap: 2px; margin-top: 16px; border-bottom: 1px solid var(--border);
  overflow-x: auto; scrollbar-width: none;
}
.note-tabs::-webkit-scrollbar { display: none; }
.note-tab {
  padding: 9px 12px; background: transparent; border: 0; border-bottom: 2px solid transparent;
  color: var(--text-2); font-size: 13px; font-weight: 500; white-space: nowrap;
}
.note-tab:hover { color: var(--text); }
.note-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.note-body { padding: 18px 20px 24px; overflow-y: auto; flex: 1; }
.note-body.with-player { padding-top: 12px; }

.audio-bar {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  margin: 0 0 16px;
}
.audio-bar audio { flex: 1; height: 34px; min-width: 0; }
.audio-bar .play-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--primary);
  color: #fff; display: grid; place-items: center; flex: none;
}
.audio-bar .play-btn svg { width: 16px; height: 16px; }
.audio-time { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }

.summary-hero {
  display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 18px;
  align-items: center; padding: 16px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-soft), transparent 75%);
  border: 1px solid color-mix(in srgb, var(--primary) 16%, var(--border));
}
.score-ring {
  width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--ring, var(--primary)) calc(var(--score, 0) * 1%), var(--surface-3) 0);
  position: relative;
}
.score-ring::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--surface); }
.score-ring .score-val { position: relative; z-index: 1; text-align: center; line-height: 1.05; }
.score-ring .score-val b { font-size: 25px; letter-spacing: -.03em; }
.score-ring .score-val small { display: block; font-size: 9.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .07em; margin-top: 2px; }
.hero-copy b { font-size: 14px; display: block; margin-bottom: 6px; }
.hero-copy p { margin: 0; color: var(--text-2); font-size: 13.5px; line-height: 1.55; }
.hero-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

.info-block { margin-top: 18px; }
.info-block h4 { font-size: 13px; margin: 0 0 8px; display: flex; align-items: center; gap: 6px; }
.info-block h4 svg { width: 15px; height: 15px; color: var(--text-3); }
.info-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.info-list li { display: flex; gap: 9px; font-size: 13.2px; line-height: 1.5; }
.info-list li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--primary); margin-top: 8px; flex: none; }
.info-list li.risk::before { background: var(--red); }
.info-list li.insight::before { background: var(--purple); }
.steps { counter-reset: step; display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.steps li { counter-increment: step; display: flex; gap: 9px; font-size: 13.2px; line-height: 1.5; }
.steps li::before {
  content: counter(step); width: 20px; height: 20px; border-radius: 6px;
  background: var(--primary-soft); color: var(--primary); font-size: 11px; font-weight: 700;
  display: grid; place-items: center; flex: none;
}
.criteria { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 7px; }
.criterion {
  display: flex; align-items: center; gap: 7px; font-size: 12.5px; padding: 7px 9px;
  border-radius: 8px; background: var(--surface-2); color: var(--text-2);
}
.criterion.ok { background: var(--green-soft); color: var(--green); }
.criterion.bad { background: var(--red-soft); color: var(--red); }
.criterion svg { width: 14px; height: 14px; flex: none; }

.objection {
  border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; margin-bottom: 8px;
}
.objection .obj-head { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.objection .obj-head b { font-size: 13px; }
.objection p { margin: 0; font-size: 12.5px; color: var(--text-2); }

/* transcript */
.transcript-tools { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.transcript-tools .search-box { flex: 1; min-width: 180px; }
.transcript-tools input { min-height: 36px; }
.transcript { display: grid; gap: 2px; }
.seg {
  display: grid; grid-template-columns: 58px 1fr; gap: 10px; padding: 8px 8px;
  border-radius: 8px;
}
.seg:hover { background: var(--surface-2); }
.seg-time {
  font-size: 11.5px; color: var(--primary); font-variant-numeric: tabular-nums;
  padding-top: 2px; cursor: pointer; white-space: nowrap;
}
.seg-time:hover { text-decoration: underline; }
.seg-speaker { font-size: 12px; font-weight: 650; margin-bottom: 2px; display: flex; align-items: center; gap: 6px; }
.seg-speaker .role-seller { color: var(--primary); }
.seg-speaker .role-client { color: var(--green); }
.seg-speaker .role-other { color: var(--purple); }
.seg-text { font-size: 13.2px; line-height: 1.55; color: var(--text); }
.seg-text mark { background: #fde68a; color: inherit; border-radius: 2px; padding: 0 1px; }
html[data-theme="dark"] .seg-text mark { background: #7c5b08; color: #fff; }
.transcript-empty { color: var(--text-3); font-size: 13px; padding: 24px 8px; }

/* speakers */
.speaker-card {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center;
  border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 9px;
}
.speaker-avatar {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-3); color: var(--text-2); font-weight: 700; font-size: 13px;
}
.speaker-card.seller .speaker-avatar { background: var(--primary-soft); color: var(--primary); }
.speaker-card.client .speaker-avatar { background: var(--green-soft); color: var(--green); }
.speaker-fields { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.speaker-fields select { width: 140px; min-height: 34px; }
.speaker-fields input { width: 170px; min-height: 34px; }
.speaker-stats { font-size: 11.5px; color: var(--text-3); text-align: right; }
.share-bar { height: 5px; width: 90px; border-radius: 5px; background: var(--surface-3); overflow: hidden; margin-top: 4px; margin-left: auto; }
.share-bar i { display: block; height: 100%; background: var(--primary); }

/* tasks in note */
.suggestion {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 9px; margin-bottom: 7px;
}
.suggestion.done { opacity: .6; }
.suggestion .txt { flex: 1; font-size: 13px; }
.suggestion .txt small { display: block; color: var(--text-3); font-size: 11px; margin-top: 2px; }

/* analytics */
.period-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.seg-control { display: inline-flex; background: var(--surface-3); border-radius: 8px; padding: 3px; gap: 2px; }
.seg-control button {
  border: 0; background: transparent; padding: 5px 10px; border-radius: 6px;
  font-size: 12.5px; color: var(--text-2);
}
.seg-control button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 15px 16px; display: grid; gap: 4px;
}
.kpi .kpi-label { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.kpi .kpi-value { font-size: 27px; font-weight: 650; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi .kpi-sub { font-size: 11.5px; color: var(--text-3); }
.kpi.warn .kpi-value { color: var(--orange); }
.kpi.bad .kpi-value { color: var(--red); }
.kpi.good .kpi-value { color: var(--green); }
.analytics-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; margin-top: 16px; }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 8px; }
.chart .bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart .bar { width: 100%; max-width: 34px; background: var(--primary); border-radius: 5px 5px 2px 2px; min-height: 2px; opacity: .85; transition: height .3s; }
.chart .bar:hover { opacity: 1; }
.chart .bar-label { font-size: 9.5px; color: var(--text-3); white-space: nowrap; }
.pipeline-row { display: grid; grid-template-columns: 130px 1fr 34px; gap: 10px; align-items: center; margin-bottom: 9px; font-size: 12.5px; }
.pipeline-track { height: 9px; background: var(--surface-3); border-radius: 9px; overflow: hidden; }
.pipeline-track i { display: block; height: 100%; border-radius: 9px; }
.pipeline-row b { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* table */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-3); font-weight: 650; padding: 11px 12px;
  border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap;
}
.table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--surface-2); }
.table .name-cell { display: flex; align-items: center; gap: 9px; font-weight: 550; }

/* team */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.person-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: grid; gap: 12px; }
.person-top { display: flex; gap: 11px; align-items: center; }
.person-top b { display: block; font-size: 14px; }
.person-top small { color: var(--text-3); font-size: 11.5px; }
.person-stats { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); }
.person-stats b { display: block; font-size: 16px; color: var(--text); }

/* settings */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.settings-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.settings-card h3 { margin: 0 0 3px; font-size: 15px; letter-spacing: -.01em; }
.settings-card > p { margin: 0 0 14px; color: var(--text-3); font-size: 12.5px; }
.status-list { display: grid; gap: 8px; }
.status-row { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 8px; background: var(--surface-2); font-size: 12.5px; }
.status-row .name { flex: 1; }
.status-row .state { font-size: 11.5px; color: var(--text-3); }
.theme-toggle { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; padding: 3px; gap: 2px; }
.theme-toggle button { border: 0; background: transparent; padding: 6px 12px; border-radius: 6px; font-size: 12.5px; color: var(--text-2); }
.theme-toggle button.active { background: var(--primary); color: #fff; }
.role-pill { font-size: 11px; padding: 2px 7px; border-radius: 20px; background: var(--surface-3); color: var(--text-2); }
.role-pill.admin { background: #ede9fe; color: #6d28d9; }
.role-pill.head { background: var(--orange-soft); color: var(--orange); }
.role-pill.sales { background: var(--primary-soft); color: var(--primary); }

/* modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 90; background: rgba(15, 23, 42, .46);
  display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px 24px;
  overflow-y: auto; animation: fade .15s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: min(620px, 100%); background: var(--surface); border-radius: 14px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, .28); animation: pop .18s ease;
  display: flex; flex-direction: column; max-height: 90vh;
}
.modal.wide { width: min(780px, 100%); }
@keyframes pop { from { transform: translateY(8px) scale(.99); opacity: 0; } }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 16px; letter-spacing: -.01em; }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot { padding: 14px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; align-items: center; }
.modal-foot .spacer { flex: 1; }

/* toast */
.toast-root { position: fixed; right: 18px; bottom: 18px; z-index: 120; display: grid; gap: 8px; }
.toast {
  background: #111827; color: #f9fafb; padding: 10px 14px; border-radius: 9px;
  font-size: 13px; box-shadow: var(--shadow); max-width: 360px; animation: pop .18s ease;
}
.toast.error { background: #b91c1c; }
.toast.success { background: #0f766e; }
.toast a { color: #bfdbfe; text-decoration: underline; }

/* upload / recorder */
.dropzone {
  border: 1.5px dashed var(--border-strong); border-radius: 12px; padding: 28px 18px;
  text-align: center; color: var(--text-2); display: grid; gap: 6px; justify-items: center;
  cursor: pointer; transition: border .15s, background .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--primary); background: var(--primary-soft); }
.dropzone svg { width: 34px; height: 34px; color: var(--primary); }
.dropzone b { font-size: 14px; color: var(--text); }
.dropzone small { color: var(--text-3); }
.source-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.source-card {
  border: 1.5px solid var(--border); border-radius: 10px; padding: 12px 10px;
  text-align: center; display: grid; gap: 6px; justify-items: center; cursor: pointer;
  background: var(--surface); font-size: 12px; color: var(--text-2);
}
.source-card svg { width: 22px; height: 22px; color: var(--text-2); }
.source-card.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.source-card.active svg { color: var(--primary); }
.source-card small { font-size: 10.5px; color: var(--text-3); line-height: 1.3; }
.recorder-panel { display: grid; gap: 16px; }
.recorder-state { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 12px; background: var(--surface-2); }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--red); animation: pulse 1.2s infinite; flex: none; }
@keyframes pulse { 50% { opacity: .35; } }
.rec-time { font-size: 26px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.level { display: flex; align-items: flex-end; gap: 3px; height: 30px; margin-left: auto; }
.level i { width: 4px; background: var(--primary); border-radius: 3px; height: 4px; transition: height .08s; }
.rec-note { font-size: 12px; color: var(--text-3); line-height: 1.5; }
.rec-warning { font-size: 12px; background: var(--orange-soft); color: var(--orange); padding: 9px 11px; border-radius: 8px; }

/* processing */
.processing {
  display: flex; gap: 14px; align-items: flex-start; padding: 16px;
  background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 18%, transparent);
  border-radius: 11px; margin-bottom: 16px;
}
.processing b { font-size: 13.5px; }
.processing p { margin: 2px 0 0; color: var(--text-2); font-size: 12.5px; }
.processing .spinner { margin-top: 3px; }
.error-box { background: var(--red-soft); color: var(--red); padding: 11px 13px; border-radius: 9px; font-size: 12.5px; margin-bottom: 14px; }

/* dropdown */
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow); min-width: 190px; padding: 5px; display: grid;
}
.menu button,
.menu a {
  border: 0; background: transparent; text-align: left; padding: 8px 10px;
  border-radius: 7px; font-size: 13px; display: flex; align-items: center; gap: 8px;
  color: var(--text); width: 100%;
}
.menu button:hover, .menu a:hover { background: var(--surface-2); }
.menu button svg, .menu a svg { width: 16px; height: 16px; color: var(--text-3); }
.menu-sep { height: 1px; background: var(--border); margin: 4px 0; }
.popover-wrap { position: relative; }

/* ------------------------------------------------------------------ mobile */
@media (max-width: 1180px) {
  .analytics-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1024px) {
  :root { --sidebar: 0px; }
  .sidebar {
    width: 250px; transform: translateX(-105%); transition: transform .2s ease;
    box-shadow: var(--shadow);
  }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .menu-toggle { display: inline-grid; }
  .topbar, .view { padding-left: 16px; padding-right: 16px; }
  .notes-layout { grid-template-columns: 280px minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-mobile-brand { display: flex; }
  .notes-layout { grid-template-columns: 1fr; }
  .notes-list-card { max-height: 40vh; }
  .note-card { min-height: auto; }
  .notes-layout.note-open .notes-list-card { display: none; }
  .notes-layout:not(.note-open) .note-detail { display: none; }
  .note-back { display: inline-grid; }
  .summary-hero { grid-template-columns: 84px 1fr; }
  .score-ring { width: 78px; height: 78px; }
  .score-ring .score-val b { font-size: 21px; }
  .source-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 13.5px; }
  .topbar { flex-wrap: wrap; gap: 8px; min-height: 56px; }
  .topbar h1 { font-size: 17px; }
  .page-actions { width: 100%; overflow-x: auto; }
  .search-box input { min-width: 0; width: 100%; }
  .board { gap: 10px; }
  .board-column { width: 82vw; min-width: 82vw; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi .kpi-value { font-size: 22px; }
  .note-head { padding: 14px 14px 0; }
  .note-body { padding: 14px; }
  .note-actions { width: 100%; margin-left: 0; justify-content: flex-start; }
  .note-head-top { flex-wrap: wrap; }
  .seg { grid-template-columns: 46px 1fr; }
  .speaker-card { grid-template-columns: 38px 1fr; }
  .speaker-stats { grid-column: 2; text-align: left; }
  .speaker-fields input { width: 100%; }
  .speaker-fields select { width: 100%; }
  .analytics-grid { margin-top: 10px; }
  .pipeline-row { grid-template-columns: 100px 1fr 28px; }
  .toast-root { left: 12px; right: 12px; bottom: 12px; }
  .toast { max-width: none; }
}
