/* b24.css — стили мокапа «График платежей», приближены к карточке CRM Битрикс24 */
:root {
  --font: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --text: #333;
  --text-2: #535c69;
  --muted: #828b95;
  --faint: #a8adb4;
  --line: #e6e9ec;
  --line-2: #dfe3e8;
  --bg: #eef2f4;
  --card: #fff;
  --hover: #f6f8f9;
  --link: #2067b0;
  --primary: #0f6fe8;
  --primary-hover: #0b5fcb;
  --primary-soft: #e5f1fd;
  --green: #1f9a55;
  --green-bar: #42c27c;
  --green-soft: #e5f6ec;
  --orange: #c17a00;
  --orange-bar: #f7a700;
  --orange-soft: #fff3dc;
  --red: #d63a45;
  --red-bar: #f0545e;
  --red-soft: #fde9eb;
  --gray-soft: #f1f3f5;
  --violet: #7a5ad8;
  --violet-soft: #efeafd;
  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 14px; line-height: 1.45; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
body.pg-frame { background: transparent; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden { display: none !important; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font: 600 13px/1 var(--font); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-light { background: #fff; border-color: var(--line-2); color: var(--text-2); }
.btn-light:hover { border-color: #c4cbd3; color: var(--text); }
.btn-ghost { background: transparent; color: var(--link); padding: 0 8px; }
.btn-ghost:hover { background: var(--primary-soft); }
.btn-danger-light { background: #fff; border-color: #f3c3c8; color: var(--red); }
.btn-danger-light:hover { background: var(--red-soft); }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.icon-btn { width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: var(--gray-soft); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- бейджи ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.plain::before { display: none; }
.b-green { background: var(--green-soft); color: var(--green); }
.b-red { background: var(--red-soft); color: var(--red); }
.b-orange { background: var(--orange-soft); color: var(--orange); }
.b-blue { background: var(--primary-soft); color: var(--link); }
.b-gray { background: var(--gray-soft); color: var(--text-2); }
.b-violet { background: var(--violet-soft); color: var(--violet); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }

/* ---------- формы ---------- */
.inp, .sel, textarea.inp {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid #d5d9de; border-radius: var(--radius-sm);
  background: #fff; font: 14px var(--font); color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.inp { height: auto; min-height: 64px; padding: 9px 12px; resize: vertical; }
.inp:focus, .sel:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15, 111, 232, .12); }
.inp.err { border-color: var(--red); }
.inp-sm { height: 32px; padding: 0 8px; font-size: 13px; }
.lbl { display: block; font-size: 12px; color: var(--muted); margin: 0 0 5px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.frow { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.fgroup { margin-bottom: 14px; }
.suffix { position: relative; }
.suffix .inp { padding-right: 30px; }
.suffix::after { content: '₽'; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; pointer-events: none; }
.radio-cards { display: grid; gap: 8px; }
.radio-card { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); cursor: pointer; }
.radio-card:hover { border-color: #c4cbd3; }
.radio-card input { margin: 3px 0 0; accent-color: var(--primary); }
.radio-card.on { border-color: var(--primary); background: #f7fbff; }
.radio-card b { display: block; font-size: 13px; font-weight: 600; }
.radio-card span { font-size: 12px; color: var(--muted); }
.seg { display: inline-flex; padding: 3px; background: var(--gray-soft); border-radius: 9px; gap: 2px; }
.seg button { border: 0; background: transparent; height: 28px; padding: 0 12px; border-radius: 7px; font: 600 12px var(--font); color: var(--text-2); cursor: pointer; }
.seg button.on { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.check { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; cursor: pointer; }
.check input { accent-color: var(--primary); width: 16px; height: 16px; margin: 0; }

/* ---------- карточки и таблицы ---------- */
.card { background: var(--card); border-radius: var(--radius); }
.card-pad { padding: 18px 20px; }
.card-title { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.card-title .sp { flex: 1; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fafbfc; }
.tbl td { padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--hover); }
.tbl .r { text-align: right; }
.tbl tfoot td { font-weight: 700; background: #fafbfc; border-top: 1px solid var(--line); border-bottom: 0; }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }

/* ---------- полоса оплаты ---------- */
.bar { display: flex; height: 6px; border-radius: 3px; background: #e9edf0; overflow: hidden; }
.bar i { display: block; height: 100%; }
.bar .g { background: var(--green-bar); }
.bar .r { background: var(--red-bar); }
.bar .o { background: var(--orange-bar); }
.bar.thick { height: 8px; border-radius: 4px; }

/* ---------- уведомления ---------- */
.note { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--radius-sm); font-size: 13px; line-height: 1.45; }
.note svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.note-blue { background: var(--primary-soft); color: #1c4f86; }
.note-red { background: var(--red-soft); color: #9f2530; }
.note-orange { background: var(--orange-soft); color: #8a5a00; }
.note-green { background: var(--green-soft); color: #186b3d; }
.note-gray { background: var(--gray-soft); color: var(--text-2); }
.note ul { margin: 4px 0 0; padding-left: 18px; }

/* ---------- модальные окна ---------- */
.overlay { position: absolute; left: 0; right: 0; top: 0; min-height: 100%; background: rgba(20, 30, 45, .35); z-index: 100; }
.overlay.fixed { position: fixed; bottom: 0; }
.modal { position: absolute; left: 50%; transform: translateX(-50%); width: min(760px, calc(100% - 32px)); background: #fff; border-radius: 14px; box-shadow: 0 18px 48px rgba(15, 30, 50, .22); display: flex; flex-direction: column; overflow: hidden; }
.modal.wide { width: min(980px, calc(100% - 32px)); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 18px; font-weight: 600; flex: 1; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { display: flex; gap: 10px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line); background: #fafbfc; }
.modal-foot .sp { flex: 1; }
.err-text { color: var(--red); font-size: 13px; }

/* ---------- тосты ---------- */
.toast-root { position: absolute; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { background: #2b3440; color: #fff; padding: 11px 16px; border-radius: 10px; font-size: 13px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); max-width: 380px; animation: tin .2s ease; }
@keyframes tin { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- меню строки ---------- */
.menu { position: absolute; z-index: 150; min-width: 200px; background: #fff; border-radius: 10px; box-shadow: 0 10px 30px rgba(15, 30, 50, .18); padding: 6px; }
.menu button { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent; text-align: left; padding: 8px 10px; border-radius: 7px; font: 13px var(--font); color: var(--text); cursor: pointer; }
.menu button:hover { background: var(--hover); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
