/* Tax Radar — месячный лимит токенов, накладка production (tr-limits-20260928).
   Только собственные классы trl-*: стили бандла (Tailwind) не переопределяются. */

.trl-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 420px;
  padding: 3px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.trl-chip:hover { background: #f1f5f9; color: #1e293b; }
.trl-chip:focus-visible, .trl-btn:focus-visible, .trl-link:focus-visible, .trl-tab:focus-visible,
.trl-banner-action:focus-visible, .trl-banner-close:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}
.trl-chip.trl-lvl-80 { border-color: #fcd34d; background: #fffbeb; color: #92400e; }
.trl-chip.trl-lvl-95 { border-color: #fdba74; background: #fff7ed; color: #9a3412; }
.trl-chip.trl-lvl-100 { border-color: #fca5a5; background: #fef2f2; color: #b91c1c; }
.trl-chip-short { display: none; }
@media (max-width: 1279px) {
  .trl-chip-full { display: none; }
  .trl-chip-short { display: inline; }
}
@media (max-width: 639px) {
  .trl-chip { display: none; }
}

/* Плашки 80 / 95 % и «исчерпан»: под шапкой (h-14 = 56px), не перекрывают поле ввода внизу. */
.trl-banner {
  position: fixed;
  top: 64px;
  right: 16px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(520px, calc(100vw - 32px));
  padding: 10px 12px 10px 14px;
  border: 1px solid #fcd34d;
  border-radius: 10px;
  background: #fffbeb;
  color: #78350f;
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.12);
}
.trl-banner.trl-lvl-95 { border-color: #fdba74; background: #fff7ed; color: #7c2d12; }
.trl-banner.trl-lvl-100 { border-color: #fca5a5; background: #fef2f2; color: #7f1d1d; }
.trl-banner-text { flex: 1 1 auto; }
.trl-banner-action {
  flex: 0 0 auto;
  padding: 5px 10px;
  border: 1px solid currentColor;
  border-radius: 8px;
  background: #fff;
  color: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.trl-banner-close {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.trl-banner-close:hover { background: rgba(0, 0, 0, 0.06); }

/* Модальное окно */
.trl-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.45);
}
.trl-modal {
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 22px 24px 20px;
  border-radius: 14px;
  background: #fff;
  color: #1e293b;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
}
.trl-modal p { margin: 0 0 10px; }
.trl-modal-title { margin: 0 0 10px; font-size: 18px; font-weight: 700; color: #0f172a; }
.trl-modal-usage { color: #475569; }
.trl-modal-ok { padding: 10px 12px; border-radius: 8px; background: #ecfdf5; color: #065f46; font-weight: 600; }
.trl-modal-status { padding: 10px 12px; border-radius: 8px; background: #eff6ff; color: #1e3a8a; }
.trl-modal-error { color: #b91c1c; }
.trl-modal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.trl-label { display: block; margin: 10px 0 6px; font-weight: 600; color: #334155; font-size: 13px; }
.trl-textarea, .trl-input {
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 14px;
  color: #0f172a;
  background: #fff;
}
.trl-textarea { width: 100%; resize: vertical; }
.trl-input { min-width: 80px; }
.trl-input-short { width: 80px; }
.trl-textarea:focus, .trl-input:focus { outline: 2px solid #93c5fd; border-color: #2563eb; }

.trl-btn {
  padding: 7px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.trl-btn:hover { background: #f8fafc; }
.trl-btn[disabled] { opacity: 0.55; cursor: default; }
.trl-btn-primary { border-color: #2563eb; background: #2563eb; color: #fff; }
.trl-btn-primary:hover { background: #1d4ed8; }
.trl-btn-danger { border-color: #fca5a5; color: #b91c1c; }
.trl-btn-danger:hover { background: #fef2f2; }
.trl-link {
  padding: 0;
  border: 0;
  background: none;
  color: #2563eb;
  font-size: 12px;
  cursor: pointer;
}
.trl-link:hover { color: #1e40af; text-decoration: underline; }
.trl-muted { color: #64748b; font-size: 12px; }
.trl-strong { font-weight: 600; color: #1e293b; }
.trl-error { color: #b91c1c; font-size: 13px; }
.trl-warn { color: #92400e; background: #fffbeb; border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.trl-notice { color: #065f46; font-size: 13px; margin: 0 0 8px; }

/* Счётчик новых заявок на пункте меню «Админ» */
.trl-nav-badge {
  display: inline-block;
  min-width: 16px;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 999px;
  background: #f97316;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

/* Раздел админки */
.trl-admin {
  margin: 0 0 20px;
  padding: 12px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  font-size: 13px;
  color: #334155;
}
.trl-admin-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.trl-admin-title { margin: 0; font-size: 14px; font-weight: 600; color: #1e293b; }
.trl-spacer { flex: 1 1 auto; }
.trl-tabs { display: flex; gap: 4px; margin: 12px 0 10px; border-bottom: 1px solid #e2e8f0; }
.trl-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: #64748b;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.trl-tab-on { border-bottom-color: #2563eb; color: #1d4ed8; }
.trl-panel > p { margin: 8px 0; }
.trl-panel > .trl-link:first-child { margin-top: 10px; }
.trl-filter { margin: 4px 0 8px; }
.trl-table-wrap { overflow-x: auto; }
.trl-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.trl-table th {
  padding: 6px 10px;
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  font-weight: 500;
  text-align: left;
}
.trl-table td { padding: 7px 10px; border-top: 1px solid #f1f5f9; vertical-align: top; }
.trl-table-small { width: auto; }
.trl-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.trl-row-blocked td { background: #fef2f2; }
.trl-edit-row td { background: #f8fafc; }
.trl-edit-row td > * { margin-right: 8px; vertical-align: middle; }
.trl-comment { max-width: 280px; color: #475569; }
.trl-comment-full { white-space: pre-wrap; word-break: break-word; background: #f8fafc; border-radius: 8px; padding: 8px 10px; }
.trl-bar { width: 90px; height: 4px; margin-top: 4px; border-radius: 2px; background: #e2e8f0; overflow: hidden; }
.trl-bar-fill { display: block; height: 100%; background: #3b82f6; }
.trl-bar-fill.trl-lvl-80 { background: #f59e0b; }
.trl-bar-fill.trl-lvl-95 { background: #f97316; }
.trl-bar-fill.trl-lvl-100 { background: #dc2626; }

.trl-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.trl-st-new { background: #ffedd5; color: #9a3412; }
.trl-st-contacted { background: #dbeafe; color: #1e40af; }
.trl-st-approved { background: #dcfce7; color: #166534; }
.trl-st-declined { background: #f1f5f9; color: #64748b; }

.trl-card-title { margin: 10px 0 8px; font-size: 15px; font-weight: 700; color: #0f172a; }
.trl-sub { margin: 14px 0 6px; font-size: 12px; font-weight: 600; color: #475569; text-transform: none; }
.trl-dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; }
.trl-dl dt { color: #64748b; }
.trl-dl dd { margin: 0; color: #1e293b; }
.trl-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.trl-approve { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
@media (max-width: 639px) {
  .trl-dl { grid-template-columns: 1fr; }
  .trl-dl dd { margin-bottom: 6px; }
}
