/*
 * Ryan Tools [Murex] — Unified Frontend Shell v0.10.0
 * Presentation only. No authentication, routing, data, or backend contracts live here.
 */

:root {
  --bg: #edf3f7;
  --surface: #ffffff;
  --surface2: #f6f9fb;
  --surface3: #e8f0f6;
  --text: #173047;
  --strong: #092238;
  --muted: #5c7285;
  --line: #d6e2ea;
  --blue: #0670c4;
  --blue2: #055896;
  --navy: #092e50;
  --orange: #b45319;
  --good: #138266;
  --good-bg: #e6f6ef;
  --warn: #9a620d;
  --warn-bg: #fff4df;
  --bad: #c34442;
  --bad-bg: #fff0ef;
  --info: #27699d;
  --info-bg: #eaf4fc;
  --shadow: 0 24px 58px rgba(17, 51, 78, .12);
  --shadow2: 0 9px 28px rgba(17, 51, 78, .075);
  --radius: 20px;
  --r: 20px;
  --motion-fast: 180ms;
  --motion-base: 420ms;
  --motion-slow: 720ms;
  --motion-ease: cubic-bezier(.22, 1, .36, 1);
  --fast: 180ms;
  --base: 420ms;
  --slow: 720ms;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

body.dark {
  --bg: #071722;
  --surface: #102431;
  --surface2: #0c1e2b;
  --surface3: #18303f;
  --text: #dce9f0;
  --strong: #f7fbfd;
  --muted: #96aebb;
  --line: #294454;
  --blue: #69b6f2;
  --blue2: #308fd2;
  --navy: #b9daf0;
  --orange: #ff9a60;
  --good: #6dd8ad;
  --good-bg: #143a30;
  --warn: #ffd07b;
  --warn-bg: #45351d;
  --bad: #ffaaa7;
  --bad-bg: #4b292b;
  --info: #9ac9ec;
  --info-bg: #15344a;
  --shadow: 0 26px 62px rgba(0, 0, 0, .32);
  --shadow2: 0 10px 30px rgba(0, 0, 0, .22);
}

html {
  background: var(--bg);
  scrollbar-color: color-mix(in srgb, var(--blue) 35%, transparent) transparent;
}

body {
  background:
    radial-gradient(circle at 7% -8%, color-mix(in srgb, var(--blue) 14%, transparent), transparent 31rem),
    radial-gradient(circle at 98% 2%, color-mix(in srgb, var(--orange) 10%, transparent), transparent 27rem),
    var(--bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.app,
.portal-shell {
  width: min(1440px, 100%);
  margin-inline: auto;
  padding: 20px;
}

.card,
.portal-topbar,
.module-card,
.roadmap-panel {
  border-color: var(--line);
  box-shadow: var(--shadow2);
}

.card,
.topbar,
.portal-topbar,
.module-card,
.kpi,
.panel,
.nav,
.secondary,
.ghost,
.icon-btn,
.primary,
.login-button {
  transition:
    border-color var(--motion-fast) ease,
    background-color var(--motion-base) ease,
    color var(--motion-fast) ease,
    transform var(--motion-base) var(--motion-ease),
    opacity var(--motion-base) ease;
}

button,
input,
select {
  min-height: 44px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.portal-shell button:focus-visible,
.owner-menu summary:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

/* Compact Hub sign-in */

.hub-login {
  isolation: isolate;
  background:
    linear-gradient(132deg, rgba(6, 112, 196, .08), transparent 42%),
    radial-gradient(circle at 84% 18%, rgba(21, 166, 160, .1), transparent 19rem),
    radial-gradient(circle at 18% 86%, rgba(180, 83, 25, .09), transparent 20rem);
}

.hub-login::before {
  inset: 0;
  width: auto;
  height: auto;
  border-radius: 0;
  background:
    repeating-radial-gradient(
      ellipse at 50% 112%,
      transparent 0 52px,
      rgba(6, 112, 196, .045) 53px 54px
    );
  filter: none;
}

.hub-login::after {
  top: -230px;
  right: -230px;
  bottom: auto;
  width: 520px;
  height: 520px;
  border: 1px solid rgba(6, 112, 196, .08);
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 49%, rgba(6, 112, 196, .05) 49.5% 50%, transparent 50.5%);
  box-shadow:
    0 0 0 58px rgba(21, 166, 160, .025),
    0 0 0 116px rgba(6, 112, 196, .018);
  filter: none;
}

.hub-login .login-card {
  overflow: hidden;
  width: min(420px, 100%);
  padding: 27px 28px;
  border-color: color-mix(in srgb, var(--blue) 32%, var(--line));
  border-radius: 24px;
  background:
    linear-gradient(155deg, color-mix(in srgb, var(--surface) 96%, var(--info-bg)), var(--surface) 58%);
  box-shadow:
    0 22px 52px rgba(17, 51, 78, .16),
    inset 0 1px 0 rgba(255, 255, 255, .72);
  backdrop-filter: none;
}

.hub-login .login-card::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--blue), #15a6a0 62%, #ed7c39);
}

.hub-login .login-card::after {
  content: "";
  position: absolute;
  top: -74px;
  right: -70px;
  width: 150px;
  height: 150px;
  border: 22px solid color-mix(in srgb, var(--blue) 6%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, #15a6a0 4%, transparent);
  pointer-events: none;
}

.hub-login .login-card > * {
  position: relative;
  z-index: 1;
}

.hub-login .login-logo-wrap {
  width: 132px;
  height: 78px;
  margin-bottom: 12px;
  border-color: color-mix(in srgb, var(--blue) 22%, var(--line));
  border-radius: 20px;
  background: linear-gradient(145deg, #ffffff, color-mix(in srgb, var(--info-bg) 74%, #ffffff));
  box-shadow:
    0 10px 24px rgba(6, 112, 196, .1),
    inset 0 1px 0 rgba(255, 255, 255, .9);
}

.hub-login .login-logo-wrap .brand-logo {
  width: 122px;
}

.hub-login .login-title h1 {
  letter-spacing: -.03em;
  font-size: 24px;
}

.hub-login .login-title p {
  margin-top: 6px;
  font-size: 11px;
}

.hub-login .login-form {
  gap: 10px;
  margin-top: 20px;
}

.hub-login .field {
  gap: 5px;
}

.hub-login .field input {
  min-height: 44px;
  border-color: color-mix(in srgb, var(--blue) 13%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface2) 96%, var(--info-bg));
  transition:
    border-color var(--motion-fast) ease,
    box-shadow var(--motion-base) ease,
    background-color var(--motion-base) ease;
}

.hub-login .login-button {
  min-height: 46px;
  margin-top: 2px;
  background: linear-gradient(135deg, var(--blue), var(--blue2) 72%, #0d728b);
  box-shadow: 0 12px 26px rgba(6, 112, 196, .22);
}

.hub-login .login-error {
  min-height: 15px;
  font-size: 10px;
}

.hub-login .login-foot {
  margin-top: 13px;
  padding-top: 12px;
  font-size: 8.5px;
}

/* Executive Hub */

.portal-topbar {
  position: sticky;
  top: 12px;
  z-index: 40;
  min-height: 86px;
  padding: 12px 14px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 98%, transparent);
  backdrop-filter: none;
}

.portal-brand {
  gap: 14px;
}

.portal-brand img {
  width: 80px;
  border-radius: 12px;
  background: #f7fafc;
}

.portal-brand-copy {
  padding-left: 14px;
}

.portal-brand-copy p {
  font-size: 11px;
}

.portal-actions > .secondary,
.portal-actions .icon-btn,
.owner-menu summary {
  min-height: 44px;
}

.owner-menu-panel {
  box-shadow: var(--shadow);
}

.portal-hero {
  min-height: 264px;
  margin: 18px 0 28px;
  padding: 38px 42px;
  border-radius: 26px;
  background: linear-gradient(128deg, #071c35 0%, #073f70 55%, #0871b5 100%);
  box-shadow: 0 24px 54px rgba(5, 54, 94, .21);
}

.portal-hero::before {
  background:
    radial-gradient(circle at 86% 14%, rgba(239, 125, 53, .32), transparent 24rem),
    radial-gradient(circle at 10% 100%, rgba(27, 163, 194, .12), transparent 28rem);
  background-size: auto;
}

.portal-kicker,
.eyebrow {
  color: var(--orange);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .16em;
}

.portal-hero .portal-kicker {
  color: #ffb07a;
}

.portal-hero h2 {
  max-width: 760px;
  margin-top: 10px;
  font-size: clamp(32px, 4.1vw, 50px);
  letter-spacing: -.045em;
}

.portal-hero p {
  margin-top: 12px;
  font-size: 13px;
}

.portal-hero-tags {
  margin-top: 18px;
}

.portal-hero-tag {
  min-height: 30px;
  padding-inline: 11px;
  font-size: 10px;
  backdrop-filter: none;
}

.portal-hero-mark {
  min-width: 176px;
  min-height: 142px;
  border-radius: 22px;
  backdrop-filter: none;
}

.portal-section-head {
  align-items: center;
  margin-bottom: 13px;
}

.portal-section-copy span {
  font-size: 9px;
}

.portal-section-copy h2 {
  font-size: clamp(22px, 2.4vw, 28px);
}

.portal-section-head > p {
  display: none;
}

.module-grid {
  gap: 14px;
}

.module-card {
  min-height: 236px;
  padding: 20px;
  border-radius: 20px;
  box-shadow: var(--shadow2);
}

.module-card::after {
  opacity: .78;
}

.module-icon {
  width: 46px;
  height: 46px;
  font-size: 14px;
}

.module-status,
.pill,
.chip,
.badge {
  font-size: 10px;
}

.module-owner {
  font-size: 10px;
}

.module-card h3 {
  margin-top: 17px;
  font-size: 21px;
}

.module-card p {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.55;
}

.module-card button.primary {
  min-height: 44px;
  font-size: 12px;
}

.roadmap-panel {
  margin-top: 24px;
  padding: 18px;
  border-radius: 20px;
  background: var(--surface);
}

.roadmap-head {
  margin-bottom: 13px;
}

.roadmap-head h2 {
  font-size: 18px;
}

.roadmap-head p {
  font-size: 11px;
}

.roadmap-card {
  min-height: 108px;
  padding: 14px;
}

.roadmap-card h3 {
  font-size: 14px;
}

.roadmap-card p {
  font-size: 11px;
  line-height: 1.5;
}

.portal-foot {
  font-size: 10px;
}

/* Unified module shell */

.topbar {
  position: relative;
  overflow: hidden;
  min-height: 92px;
  padding: 14px 16px;
  border-color: var(--line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 98%, transparent);
  box-shadow: var(--shadow2);
}

.topbar::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), #15a6a0 62%, var(--orange));
  opacity: .9;
}

.brand {
  gap: 0;
}

.topbar .brand-logo,
.brand-logo-panel {
  display: grid;
  place-items: center;
  flex: 0 0 80px;
  width: 80px;
  min-height: 62px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #f7fafc;
}

.topbar .brand-logo img,
.brand-logo-panel img {
  width: 68px;
  height: auto;
}

.brand-copy {
  min-width: 0;
  padding-left: 15px;
}

.brand-copy h1 {
  margin: 4px 0;
  color: var(--strong);
  font-size: clamp(20px, 2vw, 24px);
  line-height: 1.15;
}

.welcome {
  color: var(--muted);
  font-size: 11px;
}

.status-row {
  margin-top: 7px;
}

.pill,
.chip {
  min-height: 26px;
  padding-inline: 9px;
  letter-spacing: .02em;
}

.top-actions {
  justify-content: flex-end;
}

.top-actions .primary,
.top-actions .secondary,
.top-actions .ghost,
.top-actions .icon-btn {
  min-height: 44px;
}

.controlbar,
.filters {
  border-color: var(--line);
  background: var(--surface);
}

.control-copy h2,
.toolbar h2 {
  font-size: 18px;
}

.control-copy p,
.toolbar p,
.panel-head p {
  font-size: 11px;
  line-height: 1.55;
}

.field label {
  font-size: 10px;
}

.field input,
.field select,
.filter-grid .field input,
.filter-grid .field select {
  min-height: 44px;
  font-size: 12px;
}

.nav {
  position: sticky;
  top: 9px;
  z-index: 35;
  display: flex;
  gap: 4px;
  margin: 12px 0 0;
  padding: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 98%, transparent);
  box-shadow: var(--shadow2);
  backdrop-filter: none;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav button {
  position: relative;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: none;
  transform: none;
}

.quick-row button {
  min-height: 44px;
  font-size: 10px;
}

.module-status.soon,
.roadmap-head > span {
  font-size: 9px;
}

.nav button::before {
  display: none;
}

.nav button::after {
  content: "";
  position: absolute;
  right: 20%;
  bottom: 4px;
  left: 20%;
  height: 2px;
  border-radius: 999px;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--motion-base) var(--motion-ease);
}

.nav button:hover {
  border-color: color-mix(in srgb, var(--blue) 15%, var(--line));
  background: color-mix(in srgb, var(--info-bg) 72%, transparent);
  color: var(--blue);
  box-shadow: none;
  transform: none;
}

.nav button.active {
  border-color: color-mix(in srgb, var(--blue) 20%, var(--line));
  background: var(--info-bg);
  color: var(--blue);
  box-shadow: none;
  transform: none;
}

.nav button.active::after {
  transform: scaleX(1);
}

.kpi small {
  font-size: 10px;
}

.kpi span,
.filter-summary,
.panel-head select,
.legend-item p,
.list-item p,
.callout,
.empty {
  font-size: 11px;
}

.panel-head h3,
.legend-item strong,
.list-item strong {
  font-size: 13px;
}

.bar-label,
.bar-value {
  font-size: 11px;
}

.badge {
  min-height: 24px;
  padding-inline: 8px;
  font-size: 9.5px;
}

table {
  font-size: 11px;
}

th {
  padding: 11px 10px;
  font-size: 9px;
}

td {
  padding: 11px 10px;
}

footer {
  font-size: 10px;
}

.loader-stage,
.loader-meta {
  font-size: 10.5px;
}

/* Compositor-friendly recurring motion */

.login-shell::before,
.login-shell::after {
  animation: none;
}

.breathing-logo,
.loader-logo {
  border: 1px solid rgba(8, 119, 207, .14);
  border-radius: 14px;
  background: #f7fafc;
  filter: drop-shadow(0 10px 20px rgba(8, 119, 207, .18));
  animation: murexBreathe 1.8s ease-in-out infinite;
}

.logo-panel {
  background: #f7fafc;
}

.bar-fill,
.meter span {
  transform-origin: left center;
  animation: murexBarIn 700ms var(--motion-ease) both;
}

.bar-button:hover .bar-fill {
  filter: none;
}

.card:hover,
.panel:hover,
.kpi:hover {
  box-shadow: var(--shadow2);
}

.panel:hover,
.kpi:hover,
tbody tr:hover {
  transform: none;
}

tbody tr {
  transition: background-color var(--motion-fast) ease;
}

@keyframes murexBreathe {
  0%,
  100% {
    opacity: .82;
    transform: scale(.96);
  }

  50% {
    opacity: 1;
    transform: scale(1.035);
  }
}

@keyframes murexBarIn {
  from {
    opacity: .45;
    transform: scaleX(0);
  }

  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

@media (hover: hover) {
  .module-card:hover {
    border-color: color-mix(in srgb, var(--module-accent) 38%, var(--line));
    box-shadow: var(--shadow2);
    transform: translateY(-3px);
  }

  .primary:hover,
  .secondary:hover,
  .ghost:hover,
  .icon-btn:hover {
    transform: translateY(-1px);
  }
}

@media (max-width: 900px) {
  .app,
  .portal-shell {
    padding: 12px;
  }

  .portal-topbar {
    top: 8px;
  }

  .portal-hero {
    padding: 30px;
  }
}

@media (max-width: 820px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
    flex-direction: row;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .top-actions::-webkit-scrollbar {
    display: none;
  }

  .nav {
    position: sticky;
    top: 8px;
    right: auto;
    bottom: auto;
    left: auto;
    margin-top: 12px;
    padding: 6px;
  }

  .nav button {
    flex: 0 0 auto;
    min-width: 82px;
    padding-inline: 12px;
    font-size: 10.5px;
  }

  .nav button::after {
    content: "";
    font-size: 0;
  }

  .app {
    padding-bottom: 14px;
  }
}

@media (max-width: 560px) {
  .hub-login .login-card {
    padding: 23px 20px;
    border-radius: 22px;
  }

  .hub-login .login-logo-wrap {
    width: 124px;
    height: 72px;
    margin-bottom: 10px;
  }

  .hub-login .login-logo-wrap .brand-logo {
    width: 116px;
  }

  .portal-topbar {
    position: relative;
    top: auto;
  }

  .portal-hero {
    min-height: 0;
    padding: 24px 20px;
  }

  .portal-hero h2 {
    font-size: 32px;
  }

  .portal-hero-tag {
    font-size: 9.5px;
  }

  .topbar .brand-logo,
  .brand-logo-panel {
    display: grid;
    flex-basis: 68px;
    width: 68px;
    min-height: 56px;
  }

  .topbar .brand-logo img,
  .brand-logo-panel img {
    width: 58px;
  }

  .brand-copy {
    padding-left: 12px;
  }

  .brand-copy h1 {
    font-size: 20px;
  }

  .top-actions .primary,
  .top-actions .secondary,
  .top-actions .ghost {
    flex: 0 0 auto;
    padding-inline: 7px;
    font-size: 10.5px;
    white-space: nowrap;
  }

  .top-actions {
    gap: 6px;
  }

  .top-actions .icon-btn {
    flex: 0 0 44px;
  }

  .module-prepaid-shell .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 360px) {
  .module-prepaid-shell .kpis {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .breathing-logo,
  .loader-logo,
  .bar-fill,
  .meter span {
    animation: none;
  }
}
