:root {
  --glass-bg: rgba(255, 255, 255, 0.6);
  --glass-bg-strong: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-shadow: 0 8px 30px rgba(31, 41, 55, 0.08);
  --accent: #f18a28;
  --accent-strong: #063a68;
  --brand-navy: #063a68;
  --brand-orange: #f18a28;
  --font-body: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --danger: #ff3b30;
  --success: #34c759;
  --warning: #ff9f0a;
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --text-strong: #14304f;
  --text-muted: #5f6b7a;
}

html, body {
  height: 100%;
  height: 100dvh;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  /* Solid fallback behind the animated blobs, tinted to match them so any
     gap (e.g. around the iOS status bar/Dynamic Island while the browser
     chrome is collapsed) blends in instead of showing flat white/gray. */
  background: linear-gradient(160deg, #e8edf3 0%, #f3ede4 55%, #eee2d2 100%);
  color: var(--text-strong);
  font-family: var(--font-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.bg-blobs .blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.45;
  will-change: transform;
  animation: drift 26s ease-in-out infinite alternate;
}

.bg-blobs .blob-1 {
  width: 480px;
  height: 480px;
  top: -140px;
  left: -120px;
  background: radial-gradient(circle at 30% 30%, #3a6ea5, var(--brand-navy));
}

.bg-blobs .blob-2 {
  width: 520px;
  height: 520px;
  top: 20%;
  right: -180px;
  background: radial-gradient(circle at 60% 40%, #ffb15c, var(--brand-orange));
  animation-delay: -8s;
}

.bg-blobs .blob-3 {
  width: 420px;
  height: 420px;
  bottom: -160px;
  left: 30%;
  background: radial-gradient(circle at 40% 60%, var(--brand-navy), #08213a);
  animation-delay: -16s;
}

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(40px, 30px) scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
  .bg-blobs .blob { animation: none; }
}

h1, h2, h3, h4, h5 {
  font-weight: 700;
  color: var(--text-strong);
}

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

/* Sidebar layout */
.app-shell {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar-glass {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border-right: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  height: 100vh;
  height: 100dvh;
  transition: width 0.25s ease, padding 0.25s ease;
}

.sidebar-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--brand-navy);
  text-decoration: none;
  padding: 0 0.5rem;
  min-width: 0;
  overflow: hidden;
}

.sidebar-brand-icon {
  transition: transform 0.2s ease;
}

.sidebar-brand:hover .sidebar-brand-icon {
  transform: scale(1.08) rotate(-4deg);
}

.sidebar-brand-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(29, 29, 31, 0.75);
  text-decoration: none;
  font-weight: 500;
  font-size: inherit;
  font-family: inherit;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.sidebar-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.sidebar-link:hover {
  color: var(--text-strong);
  background: rgba(0, 0, 0, 0.06);
  transform: translateX(3px);
}

.sidebar-link:hover svg {
  color: var(--text-strong);
}

.sidebar-link.active {
  color: var(--brand-navy);
  background: linear-gradient(135deg, rgba(240, 140, 42, 0.14), rgba(6, 58, 104, 0.1));
  font-weight: 600;
}

.sidebar-link.active svg {
  color: var(--accent);
}

.sidebar-link-logout:hover {
  color: var(--danger);
  background: rgba(255, 59, 48, 0.08);
}

.sidebar-link-logout:hover svg {
  color: var(--danger);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.app-main {
  flex: 1;
  min-width: 0;
  padding: 1.5rem 1.5rem 3rem;
}

.sidebar-spacer {
  display: none;
}

.sidebar-toggle {
  display: none;
  position: fixed;
  top: calc(14px + env(safe-area-inset-top));
  left: calc(14px + env(safe-area-inset-left));
  z-index: 1100;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  cursor: pointer;
}

.sidebar-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--text-strong);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1049;
  background: rgba(0, 0, 0, 0.25);
}

.sidebar-overlay.visible {
  display: block;
}

@media (max-width: 991.98px) {
  .sidebar-toggle {
    display: flex;
  }

  .sidebar-glass {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    overflow-y: auto;
    z-index: 1050;
    padding-top: calc(4.5rem + env(safe-area-inset-top));
    padding-left: calc(1rem + env(safe-area-inset-left));
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .sidebar-glass.open {
    transform: translateX(0);
  }

  .app-main {
    padding-top: calc(4.5rem + env(safe-area-inset-top));
    padding-bottom: calc(3rem + env(safe-area-inset-bottom));
  }
}

@media (min-width: 992px) {
  .sidebar-spacer {
    display: block;
    flex-shrink: 0;
    width: 96px;
  }

  .sidebar-glass {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 500;
    height: calc(100vh - 24px);
    height: calc(100dvh - 24px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    width: 84px;
    padding-left: 0.65rem;
    padding-right: 0.65rem;
    overflow: hidden;
  }

  .sidebar-glass:hover {
    width: 240px;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .sidebar-brand-row {
    justify-content: center;
  }

  .sidebar-glass:hover .sidebar-brand-row {
    justify-content: flex-start;
  }

  .sidebar-brand span,
  .sidebar-link span {
    display: none;
    white-space: nowrap;
  }

  .sidebar-glass:hover .sidebar-brand span,
  .sidebar-glass:hover .sidebar-link span {
    display: inline;
  }

  .sidebar-link {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }

  .sidebar-glass:hover .sidebar-link {
    justify-content: flex-start;
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .sidebar-link:hover {
    transform: none;
  }

  .sidebar-glass:hover .sidebar-link:hover {
    transform: translateX(3px);
  }
}

/* Cards */
.card {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.card-body {
  padding: 1.5rem;
}

.stat-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(31, 41, 55, 0.12);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.85rem;
}

.stat-icon svg {
  width: 22px;
  height: 22px;
}

.stat-icon-success {
  background: rgba(52, 199, 89, 0.15);
  color: #1f8a3c;
}

.stat-icon-danger {
  background: rgba(255, 59, 48, 0.15);
  color: #d9291f;
}

.stat-icon-warning {
  background: rgba(255, 159, 10, 0.18);
  color: #b6710a;
}

.stat-icon-brand {
  background: rgba(6, 58, 104, 0.12);
  color: var(--brand-navy);
}

/* Revenue chart */
.revenue-chart {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  height: 180px;
  padding-top: 1.5rem;
}

.revenue-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}

.revenue-bar-value {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 0.35rem;
  white-space: nowrap;
}

.revenue-bar {
  width: 100%;
  max-width: 40px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  transition: height 0.4s ease;
}

.revenue-bar-label {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Router resource usage */
.router-usage-card {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.usage-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}

.usage-row:last-child {
  margin-bottom: 0;
}

.usage-label {
  width: 32px;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.usage-bar-track {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.usage-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.usage-ok {
  background: #34c759;
}

.usage-warning {
  background: #ff9f0a;
}

.usage-danger {
  background: #ff3b30;
}

.usage-value {
  width: 32px;
  text-align: right;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Buttons */
.btn {
  border-radius: var(--radius-pill);
  font-weight: 500;
  padding: 0.5rem 1.15rem;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border: none;
  box-shadow: 0 6px 16px rgba(240, 140, 42, 0.35);
}

.btn.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 8px 22px rgba(240, 140, 42, 0.45);
  transform: translateY(-1px);
}

.btn.btn-outline-secondary,
.btn.btn-outline-dark,
.btn.btn-outline-light {
  border: 1px solid rgba(0, 0, 0, 0.15);
  color: var(--text-strong);
  background: rgba(255, 255, 255, 0.4);
}

.btn.btn-outline-secondary:hover,
.btn.btn-outline-dark:hover,
.btn.btn-outline-light:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-strong);
}

.btn.btn-outline-danger {
  border: 1px solid rgba(255, 59, 48, 0.4);
  color: var(--danger);
  background: rgba(255, 59, 48, 0.06);
}

.btn.btn-outline-danger:hover {
  background: rgba(255, 59, 48, 0.15);
  color: var(--danger);
}

.btn.btn-outline-success {
  border: 1px solid rgba(52, 199, 89, 0.4);
  color: #1f8a3c;
  background: rgba(52, 199, 89, 0.08);
}

.btn.btn-outline-success:hover {
  background: rgba(52, 199, 89, 0.18);
}

.btn-sm {
  padding: 0.3rem 0.85rem;
  font-size: 0.85rem;
}

/* Forms */
.form-control,
.form-select {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.9rem;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.form-control:focus,
.form-select:focus {
  background: rgba(255, 255, 255, 0.8);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(240, 140, 42, 0.15);
}

.form-label {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Data lists (subscribers, contracts, plans, routers, invoices): each record
   is its own rounded "bubble" row with visible spacing between them (not a
   dense table), so long text doesn't look cramped. Shared across panels;
   each panel just sets its own column widths via a .grid-cols-* modifier. */
.data-list-scroll {
  overflow-x: auto;
}

.data-list-header,
.data-row-grid {
  display: grid;
  gap: 0.75rem;
  align-items: center;
}

.data-list-header {
  padding: 0 1.25rem 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.data-list-body {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.data-row {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  overflow: hidden;
  transition: box-shadow 0.15s ease;
}

.data-row:hover {
  box-shadow: 0 10px 30px rgba(31, 41, 55, 0.1);
}

a.data-row {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.data-row-grid {
  padding: 0.85rem 1.25rem;
}

.data-row.open .data-row-grid {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.data-row-primary {
  font-weight: 500;
  color: var(--text-strong);
}

/* Per-panel column widths */
.grid-cols-subscribers {
  grid-template-columns: minmax(220px, 2.2fr) minmax(110px, 1fr) minmax(100px, 1fr) minmax(90px, 1fr) minmax(90px, 1fr) minmax(90px, auto) 44px;
  min-width: 820px;
}

.grid-cols-contracts {
  grid-template-columns: minmax(110px, 1fr) minmax(180px, 1.8fr) minmax(110px, 1fr) minmax(110px, 1fr) minmax(100px, 1fr) 44px;
  min-width: 700px;
}

.grid-cols-plans {
  grid-template-columns: minmax(140px, 1.4fr) minmax(90px, 1fr) minmax(110px, 1fr) minmax(120px, 1fr) minmax(100px, 1fr) 44px;
  min-width: 650px;
}

.grid-cols-routers {
  grid-template-columns: minmax(140px, 1.2fr) minmax(140px, 1.4fr) minmax(110px, 1fr) minmax(80px, 1fr) 44px;
  min-width: 600px;
}

.grid-cols-invoices {
  grid-template-columns: minmax(160px, 1.6fr) minmax(90px, 1fr) minmax(90px, 1fr) minmax(100px, 1fr) minmax(90px, 1fr) 44px;
  min-width: 660px;
}

.grid-cols-import {
  grid-template-columns: 28px minmax(200px, 2fr) minmax(110px, 1fr) minmax(90px, 1fr) minmax(90px, auto) 180px;
  min-width: 780px;
}

.grid-cols-portal-invoices {
  grid-template-columns: minmax(90px, 1fr) minmax(90px, 1fr) minmax(110px, 1fr) minmax(90px, 1fr) minmax(100px, auto);
  min-width: 520px;
}

.grid-cols-support {
  grid-template-columns: minmax(140px, 1.2fr) minmax(220px, 2fr) minmax(120px, 1fr) minmax(90px, 1fr) minmax(140px, 1fr);
  min-width: 700px;
}

.grid-cols-sessions {
  grid-template-columns: minmax(100px, 1fr) minmax(160px, 1.6fr) minmax(110px, 1fr) minmax(100px, 1fr) minmax(100px, 1fr) minmax(110px, 1fr) minmax(120px, 1fr);
  min-width: 800px;
}

.grid-cols-antennas {
  grid-template-columns: minmax(140px, 1.2fr) minmax(140px, 1.4fr) minmax(110px, 1fr) 44px;
  min-width: 500px;
}

.grid-cols-stations {
  grid-template-columns: minmax(100px, 1fr) minmax(150px, 1.5fr) minmax(120px, 1fr) minmax(120px, 1fr) minmax(90px, 1fr) minmax(70px, 1fr) minmax(90px, 1fr) minmax(110px, 1fr);
  min-width: 900px;
}

/* On phones, the multi-column grid (and its horizontal scroll) is where the
   toggle button ends up out of reach. Below this width every row becomes a
   stacked card instead - full width, no scrolling required to see or open
   its actions - and tapping anywhere on the card opens the menu, not just
   the small chevron. */
@media (max-width: 700px) {
  .data-list-scroll {
    overflow-x: visible;
  }

  .data-list-header {
    display: none;
  }

  .data-row-grid {
    display: flex !important;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
    min-width: 0 !important;
    padding: 0.85rem 3.4rem 0.85rem 1.1rem;
    position: relative;
    cursor: pointer;
  }

  .data-row-grid > [data-label]::before {
    content: attr(data-label) ": ";
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }

  .data-row-grid > .text-end {
    position: absolute;
    top: 0.6rem;
    right: 0.7rem;
  }
}

/* Per-row actions submenu: a single toggle per row expands an inline strip
   of pill actions directly underneath it, instead of a cluttered row of
   buttons or a floating popup. Height is animated via JS (measured
   scrollHeight) since a pure-CSS collapse trick wasn't reliably reaching a
   true 0px in real-world testing. */
.row-actions-toggle {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.row-actions-chevron {
  width: 16px;
  height: 16px;
  transition: transform 0.18s ease;
}

.row-actions-toggle[aria-expanded="true"] .row-actions-chevron {
  transform: rotate(180deg);
}

.row-actions-collapse {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.22s ease;
}

.row-actions-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.9rem;
}

.row-actions-item-form {
  margin: 0;
}

.row-actions-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.5);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-strong);
  text-decoration: none;
  white-space: nowrap;
}

.row-actions-item:hover {
  background: rgba(0, 0, 0, 0.08);
}

.row-actions-item.danger {
  color: var(--danger);
  border-color: rgba(255, 59, 48, 0.25);
}

.row-actions-item svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Tables */
.table {
  --bs-table-bg: transparent;
  --bs-table-hover-bg: rgba(0, 0, 0, 0.035);
  margin-bottom: 0;
}

.table > :not(caption) > * > * {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

.table thead th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

/* Alerts & badges */
.alert {
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.alert-danger {
  background: rgba(255, 59, 48, 0.1);
  color: #b0261c;
  border-color: rgba(255, 59, 48, 0.2);
}

.alert-success {
  background: rgba(52, 199, 89, 0.12);
  color: #1f7a34;
  border-color: rgba(52, 199, 89, 0.2);
}

.badge {
  border-radius: var(--radius-pill);
  font-weight: 500;
  padding: 0.4em 0.8em;
}

code {
  background: rgba(0, 0, 0, 0.06);
  color: inherit;
  padding: 0.15em 0.5em;
  border-radius: 6px;
  font-size: 0.85em;
}

.mikrotik-script-block {
  background: #0f1e2e;
  color: #d8e6f2;
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  font-size: 0.82rem;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre;
}

.mikrotik-script-block code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* Client portal: a bold gradient "hero" card for balance/status (inspired
   by typical carrier-app balance cards, but in STROC's own brand colors and
   the same frosted-glass language as the rest of the app) plus a couple of
   glass quick-action tiles underneath. */
.portal-hero-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-navy) 0%, #0d5c94 60%, var(--brand-orange) 145%);
  box-shadow: 0 20px 45px rgba(6, 58, 104, 0.35);
}

.portal-hero-blob {
  position: absolute;
  top: -70px;
  right: -60px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  filter: blur(45px);
  pointer-events: none;
}

.portal-hero-blob-2 {
  position: absolute;
  bottom: -80px;
  left: -40px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  filter: blur(45px);
  pointer-events: none;
}

.portal-hero-content {
  position: relative;
}

.portal-hero-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.75);
}

.portal-hero-name {
  font-size: 1.15rem;
  font-weight: 600;
}

.portal-hero-badge {
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.03em;
}

.portal-hero-balance-row {
  margin-top: 1.5rem;
}

.portal-hero-balance {
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.15;
}

.portal-hero-due {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 0.15rem;
}

.portal-hero-mxn {
  font-size: 0.95rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
}

.portal-plan-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-strong);
}

.portal-mxn-tag {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  margin-left: 0.3rem;
}

/* Portal login: full-bleed brand gradient (matching the hero card) behind a
   floating frosted-glass card, instead of a plain white Bootstrap card. */
.portal-login-page {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow: hidden;
  background: linear-gradient(160deg, var(--brand-navy) 0%, #0d5c94 55%, var(--brand-orange) 140%);
}

.portal-login-blob {
  position: absolute;
  top: -12%;
  right: -12%;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  filter: blur(60px);
  pointer-events: none;
}

.portal-login-blob-2 {
  position: absolute;
  bottom: -16%;
  left: -12%;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  filter: blur(60px);
  pointer-events: none;
}

.portal-login-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.35);
  -webkit-backdrop-filter: blur(45px) saturate(220%);
  backdrop-filter: blur(45px) saturate(220%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 70px rgba(6, 58, 104, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  padding: 2rem 1.75rem;
  text-align: center;
}

.portal-input-group {
  position: relative;
}

.portal-input-icon {
  position: absolute;
  z-index: 2;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  color: var(--text-strong);
  pointer-events: none;
}

.portal-input-icon svg {
  width: 16px;
  height: 16px;
}

.portal-input {
  padding-left: 2.6rem !important;
  background: rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-md);
}

.portal-input:focus {
  background: rgba(255, 255, 255, 0.9);
}

.portal-login-recover-link {
  display: block;
  margin-top: 1.1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
}

.portal-login-recover-link:hover {
  color: var(--brand-orange);
  text-decoration: underline;
}

.portal-login-logo {
  height: 52px;
  margin-bottom: 0.75rem;
}

.portal-login-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 0.25rem;
}

.portal-login-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Revolut-style top bar: avatar + greeting on the left, circular icon-only
   action buttons on the right, instead of text pill buttons. */
.portal-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.portal-greeting {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.portal-avatar {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-navy), var(--brand-orange));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.05rem;
}

.portal-greeting-text {
  min-width: 0;
}

.portal-greeting-text .small-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.2;
}

.portal-greeting-text .name {
  font-weight: 600;
  color: var(--text-strong);
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portal-topbar-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.portal-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  backdrop-filter: blur(16px) saturate(180%);
  color: var(--text-strong);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.portal-icon-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(31, 41, 55, 0.1);
  color: var(--text-strong);
}

.portal-icon-btn svg {
  width: 18px;
  height: 18px;
}

/* Quick actions row: circular tinted icon + label underneath, no card
   border - closer to a Revolut/neobank action row than a boxed tile. */
.portal-quick-actions {
  display: flex;
  justify-content: space-around;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.portal-quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 0;
  min-width: 0;
  color: var(--text-strong);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 500;
  text-align: center;
}

.portal-quick-action:hover {
  color: var(--text-strong);
}

.portal-quick-action-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(31, 41, 55, 0.08);
  transition: transform 0.15s ease;
}

.portal-quick-action:hover .portal-quick-action-icon {
  transform: translateY(-3px);
}

.portal-quick-action-icon svg {
  width: 22px;
  height: 22px;
}

.portal-quick-action-icon.tone-warning {
  background: rgba(255, 159, 10, 0.16);
  color: #d9770a;
}

.portal-quick-action-icon.tone-navy {
  background: rgba(6, 58, 104, 0.12);
  color: var(--brand-navy);
}

.portal-quick-action-icon.tone-blue {
  background: rgba(10, 132, 255, 0.14);
  color: #0a84ff;
}

.portal-plan-icon {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(10, 132, 255, 0.14);
  color: #0a84ff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.portal-plan-icon svg {
  width: 22px;
  height: 22px;
}

/* Floating bottom nav (mobile only): a Revolut-style docked tab bar so
   primary navigation doesn't rely on scrolling back up to the top bar. */
.portal-bottom-nav {
  display: none;
}

.portal-bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.66rem;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}

.portal-bottom-nav-item svg {
  width: 20px;
  height: 20px;
}

.portal-bottom-nav-item.active {
  color: var(--brand-orange);
  background: rgba(241, 138, 40, 0.14);
}

@media (max-width: 700px) {
  .portal-hide-mobile {
    display: none;
  }

  .portal-page-with-bottom-nav {
    padding-bottom: 5.5rem;
  }

  .portal-bottom-nav {
    display: flex;
    position: fixed;
    left: 50%;
    bottom: calc(0.75rem + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    width: calc(100% - 1.5rem);
    max-width: 420px;
    justify-content: space-around;
    align-items: center;
    padding: 0.5rem;
    background: var(--glass-bg-strong);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-pill);
    box-shadow: 0 12px 34px rgba(6, 58, 104, 0.18);
    z-index: 1030;
  }
}
