.br-banks-section,
.br-banks-section * {
  box-sizing: border-box;
}

.br-banks-section {
  color: #17334a;
}

.br-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.br-section-head h2 {
  margin: 0;
  color: #17334a;
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.br-section-head p {
  margin: 7px 0 0;
  color: #788699;
  font-size: 14px;
  line-height: 1.45;
}

.br-section-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

.br-add-bank-button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 13px;
  border: 1px solid #c8df54;
  border-radius: 10px;
  background: #d9f35f;
  color: #30401e;
  box-shadow: 0 7px 18px rgba(167, 195, 43, 0.18);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: filter 140ms ease, transform 140ms ease;
}

.br-add-bank-button:hover,
.br-add-bank-button:focus-visible {
  filter: brightness(1.03);
  outline: none;
  transform: translateY(-1px);
}

.br-counter {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid #dfe5ec;
  border-radius: 999px;
  background: #eef1f5;
  color: #667386;
  font-size: 12px;
  font-weight: 700;
}

.br-bank-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr));
  gap: 16px;
}

.br-bank-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid #dfe5ec;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 9px 26px rgba(29, 52, 74, 0.06);
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
  overflow: hidden;
}

.br-bank-card:hover,
.br-bank-card:focus-visible {
  border-color: #b9c6d5;
  box-shadow: 0 14px 32px rgba(29, 52, 74, 0.11);
  outline: none;
  transform: translateY(-2px);
}

.br-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.br-card-head h3 {
  min-width: 0;
  margin: 0;
  color: #17334a;
  font-size: 19px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.br-priority {
  flex: 0 1 auto;
  max-width: 58%;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
}

.br-priority--p0 { background: #ffeaec; color: #b42332; }
.br-priority--p1 { background: #fff0dc; color: #a45a00; }
.br-priority--p2 { background: #e9f2ff; color: #2c67a1; }
.br-priority--p3 { background: #eef1f5; color: #647184; }
.br-priority--empty { background: #eef1f5; color: #7e8998; }

.br-stage {
  display: inline-flex;
  max-width: 100%;
  margin-top: 10px;
  padding: 6px 10px;
  border: 1px solid #cfe9df;
  border-radius: 9px;
  background: #ecf8f3;
  color: #21765c;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: normal;
}

.br-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px 18px;
  margin-top: 20px;
}

.br-field {
  min-width: 0;
}

.br-field--wide {
  grid-column: 1 / -1;
}

.br-label {
  display: block;
  margin-bottom: 5px;
  color: #8894a4;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
}

.br-value {
  min-width: 0;
  color: #3f5064;
  font-size: 13px;
  line-height: 1.48;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.br-muted {
  color: #9aa4b1;
}

.br-contact,
.br-latest {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.br-contact-name,
.br-latest time {
  color: #263d52;
  font-weight: 700;
}

.br-contact-phone {
  color: #748195;
}

.br-clamp {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.br-card-action {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #edf0f4;
  color: #6258b5;
  font-size: 12px;
  font-weight: 700;
}

.br-modal-open {
  overflow: hidden;
}

.br-modal-backdrop {
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(16, 35, 53, 0.52);
  backdrop-filter: blur(8px);
}

.br-modal,
.br-modal * {
  box-sizing: border-box;
}

.br-modal {
  display: flex;
  flex-direction: column;
  width: min(920px, 100%);
  max-height: min(900px, calc(100vh - 48px));
  overflow: hidden;
  border: 1px solid #dce3eb;
  border-radius: 22px;
  background: #fff;
  color: #273f55;
  box-shadow: 0 32px 90px rgba(16, 35, 53, 0.28);
}

.br-modal-head,
.br-modal-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 24px;
}

.br-modal-head {
  border-bottom: 1px solid #e8edf2;
}

.br-modal-head h2 {
  margin: 2px 0 0;
  color: #17334a;
  font-size: 24px;
  line-height: 1.25;
}

.br-eyebrow {
  margin: 0;
  color: #8692a3;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.br-modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 2px 24px 26px;
  scrollbar-color: #c8d0da transparent;
}

.br-form-section {
  padding: 22px 0;
  border-bottom: 1px solid #edf0f4;
}

.br-form-section:last-child {
  border-bottom: 0;
}

.br-form-section h3 {
  margin: 0 0 15px;
  color: #263f55;
  font-size: 15px;
  line-height: 1.4;
}

.br-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.br-contact-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.br-form-wide {
  grid-column: 1 / -1;
}

.br-form-section label,
.br-comment-form label,
.br-communication-row label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
  color: #657387;
  font-size: 12px;
  font-weight: 700;
}

.br-input {
  width: 100%;
  min-width: 0;
  border: 1px solid #d8dfe8;
  border-radius: 11px;
  outline: none;
  background: #f9fbfc;
  color: #263d52;
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

input.br-input,
select.br-input {
  height: 43px;
  padding: 0 12px;
}

textarea.br-input {
  min-height: 74px;
  padding: 11px 12px;
  resize: vertical;
}

.br-input:focus {
  border-color: #7d82d6;
  box-shadow: 0 0 0 3px rgba(99, 102, 180, 0.12);
}

.br-input::placeholder {
  color: #9ba5b2;
}

.br-subsection-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 15px;
}

.br-subsection-head h3 {
  margin-bottom: 3px;
}

.br-subsection-head p {
  margin: 0;
  color: #8390a1;
  font-size: 12px;
  line-height: 1.45;
}

.br-communication-row {
  position: relative;
  display: grid;
  grid-template-columns: 155px minmax(0, 1fr) 36px;
  align-items: end;
  gap: 12px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid #e2e7ed;
  border-radius: 14px;
  background: #f7f9fb;
}

.br-communication-comment-wrap textarea {
  min-height: 61px;
}

.br-icon-button {
  display: inline-grid;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid #dce3eb;
  border-radius: 10px;
  background: #fff;
  color: #758295;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.br-icon-button:hover,
.br-icon-button:focus-visible {
  border-color: #e9a5ad;
  color: #b42332;
  outline: none;
}

.br-close-modal {
  align-self: flex-start;
}

.br-add-button,
.br-secondary-button,
.br-primary-button,
.br-danger-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 10px;
  padding: 0 15px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: filter 140ms ease, border-color 140ms ease, opacity 140ms ease;
}

.br-add-button,
.br-secondary-button {
  border: 1px solid #d8dfe8;
  background: #fff;
  color: #566579;
}

.br-add-button:hover,
.br-secondary-button:hover {
  border-color: #8e92d7;
  color: #3f477e;
}

.br-primary-button {
  border: 1px solid rgba(129, 140, 248, 0.65);
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  color: #fff;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.22);
}

.br-primary-button:hover {
  filter: brightness(1.08);
}

.br-danger-button {
  border: 1px solid #e4aab0;
  background: #fff;
  color: #a82d3a;
}

.br-danger-button:hover,
.br-danger-button:focus-visible {
  border-color: #c8515d;
  outline: none;
  filter: brightness(0.99);
}

.br-danger-button--solid {
  border-color: #b42332;
  background: #b42332;
  color: #fff;
}

.br-add-button:disabled,
.br-secondary-button:disabled,
.br-primary-button:disabled,
.br-danger-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.br-form-error {
  min-height: 18px;
  margin: 9px 0 0;
  color: #b42332;
  font-size: 12px;
}

.br-comment-count {
  display: inline-grid;
  min-width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  background: #eeedfb;
  color: #5853a3;
  font-size: 12px;
  font-weight: 800;
}

.br-comments-list {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.br-comment {
  padding: 13px 14px;
  border: 1px solid #e2e7ed;
  border-radius: 12px;
  background: #f7f9fb;
}

.br-comment-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: #8490a0;
  font-size: 11px;
}

.br-comment-meta strong {
  color: #354b60;
  font-size: 12px;
}

.br-comment p {
  margin: 7px 0 0;
  color: #536377;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.br-empty-comments {
  margin: 0;
  color: #8c97a6;
  font-size: 13px;
}

.br-comment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px auto;
  align-items: end;
  gap: 12px;
}

.br-modal-footer {
  justify-content: space-between;
  border-top: 1px solid #e8edf2;
  background: #f8fafc;
}

.br-modal-footer-left,
.br-modal-footer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.br-confirm-backdrop {
  position: fixed;
  z-index: 12000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(16, 35, 53, 0.46);
  backdrop-filter: blur(5px);
}

.br-confirm-dialog,
.br-confirm-dialog * {
  box-sizing: border-box;
}

.br-confirm-dialog {
  width: min(430px, 100%);
  padding: 26px;
  border: 1px solid #e0e5eb;
  border-radius: 18px;
  background: #fff;
  color: #31475b;
  box-shadow: 0 26px 70px rgba(16, 35, 53, 0.3);
  text-align: center;
}

.br-confirm-icon {
  display: grid;
  width: 44px;
  height: 44px;
  margin: 0 auto 14px;
  place-items: center;
  border-radius: 50%;
  background: #ffeaec;
  color: #b42332;
  font-size: 21px;
  font-weight: 900;
}

.br-confirm-dialog h3 {
  margin: 0;
  color: #17334a;
  font-size: 19px;
}

.br-confirm-dialog p {
  margin: 10px 0 21px;
  color: #718094;
  font-size: 13px;
  line-height: 1.55;
}

.br-confirm-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.br-toast {
  position: fixed;
  z-index: 11000;
  right: 24px;
  bottom: 24px;
  max-width: min(420px, calc(100vw - 48px));
  padding: 13px 16px;
  border: 1px solid rgba(110, 231, 183, 0.28);
  border-radius: 12px;
  background: #10291f;
  color: #b7f7d7;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.br-toast--visible {
  opacity: 1;
  transform: translateY(0);
}

.br-toast--error {
  border-color: rgba(248, 113, 113, 0.3);
  background: #32161a;
  color: #fecdd3;
}

@media (max-width: 820px) {
  .br-form-grid,
  .br-contact-grid,
  .br-comment-form {
    grid-template-columns: 1fr;
  }

  .br-form-wide {
    grid-column: auto;
  }

  .br-comment-form .br-secondary-button {
    justify-self: start;
  }
}

@media (max-width: 640px) {
  .br-section-head {
    flex-direction: column;
    gap: 12px;
  }

  .br-section-actions {
    width: 100%;
    justify-content: space-between;
  }

  .br-card-grid {
    grid-template-columns: 1fr;
  }

  .br-field--wide {
    grid-column: auto;
  }

  .br-modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .br-modal {
    width: 100%;
    max-height: 94vh;
    border-radius: 20px 20px 0 0;
  }

  .br-modal-head,
  .br-modal-footer {
    padding: 17px 18px;
  }

  .br-modal-body {
    padding: 0 18px 22px;
  }

  .br-communication-row {
    grid-template-columns: 1fr 36px;
    align-items: end;
  }

  .br-communication-row > label:first-child {
    grid-column: 1 / -1;
  }

  .br-communication-comment-wrap {
    grid-column: 1;
  }

  .br-remove-communication {
    grid-column: 2;
  }
}

@media (max-width: 420px) {
  .br-card-head {
    flex-direction: column;
  }

  .br-priority {
    max-width: 100%;
  }

  .br-modal-footer {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .br-modal-footer-left,
  .br-modal-footer-actions {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }

  .br-modal-footer-left:empty {
    display: none;
  }

  .br-modal-footer-left .br-danger-button {
    grid-column: 1 / -1;
  }

  .br-confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}
