@import url('./variables.css');

:root {
  --bg: var(--cosmic-bg);
  --panel: var(--cosmic-panel);
  --border: var(--cosmic-border);
  --text: var(--cosmic-text);
  --muted: var(--cosmic-muted);
  --muted2: var(--cosmic-muted-2);
  --radius: var(--radius-lg);
  --shadow: var(--shadow-lg);
  --brand: var(--cosmic-primary);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

/* Cosmic Background Glow */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 30%, rgba(6, 182, 212, 0.08) 0%, transparent 40%);
}

a {
  color: inherit;
  text-decoration: none;
  transition: 0.2s;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* SCROLLBARS */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* SIDEBAR */
.app-sidebar {
  width: 180px;
  flex-shrink: 0;
  background: rgba(5, 5, 8, 0.88);
  border-right: 1px solid rgba(255, 255, 255, .09);
  backdrop-filter: blur(20px);
  padding: 16px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

.app-brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 6px 8px 14px;
  text-decoration: none;
  margin-bottom: 0;
}

.app-brand img {
  width: 26px;
  height: 26px;
  border-radius: 8px;
}

.app-brand .t {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  color: #fff;
}

.ws-card {
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
  flex-shrink: 0;
  overflow: hidden;
}

.ws-card:hover {
  border-color: rgba(255, 255, 255, .15);
}

.ws-name {
  font-weight: 600;
  color: #fff;
  font-size: 0.82rem;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-meta {
  margin-top: 3px;
  font-size: 0.72rem;
  color: rgba(232, 238, 252, .5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-soft {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 20px;
  background: rgba(99, 102, 241, .1);
  border: 1px solid rgba(99, 102, 241, .2);
  color: rgba(232, 238, 252, .85);
  font-size: 0.7rem;
  font-weight: 600;
}

.side-section {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(232, 238, 252, .35);
  font-weight: 600;
  margin: 16px 10px 6px;
}

.side-link {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  color: rgba(232, 238, 252, .7);
  font-size: 0.85rem;
  border: 1px solid transparent;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}

.side-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, .05);
}

.side-link.active {
  background: rgba(99, 102, 241, .1);
  color: #fff;
  border-color: rgba(99, 102, 241, .2);
  font-weight: 500;
}

.side-link i {
  font-size: 0.95rem;
  opacity: 0.8;
  flex-shrink: 0;
}

.side-submenu {
  margin-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 3px;
}

.side-sublink {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.82rem;
  color: rgba(232, 238, 252, .5);
  transition: 0.15s;
  text-decoration: none;
}

.side-sublink:hover {
  color: #fff;
  background: rgba(255, 255, 255, .04);
}

.side-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  flex-shrink: 0;
}

.side-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  color: rgba(232, 238, 252, .5);
  font-size: 0.85rem;
  border-radius: 10px;
  transition: 0.15s;
  text-decoration: none;
}

.side-btn:hover {
  background: rgba(255, 255, 255, .05);
  color: #fff;
}

.side-tooltip {
  display: none !important;
}

/* MAIN AREA */
.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-main-shell {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: clip;
  overflow-y: auto;
  padding: 16px;
}

.app-main-shell>* {
  min-width: 0;
}

.app-topbar {
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(3, 3, 4, 0.7);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-title h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
}

.btn-solid {
  background: var(--cosmic-gradient);
  border: none;
  color: #fff;
  padding: 8px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  transition: transform 0.2s;
}

.btn-solid:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.page {
  padding: 32px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  min-width: 0;
}

/* CARDS */
.cardx {
  background: var(--cosmic-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.cardx::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.card-glass {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.card-highlight {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.tablex {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.tablex th {
  text-align: left;
  padding: 12px 16px;
  color: var(--muted2);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

.tablex td {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 0.95rem;
}

.tablex tr:last-child td {
  border-bottom: none;
}

.tablex tr:hover td {
  background: var(--cosmic-panel-hover);
}

/* FORMS - Force dark theme override */
.form-control,
.form-select,
.input-dark {
  background-color: rgba(10, 10, 12, 0.6) !important;
  border: 1px solid var(--border) !important;
  color: #fff !important;
  border-radius: var(--radius-md) !important;
  padding: 10px 14px !important;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--cosmic-primary) !important;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2) !important;
  background-color: rgba(5, 5, 8, 0.8) !important;
  color: #fff !important;
}

/* This attempts to style the dropdown options, works in Chrome/FF */
.form-select option {
  background-color: #0b0f16;
  color: #e8eefc;
}

/* UTILS */
.badge-soft {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-soft {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: 0.2s;
  border: 1px solid transparent;
}

.btn-soft:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.1);
}

@media (max-width: 900px) {
  .app-sidebar {
    position: fixed;
    left: -100%;
    z-index: 100;
    transition: 0.3s;
  }

  .app-sidebar.open {
    left: 0;
  }

  .app-sidebar.open+.app-main::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
  }
}

/* ADMIN PANEL OVERRIDES */
body.active-admin .card {
  background: #0f1118;
  /* Solid dark background for contrast */
  border: 1px solid var(--border);
  color: var(--text);
}

body.active-admin .card-title {
  color: #fff;
  font-weight: 700;
}

body.active-admin .text-muted {
  color: var(--muted) !important;
}

body.active-admin .btn-outline-primary {
  border-color: var(--border);
  color: var(--text);
}

body.active-admin .btn-outline-primary:hover {
  border-color: var(--brand);
  color: #fff;
  background: var(--brand);
}


:root {
  --text: #e8eefc;
  --muted: rgba(233, 238, 246, .72);
  --muted2: rgba(233, 238, 246, .58);
  --brand: #7c7cff;
  --ok: #3de1c5;
  --danger: #ff5a7a;
  --shadow: 0 18px 45px rgba(0, 0, 0, .55);
  --radius: 18px;
}

* {
  box-sizing: border-box
}

html,
body {
  height: 100%
}

body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  /* Solid dark background (no bottom gradients)
     Decorative glow is rendered in body::before (top-only). */
  background: var(--bg);
  color: var(--text);
}

/* Top-only subtle glow (prevents ugly bottom gradients) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(900px 520px at 18% -12%, rgba(124, 124, 255, .18), transparent 62%),
    radial-gradient(820px 520px at 92% -10%, rgba(61, 225, 197, .10), transparent 64%);
}

a {
  color: inherit
}

.app-shell {
  display: flex;
  min-height: 100vh
}

/* SIDEBAR (enterprise theme) */
.app-sidebar {
  width: 180px;
  background: rgba(6, 7, 11, .9);
  border-right: 1px solid rgba(255, 255, 255, .09);
  padding: 16px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
}

.app-brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 6px 8px 14px;
  text-decoration: none;
}

.app-brand img {
  width: 26px;
  height: 26px;
  border-radius: 8px;
}

.app-brand .t {
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: .1px;
}

.app-brand .s {
  font-size: 0.72rem;
  color: var(--muted2);
}

.ws-card {
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 4px 0 12px;
  overflow: hidden;
}

.ws-name {
  margin: 0;
  font-weight: 700;
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-meta {
  margin: 3px 0 0;
  color: var(--muted2);
  font-size: 0.72rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-soft {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(124, 124, 255, .10);
  border: 1px solid rgba(124, 124, 255, .22);
  color: rgba(232, 238, 252, .9);
  font-size: 0.7rem;
}

.side-section {
  margin: 16px 10px 6px;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(232, 238, 252, .3);
  font-weight: 600;
}

.side-link {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: rgba(232, 238, 252, .7);
  border: 1px solid transparent;
  font-size: 0.85rem;
  transition: background 0.15s, color 0.15s;
}

.side-link:hover {
  background: rgba(255, 255, 255, .05);
  color: #fff;
}

.side-link.active {
  background: rgba(124, 124, 255, .10);
  border-color: rgba(124, 124, 255, .25);
  color: #fff;
  font-weight: 500;
}

.side-link i {
  font-size: 0.95rem;
  opacity: 0.8;
  flex-shrink: 0;
}

.side-submenu {
  margin-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 3px;
}

.side-sublink {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.82rem;
  color: rgba(232, 238, 252, .5);
  transition: 0.15s;
  text-decoration: none;
}

.side-sublink:hover {
  color: #fff;
  background: rgba(255, 255, 255, .04);
}

.side-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.side-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 0.85rem;
  color: rgba(232, 238, 252, .5);
  transition: 0.15s;
}

.side-btn:hover {
  background: rgba(255, 255, 255, .04);
  color: #fff;
}

.side-tooltip {
  display: none !important;
}

.app-main {
  flex: 1;
  min-width: 0
}

.app-topbar {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: rgba(7, 9, 13, .55);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-end
}

.top-title h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 800
}

.top-title p {
  margin: 6px 0 0;
  color: var(--muted2);
  font-size: 13px
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end
}

.kbd-pill {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .02);
  color: var(--muted);
  font-size: 12px;
}

.btn-soft,
.btn-solid {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  text-decoration: none;
  border: 1px solid var(--border);
  font-weight: 600;
}

.btn-soft {
  background: rgba(255, 255, 255, .02)
}

.btn-soft:hover {
  background: rgba(255, 255, 255, .04)
}

.btn-solid {
  background: linear-gradient(180deg, rgba(124, 124, 255, .30), rgba(124, 124, 255, .16));
  border-color: rgba(124, 124, 255, .35);
}

.btn-solid:hover {
  filter: brightness(1.05)
}

.page {
  padding: 22px
}

.cardx {
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.cardx h3 {
  font-size: 14px;
  margin: 0 0 12px;
  color: rgba(232, 238, 252, .92);
  font-weight: 700
}

.muted {
  color: var(--muted2)
}

.input-dark,
.form-control,
.form-select {
  background: rgba(255, 255, 255, .03) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
}

.form-control::placeholder {
  color: rgba(232, 238, 252, .38)
}

.table {
  color: var(--text)
}

.table thead th {
  color: rgba(232, 238, 252, .88);
  border-color: var(--border)
}

.table td,
.table th {
  border-color: var(--border)
}

/* Fix: Bootstrap table cells default to white background */
.table> :not(caption)>*>* {
  background: rgba(255, 255, 255, .02) !important;
  color: var(--text) !important;
}

.table thead th {
  background: rgba(255, 255, 255, .04) !important;
}

.table-hover tbody tr:hover>* {
  background: rgba(124, 124, 255, .06) !important;
}

.table-striped>tbody>tr:nth-of-type(odd)>* {
  background: rgba(255, 255, 255, .015) !important;
}

/* Kill accidental light backgrounds */
.table-light,
.bg-white,
.bg-light {
  background: transparent !important
}

/* Better readability in muted text */
.text-muted {
  color: var(--muted) !important
}

hr {
  border-color: var(--border);
  opacity: 1
}

.alertx {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .03);
  color: var(--text);
  box-shadow: var(--shadow);
}

.alertx-ok {
  border-color: rgba(61, 225, 197, .25)
}

.alertx-danger {
  border-color: rgba(255, 90, 122, .25)
}

/* Mobile sidebar */
@media (max-width: 991px) {
  .app-sidebar {
    position: fixed;
    left: -290px;
    top: 0;
    height: 100vh;
    z-index: 50;
    transition: left .18s ease
  }

  .app-sidebar.open {
    left: 0
  }

  .app-topbar {
    position: sticky
  }
}

.text-muted {
  color: var(--muted) !important;
}

.form-text,
.small,
small,
.card .text-muted,
.card p.text-muted {
  color: var(--muted2) !important;
}

.subtitle,
.description,
.desc,
.hint,
.helper,
.feature-desc {
  color: var(--muted2) !important;
}

.card p {
  color: var(--muted2);
}

/* =========================
   Super Admin pages styling
   (scoped to body.active-admin)
   ========================= */
body.active-admin .card {
  background: rgba(255, 255, 255, .035);
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

body.active-admin .card .card-body {
  padding: 18px;
}

body.active-admin .card .card-title {
  font-weight: 800;
  letter-spacing: .2px;
}

body.active-admin .btn {
  border-radius: 12px;
}

body.active-admin .btn-outline-primary,
body.active-admin .btn-outline-secondary {
  border-color: rgba(255, 255, 255, .18);
}

body.active-admin .btn-outline-primary:hover,
body.active-admin .btn-outline-secondary:hover {
  border-color: rgba(255, 255, 255, .30);
}

body.active-admin .admin-stat {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

body.active-admin .admin-stat .k {
  color: var(--muted2);
  font-size: 12px;
}

body.active-admin .admin-stat .v {
  font-weight: 900;
  font-size: 26px;
  line-height: 1;
}

/* =========================
   Modal (team invites)
   ========================= */
.modalx {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}

.modalx .modalx-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(6px);
}

.modalx .modalx-card {
  position: relative;
  z-index: 2;
  max-width: 560px;
  width: calc(100% - 24px);
  margin: 8vh auto;
  background: rgba(14, 20, 32, .98);
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 18px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .65);
  overflow: hidden;
}

.modalx .modalx-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.modalx .modalx-b {
  padding: 14px
}

.btn-icon {
  border: 1px solid rgba(255, 255, 255, .10);
  background: rgba(255, 255, 255, .02);
  color: rgba(232, 238, 252, .9);
  border-radius: 12px;
  padding: 6px 10px;
  cursor: pointer;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, .05)
}

/* =========================
   Table (team)
   ========================= */
.tablex {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--text);
}

.tablex thead th {
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(232, 238, 252, .80);
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .10);
}

.tablex tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  vertical-align: middle;
}

.tablex tbody tr:hover td {
  background: rgba(124, 124, 255, .05);
}

/* Studio submenu (only visible when active=studio) */
.side-submenu {
  margin-left: 34px;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.side-sublink {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: .35rem .75rem;
  border-radius: 12px;
  font-size: .92rem;
  color: rgba(245, 247, 255, .78);
  text-decoration: none;
  border: 1px solid transparent;
  opacity: .95;
}

.side-sublink:hover {
  background: rgba(255, 255, 255, .05);
  border-color: rgba(255, 255, 255, .08);
  color: rgba(245, 247, 255, .92);
}

/* Version strip (Studio) */
.studio-version-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.studio-version-strip .sv-item {
  flex: 1 1 180px;
  border: 1px solid rgba(255, 255, 255, .10);
  background: rgba(0, 0, 0, .14);
  border-radius: 14px;
  padding: 10px 12px;
}

.studio-version-strip .sv-k {
  font-size: .86rem;
  color: rgba(245, 247, 255, .62);
}

.studio-version-strip .sv-v {
  font-weight: 800;
  color: rgba(245, 247, 255, .92);
  margin-top: 2px;
}

.studio-version-strip .sv-t {
  font-size: .86rem;
  color: rgba(245, 247, 255, .60);
  margin-top: 2px;
  word-break: break-word;
}

/* Studio deep tabs */
.studio-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.studio-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .04);
  color: rgba(245, 247, 255, .88);
  text-decoration: none;
}

.studio-tab:hover {
  background: rgba(255, 255, 255, .06);
  color: rgba(245, 247, 255, .95);
}

.studio-tab.is-active {
  border-color: rgba(107, 124, 255, .55);
  background: rgba(107, 124, 255, .16);
  color: rgba(245, 247, 255, .98);
}

/* Maintenance banner (read-only mode) */
.maintenance-banner {
  padding: 10px 16px;
  margin: 0 18px 12px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: linear-gradient(135deg, rgba(245, 158, 11, .18), rgba(255, 255, 255, .03));
  color: rgba(245, 247, 255, .92);
}

.maintenance-banner .inner {
  display: flex;
  align-items: flex-start;
  gap: 10px
}

.maintenance-banner i {
  font-size: 18px;
  line-height: 1;
  margin-top: 2px;
  color: rgba(245, 158, 11, .95)
}

.maintenance-banner .t {
  font-weight: 800;
  letter-spacing: -.01em
}

.maintenance-banner .s {
  font-size: 13px;
  opacity: .85
}

/* Dashboard visual sync: global left sidebar */
body.app-body.theme-carbon {
  --spect-sidebar-bg: linear-gradient(180deg, rgba(8, 9, 13, 0.98), rgba(5, 6, 9, 0.98));
  --spect-sidebar-surface: rgba(255, 255, 255, 0.035);
  --spect-sidebar-surface-2: rgba(255, 255, 255, 0.055);
  --spect-sidebar-border: rgba(255, 255, 255, 0.09);
  --spect-sidebar-border-strong: rgba(255, 255, 255, 0.16);
  --spect-sidebar-text: rgba(235, 241, 255, 0.94);
  --spect-sidebar-muted: rgba(180, 195, 230, 0.66);
  --spect-sidebar-faint: rgba(255, 255, 255, 0.42);
  --spect-sidebar-accent: #5b8ef0;
  --spect-sidebar-accent-soft: rgba(91, 142, 240, 0.16);
  --spect-sidebar-danger: #ff7b7b;
  --spect-sidebar-danger-soft: rgba(255, 107, 107, 0.14);
}

body.app-body.theme-carbon .app-sidebar.spect-sidebar {
  width: 252px;
  padding: 0;
  background:
    radial-gradient(circle at top left, rgba(91, 142, 240, 0.12), transparent 34%),
    var(--spect-sidebar-bg);
  border-right: 1px solid var(--spect-sidebar-border);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(24px);
  overflow: hidden;
}

body.app-body.theme-carbon .app-sidebar.spect-sidebar .spect-sidebar__top {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 14px 14px;
  border-bottom: 1px solid var(--spect-sidebar-border);
}

body.app-body.theme-carbon .app-sidebar.spect-sidebar .spect-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.app-body.theme-carbon .app-sidebar.spect-sidebar .spect-sidebar__brand:hover {
  opacity: 1;
}

body.app-body.theme-carbon .app-sidebar.spect-sidebar .spect-sidebar__brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

body.app-body.theme-carbon .app-sidebar.spect-sidebar .spect-sidebar__brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 0;
  box-shadow: none;
}

body.app-body.theme-carbon .app-sidebar.spect-sidebar .spect-sidebar__brand-copy {
  min-width: 0;
}

body.app-body.theme-carbon .app-sidebar.spect-sidebar .spect-sidebar__brand-name {
  font-family: 'Manrope', sans-serif;
  font-size: 1.72rem;
  font-style: italic;
  font-weight: 800;
  line-height: 0.96;
  letter-spacing: -0.07em;
  color: #fff;
  text-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

body.app-body.theme-carbon .app-sidebar.spect-sidebar .spect-sidebar__workspace {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

body.app-body.theme-carbon .app-sidebar.spect-sidebar .spect-sidebar__workspace-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  border-radius: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.app-body.theme-carbon .app-sidebar.spect-sidebar .spect-sidebar__workspace-select.form-select,
body.app-body.theme-carbon .app-sidebar.spect-sidebar .spect-sidebar__workspace-name {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 14px;
  border: 1px solid var(--spect-sidebar-border);
  background: rgba(255, 255, 255, 0.02);
  color: #fff;
  font-family: 'Manrope', sans-serif;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  box-shadow: none;
}

body.app-body.theme-carbon .app-sidebar.spect-sidebar .spect-sidebar__workspace-select.form-select {
  padding-right: 36px;
  cursor: pointer;
}

body.app-body.theme-carbon .app-sidebar.spect-sidebar .spect-sidebar__workspace-select.form-select:focus {
  border-color: rgba(91, 142, 240, 0.48);
  box-shadow: 0 0 0 3px rgba(91, 142, 240, 0.12);
}

body.app-body.theme-carbon .app-sidebar.spect-sidebar .spect-sidebar__workspace-name {
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.app-body.theme-carbon .app-sidebar.spect-sidebar .spect-sidebar__workspace-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

body.app-body.theme-carbon .app-sidebar.spect-sidebar .spect-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(91, 142, 240, 0.26);
  background: rgba(91, 142, 240, 0.1);
  color: #b8d0ff;
  font-family: 'Manrope', sans-serif;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: lowercase;
}

body.app-body.theme-carbon .app-sidebar.spect-sidebar .spect-badge i {
  font-size: 0.8rem;
  line-height: 1;
}

body.app-body.theme-carbon .app-sidebar.spect-sidebar .spect-badge--danger {
  border-color: rgba(255, 123, 123, 0.26);
  background: rgba(255, 123, 123, 0.11);
  color: #ffb0b0;
}

body.app-body.theme-carbon .app-sidebar.spect-sidebar .spect-sidebar__nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 16px;
  padding: 14px 10px 18px;
  overflow-y: auto;
}

body.app-body.theme-carbon .app-sidebar.spect-sidebar .spect-sidebar__group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

body.app-body.theme-carbon .app-sidebar.spect-sidebar .spect-sidebar__links {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

body.app-body.theme-carbon .app-sidebar.spect-sidebar .side-section {
  margin: 0 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--spect-sidebar-faint);
}

body.app-body.theme-carbon .app-sidebar.spect-sidebar .side-section--danger {
  color: #ff8f8f;
}

body.app-body.theme-carbon .app-sidebar.spect-sidebar .side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  min-height: 38px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--spect-sidebar-muted);
  font-family: 'Manrope', sans-serif;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

body.app-body.theme-carbon .app-sidebar.spect-sidebar .side-link:hover {
  background: var(--spect-sidebar-surface);
  border-color: rgba(255, 255, 255, 0.06);
  color: var(--spect-sidebar-text);
  transform: translateX(2px);
}

body.app-body.theme-carbon .app-sidebar.spect-sidebar .side-link.active {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.035));
  border-color: var(--spect-sidebar-border-strong);
  color: #fff;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

body.app-body.theme-carbon .app-sidebar.spect-sidebar .side-link.active::before {
  content: none;
}

body.app-body.theme-carbon .app-sidebar.spect-sidebar .side-link__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.84rem;
  line-height: 1;
  transition: color 0.2s ease, transform 0.2s ease, text-shadow 0.2s ease;
}

body.app-body.theme-carbon .app-sidebar.spect-sidebar .side-link:hover .side-link__icon {
  color: var(--spect-sidebar-text);
  transform: scale(1.04);
}

body.app-body.theme-carbon .app-sidebar.spect-sidebar .side-link.active .side-link__icon {
  color: var(--spect-sidebar-accent);
  text-shadow: 0 0 18px rgba(91, 142, 240, 0.26);
}

body.app-body.theme-carbon .app-sidebar.spect-sidebar .side-link__label {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.app-body.theme-carbon .app-sidebar.spect-sidebar .side-link--danger.active {
  background: linear-gradient(180deg, var(--spect-sidebar-danger-soft), rgba(255, 123, 123, 0.06));
  border-color: rgba(255, 123, 123, 0.26);
  color: #ffd1d1;
}

body.app-body.theme-carbon .app-sidebar.spect-sidebar .side-link--danger.active .side-link__icon {
  color: var(--spect-sidebar-danger);
  text-shadow: 0 0 18px rgba(255, 123, 123, 0.22);
}

@media (max-width: 639.98px) {
  body.app-body.theme-carbon .app-sidebar.spect-sidebar {
    width: min(288px, calc(100vw - 20px));
    border-radius: 0 24px 24px 0;
  }
}

@media (min-width: 640px) {
  .app-main-shell {
    padding: 32px;
  }
}

@media (min-width: 768px) {
  .app-main-shell {
    padding: 40px;
  }
}

@media (max-width: 767.98px) {
  .app-main-shell {
    padding: 14px;
  }
}

@media (max-width: 479.98px) {
  .app-main-shell {
    padding: 12px;
  }
}

/* =========================
   Super Admin responsive layer
   (scoped to body.active-admin)
   ========================= */
@media (max-width: 991.98px) {
  body.active-admin .app-main-shell > .d-flex.align-items-center.justify-content-between,
  body.active-admin .app-main-shell > .d-flex.align-items-start.justify-content-between,
  body.active-admin .app-main-shell > .d-flex.justify-content-between.align-items-center,
  body.active-admin .app-main-shell > .d-flex.justify-content-between.align-items-start,
  body.active-admin .app-main-shell .card .d-flex.align-items-center.justify-content-between,
  body.active-admin .app-main-shell .card .d-flex.align-items-start.justify-content-between,
  body.active-admin .app-main-shell .card .d-flex.justify-content-between.align-items-center,
  body.active-admin .app-main-shell .card .d-flex.justify-content-between.align-items-start,
  body.active-admin .app-main-shell .list-group-item .d-flex.justify-content-between {
    flex-direction: column;
    align-items: stretch !important;
    gap: 12px !important;
  }

  body.active-admin .app-main-shell > .d-flex.align-items-center.justify-content-between > *,
  body.active-admin .app-main-shell > .d-flex.align-items-start.justify-content-between > *,
  body.active-admin .app-main-shell > .d-flex.justify-content-between.align-items-center > *,
  body.active-admin .app-main-shell > .d-flex.justify-content-between.align-items-start > *,
  body.active-admin .app-main-shell .card .d-flex.align-items-center.justify-content-between > *,
  body.active-admin .app-main-shell .card .d-flex.align-items-start.justify-content-between > *,
  body.active-admin .app-main-shell .card .d-flex.justify-content-between.align-items-center > *,
  body.active-admin .app-main-shell .card .d-flex.justify-content-between.align-items-start > *,
  body.active-admin .app-main-shell .list-group-item .d-flex.justify-content-between > * {
    min-width: 0;
  }

  body.active-admin .card .card-body {
    padding: 16px;
  }

  body.active-admin .app-main-shell .card,
  body.active-admin .app-main-shell .card > *,
  body.active-admin .app-main-shell .card-header,
  body.active-admin .app-main-shell .card-body,
  body.active-admin .app-main-shell .card-footer,
  body.active-admin .app-main-shell .list-group-item,
  body.active-admin .app-main-shell .list-group-item > * {
    min-width: 0;
  }

  body.active-admin .row.g-2 > [class*="col-"],
  body.active-admin .row.g-3 > [class*="col-"],
  body.active-admin .row.g-4 > [class*="col-"] {
    min-width: 0;
  }

  body.active-admin .row.g-2 .col-auto,
  body.active-admin .row.g-3 .col-auto,
  body.active-admin .row.g-4 .col-auto {
    flex: 1 1 100%;
    width: 100%;
  }

  body.active-admin .row.g-2 .form-control[style],
  body.active-admin .row.g-2 .form-select[style],
  body.active-admin .row.g-3 .form-control[style],
  body.active-admin .row.g-3 .form-select[style],
  body.active-admin .row.g-4 .form-control[style],
  body.active-admin .row.g-4 .form-select[style] {
    width: 100% !important;
    max-width: 100%;
  }

  body.active-admin .row.g-2 .d-flex,
  body.active-admin .row.g-3 .d-flex,
  body.active-admin .row.g-4 .d-flex {
    flex-wrap: wrap;
  }

  body.active-admin .app-main-shell .d-flex.gap-2,
  body.active-admin .app-main-shell .d-flex.gap-3,
  body.active-admin .app-main-shell .d-flex.gap-4,
  body.active-admin .app-main-shell .list-group-item .d-flex {
    flex-wrap: wrap;
  }

  body.active-admin .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 14px;
  }

  body.active-admin .table {
    min-width: 680px;
    margin-bottom: 0;
  }

  body.active-admin pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  body.active-admin code,
  body.active-admin .badge,
  body.active-admin details > summary {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  body.active-admin .app-main-shell .table td[style*="text-overflow:ellipsis"],
  body.active-admin .app-main-shell .table td [style*="text-overflow:ellipsis"],
  body.active-admin .app-main-shell .card [style*="text-overflow:ellipsis"],
  body.active-admin .app-main-shell .card [style*="white-space:nowrap"][style*="overflow:hidden"],
  body.active-admin .app-main-shell .card [style*="white-space: nowrap"][style*="overflow:hidden"],
  body.active-admin .app-main-shell .table td[style*="white-space:nowrap"],
  body.active-admin .app-main-shell .table td[style*="white-space: nowrap"],
  body.active-admin .app-main-shell .table td [style*="white-space:nowrap"],
  body.active-admin .app-main-shell .table td [style*="white-space: nowrap"] {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    max-width: none !important;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

@media (max-width: 767.98px) {
  body.active-admin .card .card-body {
    padding: 14px;
  }

  body.active-admin .app-main-shell > form.row.g-2,
  body.active-admin .app-main-shell > .row.g-2,
  body.active-admin .app-main-shell > .row.g-3,
  body.active-admin .app-main-shell > .row.g-4 {
    margin-left: 0;
    margin-right: 0;
  }

  body.active-admin .app-main-shell > form.row.g-2 > [class*="col-"],
  body.active-admin .app-main-shell > .row.g-2 > [class*="col-"],
  body.active-admin .app-main-shell > .row.g-3 > [class*="col-"],
  body.active-admin .app-main-shell > .row.g-4 > [class*="col-"] {
    padding-left: 0;
    padding-right: 0;
  }

  body.active-admin .app-main-shell > form.row.g-2 .btn,
  body.active-admin .app-main-shell > .row.g-2 .btn,
  body.active-admin .app-main-shell > .row.g-3 .btn,
  body.active-admin .app-main-shell > .row.g-4 .btn {
    width: 100%;
    justify-content: center;
  }

  body.active-admin .btn,
  body.active-admin .btn-sm {
    white-space: normal;
  }

  body.active-admin .text-nowrap,
  body.active-admin .app-main-shell .text-end {
    white-space: normal !important;
  }

  body.active-admin td.text-end,
  body.active-admin th.text-end {
    text-align: left !important;
  }

  body.active-admin td.text-end form.d-inline,
  body.active-admin td.text-end form.d-inline-flex,
  body.active-admin td.text-end a.btn,
  body.active-admin td.text-end button.btn {
    display: flex;
    width: 100%;
    justify-content: center;
  }

  body.active-admin td.text-end form.d-inline,
  body.active-admin td.text-end form.d-inline-flex {
    margin-top: 6px;
  }

  body.active-admin td.text-end a.btn,
  body.active-admin td.text-end button.btn {
    margin-top: 6px;
  }

  body.active-admin td.text-nowrap form.d-inline,
  body.active-admin td.text-nowrap form.d-inline-flex,
  body.active-admin td.text-nowrap a.btn,
  body.active-admin td.text-nowrap button.btn {
    display: flex;
    width: 100%;
    justify-content: center;
    margin-top: 6px;
  }

  body.active-admin .app-main-shell .d-flex.gap-2 > .btn,
  body.active-admin .app-main-shell .d-flex.gap-2 > a.btn,
  body.active-admin .app-main-shell .d-flex.gap-2 > form,
  body.active-admin .app-main-shell .d-flex.gap-3 > .btn,
  body.active-admin .app-main-shell .d-flex.gap-3 > a.btn,
  body.active-admin .app-main-shell .d-flex.gap-3 > form,
  body.active-admin .app-main-shell .d-flex.gap-4 > .btn,
  body.active-admin .app-main-shell .d-flex.gap-4 > a.btn,
  body.active-admin .app-main-shell .d-flex.gap-4 > form {
    width: 100%;
  }

  body.active-admin .app-main-shell .d-flex.gap-2 > form .btn,
  body.active-admin .app-main-shell .d-flex.gap-3 > form .btn,
  body.active-admin .app-main-shell .d-flex.gap-4 > form .btn {
    width: 100%;
    justify-content: center;
  }

  body.active-admin .app-main-shell select[style*="width:auto"],
  body.active-admin .app-main-shell .form-select[style*="width:auto"] {
    width: 100% !important;
  }

  body.active-admin .app-main-shell .card-body[style*="max-height:70vh"] {
    max-height: 54vh !important;
  }

  body.active-admin .app-main-shell .card-body[style*="max-height:40vh"] {
    max-height: 36vh !important;
  }

  body.active-admin .app-main-shell pre[style*="max-height:640px"] {
    max-height: 56vh !important;
  }

  body.active-admin .app-main-shell pre[style*="max-height:420px"] {
    max-height: 48vh !important;
  }

  body.active-admin .table {
    min-width: 620px;
  }
}

/* =========================
   Shared app responsive layer
   (team / tickets / inbox / widget health)
   ========================= */
@media (max-width: 991.98px) {
  .cardx,
  .cardx > *,
  .cardx .row > [class*="col-"] {
    min-width: 0;
  }

  .cardx-h,
  .cardx-b {
    min-width: 0;
  }

  .cardx [style*="display:flex"][style*="justify-content:space-between"],
  .cardx [style*="display: flex"][style*="justify-content:space-between"],
  .cardx [style*="display: flex"][style*="justify-content: space-between"],
  .cardx-h[style*="display:flex"],
  .cardx-h[style*="display: flex"] {
    flex-direction: column;
    align-items: stretch !important;
  }

  .cardx .d-flex {
    flex-wrap: wrap;
  }

  .cardx .table-responsive,
  body.active-team .table-responsive,
  body.active-tickets .table-responsive,
  body.active-inbox .table-responsive,
  body.active-widget_health .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 14px;
  }

  .tablex {
    min-width: 640px;
  }

  .modalx .modalx-card {
    margin: 24px auto;
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
  }

  .modalx .modalx-b {
    overflow: auto;
  }

  body.active-team .app-main-shell .row.g-2 > [class*="col-"],
  body.active-team .app-main-shell .row.g-3 > [class*="col-"],
  body.active-tickets .app-main-shell .row.g-2 > [class*="col-"],
  body.active-tickets .app-main-shell .row.g-3 > [class*="col-"],
  body.active-tickets .app-main-shell .row.g-4 > [class*="col-"],
  body.active-inbox .app-main-shell .row.g-2 > [class*="col-"],
  body.active-inbox .app-main-shell .row.g-3 > [class*="col-"],
  body.active-widget_health .app-main-shell .row.g-2 > [class*="col-"],
  body.active-widget_health .app-main-shell .row.g-3 > [class*="col-"] {
    min-width: 0;
  }

  .cardx code,
  .cardx pre,
  body.active-tickets code,
  body.active-team code,
  body.active-inbox code,
  body.active-widget_health code {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

@media (max-width: 767.98px) {
  .cardx {
    padding: 14px;
  }

  .btn-soft,
  .btn-solid {
    white-space: normal;
  }

  .cardx .d-flex.gap-2 > .btn-soft,
  .cardx .d-flex.gap-2 > .btn-solid,
  .cardx .d-flex.gap-2 > .btn,
  .cardx .d-flex.gap-3 > .btn-soft,
  .cardx .d-flex.gap-3 > .btn-solid,
  .cardx .d-flex.gap-3 > .btn {
    width: 100%;
    justify-content: center;
  }

  body.active-team .app-main-shell .d-flex.gap-2,
  body.active-team .app-main-shell .d-flex.gap-3,
  body.active-tickets .app-main-shell .d-flex.gap-2,
  body.active-tickets .app-main-shell .d-flex.gap-3,
  body.active-inbox .app-main-shell .d-flex.gap-2,
  body.active-inbox .app-main-shell .d-flex.gap-3,
  body.active-widget_health .app-main-shell .d-flex.gap-2,
  body.active-widget_health .app-main-shell .d-flex.gap-3 {
    flex-wrap: wrap;
  }

  body.active-team .app-main-shell .d-flex.gap-2 > .btn-soft,
  body.active-team .app-main-shell .d-flex.gap-2 > .btn-solid,
  body.active-team .app-main-shell .d-flex.gap-3 > .btn-soft,
  body.active-team .app-main-shell .d-flex.gap-3 > .btn-solid,
  body.active-inbox .app-main-shell .d-flex.gap-2 > .btn,
  body.active-inbox .app-main-shell .d-flex.gap-3 > .btn,
  body.active-tickets .app-main-shell .d-flex.gap-2 > .btn,
  body.active-tickets .app-main-shell .d-flex.gap-3 > .btn,
  body.active-widget_health .app-main-shell form.row.g-2 .btn,
  body.active-widget_health .app-main-shell form.row.g-3 .btn {
    width: 100%;
    justify-content: center;
  }

  .modalx .modalx-card {
    width: calc(100% - 16px);
    margin: 8px auto;
    max-height: calc(100vh - 16px);
    border-radius: 16px;
  }

.tablex {
  min-width: 600px;
  }
}

/* =========================
   Shared studio responsive layer
   ========================= */
@media (max-width: 991.98px) {
  .studio-version-strip .sv-item {
    min-width: 0;
  }

  body.active-studio .app-main-shell > .container-fluid,
  body.active-studio .app-main-shell > .container-fluid > *,
  body.active-studio .app-main-shell .card-soft,
  body.active-studio .app-main-shell .card-soft > *,
  body.active-studio .app-main-shell .cardx,
  body.active-studio .app-main-shell .cardx > *,
  body.active-studio .app-main-shell .row > [class*="col-"] {
    min-width: 0;
  }

  body.active-studio .app-main-shell > .d-flex.align-items-center.justify-content-between,
  body.active-studio .app-main-shell > .d-flex.align-items-start.justify-content-between,
  body.active-studio .app-main-shell > .d-flex.justify-content-between.align-items-center,
  body.active-studio .app-main-shell > .d-flex.justify-content-between.align-items-start,
  body.active-studio .app-main-shell .card-soft .d-flex.align-items-center.justify-content-between,
  body.active-studio .app-main-shell .card-soft .d-flex.align-items-start.justify-content-between,
  body.active-studio .app-main-shell .card-soft .d-flex.justify-content-between.align-items-center,
  body.active-studio .app-main-shell .card-soft .d-flex.justify-content-between.align-items-start,
  body.active-studio .app-main-shell .cardx .d-flex.align-items-center.justify-content-between,
  body.active-studio .app-main-shell .cardx .d-flex.align-items-start.justify-content-between,
  body.active-studio .app-main-shell .cardx .d-flex.justify-content-between.align-items-center,
  body.active-studio .app-main-shell .cardx .d-flex.justify-content-between.align-items-start {
    flex-direction: column;
    align-items: stretch !important;
    gap: 12px !important;
  }

  body.active-studio .app-main-shell > .d-flex.align-items-center.justify-content-between > *,
  body.active-studio .app-main-shell > .d-flex.align-items-start.justify-content-between > *,
  body.active-studio .app-main-shell > .d-flex.justify-content-between.align-items-center > *,
  body.active-studio .app-main-shell > .d-flex.justify-content-between.align-items-start > *,
  body.active-studio .app-main-shell .card-soft .d-flex.align-items-center.justify-content-between > *,
  body.active-studio .app-main-shell .card-soft .d-flex.align-items-start.justify-content-between > *,
  body.active-studio .app-main-shell .card-soft .d-flex.justify-content-between.align-items-center > *,
  body.active-studio .app-main-shell .card-soft .d-flex.justify-content-between.align-items-start > *,
  body.active-studio .app-main-shell .cardx .d-flex.align-items-center.justify-content-between > *,
  body.active-studio .app-main-shell .cardx .d-flex.align-items-start.justify-content-between > *,
  body.active-studio .app-main-shell .cardx .d-flex.justify-content-between.align-items-center > *,
  body.active-studio .app-main-shell .cardx .d-flex.justify-content-between.align-items-start > * {
    min-width: 0;
  }

  body.active-studio .app-main-shell .d-flex.gap-2,
  body.active-studio .app-main-shell .d-flex.gap-3,
  body.active-studio .app-main-shell .d-flex.gap-4 {
    flex-wrap: wrap;
  }

  body.active-studio .app-main-shell .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 14px;
  }

  body.active-studio .app-main-shell .table {
    min-width: 680px;
    margin-bottom: 0;
  }

  body.active-studio .app-main-shell pre,
  body.active-studio .app-main-shell code,
  body.active-studio .app-main-shell .badge {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  body.active-studio .app-main-shell .text-nowrap,
  body.active-studio .app-main-shell [style*="white-space:nowrap"],
  body.active-studio .app-main-shell [style*="white-space: nowrap"] {
    white-space: normal !important;
  }

  body.active-studio .app-main-shell .modal-dialog {
    margin-left: 12px;
    margin-right: 12px;
  }
}

@media (max-width: 767.98px) {
  .studio-version-strip {
    gap: 8px;
  }

  .studio-version-strip .sv-item {
    flex: 1 1 100%;
  }

  .studio-tabs {
    gap: 8px;
  }

  .studio-tab {
    width: 100%;
    justify-content: center;
  }

  body.active-studio .app-main-shell > .container-fluid {
    padding-left: 0;
    padding-right: 0;
  }

  body.active-studio .app-main-shell .btn,
  body.active-studio .app-main-shell .btn-sm,
  body.active-studio .app-main-shell .btn-soft,
  body.active-studio .app-main-shell .btn-solid {
    white-space: normal;
  }

  body.active-studio .app-main-shell .d-flex.gap-2 > .btn,
  body.active-studio .app-main-shell .d-flex.gap-2 > a.btn,
  body.active-studio .app-main-shell .d-flex.gap-2 > .btn-soft,
  body.active-studio .app-main-shell .d-flex.gap-2 > .btn-solid,
  body.active-studio .app-main-shell .d-flex.gap-2 > form,
  body.active-studio .app-main-shell .d-flex.gap-3 > .btn,
  body.active-studio .app-main-shell .d-flex.gap-3 > a.btn,
  body.active-studio .app-main-shell .d-flex.gap-3 > .btn-soft,
  body.active-studio .app-main-shell .d-flex.gap-3 > .btn-solid,
  body.active-studio .app-main-shell .d-flex.gap-3 > form,
  body.active-studio .app-main-shell .d-flex.gap-4 > .btn,
  body.active-studio .app-main-shell .d-flex.gap-4 > a.btn,
  body.active-studio .app-main-shell .d-flex.gap-4 > .btn-soft,
  body.active-studio .app-main-shell .d-flex.gap-4 > .btn-solid,
  body.active-studio .app-main-shell .d-flex.gap-4 > form {
    width: 100%;
  }

  body.active-studio .app-main-shell .d-flex.gap-2 > form .btn,
  body.active-studio .app-main-shell .d-flex.gap-2 > form .btn-soft,
  body.active-studio .app-main-shell .d-flex.gap-2 > form .btn-solid,
  body.active-studio .app-main-shell .d-flex.gap-3 > form .btn,
  body.active-studio .app-main-shell .d-flex.gap-3 > form .btn-soft,
  body.active-studio .app-main-shell .d-flex.gap-3 > form .btn-solid,
  body.active-studio .app-main-shell .d-flex.gap-4 > form .btn,
  body.active-studio .app-main-shell .d-flex.gap-4 > form .btn-soft,
  body.active-studio .app-main-shell .d-flex.gap-4 > form .btn-solid {
    width: 100%;
    justify-content: center;
  }

  body.active-studio .app-main-shell select[style*="width:auto"],
  body.active-studio .app-main-shell .form-select[style*="width:auto"] {
    width: 100% !important;
  }

  body.active-studio .app-main-shell .table {
    min-width: 620px;
  }

  body.active-studio .app-main-shell .modal-dialog {
    margin-left: 8px;
    margin-right: 8px;
  }
}
