/* Institution admin extensions — org CRUD + KYC panel */

.cf-inst-panel--orgs-standalone {
  margin-bottom: 1.5rem;
}

.cf-inst-super-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1.1rem;
  border-radius: 12px;
  border: 1px solid rgba(34, 197, 94, 0.35);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.12) 0%, rgba(15, 39, 68, 0.4) 100%);
}

.cf-inst-super-bar__text {
  display: grid;
  gap: 0.2rem;
}

.cf-inst-super-bar__text strong {
  font-size: 0.92rem;
  color: #86efac;
}

.cf-inst-super-bar__text span {
  font-size: 0.8rem;
  color: #94a3b8;
}

html[data-theme="light"] .cf-inst-super-bar {
  background: linear-gradient(135deg, #ecfdf5 0%, #f8fafc 100%);
  border-color: #a7f3d0;
}

html[data-theme="light"] .cf-inst-super-bar__text strong {
  color: #047857;
}

html[data-theme="dark"] #cf-nav-organizations {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.cf-inst-grid {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 0.75rem;
}

@media (max-width: 640px) {
  .cf-inst-grid {
    grid-template-columns: 1fr;
  }
}

.cf-inst-panel {
  margin-top: 1.25rem;
  padding: 1.25rem 1.5rem;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: linear-gradient(160deg, #f8fafc 0%, #ffffff 100%);
  color: #0f172a;
}

html[data-theme="dark"] .cf-inst-panel {
  background: linear-gradient(160deg, #0f172a 0%, #1e293b 100%);
  border-color: rgba(148, 163, 184, 0.2);
  color: #f8fafc;
}

.cf-inst-panel h3,
.cf-inst-panel h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.cf-inst-lead {
  font-size: 0.88rem;
  line-height: 1.55;
  color: #64748b;
  margin: 0 0 1rem;
}

html[data-theme="dark"] .cf-inst-lead {
  color: #94a3b8;
}

.cf-inst-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.cf-inst-form {
  display: grid;
  gap: 0.85rem;
  max-width: 560px;
}

.cf-inst-form label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
}

html[data-theme="dark"] .cf-inst-form label {
  color: #cbd5e1;
}

.cf-inst-form input,
.cf-inst-form textarea,
.cf-inst-form select {
  font: inherit;
  font-weight: 400;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
}

html[data-theme="dark"] .cf-inst-form input,
html[data-theme="dark"] .cf-inst-form textarea,
html[data-theme="dark"] .cf-inst-form select {
  background: #0f172a;
  border-color: #475569;
  color: #f8fafc;
}

.cf-inst-check {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
  flex-direction: row !important;
}

.cf-inst-check input {
  width: auto;
}

.cf-inst-hint {
  font-weight: 500;
  color: #64748b;
  font-size: 0.75rem;
}

.cf-inst-callback-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.cf-inst-callback-row input[readonly] {
  flex: 1;
  background: #f1f5f9;
  color: #334155;
  cursor: text;
  font-size: 0.78rem;
}

html[data-theme="dark"] .cf-inst-callback-row input[readonly] {
  background: #0f172a;
  color: #94a3b8;
}

.cf-inst-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.cf-inst-btn {
  appearance: none;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  border-radius: 8px;
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.cf-inst-btn--primary {
  background: #0f2744;
  border-color: #0f2744;
  color: #fff;
}

.cf-inst-btn--danger {
  border-color: #fecaca;
  color: #b91c1c;
  background: #fef2f2;
}

.cf-inst-btn--sm {
  padding: 0.3rem 0.55rem;
  font-size: 0.75rem;
}

.cf-inst-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: inherit;
  padding: 0.5rem 0.75rem;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
}

/* Institution page tabs — dark dashboard contrast */
[role="tablist"] [role="tab"],
button[role="tab"],
[data-state][role="tab"] {
  color: #cbd5e1 !important;
  opacity: 1 !important;
}
[role="tablist"] [role="tab"][data-state="active"],
[role="tablist"] [role="tab"][aria-selected="true"],
button[role="tab"][data-state="active"],
button[role="tab"][aria-selected="true"] {
  color: #34d399 !important;
  background: rgba(16, 185, 129, 0.18) !important;
  border-bottom: 2px solid #34d399 !important;
}
.cf-inst-tab[data-state="active"],
.cf-inst-tab[aria-selected="true"] {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}

.cf-inst-table-wrap {
  overflow-x: auto;
  margin-top: 0.75rem;
}

.cf-inst-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.cf-inst-table th,
.cf-inst-table td {
  text-align: left;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.cf-inst-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.cf-inst-badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(100, 116, 139, 0.15);
  color: #64748b;
}

.cf-inst-badge--ok {
  background: rgba(34, 197, 94, 0.15);
  color: #059669;
}

.cf-inst-badge--warn {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
}

.cf-inst-badge--info {
  background: rgba(59, 130, 246, 0.15);
  color: #2563eb;
}

.cf-inst-row-actions {
  white-space: nowrap;
}

.cf-inst-row-actions--stack {
  white-space: normal;
  min-width: 11rem;
}

.cf-inst-row-actions--stack .cf-inst-btn {
  margin-bottom: 0.25rem;
}

.cf-inst-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  margin: 0.75rem 0;
}

.cf-inst-license-fieldset {
  border: 1px solid rgba(100, 116, 139, 0.25);
  border-radius: 12px;
  padding: 12px 14px 14px;
  margin: 14px 0;
}

.cf-inst-license-fieldset legend {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  padding: 0 6px;
}

.cf-inst-module-grid {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  margin-top: 10px;
}

.cf-inst-module-check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: start;
  font-size: 0.82rem;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(100, 116, 139, 0.06);
  cursor: pointer;
}

.cf-inst-module-check strong {
  display: block;
  color: #0f172a;
}

.cf-inst-module-check small {
  display: block;
  color: #64748b;
  line-height: 1.35;
  margin-top: 2px;
}

.cf-inst-dialog {
  border: none;
  border-radius: 16px;
  padding: 0;
  max-width: 480px;
  width: calc(100% - 2rem);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

.cf-inst-dialog--org {
  max-width: min(720px, calc(100vw - 1.5rem));
}

.cf-inst-dialog::backdrop {
  background: rgba(15, 39, 68, 0.45);
}

.cf-inst-dialog__form {
  padding: 1.25rem 1.5rem 1.5rem;
  display: grid;
  gap: 0.75rem;
}

.cf-inst-org-form {
  gap: 1rem;
  max-height: min(88vh, 920px);
  overflow: auto;
}

.cf-inst-form-section {
  display: grid;
  gap: 0.65rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

html[data-theme="dark"] .cf-inst-form-section {
  background: #0f172a;
  border-color: #334155;
}

.cf-inst-form-section h5 {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}

.cf-inst-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

@media (max-width: 640px) {
  .cf-inst-form-grid {
    grid-template-columns: 1fr;
  }
}

.cf-inst-logo-upload {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1rem;
  align-items: start;
  padding: 0.85rem;
  border: 1px dashed #94a3b8;
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.cf-inst-logo-upload__drop--active {
  border-color: #0d9488;
  background: #f0fdfa;
}

html[data-theme="dark"] .cf-inst-logo-upload {
  background: #020617;
  border-color: #475569;
}

html[data-theme="dark"] .cf-inst-logo-upload__drop--active {
  background: #042f2e;
  border-color: #14b8a6;
}

@media (max-width: 560px) {
  .cf-inst-logo-upload {
    grid-template-columns: 1fr;
  }
}

.cf-inst-logo-upload__preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  border-radius: 10px;
  background: linear-gradient(165deg, #0f2744 0%, #001933 100%);
  overflow: hidden;
  padding: 0.65rem;
}

.cf-inst-logo-upload__preview img {
  display: block;
  max-width: 100%;
  max-height: 96px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.cf-inst-logo-upload__placeholder {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
  text-align: center;
  line-height: 1.4;
}

.cf-inst-logo-upload__title {
  margin: 0 0 0.25rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
}

html[data-theme="dark"] .cf-inst-logo-upload__title {
  color: #f8fafc;
}

.cf-inst-logo-upload__pick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.35rem;
  cursor: pointer;
}

.cf-inst-logo-url-fallback {
  margin-top: 0.65rem;
  font-size: 0.82rem;
}

.cf-inst-logo-url-fallback summary {
  cursor: pointer;
  color: #0d9488;
  font-weight: 600;
}

.cf-inst-color-field {
  margin-top: 0.35rem;
}

.cf-inst-color-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.cf-inst-color-row input[type="color"] {
  width: 42px;
  height: 38px;
  padding: 2px;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
}

.cf-inst-color-row input[type="text"] {
  flex: 1;
}

.cf-inst-actions--dialog {
  position: sticky;
  bottom: 0;
  padding-top: 0.35rem;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0), #f8fafc 28%);
}

html[data-theme="dark"] .cf-inst-actions--dialog {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0), #0f172a 28%);
}

.cf-inst-toast {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 99999;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
  display: none;
}

.cf-inst-toast--ok {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.cf-inst-toast--err {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.cf-inst-demo-stats {
  margin: 0.75rem 0 1rem;
}

.cf-inst-demo-list {
  margin: 0;
  padding-left: 1.25rem;
  color: #334155;
}

.cf-inst-demo-list li {
  margin: 0.35rem 0;
}

.cf-inst-muted {
  color: #64748b;
  font-size: 0.88rem;
}

.cf-inst-dl {
  display: grid;
  gap: 0.65rem;
  margin: 0.75rem 0 0;
}

.cf-inst-dl div {
  display: grid;
  gap: 0.15rem;
}

.cf-inst-dl dt {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.cf-inst-dl dd {
  margin: 0;
  font-size: 0.92rem;
}

html[data-theme="dark"] .cf-inst-dl dt {
  color: #94a3b8;
}
