/* Midleo Clients portal — thin brand layer on Bootstrap 5.3 (aligned with midleo.core) */
/* Fonts: Ubuntu if installed locally, else system UI — no CDN fonts */

:root {
  --mid-brand: #0093e9;
  --mid-brand-rgb: 0, 147, 233;
  --mid-brand-dark: #0077c2;
  --mid-accent: var(--mid-brand);
  --mid-accent-rgb: var(--mid-brand-rgb);
  --mid-accent-muted: rgba(var(--mid-brand-rgb), 0.12);
  --mid-accent-border: rgba(var(--mid-brand-rgb), 0.25);
  --mid-status-success: #16a34a;
  --mid-status-danger: #dc2626;
  --mid-muted: #64748b;
  --bs-primary: var(--mid-brand);
  --bs-primary-rgb: var(--mid-brand-rgb);
  --bs-link-color: var(--mid-brand);
  --bs-link-hover-color: var(--mid-brand-dark);
  --bs-border-radius: 0.5rem;
  --bs-border-radius-sm: 0.375rem;
  --bs-body-font-family: "Ubuntu", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bs-body-font-weight: 300;
  --bs-body-color: #1a2438;
  --mid-card-border: rgba(15, 23, 42, 0.1);
  --mid-glass-bg: #fff;
  --mid-card-cap-bg: rgba(248, 250, 252, 0.95);
}

html {
  min-height: 100%;
}

body.mid-portal {
  font-family: var(--bs-body-font-family);
  font-weight: var(--bs-body-font-weight);
  color: var(--bs-body-color);
  background:
    radial-gradient(ellipse 120% 80% at 0% -20%, rgba(var(--mid-brand-rgb), 0.07), transparent 55%),
    radial-gradient(ellipse 80% 50% at 100% 0%, rgba(var(--mid-brand-rgb), 0.04), transparent 45%),
    linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.mid-portal a:not(.btn):not(.nav-link):not(.navbar-brand) {
  color: var(--mid-accent);
}

body.mid-portal a:not(.btn):not(.nav-link):not(.navbar-brand):hover {
  color: var(--mid-brand-dark);
}

.mid-topbar {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--mid-card-border);
  backdrop-filter: blur(10px);
}

.mid-topbar .navbar-brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--bs-body-color) !important;
}

.mid-topbar .navbar-brand .brand-mark {
  color: var(--mid-accent);
}

.mid-topbar .nav-link,
.mid-topbar .navbar-text {
  font-weight: 400;
  font-size: 0.9rem;
}

.mid-topbar .nav-link.active {
  color: var(--mid-brand) !important;
  font-weight: 500;
}

.mid-main {
  flex: 1 0 auto;
  padding-top: 1.75rem;
  padding-bottom: 2.5rem;
}

.mid-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--mid-card-border);
  color: var(--mid-muted);
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.65);
}

.mid-card {
  background: var(--mid-glass-bg);
  border: 1px solid var(--mid-card-border);
  border-radius: var(--bs-border-radius);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 4px 20px rgba(15, 23, 42, 0.06);
}

.mid-card .card-header {
  background: var(--mid-card-cap-bg);
  border-bottom: 1px solid var(--mid-card-border);
  font-weight: 500;
}

.mid-hero h1 {
  font-weight: 500;
  letter-spacing: -0.02em;
}

.mid-hero .lede {
  color: var(--mid-muted);
  font-weight: 300;
}

.btn-primary {
  --bs-btn-bg: var(--mid-brand);
  --bs-btn-border-color: var(--mid-accent-border);
  --bs-btn-hover-bg: var(--mid-brand-dark);
  --bs-btn-hover-border-color: var(--mid-brand-dark);
  --bs-btn-active-bg: var(--mid-brand-dark);
  --bs-btn-active-border-color: var(--mid-brand-dark);
  font-weight: 600;
  background: linear-gradient(135deg, var(--mid-brand) 0%, color-mix(in srgb, var(--mid-brand) 82%, #000) 100%);
  border-color: var(--mid-accent-border);
}

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(135deg, color-mix(in srgb, var(--mid-brand) 88%, #fff) 0%, var(--mid-brand) 100%);
}

.btn-outline-primary {
  --bs-btn-color: var(--mid-brand);
  --bs-btn-border-color: var(--mid-accent-border);
  --bs-btn-hover-bg: var(--mid-accent-muted);
  --bs-btn-hover-border-color: var(--mid-brand);
  --bs-btn-hover-color: var(--mid-brand-dark);
  --bs-btn-active-bg: var(--mid-accent-muted);
  --bs-btn-active-color: var(--mid-brand-dark);
  font-weight: 500;
}

.btn-outline-danger {
  --bs-btn-color: var(--mid-status-danger);
  --bs-btn-border-color: rgba(220, 38, 38, 0.35);
  --bs-btn-hover-bg: rgba(220, 38, 38, 0.08);
  --bs-btn-hover-border-color: rgba(220, 38, 38, 0.45);
  --bs-btn-hover-color: var(--mid-status-danger);
}

.badge-latest {
  background: var(--mid-accent-muted);
  color: var(--mid-accent);
  border: 1px solid var(--mid-accent-border);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.badge-role {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid var(--mid-card-border);
  font-weight: 500;
  text-transform: lowercase;
}

.badge-status {
  font-weight: 600;
  letter-spacing: 0.01em;
}

.badge-status-on {
  background: rgba(22, 163, 74, 0.12);
  color: var(--mid-status-success);
  border: 1px solid rgba(22, 163, 74, 0.28);
}

.badge-status-off {
  background: rgba(220, 38, 38, 0.1);
  color: var(--mid-status-danger);
  border: 1px solid rgba(220, 38, 38, 0.25);
}

/* —— Product download panels —— */
.product-panel {
  background: var(--mid-glass-bg);
  border: 1px solid var(--mid-card-border);
  border-radius: calc(var(--bs-border-radius) + 0.15rem);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 8px 28px rgba(15, 23, 42, 0.07);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.product-panel-head {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 1.25rem 1.35rem;
  border-bottom: 1px solid var(--mid-card-border);
  background:
    linear-gradient(135deg, rgba(var(--mid-brand-rgb), 0.06) 0%, transparent 55%),
    var(--mid-card-cap-bg);
}

.product-panel-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--mid-accent-muted);
  color: var(--mid-brand);
  font-size: 1.25rem;
  border: 1px solid var(--mid-accent-border);
}

.product-panel-title {
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.product-panel-blurb {
  color: var(--mid-muted);
  font-size: 0.875rem;
  margin-top: 0.15rem;
}

.latest-release {
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: linear-gradient(180deg, rgba(var(--mid-brand-rgb), 0.035) 0%, transparent 70%);
}

@media (min-width: 576px) {
  .latest-release {
    flex-direction: row;
    align-items: stretch;
    justify-content: space-between;
  }

  .latest-release-cta {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    flex-shrink: 0;
  }
}

.latest-version {
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--bs-body-color);
}

.latest-facts {
  display: grid;
  grid-template-columns: auto auto;
  gap: 0.75rem 1.75rem;
  margin-top: 0.85rem;
}

.latest-facts dt {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mid-muted);
  font-weight: 500;
  margin: 0;
}

.latest-facts dd {
  margin: 0.1rem 0 0;
  font-weight: 400;
  font-size: 0.95rem;
}

.previous-releases {
  border-top: 1px solid var(--mid-card-border);
  padding: 0.85rem 0.85rem 0.95rem;
  background: #fafbfc;
}

.previous-releases-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--mid-muted);
  font-weight: 600;
  margin: 0 0.5rem 0.55rem;
}

.previous-release-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: stretch;
  padding: 0.85rem 0.75rem;
  border-radius: var(--bs-border-radius-sm);
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

@media (min-width: 480px) {
  .previous-release-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.previous-release-row:hover {
  background: #fff;
  box-shadow: 0 1px 8px rgba(15, 23, 42, 0.06);
}

.previous-version {
  font-weight: 500;
  font-size: 0.95rem;
}

.previous-meta {
  color: var(--mid-muted);
  font-size: 0.8rem;
  margin-top: 0.15rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.4rem;
}

.meta-sep {
  opacity: 0.5;
}

.release-sha-details summary {
  cursor: pointer;
  color: var(--mid-muted);
  font-size: 0.75rem;
  font-weight: 500;
  list-style: none;
  user-select: none;
}

.release-sha-details summary::-webkit-details-marker {
  display: none;
}

.release-sha-details summary::before {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid var(--mid-muted);
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
  margin-right: 0.4rem;
  vertical-align: 0.1em;
  transition: transform 0.15s ease;
}

.release-sha-details[open] summary::before {
  transform: rotate(90deg);
}

.release-sha {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  color: #475569;
  word-break: break-all;
  margin-top: 0.35rem;
  padding: 0.5rem 0.65rem;
  background: #f1f5f9;
  border-radius: 0.35rem;
  border: 1px solid var(--mid-card-border);
}

.mid-empty-icon {
  width: 3rem;
  height: 3rem;
  margin-inline: auto;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--mid-accent-muted);
  color: var(--mid-brand);
  font-size: 1.35rem;
  border: 1px solid var(--mid-accent-border);
}

.product-empty {
  flex: 1;
}

.auth-wrap {
  max-width: 420px;
  margin: 2.5rem auto 1rem;
}

.auth-wrap .mid-card {
  padding: 1.75rem;
}

.auth-wrap h1 {
  font-weight: 500;
  letter-spacing: -0.02em;
}

.auth-wrap .lede {
  color: var(--mid-muted);
}

/* —— Admin / DataTables —— */
.admin-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.mid-admin .mid-dt {
  --dt-row-border: var(--mid-card-border);
}

.mid-admin .mid-dt thead th {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--mid-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom-width: 1px;
  white-space: nowrap;
}

.mid-admin .mid-dt tbody td {
  vertical-align: middle;
}

.mid-admin .dataTables_wrapper .dataTables_filter input {
  border: 1px solid var(--mid-card-border);
  border-radius: var(--bs-border-radius-sm);
  padding: 0.35rem 0.65rem;
  min-width: 12rem;
}

.mid-admin .dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--mid-accent-border);
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(var(--mid-brand-rgb), 0.2);
}

.mid-admin .dataTables_wrapper .dataTables_length select {
  border-radius: var(--bs-border-radius-sm);
  border-color: var(--mid-card-border);
}

.mid-admin .dataTables_wrapper .dataTables_info,
.mid-admin .dataTables_wrapper .dataTables_paginate {
  color: var(--mid-muted);
  font-size: 0.85rem;
  padding-top: 0.85rem;
}

.mid-admin .page-item.active .page-link {
  background-color: var(--mid-brand);
  border-color: var(--mid-brand);
}

.mid-admin .page-link {
  color: var(--mid-brand);
}

.table > :not(caption) > * > * {
  background-color: transparent;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--mid-accent-border);
  box-shadow: 0 0 0 0.2rem rgba(var(--mid-brand-rgb), 0.2);
}

.btn-link.sign-out {
  text-decoration: none;
  font-weight: 400;
  padding: 0;
  vertical-align: baseline;
}

.btn-link.sign-out:hover {
  color: var(--mid-brand-dark);
}

.modal-content {
  border: 1px solid var(--mid-card-border);
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.14);
}

.modal-header,
.modal-footer {
  border-color: var(--mid-card-border);
}

/* ——— Interface refresh ——— */

:root {
  --mid-ink: #0f172a;
  --mid-ink-soft: #334155;
  --mid-surface: #ffffff;
  --mid-surface-soft: #f8fafc;
  --mid-line: #e2e8f0;
  --mid-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.05);
  --mid-shadow-lg: 0 24px 70px rgba(15, 23, 42, 0.16);
  --bs-border-radius: 0.85rem;
  --bs-border-radius-sm: 0.65rem;
}

body.mid-portal {
  color: var(--mid-ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(var(--mid-brand-rgb), 0.09), transparent 26rem),
    linear-gradient(180deg, #f8fbff 0%, #f4f7fb 100%);
}

.mid-topbar {
  min-height: 4.6rem;
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(18px) saturate(150%);
}

.mid-topbar .navbar {
  min-height: 4.6rem;
}

.brand-symbol {
  width: 2.35rem;
  height: 2.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 0.75rem;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.22), transparent 45%),
    linear-gradient(145deg, #0ea5e9, #0369a1);
  box-shadow: 0 8px 18px rgba(var(--mid-brand-rgb), 0.24);
  font-size: 1rem;
  font-weight: 700;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.mid-topbar .navbar-brand .brand-mark {
  color: var(--mid-ink);
  font-size: 1rem;
}

.brand-subtitle {
  margin-top: 0.2rem;
  color: var(--mid-muted);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mid-topbar .nav-link {
  padding: 0.6rem 0.8rem !important;
  border-radius: 0.65rem;
  color: #475569;
  font-weight: 500;
}

.mid-topbar .nav-link:hover {
  color: var(--mid-ink);
  background: #f1f5f9;
}

.mid-topbar .nav-link.active {
  color: #0369a1 !important;
  background: rgba(var(--mid-brand-rgb), 0.1);
}

.nav-identity {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-left: 0.75rem;
  padding-left: 1rem;
  border-left: 1px solid var(--mid-line);
}

.nav-avatar,
.client-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: #0369a1;
  background: rgba(var(--mid-brand-rgb), 0.1);
  border: 1px solid rgba(var(--mid-brand-rgb), 0.14);
}

.nav-avatar {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 50%;
}

.nav-identity-copy {
  display: flex;
  min-width: 0;
  max-width: 12rem;
  flex-direction: column;
  line-height: 1.2;
}

.nav-identity-name,
.nav-identity-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-identity-name {
  color: var(--mid-ink);
  font-size: 0.82rem;
  font-weight: 600;
}

.nav-identity-email {
  margin-top: 0.15rem;
  color: var(--mid-muted);
  font-size: 0.68rem;
}

.btn-icon {
  width: 2.35rem;
  height: 2.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 0.65rem;
  color: #64748b;
}

.btn-icon:hover {
  color: var(--mid-ink);
  background: #f1f5f9;
  border-color: var(--mid-line);
}

.mid-main {
  width: 100%;
  padding-top: 2.25rem;
  padding-bottom: 3.25rem;
}

.mid-footer {
  color: #64748b;
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.64);
}

.alert {
  border: 0;
  border-left: 4px solid currentColor;
  box-shadow: var(--mid-shadow-sm);
}

.section-kicker,
.hero-kicker {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.section-kicker {
  color: #0284c7;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.9rem 0 0.25rem;
}

.section-heading h2 {
  color: var(--mid-ink);
  font-weight: 650;
  letter-spacing: -0.025em;
}

.section-note,
.table-header-note {
  color: var(--mid-muted);
  font-size: 0.78rem;
  font-weight: 500;
}

/* Dashboard */

.mid-dashboard-hero {
  position: relative;
  display: flex;
  min-height: 13rem;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  overflow: hidden;
  padding: 2rem 2.1rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 1.35rem;
  color: #fff;
  background:
    radial-gradient(circle at 88% 8%, rgba(255, 255, 255, 0.2), transparent 11rem),
    radial-gradient(circle at 75% 115%, rgba(56, 189, 248, 0.42), transparent 18rem),
    linear-gradient(120deg, #082f49 0%, #075985 48%, #0284c7 100%);
  box-shadow: 0 24px 50px rgba(3, 105, 161, 0.2);
}

.mid-dashboard-hero::after,
.admin-hero::after,
.auth-story::after {
  content: "";
  position: absolute;
  width: 20rem;
  height: 20rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  pointer-events: none;
}

.mid-dashboard-hero::after {
  top: -12rem;
  right: -4rem;
  box-shadow: 0 0 0 3rem rgba(255, 255, 255, 0.025), 0 0 0 6rem rgba(255, 255, 255, 0.02);
}

.mid-dashboard-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 42rem;
}

.mid-dashboard-hero h1,
.admin-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.65rem);
  font-weight: 650;
  letter-spacing: -0.045em;
}

.mid-dashboard-hero p,
.admin-hero p {
  max-width: 42rem;
  color: rgba(255, 255, 255, 0.76);
  font-size: 1rem;
}

.hero-kicker {
  color: rgba(255, 255, 255, 0.68);
}

.hero-trust {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem;
}

.hero-trust span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(8px);
  font-size: 0.75rem;
  font-weight: 600;
}

.product-panel {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 1.15rem;
  box-shadow: var(--mid-shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.product-panel:hover {
  border-color: rgba(var(--mid-brand-rgb), 0.24);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.09);
  transform: translateY(-2px);
}

.product-panel-head {
  padding: 1.35rem 1.45rem;
  background:
    radial-gradient(circle at 100% 0%, rgba(var(--mid-brand-rgb), 0.1), transparent 12rem),
    #fff;
}

.product-panel-icon {
  width: 2.8rem;
  height: 2.8rem;
  border: 0;
  border-radius: 0.85rem;
  color: #fff;
  background: linear-gradient(145deg, #0ea5e9, #0369a1);
  box-shadow: 0 8px 18px rgba(var(--mid-brand-rgb), 0.2);
}

.product-panel-title {
  color: var(--mid-ink);
  font-size: 1.12rem;
  font-weight: 650;
}

.latest-release {
  padding: 1.5rem;
  background: #fff;
}

.latest-version {
  font-size: 1.7rem;
  font-weight: 650;
}

.latest-release .btn,
.previous-release-row .btn {
  border-radius: 0.65rem;
}

.previous-releases {
  background: #f8fafc;
}

/* Login */

body.mid-template-login {
  background:
    radial-gradient(circle at 90% 10%, rgba(var(--mid-brand-rgb), 0.12), transparent 25rem),
    #eef4f9;
}

.mid-auth-main {
  width: 100%;
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  padding: 2rem;
}

.mid-auth-alert {
  position: fixed;
  z-index: 1080;
  top: 1.25rem;
  left: 50%;
  width: min(92vw, 32rem);
  transform: translateX(-50%);
}

.auth-shell {
  width: min(100%, 72rem);
  min-height: min(44rem, calc(100vh - 8.5rem));
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(24rem, 0.92fr);
  overflow: hidden;
  margin: 0 auto;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 1.5rem;
  background: #fff;
  box-shadow: var(--mid-shadow-lg);
}

.auth-story {
  position: relative;
  overflow: hidden;
  padding: 3.25rem;
  color: #fff;
  background:
    radial-gradient(circle at 14% 15%, rgba(56, 189, 248, 0.36), transparent 16rem),
    radial-gradient(circle at 95% 90%, rgba(14, 165, 233, 0.3), transparent 19rem),
    linear-gradient(145deg, #071b2d 0%, #083b5c 53%, #075985 100%);
}

.auth-story::after {
  right: -8rem;
  bottom: -7rem;
  width: 24rem;
  height: 24rem;
  box-shadow: 0 0 0 4rem rgba(255, 255, 255, 0.025), 0 0 0 8rem rgba(255, 255, 255, 0.018);
}

.auth-story-content {
  position: relative;
  z-index: 1;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 0.75rem;
  color: #fff !important;
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
}

.auth-brand .brand-symbol {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.08)),
    #0284c7;
  box-shadow: none;
}

.auth-story-copy {
  max-width: 31rem;
  margin: auto 0;
  padding: 4rem 0;
}

.auth-eyebrow {
  display: inline-flex;
  align-items: center;
  margin-bottom: 1.15rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  color: #bae6fd;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.auth-story h2 {
  margin-bottom: 1.15rem;
  font-size: clamp(2rem, 4vw, 3.1rem);
  font-weight: 650;
  line-height: 1.03;
  letter-spacing: -0.05em;
}

.auth-story-copy > p {
  max-width: 28rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1rem;
  line-height: 1.7;
}

.auth-benefits {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.75rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.87rem;
  font-weight: 500;
}

.auth-benefits li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.auth-benefits i {
  color: #7dd3fc;
  font-size: 1rem;
}

.auth-story-status {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.75rem;
  font-weight: 500;
}

.status-pulse {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0.3rem rgba(74, 222, 128, 0.12);
}

.auth-form-panel {
  display: flex;
  align-items: center;
  padding: clamp(2rem, 5vw, 4.5rem);
  background:
    radial-gradient(circle at 100% 0%, rgba(var(--mid-brand-rgb), 0.06), transparent 15rem),
    #fff;
}

.auth-card {
  width: 100%;
  max-width: 27rem;
  margin: 0 auto;
}

.auth-card-icon {
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  border-radius: 0.9rem;
  color: #0369a1;
  background: rgba(var(--mid-brand-rgb), 0.1);
  font-size: 1.25rem;
}

.auth-card h1 {
  color: var(--mid-ink);
  font-size: 2rem;
  font-weight: 650;
  letter-spacing: -0.04em;
}

.auth-card-lede {
  color: var(--mid-muted);
  line-height: 1.55;
}

.auth-card .form-label {
  margin-bottom: 0.45rem;
  color: var(--mid-ink-soft);
  font-size: 0.78rem;
  font-weight: 650;
}

.field-with-icon {
  position: relative;
}

.field-with-icon > i {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 1rem;
  color: #94a3b8;
  transform: translateY(-50%);
  pointer-events: none;
}

.field-with-icon .form-control {
  min-height: 3.15rem;
  padding-left: 2.8rem;
  border-color: var(--mid-line);
  border-radius: 0.8rem;
  background: #fbfdff;
}

.field-with-icon .form-control:focus {
  background: #fff;
}

.auth-card .btn-lg {
  min-height: 3.2rem;
  border-radius: 0.8rem;
  font-size: 0.92rem;
}

.auth-help {
  display: flex;
  gap: 0.55rem;
  margin-top: 1.5rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--mid-line);
  color: var(--mid-muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.mid-auth-footer {
  background: transparent;
}

/* Admin */

.admin-hero {
  position: relative;
  overflow: hidden;
  padding: 1.8rem 2rem;
  border-radius: 1.35rem;
  color: #fff;
  background:
    radial-gradient(circle at 92% 5%, rgba(255, 255, 255, 0.18), transparent 11rem),
    linear-gradient(120deg, #0f172a 0%, #0c4a6e 62%, #0369a1 100%);
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.16);
}

.admin-hero::after {
  top: -13rem;
  right: -5rem;
  box-shadow: 0 0 0 3rem rgba(255, 255, 255, 0.025), 0 0 0 6rem rgba(255, 255, 255, 0.018);
}

.admin-hero-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
}

.admin-add-button {
  flex: 0 0 auto;
  border-color: rgba(255, 255, 255, 0.3);
  color: #075985;
  font-weight: 650;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.admin-metrics {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  max-width: 42rem;
  margin-top: 1.6rem;
}

.admin-metric {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
}

.admin-metric-icon {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 0.6rem;
  color: #bae6fd;
  background: rgba(125, 211, 252, 0.12);
}

.admin-metric-icon-success {
  color: #bbf7d0;
  background: rgba(74, 222, 128, 0.12);
}

.admin-metric strong,
.admin-metric small {
  display: block;
}

.admin-metric strong {
  color: #fff;
  font-size: 1rem;
  line-height: 1.1;
}

.admin-metric small {
  margin-top: 0.12rem;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.65rem;
}

.mid-card {
  border-color: rgba(148, 163, 184, 0.24);
  border-radius: 1.1rem;
  box-shadow: var(--mid-shadow-sm);
}

.mid-card .card-header {
  padding-inline: 1.25rem;
  border-color: var(--mid-line);
  border-radius: 1.1rem 1.1rem 0 0;
  background: #fff;
}

.client-name-cell {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 11rem;
}

.client-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.7rem;
}

.badge-self {
  color: #475569;
  border: 1px solid var(--mid-line);
  background: #f8fafc;
}

.admin-actions .btn {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 0.55rem;
}

.mid-admin .mid-dt tbody tr {
  transition: background-color 0.15s ease;
}

.mid-admin .mid-dt tbody td {
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
  border-color: #edf1f5;
}

.mid-admin .dataTables_wrapper .dataTables_filter input,
.mid-admin div.dt-container .dt-search input {
  min-height: 2.55rem;
  min-width: 15rem;
  margin-left: 0;
  border-color: var(--mid-line);
  background: #f8fafc;
}

.modal-backdrop.show {
  opacity: 0.45;
  backdrop-filter: blur(2px);
}

.modal-content {
  overflow: hidden;
  border: 0;
  border-radius: 1.1rem;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.22);
}

.modal-header {
  padding: 1.2rem 1.35rem;
  background:
    radial-gradient(circle at 100% 0%, rgba(var(--mid-brand-rgb), 0.08), transparent 10rem),
    #fff;
}

.modal-body {
  padding: 1.3rem 1.35rem;
}

.modal-footer {
  padding: 1rem 1.35rem;
  background: #f8fafc;
}

.modal-heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.modal-heading-icon {
  width: 2.4rem;
  height: 2.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 0.7rem;
  color: #0369a1;
  background: rgba(var(--mid-brand-rgb), 0.1);
}

.modal-context {
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--mid-line);
  border-radius: 0.7rem;
  color: var(--mid-muted);
  background: #f8fafc;
  font-size: 0.8rem;
}

.modal .form-control,
.modal .form-select {
  min-height: 2.8rem;
  border-color: var(--mid-line);
  background-color: #fbfdff;
}

.modal .form-label {
  color: var(--mid-ink-soft);
  font-size: 0.8rem;
}

@media (max-width: 991.98px) {
  .auth-shell {
    grid-template-columns: minmax(0, 0.9fr) minmax(22rem, 1.1fr);
  }

  .auth-story {
    padding: 2.25rem;
  }

  .auth-story h2 {
    font-size: 2.1rem;
  }

  .hero-trust {
    max-width: 14rem;
  }
}

@media (max-width: 767.98px) {
  .mid-topbar .navbar-collapse {
    padding: 0.75rem 0 0.5rem;
  }

  .mid-topbar .navbar-nav {
    align-items: stretch;
  }

  .nav-identity {
    margin: 0.5rem 0;
    padding: 0.75rem 0;
    border-top: 1px solid var(--mid-line);
    border-left: 0;
    border-bottom: 1px solid var(--mid-line);
  }

  .mid-main {
    padding-top: 1.25rem;
  }

  .mid-dashboard-hero,
  .admin-hero {
    padding: 1.5rem;
  }

  .mid-dashboard-hero {
    min-height: auto;
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-trust {
    max-width: none;
    justify-content: flex-start;
  }

  .admin-hero-head {
    align-items: stretch;
    flex-direction: column;
    gap: 1rem;
  }

  .admin-add-button {
    align-self: flex-start;
  }

  .auth-shell {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .auth-story {
    min-height: 16rem;
    padding: 2rem;
  }

  .auth-story-copy {
    padding: 2.5rem 0 0;
  }

  .auth-story-copy > p,
  .auth-benefits,
  .auth-story-status {
    display: none;
  }

  .auth-form-panel {
    padding: 2.5rem 2rem;
  }
}

@media (max-width: 575.98px) {
  .mid-auth-main {
    align-items: flex-start;
    padding: 0;
  }

  .auth-shell {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .auth-story {
    min-height: 13rem;
    border-radius: 0 0 1.5rem 1.5rem;
  }

  .auth-story h2 {
    font-size: 1.8rem;
  }

  .auth-story-copy {
    padding-top: 1.9rem;
  }

  .auth-form-panel {
    padding: 2.25rem 1.35rem 3rem;
  }

  .mid-auth-footer {
    display: none;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-metrics {
    grid-template-columns: 1fr;
  }

  .admin-metric {
    padding: 0.65rem 0.75rem;
  }

  .modal-dialog {
    margin: 0.75rem;
  }
}

/* API guide */

.api-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.8rem 2rem;
  border-radius: 1.35rem;
  color: #fff;
  background:
    radial-gradient(circle at 88% 10%, rgba(56, 189, 248, 0.3), transparent 15rem),
    linear-gradient(120deg, #082f49 0%, #075985 55%, #0284c7 100%);
  box-shadow: 0 20px 44px rgba(3, 105, 161, 0.18);
}

.api-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 650;
  letter-spacing: -0.04em;
}

.api-hero p {
  max-width: 43rem;
  color: rgba(255, 255, 255, 0.76);
}

.api-account {
  min-width: 16rem;
  display: grid;
  gap: 0.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(8px);
}

.api-account-label {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.api-account strong {
  overflow-wrap: anywhere;
  font-size: 0.85rem;
}

.api-account .badge {
  width: fit-content;
  margin-top: 0.25rem;
}

.api-security-note {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.15rem;
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: 0.9rem;
  color: #0c4a6e;
  background: rgba(224, 242, 254, 0.72);
}

.api-security-note > i {
  margin-top: 0.1rem;
  font-size: 1.2rem;
}

.api-security-note strong,
.api-security-note span {
  display: block;
}

.api-security-note span {
  margin-top: 0.15rem;
  color: #475569;
  font-size: 0.82rem;
}

.api-step-card {
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 1.1rem;
  background: #fff;
  box-shadow: var(--mid-shadow-sm);
}

.api-step-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid var(--mid-line);
  background: #f8fafc;
}

.api-step-number {
  width: 2.35rem;
  height: 2.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 0.75rem;
  color: #fff;
  background: linear-gradient(145deg, #0ea5e9, #0369a1);
  font-weight: 700;
}

.api-step-body {
  padding: 1.25rem;
}

.api-step-body > p {
  color: var(--mid-muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.api-code-block {
  position: relative;
  overflow: hidden;
  margin: 1rem 0;
  border: 1px solid #1e293b;
  border-radius: 0.85rem;
  background: #0f172a;
}

.api-code-block pre {
  overflow-x: auto;
  margin: 0;
  padding: 1.15rem 5rem 1.15rem 1.15rem;
  color: #e2e8f0;
  font-size: 0.78rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.api-code-block code {
  color: inherit;
}

.api-copy-button {
  position: absolute;
  z-index: 2;
  top: 0.65rem;
  right: 0.65rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.45rem;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.68rem;
  font-weight: 600;
}

.api-copy-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.api-command-note {
  color: #64748b;
  font-size: 0.75rem;
}

.api-package-command + .api-package-command {
  margin-top: 1rem;
}

.api-package-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--mid-ink-soft);
  font-size: 0.8rem;
  font-weight: 650;
}

.api-package-label + .api-code-block {
  margin-top: 0.5rem;
}

.api-no-package {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 1rem 0;
  padding: 0.9rem 1rem;
  border: 1px dashed var(--mid-line);
  border-radius: 0.75rem;
  color: var(--mid-muted);
  background: #f8fafc;
  font-size: 0.82rem;
}

.api-fields-table th {
  color: #64748b;
  background: #f8fafc;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.api-fields-table th,
.api-fields-table td {
  padding: 0.8rem 1.2rem;
  border-color: #edf1f5;
  font-size: 0.82rem;
}

.api-fields-table td:first-child {
  width: 9rem;
}

.api-status-list {
  display: grid;
  gap: 0.75rem;
}

.api-status-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.api-status-code {
  min-width: 2.8rem;
  padding: 0.28rem 0.4rem;
  border-radius: 0.45rem;
  color: #0369a1;
  background: rgba(var(--mid-brand-rgb), 0.1);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
}

.api-status-list strong,
.api-status-list small {
  display: block;
}

.api-status-list strong {
  color: var(--mid-ink-soft);
  font-size: 0.83rem;
}

.api-status-list small {
  margin-top: 0.12rem;
  color: var(--mid-muted);
  font-size: 0.73rem;
}

@media (max-width: 767.98px) {
  .api-hero {
    align-items: flex-start;
    flex-direction: column;
    padding: 1.5rem;
  }

  .api-account {
    width: 100%;
    min-width: 0;
  }
}

/* Account password */
.password-shell {
  max-width: 1020px;
  margin: 0 auto;
}

.password-heading {
  margin: 0 0 1.5rem;
}

.password-heading h1 {
  margin: 0.4rem 0 0.45rem;
  font-size: clamp(1.8rem, 4vw, 2.45rem);
  font-weight: 600;
  letter-spacing: -0.035em;
}

.password-heading p {
  margin: 0;
  color: var(--mid-muted);
}

.password-card {
  overflow: hidden;
}

.password-card .form-control {
  border-color: rgba(15, 23, 42, 0.14);
  font-size: 1rem;
}

.password-card .form-control:focus {
  border-color: rgba(var(--mid-brand-rgb), 0.55);
  box-shadow: 0 0 0 0.22rem rgba(var(--mid-brand-rgb), 0.12);
}

.password-aside {
  position: relative;
  overflow: hidden;
  padding: 2rem;
  border: 1px solid rgba(var(--mid-brand-rgb), 0.2);
  border-radius: var(--bs-border-radius);
  color: #e0f2fe;
  background:
    radial-gradient(circle at 100% 0, rgba(56, 189, 248, 0.32), transparent 40%),
    linear-gradient(145deg, #082f49, #075985);
  box-shadow: 0 12px 34px rgba(8, 47, 73, 0.18);
}

.password-aside-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.85rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  font-size: 1.35rem;
}

.password-aside h2 {
  color: #fff;
}

.password-aside .password-email {
  margin: 0;
  overflow-wrap: anywhere;
  color: #bae6fd;
}

.password-aside hr {
  margin: 1.75rem 0;
  border-color: rgba(255, 255, 255, 0.18);
  opacity: 1;
}

.password-aside p:last-child {
  color: #bae6fd;
  line-height: 1.7;
}
