html {
  overflow-y: scroll;
}

body {
  overflow-y: scroll;
}

.admin-shell {
  width: 100%;
  margin: 0;
  padding: 0 8px;
  border: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}

body:has(.admin-shell) .workspace {
  padding: 0;
  height: calc(100vh - 76px);
}

body:has(.admin-shell) .workspace .admin-shell {
  height: 100%;
  min-height: 100%;
}

#leadSheet {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

#inviteSheet {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.module-line .module-btn {
  text-decoration: none;
}

.module-line .module-btn[data-admin-nav] {
  appearance: none;
  -webkit-appearance: none;
}

.admin-panel {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  gap: 8px;
}

.admin-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-title {
  margin: 0;
  font-size: 26px;
  line-height: 1;
  color: #f6f9ff;
  font-weight: 900;
}

.admin-subtitle {
  color: #9ebce7;
  font-size: 14px;
}

.admin-grid-4,
.admin-grid-3,
.admin-grid-2 {
  display: grid;
  gap: 7px;
}

.admin-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.admin-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-input,
.admin-select,
.admin-btn {
  min-height: 36px;
  border-radius: 8px;
  font: inherit;
}

.admin-input,
.admin-select {
  border: 1px solid #5f80ad;
  background: #edf3fc;
  color: #193b66;
  padding: 0 9px;
}

.admin-select-accent {
  border-color: #be7a2e;
  background: linear-gradient(180deg, #ffcd73 0%, #edae49 100%);
  color: #1c2f4e;
  font-weight: 800;
}

.admin-btn {
  border: none;
  cursor: pointer;
  color: #10294d;
  font-weight: 800;
  padding: 0 12px;
  background: linear-gradient(180deg, #fcd377 0%, #efb34f 100%);
}

.admin-btn.secondary {
  background: linear-gradient(180deg, #bad3ff 0%, #95b9f7 100%);
}

.admin-btn.ghost {
  background: rgba(9, 27, 54, 0.38);
  border: 1px solid #6387b9;
  color: #dbe8ff;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-status {
  font-size: 13px;
  color: #acc6ea;
}

.admin-status.error {
  color: #efafb7;
}

.admin-status.ok {
  color: #89deb1;
}

.admin-toast-host {
  position: fixed;
  right: 16px;
  bottom: 14px;
  z-index: 180;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.admin-toast {
  min-width: 260px;
  max-width: 380px;
  border-radius: 10px;
  border: 1px solid rgba(140, 160, 190, 0.42);
  background: rgba(17, 34, 58, 0.96);
  color: #e9f1ff;
  padding: 9px 12px;
  font-size: 12px;
  line-height: 1.35;
  box-shadow: 0 10px 28px rgba(8, 16, 31, 0.45);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.admin-toast.is-ok {
  border-color: rgba(132, 195, 146, 0.58);
  background: rgba(28, 74, 40, 0.95);
  color: #dbffe4;
}

.admin-toast.is-warn {
  border-color: rgba(232, 186, 110, 0.54);
  background: rgba(84, 57, 20, 0.96);
  color: #ffe6bb;
}

.admin-toast.is-error {
  border-color: rgba(211, 137, 154, 0.56);
  background: rgba(96, 42, 61, 0.96);
  color: #ffe3eb;
}

.admin-toast.is-leaving {
  opacity: 0;
  transform: translateY(5px);
}

.admin-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 190;
  background: rgba(5, 13, 24, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.admin-confirm-card {
  width: min(480px, calc(100vw - 32px));
  border: 1px solid rgba(123, 160, 207, 0.58);
  border-radius: 12px;
  background: #0d2546;
  box-shadow: 0 16px 40px rgba(3, 11, 22, 0.52);
  padding: 14px;
}

.admin-confirm-card h3 {
  margin: 0;
  color: #eef6ff;
  font-size: 18px;
  font-weight: 800;
}

.admin-confirm-card p {
  margin: 8px 0 0;
  color: #c7daf8;
  font-size: 13px;
  line-height: 1.4;
}

.admin-confirm-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.admin-table-wrap {
  border: 1px solid #486999;
  border-radius: 10px;
  overflow: auto;
  background: rgba(9, 24, 47, 0.56);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1060px;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid rgba(126, 157, 204, 0.22);
  padding: 7px;
  text-align: left;
  vertical-align: top;
  font-size: 12px;
}

.admin-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #d7e7ff;
  background: linear-gradient(180deg, #28537f 0%, #20496f 100%);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 10px;
  font-weight: 900;
}

.admin-table td code {
  color: #dfe8f8;
  font-size: 11px;
}

.admin-cell-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-cell-actions .admin-btn,
.admin-cell-actions .admin-select,
.admin-cell-actions .admin-input {
  min-height: 30px;
  height: 30px;
  font-size: 11px;
}

.admin-cell-actions .admin-input {
  width: 122px;
}

.admin-cell-actions .admin-select {
  min-width: 120px;
}

.admin-link {
  color: #ffd88d;
  text-decoration: none;
  border-bottom: 1px dashed rgba(255, 216, 141, 0.6);
}

.admin-note {
  border: 1px solid #5175ab;
  border-radius: 8px;
  background: rgba(8, 22, 42, 0.56);
  color: #c3d8f7;
  padding: 9px;
  font-size: 12px;
}

.admin-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid #6a8cbb;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  color: #deebff;
}

.admin-chip.ok {
  border-color: #55ac81;
  color: #85ddb0;
}

.admin-chip.warn {
  border-color: #c9a76a;
  color: #ffd57a;
}

.admin-chip.danger {
  border-color: #c8828d;
  color: #f2aab2;
}

.admin-chip.info {
  border-color: #7ea8d8;
  color: #cce0ff;
}

.admin-kpis {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.admin-kpi {
  border: 1px solid #4b6fa2;
  border-radius: 12px;
  padding: 10px;
  background: rgba(10, 31, 63, 0.5);
}

.admin-kpi b {
  display: block;
  font-size: 24px;
  line-height: 1;
}

.admin-kpi span {
  color: #a8c2e3;
  font-size: 12px;
}

.admin-pre {
  margin: 0;
  border: 1px solid #4b6fa2;
  border-radius: 10px;
  background: rgba(7, 24, 49, 0.6);
  color: #bdd4f7;
  padding: 10px;
  font-size: 12px;
  overflow: auto;
}

.lead-create-form {
  border: 1px solid #3f6a9e;
  border-radius: 10px;
  background: rgba(14, 38, 72, 0.7);
  padding: 10px;
  margin-top: 8px;
}

.lead-create-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.lead-create-actions {
  display: flex;
  gap: 7px;
  margin-top: 8px;
}

.lead-status-cell .plan-status-button {
  justify-content: center;
  gap: 7px;
}

.lead-status-cell .status-pill {
  min-width: 72px;
  justify-content: center;
  font-weight: 800;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18) inset;
}

.lead-row-active td {
  background: #ccdff7 !important;
}

.lead-row-active td:first-child {
  box-shadow: inset 3px 0 0 #2e5e97;
}

.plan-table .admin-chip {
  font-size: 10px;
  padding: 2px 6px;
}

.plan-table .admin-cell-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.plan-table .admin-cell-actions .admin-btn,
.plan-table .admin-cell-actions .admin-select,
.plan-table .admin-cell-actions .admin-input {
  min-height: 24px;
  height: 24px;
  font-size: 10px;
  border-radius: 5px;
  padding: 0 6px;
}

.plan-table .admin-cell-actions .admin-input {
  width: 110px;
}

.plan-table .admin-cell-actions .admin-select {
  min-width: 100px;
}

.plan-table td code {
  color: #dfe8f8;
  font-size: 11px;
}

@media (max-width: 1240px) {
  .admin-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

@media (max-width: 760px) {
  .admin-title {
    font-size: 23px;
  }

  .admin-grid-4,
  .admin-grid-3,
  .admin-grid-2,
  .admin-kpis {
    grid-template-columns: 1fr;
  }

  .lead-create-grid {
    grid-template-columns: 1fr !important;
  }
}
