/* ============================================================
   Witora · ERP Рекрутинга — design system
   Фирменные токены из брендбука «Witora Design System»:
   navy #1A1E2A, brand blue #2B66FE, Montserrat, плоский и
   геометричный стиль (без градиентов).
   ============================================================ */
:root {
  --bg:            #eef0f3;   /* gray-100 / paper */
  --surface:       #ffffff;
  --surface-2:     #f5f6f8;   /* subtle surface */
  --sidebar:       #1a1e2a;   /* witora navy */
  --sidebar-2:     #2a3142;   /* navy-700 */
  --sidebar-text:  #9aa3b6;   /* muted on navy */
  --sidebar-active:#2b66fe;   /* brand blue */

  --text:          #1a1e2a;   /* navy ink */
  --text-soft:     #5b6070;
  --text-faint:    #8c8e94;   /* gray-mid */
  --border:        #dcdee2;
  --border-strong: #c6c7ca;

  --primary:       #2b66fe;   /* witora blue */
  --primary-dark:  #1d51da;   /* blue-600 */
  --primary-soft:  #e9f0ff;   /* info-bg */

  --green:   #1f9d6b;  --green-bg:  #e3f5ec;
  --amber:   #d98a16;  --amber-bg:  #fbf0db;
  --red:     #d6453d;  --red-bg:    #fbe7e6;
  --gray:    #5b6070;  --gray-bg:   #eef0f3;
  --violet:  #5b63d6;  --violet-bg: #ecebff;  /* охлаждён под бренд (без фиолета) */
  --cyan:    #1f7fa8;  --cyan-bg:   #e2f1f7;

  --radius:   14px;   /* cards (radius-lg) */
  --radius-s: 8px;    /* controls */
  --shadow:   0 1px 3px rgba(26,30,42,.08), 0 1px 2px rgba(26,30,42,.04);
  --shadow-lg:0 12px 28px rgba(26,30,42,.12), 0 4px 8px rgba(26,30,42,.05);
  --sidebar-w: 248px;
  --font: "Montserrat", Arial, "Helvetica Neue", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
/* Montserrat: заголовки — плотный трекинг (бренд) */
.page-title, .page-head h1, .kpi .value, .card-head h2, .card-head h3,
.brand .name, h1, h2, h3 { letter-spacing: -0.01em; }

#app { display: flex; min-height: 100vh; }

/* ---------------- Sidebar ---------------- */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--sidebar);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 20px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.brand .logo {
  width: 38px; height: 38px; flex: none; display: block;
}
.brand .logo img { width: 100%; height: 100%; display: block; }
.brand .name { color: #fff; font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.brand .sub  { color: var(--sidebar-text); font-size: 11px; letter-spacing: .02em; }

.nav { padding: 12px 12px 24px; flex: 1; }
.nav-group-title {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .9px;
  color: #5d6party; color: #61708f; padding: 14px 12px 6px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: var(--radius-s);
  color: var(--sidebar-text); font-size: 13.5px; font-weight: 500;
  margin: 1px 0; transition: background .12s, color .12s; cursor: pointer;
  border: none; background: none; width: 100%; text-align: left;
}
.nav-item .ic { width: 18px; text-align: center; font-size: 15px; opacity: .85; }
.nav-item:hover { background: var(--sidebar-2); color: #fff; }
.nav-item.active { background: var(--sidebar-active); color: #fff; }
.nav-item .badge-count {
  margin-left: auto; background: rgba(255,255,255,.14); color: #fff;
  font-size: 11px; padding: 1px 7px; border-radius: 10px; font-weight: 600;
}
.nav-item.active .badge-count { background: rgba(255,255,255,.25); }

/* ---------------- Main / Topbar ---------------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 62px; background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
  padding: 0 28px; position: sticky; top: 0; z-index: 20;
}
.topbar > div:first-child { flex: 0 0 auto; }
.topbar .page-title { font-size: 18px; font-weight: 700; white-space: nowrap; }
.topbar .page-sub { color: var(--text-soft); font-size: 12.5px; margin-top: 1px; white-space: nowrap; }
.topbar .spacer { flex: 1; }
.role-switch select { max-width: 200px; }
.user-chip .tiny { white-space: nowrap; }

.role-switch {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 5px 10px;
}
.role-switch label { font-size: 11px; color: var(--text-faint); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.role-switch select {
  border: none; background: none; font-family: inherit; font-size: 13px;
  font-weight: 600; color: var(--text); cursor: pointer; outline: none; max-width: 240px;
}
.account { position: relative; }
.user-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 10px 5px 6px; border-radius: 10px;
  border: 1px solid transparent; background: none; cursor: pointer; transition: .12s;
}
.user-chip:hover { background: var(--surface-2); border-color: var(--border); }
.user-chip .caret { color: var(--text-faint); font-size: 11px; }

.account-menu {
  position: absolute; top: 50px; right: 0; width: 290px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 60;
  overflow: hidden; animation: pop .14s ease-out;
}
.account-menu[hidden] { display: none; }
.acc-head { display: flex; gap: 12px; align-items: center; padding: 16px; border-bottom: 1px solid var(--border); }
.acc-head .avatar { width: 44px; height: 44px; font-size: 16px; }
.acc-head .nm { font-weight: 700; font-size: 14px; }
.acc-head .rl { font-size: 12px; color: var(--text-soft); }
.acc-head .em { font-size: 11.5px; color: var(--text-faint); margin-top: 1px; }
.acc-section { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.acc-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--text-faint); font-weight: 700; margin-bottom: 6px; }
.acc-section select { width: 100%; }
.acc-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 11px 16px; border: none; background: none; font-family: inherit;
  font-size: 13.5px; font-weight: 500; color: var(--text); text-align: left; cursor: pointer;
}
.acc-item:hover { background: var(--surface-2); }
.acc-item.danger { color: var(--red); }
.acc-sep { height: 1px; background: var(--border); }

/* Header actions: уведомления и сообщения */
.topbar-actions { display: flex; align-items: center; gap: 4px; margin-right: 4px; }
.hdr-pop { position: relative; }
.icon-btn {
  position: relative; width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid transparent; background: none; font-size: 17px;
  display: grid; place-items: center; cursor: pointer; transition: .12s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border); }
.dot-badge {
  position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 9px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid var(--surface); line-height: 1;
}
.hdr-menu {
  position: absolute; top: 48px; right: 0; width: 350px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  z-index: 60; overflow: hidden; animation: pop .14s ease-out;
}
.hdr-menu[hidden] { display: none; }
.hdr-menu.wide { width: 380px; }
.inbox-head { display: flex; align-items: center; gap: 8px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.inbox-head h4 { margin: 0; font-size: 14px; }
.inbox-head .spacer { flex: 1; }
.inbox-head button { border: none; background: none; color: var(--primary); font-size: 12px; font-weight: 600; cursor: pointer; }
.inbox-head button:hover { text-decoration: underline; }
.inbox-list { max-height: 384px; overflow-y: auto; }
.inbox-item { display: flex; gap: 11px; padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; align-items: flex-start; }
.inbox-item:last-child { border-bottom: none; }
.inbox-item:hover { background: var(--surface-2); }
.inbox-item.unread { background: #f4f8ff; }
.inbox-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-size: 15px; flex: none; }
.inbox-item .it-title { font-weight: 600; font-size: 13px; }
.inbox-item .it-text { font-size: 12px; color: var(--text-soft); margin-top: 2px; }
.inbox-item .it-time { font-size: 11px; color: var(--text-faint); margin-top: 3px; }
.inbox-item .unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex: none; margin-top: 6px; }
.inbox-foot { padding: 10px 16px; text-align: center; border-top: 1px solid var(--border); }

/* Окно переписки */
.thread-head { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.msg-log { display: flex; flex-direction: column; gap: 9px; max-height: 50vh; overflow-y: auto; padding: 4px 2px; }
.msg-row { display: flex; }
.msg-row.out { justify-content: flex-end; }
.msg-bubble { max-width: 80%; padding: 8px 12px; border-radius: 12px; font-size: 13px; line-height: 1.4; }
.msg-in { background: var(--surface-2); border-bottom-left-radius: 3px; }
.msg-out { background: var(--primary-soft); border-bottom-right-radius: 3px; }
.msg-meta { font-size: 10.5px; color: var(--text-faint); font-weight: 600; margin-bottom: 3px; }
.msg-time { font-size: 10px; color: var(--text-faint); margin-top: 3px; text-align: right; }
.msg-compose { display: flex; gap: 8px; margin-top: 14px; }

/* Upload / AI-распознавание */
.upload-zone {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius-s);
  padding: 18px; text-align: center; cursor: pointer; transition: .12s; background: var(--surface-2);
}
.upload-zone:hover, .upload-zone.drag { border-color: var(--primary); background: var(--primary-soft); }
.upload-zone .big { font-size: 26px; }
.doc-chip { display: inline-flex; align-items: center; gap: 7px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 4px 10px; font-size: 12px; margin: 8px 6px 0 0; }
.doc-chip .x { cursor: pointer; color: var(--text-faint); }
.field-recognized input, .field-recognized select { border-color: var(--green) !important; background: #f3fbf5; }
.ai-spin { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--primary-soft); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.ai-badge { display: inline-block; font-size: 10.5px; font-weight: 700; color: #fff; background: var(--primary); border-radius: 6px; padding: 1px 7px; vertical-align: middle; margin-left: 6px; }

/* Большая форма соискателя — секции одним списком */
.modal.xl { max-width: 1240px; width: 95vw; }
.modal.xl .modal-body { max-height: 82vh; padding: 24px 28px; }
.modal-overlay:has(.modal.xl) { padding: 24px 16px; }
.cf-body { min-height: 320px; }
.cf-sec { padding-top: 20px; margin-top: 20px; border-top: 1px solid var(--border); }
.cf-sec:first-child { padding-top: 0; margin-top: 0; border-top: none; }
.cf-sec-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; padding-left: 11px; border-left: 3px solid var(--primary); letter-spacing: -.01em; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px 16px; align-items: end; }
@media (max-width: 820px){ .form-grid { grid-template-columns: 1fr 1fr; } }
.cf-check { display: flex; align-items: center; gap: 8px; font-size: 13px; padding-bottom: 8px; }
.cf-radios { display: flex; gap: 16px; padding-top: 7px; }
.cf-radio { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.cf-multi { display: flex; flex-wrap: wrap; gap: 8px; }
.cf-chip-check { display: flex; align-items: center; gap: 6px; font-size: 12px; border: 1px solid var(--border); border-radius: 20px; padding: 5px 10px; cursor: pointer; background: var(--surface); }
.cf-chip-check:hover { border-color: var(--primary); }

/* История коммуникаций (сообщения + звонки) */
.comm-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-s); overflow: hidden; }
.comm-item { display: flex; gap: 11px; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.comm-item:last-child { border-bottom: none; }
.comm-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-size: 15px; flex: none; }
.comm-item .ttl { font-weight: 600; font-size: 12.5px; }
.comm-item .txt { font-size: 12.5px; color: var(--text-soft); margin-top: 2px; }
.comm-item .meta { font-size: 11px; color: var(--text-faint); margin-top: 3px; }
.comm-rec { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--primary); cursor: pointer; margin-top: 5px; font-weight: 600; }
.comm-rec:hover { text-decoration: underline; }

/* Звонок — SIP-набор */
.call-dialer { text-align: center; padding: 18px 10px; }
.call-phone { font-size: 22px; font-weight: 700; letter-spacing: .5px; }
.call-state { color: var(--text-soft); margin-top: 6px; font-size: 13px; }
.call-pulse { width: 74px; height: 74px; border-radius: 50%; background: var(--green-bg); display: grid; place-items: center; font-size: 30px; margin: 4px auto 14px; animation: callpulse 1.4s infinite; }
@keyframes callpulse { 0% { box-shadow: 0 0 0 0 rgba(31,157,107,.4); } 100% { box-shadow: 0 0 0 18px rgba(31,157,107,0); } }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: var(--sidebar); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}

/* ---------------- View ---------------- */
.view { padding: 24px 28px 48px; flex: 1; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 20px; margin: 0 0 2px; }
.page-head p { margin: 0; color: var(--text-soft); font-size: 13px; }
.page-head .spacer { flex: 1; }

/* KPI cards */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px,1fr)); gap: 14px; margin-bottom: 22px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.kpi .label { color: var(--text-soft); font-size: 12.5px; font-weight: 500; }
.kpi .value { font-size: 27px; font-weight: 700; margin-top: 6px; letter-spacing: -.5px; }
.kpi .delta { font-size: 12px; margin-top: 4px; }
.kpi .ic-bubble {
  position: absolute; top: 14px; right: 14px; width: 38px; height: 38px;
  border-radius: 10px; display: grid; place-items: center; font-size: 18px;
}

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.card-head h2, .card-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.card-head .spacer { flex: 1; }
.card-body { padding: 16px 18px; }
.card-body.flush { padding: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
@media (max-width: 980px){ .grid-2,.grid-3 { grid-template-columns: 1fr; } }

/* Tables */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-faint); font-weight: 600; padding: 11px 14px;
  border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap;
}
table.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tbody tr { transition: background .1s; }
table.tbl tbody tr:hover { background: var(--surface-2); }
table.tbl tr.clickable { cursor: pointer; }
.t-strong { font-weight: 600; color: var(--text); }
.t-soft { color: var(--text-soft); }
.t-mono { font-variant-numeric: tabular-nums; }

/* Badges / chips */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 20px;
  white-space: nowrap; line-height: 1.4;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-green  { background: var(--green-bg);  color: #157f3c; }
.b-amber  { background: var(--amber-bg);  color: #b45309; }
.b-red    { background: var(--red-bg);    color: #c2272d; }
.b-gray   { background: var(--gray-bg);   color: #55617a; }
.b-blue   { background: var(--primary-soft); color: var(--primary-dark); }
.b-violet { background: var(--violet-bg); color: #6d28d9; }
.b-cyan   { background: var(--cyan-bg);   color: #0e7490; }

.tag { display:inline-block; font-size: 11.5px; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-soft); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); font-size: 13px; font-weight: 600;
  padding: 8px 14px; border-radius: var(--radius-s); transition: .12s;
}
.btn:hover { background: var(--surface-2); border-color: var(--text-faint); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-soft { background: var(--primary-soft); border-color: transparent; color: var(--primary-dark); }
.btn-soft:hover { background: #dbe7ff; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--red-bg); border-color: transparent; color: var(--red); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 7px 9px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Quick filter chips (плашки) */
.fchips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.fchip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: 20px; border: 1px solid var(--border-strong);
  background: var(--surface); font-size: 13px; font-weight: 600; color: var(--text-soft);
  cursor: pointer; transition: .12s;
}
.fchip:hover { border-color: var(--primary); color: var(--text); }
.fchip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.fchip .cnt { background: var(--gray-bg); color: var(--text-soft); border-radius: 10px; padding: 0 7px; font-size: 11px; font-weight: 700; }
.fchip.active .cnt { background: rgba(255,255,255,.25); color: #fff; }

/* Bulk action bar */
.bulkbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--primary-soft); border: 1px solid #cfe0ff; border-radius: var(--radius-s);
  padding: 10px 14px; margin-bottom: 14px; animation: pop .14s ease-out;
}
.bulkbar .sel-count { font-weight: 700; color: var(--primary-dark); }

/* selectable table */
.chk-col { width: 38px; text-align: center; }
.chk-col input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }
table.tbl tr.row-selected { background: var(--primary-soft); }
table.tbl tr.row-selected:hover { background: #dde9ff; }
td.link { cursor: pointer; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.field { display: flex; flex-direction: column; gap: 3px; }
.field label { font-size: 11px; color: var(--text-faint); font-weight: 600; }
.input, select.input {
  border: 1px solid var(--border-strong); border-radius: var(--radius-s);
  padding: 8px 11px; font-family: inherit; font-size: 13px; background: var(--surface);
  color: var(--text); outline: none; min-width: 150px;
}
.input:focus, select.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.search-box { position: relative; }
.search-box .input { padding-left: 32px; min-width: 240px; }
.search-box::before { content: "🔍"; position: absolute; left: 10px; top: 8px; font-size: 13px; opacity: .5; }

/* Empty & misc */
.empty { text-align: center; color: var(--text-faint); padding: 44px 20px; }
.empty .big { font-size: 32px; margin-bottom: 8px; }
.muted { color: var(--text-soft); }
.tiny { font-size: 11.5px; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-col { display: flex; flex-direction: column; gap: 4px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mb-0 { margin-bottom: 0; }

/* Progress / bars */
.bar { height: 7px; background: var(--gray-bg); border-radius: 6px; overflow: hidden; min-width: 90px; }
.bar > span { display: block; height: 100%; background: var(--primary); border-radius: 6px; }

/* Avatars list */
.cell-person { display: flex; align-items: center; gap: 10px; }
.cell-person .avatar { width: 30px; height: 30px; font-size: 11px; }
.cell-person .sub { font-size: 11.5px; color: var(--text-soft); }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.tab {
  padding: 9px 14px; font-size: 13.5px; font-weight: 600; color: var(--text-soft);
  border: none; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Workflow / stepper */
.stepper { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.step {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 20px;
  background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; font-weight: 600; color: var(--text-soft);
}
.step.done { background: var(--green-bg); color: #157f3c; border-color: transparent; }
.step.current { background: var(--primary); color: #fff; border-color: var(--primary); }
.step.skipped { opacity: .5; }
.step .num { width: 18px; height: 18px; border-radius: 50%; background: rgba(0,0,0,.08); display: grid; place-items: center; font-size: 11px; }
.step.current .num { background: rgba(255,255,255,.25); }
.step-arrow { color: var(--text-faint); font-size: 13px; }

/* Timesheet grid */
.ts-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table.timesheet { border-collapse: collapse; font-size: 12px; min-width: 900px; }
table.timesheet th, table.timesheet td { border: 1px solid var(--border); padding: 0; text-align: center; }
table.timesheet th { background: var(--surface-2); font-weight: 600; padding: 6px 4px; color: var(--text-soft); font-size: 11px; position: sticky; top: 0; }
table.timesheet th.weekend, table.timesheet td.weekend { background: #fbf3f3; }
table.timesheet td.today { box-shadow: inset 0 0 0 2px var(--primary); }
table.timesheet .name-col { text-align: left; padding: 7px 10px; white-space: nowrap; position: sticky; left: 0; background: var(--surface); z-index: 2; min-width: 210px; }
table.timesheet th.name-col { z-index: 3; background: var(--surface-2); }
table.timesheet .cell { width: 34px; height: 34px; font-weight: 600; cursor: pointer; position: relative; }
table.timesheet .cell:hover { background: var(--primary-soft); }
table.timesheet .cell.day { color: #b45309; }
table.timesheet .cell.night { color: #6d28d9; background: #faf7ff; }
table.timesheet .cell.off { color: var(--text-faint); }
table.timesheet .cell.blocked { background: #3b4252; color: #3b4252; cursor: not-allowed; }
table.timesheet .cell .note-flag { position: absolute; top: 1px; right: 2px; font-size: 8px; color: var(--red); }
table.timesheet .sum-col { font-weight: 700; background: var(--surface-2); }
.ts-legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 12px 2px; font-size: 12px; color: var(--text-soft); }
.ts-legend span { display: flex; align-items: center; gap: 6px; }
.sw { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--border); display: inline-block; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(16,24,40,.45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 60px 20px; z-index: 100; overflow-y: auto;
}
.modal {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 640px; animation: pop .14s ease-out;
}
.modal.wide { max-width: 880px; }
@keyframes pop { from { transform: translateY(-8px); opacity: 0; } }
.modal-head { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-head .spacer { flex: 1; }
.modal-body { padding: 20px; max-height: 64vh; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.x-btn { border: none; background: none; font-size: 20px; color: var(--text-faint); line-height: 1; }
.x-btn:hover { color: var(--text); }

/* Detail rows */
.detail-grid { display: grid; grid-template-columns: 160px 1fr; gap: 9px 16px; font-size: 13px; }
.detail-grid dt { color: var(--text-soft); }
.detail-grid dd { margin: 0; font-weight: 500; }

/* Toast */
.toast-root { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--text); color: #fff; padding: 12px 16px; border-radius: 10px;
  box-shadow: var(--shadow-lg); font-size: 13px; font-weight: 500; max-width: 340px;
  display: flex; align-items: center; gap: 10px; animation: slidein .2s ease-out;
}
.toast.ok { background: #15803d; }
.toast.warn { background: #b45309; }
.toast.err { background: #c2272d; }
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } }

/* Section title inline */
.sub-head { font-size: 13px; font-weight: 700; color: var(--text-soft); text-transform: uppercase; letter-spacing: .5px; margin: 4px 0 10px; }

/* List groups (dashboard) */
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: none; }
.list-row .spacer { flex: 1; }

/* Kanban (сориентированные) */
.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 1100px){ .kanban { grid-template-columns: 1fr 1fr; } }
.kanban-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; }
.kanban-col h4 { margin: 2px 6px 10px; font-size: 12.5px; display: flex; align-items: center; gap: 7px; }
.kanban-col h4 .count { margin-left: auto; color: var(--text-faint); font-weight: 600; }
.kanban-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-s); padding: 10px 11px; margin-bottom: 8px; box-shadow: var(--shadow); cursor: pointer; }
.kanban-card:hover { border-color: var(--primary); }
.kanban-card .nm { font-weight: 600; font-size: 13px; }
.kanban-card .meta { font-size: 11.5px; color: var(--text-soft); margin-top: 3px; }

/* Calendar */
.cal-grid { display: grid; grid-template-columns: 70px repeat(7, 1fr); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.cal-grid .ch { background: var(--surface-2); padding: 9px 6px; text-align: center; font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); }
.cal-grid .ch.day-name small { display: block; color: var(--text-faint); font-weight: 500; }
.cal-grid .time-label { padding: 6px; font-size: 11px; color: var(--text-faint); text-align: right; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.cal-cell { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); min-height: 68px; padding: 3px; position: relative; vertical-align: top; }
.cal-slot { border-radius: 6px; padding: 4px 7px; font-size: 11px; font-weight: 600; margin-bottom: 3px; cursor: pointer; }
.cal-slot.free { background: var(--green-bg); color: #157f3c; }
.cal-slot.busy { background: var(--primary-soft); color: var(--primary-dark); }
.cal-slot.past { background: var(--gray-bg); color: var(--text-faint); }

/* Working calendar */
.cal-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.week-nav { display: flex; align-items: center; gap: 6px; }
.week-label { font-weight: 700; font-size: 14px; min-width: 200px; text-align: center; }
.cal-cell.today-col { background: #fbfcff; }
.cal-cell.weekend { background: #fbf7f7; }
.cell-add { position: absolute; inset: 0; border: none; background: none; color: transparent; cursor: pointer; font-size: 18px; width: 100%; }
.cal-cell:hover .cell-add { color: var(--text-faint); }
.slot-box { background: #eef4ff; border: 1px solid #d4e2ff; border-radius: 7px; padding: 5px; position: relative; }
.slot-head { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--primary-dark); font-weight: 700; margin-bottom: 4px; }
.slot-head .cap { margin-left: auto; background: #fff; border-radius: 8px; padding: 0 6px; font-size: 10px; }
.slot-head .cap.full { background: var(--amber-bg); color: #b45309; }
.slot-head .ico { cursor: pointer; opacity: .55; font-size: 11px; }
.slot-head .ico:hover { opacity: 1; }
.mtg-chip { display: block; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--primary); border-radius: 5px; padding: 3px 6px; font-size: 10.5px; margin-bottom: 3px; cursor: pointer; font-weight: 600; color: var(--text); }
.mtg-chip:hover { border-color: var(--primary); }
.mtg-chip .mp { font-weight: 500; color: var(--text-soft); }
.mtg-chip.done { border-left-color: var(--green); }
.mtg-chip.cancelled, .mtg-chip.moved { border-left-color: var(--gray); opacity: .65; text-decoration: line-through; }
.slot-add { display: block; width: 100%; text-align: center; border: 1px dashed var(--border-strong); border-radius: 5px; background: none; color: var(--primary-dark); font-size: 10.5px; font-weight: 600; padding: 2px; cursor: pointer; }
.slot-add:hover { background: #fff; border-color: var(--primary); }

/* Access denied note */
.rbac-note { display: flex; gap: 10px; align-items: center; background: var(--amber-bg); color: #b45309; border: 1px solid #f3d9ad; border-radius: var(--radius-s); padding: 10px 14px; font-size: 12.5px; font-weight: 500; margin-bottom: 16px; }

/* Inline meta strip */
.meta-strip { display: flex; flex-wrap: wrap; gap: 22px; margin-bottom: 4px; }
.meta-strip .m .k { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .5px; }
.meta-strip .m .v { font-size: 14px; font-weight: 600; margin-top: 2px; }

/* scrollbars */
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: #2a3550; border-radius: 8px; }
::-webkit-scrollbar { height: 10px; width: 10px; }
::-webkit-scrollbar-thumb { background: #cdd5e3; border-radius: 8px; }
