:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-soft: #f7f9fc;
  --line: #dbe4ee;
  --line-strong: #bdcad8;
  --text: #0c1b33;
  --muted: #64748b;
  --navy: #07152f;
  --blue: #1479ff;
  --teal: #0bb9a5;
  --orange: #f59e0b;
  --red: #dc3346;
  --green: #07975f;
  --purple: #7658ef;
  --shadow: 0 12px 34px rgba(15, 36, 64, .07);
  --shadow-lg: 0 26px 72px rgba(15, 36, 64, .14);
}

body {
  color: var(--text);
  font-family: Inter, "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  letter-spacing: -.008em;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, strong { letter-spacing: -.025em; }
h1 { font-weight: 760; }
h2, h3 { font-weight: 730; }
.eyebrow { color: #1672dc; letter-spacing: .14em; }
.ui-icon { display: block; width: 20px; height: 20px; flex: 0 0 auto; }

.button {
  min-height: 42px;
  border-radius: 10px;
  font-size: 12px;
  letter-spacing: -.01em;
  box-shadow: none;
}
.button.primary {
  background: linear-gradient(118deg, #1377f3, #06a99d);
  box-shadow: 0 8px 20px rgba(20, 121, 255, .18);
}
.button.secondary { border-color: #c5d1dd; background: #fff; }
.button:focus-visible, .nav-link:focus-visible, .user-chip:focus-visible {
  outline: 3px solid rgba(20, 121, 255, .25);
  outline-offset: 2px;
}

input, select {
  min-height: 46px;
  padding: 10px 12px;
  border-color: #cad6e2;
  border-radius: 10px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
input:hover, select:hover { border-color: #9fb1c3; }
input:focus, select:focus { border-color: #1479ff; box-shadow: 0 0 0 4px rgba(20, 121, 255, .11); }

.alert {
  padding: 13px 15px;
  border-radius: 11px;
  box-shadow: 0 5px 18px rgba(15, 36, 64, .035);
}

/* Professional application shell */
.portal-shell { grid-template-columns: 272px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  isolation: isolate;
  padding: 22px 16px 18px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  background:
    radial-gradient(circle at 18% 8%, rgba(20, 121, 255, .28), transparent 14rem),
    linear-gradient(180deg, #0a1b3a 0%, #07142f 48%, #061129 100%);
  box-shadow: 14px 0 40px rgba(7, 21, 47, .08);
}
.sidebar::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -110px;
  bottom: -90px;
  width: 240px;
  height: 240px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 50%;
}
.sidebar-logo {
  width: 170px;
  margin: 0 6px 10px;
  padding: 10px 15px;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 9px 24px rgba(0, 0, 0, .13);
}
.sidebar-logo img { width: 138px; }
.sidebar-caption { margin: 0 10px 26px; color: #8fa6c4; font-size: 10px; letter-spacing: .035em; }
.sidebar nav { gap: 3px; }
.nav-heading { margin: 18px 12px 7px; color: #7188a8; font-size: 8px; letter-spacing: .19em; }
.nav-link {
  min-height: 43px;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #b9c9dc;
  font-size: 12px;
  font-weight: 650;
}
.nav-link .ui-icon { width: 18px; height: 18px; color: #8fa8c4; }
.nav-link > span { display: inline; width: auto; font-size: inherit; }
.nav-link:hover { border-color: rgba(255,255,255,.06); color: #fff; background: rgba(255,255,255,.055); }
.nav-link:hover .ui-icon { color: #7dd6ff; }
.nav-link.active {
  border-color: rgba(92, 209, 235, .24);
  color: #fff;
  background: linear-gradient(110deg, rgba(20,121,255,.82), rgba(11,185,165,.62));
  box-shadow: 0 9px 24px rgba(3, 106, 178, .22);
}
.nav-link.active .ui-icon { color: #fff; }
.sidebar-footer { display: grid; gap: 8px; margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.09); }
.sidebar-account { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; padding: 8px; border-radius: 11px; color: #fff; }
.sidebar-account:hover { background: rgba(255,255,255,.05); text-decoration: none; }
.sidebar-account > span:last-child { display: grid; min-width: 0; }
.sidebar-account strong, .sidebar-account small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-account strong { font-size: 11px; }
.sidebar-account small { color: #8fa6c4; font-size: 9px; }
.sidebar-avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #fff; background: linear-gradient(145deg, #1479ff, #0bb9a5); font-weight: 800; }
.sidebar-logout { margin-top: 0; }
.sidebar-logout .nav-button { margin: 0; }

.portal-main {
  padding: 32px clamp(24px, 3.5vw, 58px) 64px;
  background:
    radial-gradient(circle at 88% 0%, rgba(20,121,255,.075), transparent 25rem),
    linear-gradient(180deg, #f8fbff 0, #f4f7fb 330px, #f4f7fb 100%);
}
.topbar { margin-bottom: 26px; }
.topbar h1 { margin-bottom: 7px; font-size: clamp(28px, 3vw, 40px); }
.topbar .muted { margin-bottom: 0; font-size: 13px; }
.user-chip {
  min-width: 220px;
  gap: 11px;
  padding: 8px 9px;
  border-color: #d6e0ea;
  border-radius: 14px;
  color: var(--text);
  background: rgba(255,255,255,.92);
  box-shadow: 0 8px 24px rgba(15,36,64,.055);
}
.user-chip:hover { border-color: #afc1d2; text-decoration: none; transform: translateY(-1px); }
.user-chip > span { width: 39px; height: 39px; }
.user-chip > .ui-icon { width: 17px; height: 17px; margin-left: auto; color: #7d91a5; }
.user-chip strong { font-size: 11px; }
.user-chip small { font-size: 9px; }

.account-status-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid #d8e4ee;
  border-radius: 14px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 8px 24px rgba(15,36,64,.045);
}
.account-status-strip > span { display: flex; align-items: center; gap: 10px; }
.account-status-strip .ui-icon { width: 19px; height: 19px; color: var(--green); }
.account-status-strip > span > span { display: grid; }
.account-status-strip strong { font-size: 11px; }
.account-status-strip small { color: var(--muted); font-size: 9px; }
.account-status-strip > a { display: flex; align-items: center; gap: 4px; color: #126fd0; font-size: 11px; font-weight: 750; }
.account-status-strip > a .ui-icon { width: 15px; height: 15px; }

.section-block { margin-top: 30px; }
.section-heading { margin-bottom: 16px; }
.product-grid { gap: 20px; }
.product-card {
  gap: 18px;
  padding: 24px;
  border: 1px solid #dce5ee;
  border-top: 1px solid #dce5ee;
  border-radius: 17px;
  box-shadow: 0 14px 38px rgba(15,36,64,.065);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.product-card:hover { transform: translateY(-2px); border-color: #c2d2e1; box-shadow: 0 18px 44px rgba(15,36,64,.095); }
.product-card.active { box-shadow: inset 0 3px 0 var(--green), 0 14px 38px rgba(15,36,64,.065); }
.product-card.pending, .product-card.scheduled { box-shadow: inset 0 3px 0 var(--orange), 0 14px 38px rgba(15,36,64,.065); }
.product-card.expired, .product-card.suspended { box-shadow: inset 0 3px 0 var(--red), 0 14px 38px rgba(15,36,64,.065); }
.product-icon { width: 45px; height: 45px; color: #116ba8; background: linear-gradient(145deg, #eef7ff, #e7f5fa); }
.product-icon .ui-icon { width: 23px; height: 23px; }
.provider-mark .ui-icon { width: 24px; height: 24px; }
.product-card h3 { font-size: 18px; }
.product-price {
  margin: 12px 0 0;
  display: flex;
  align-items: baseline;
  gap: 7px;
  color: var(--navy);
}
.product-price strong { font-size: 22px; letter-spacing: -.035em; }
.product-price span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: capitalize;
  letter-spacing: .06em;
}
.feature-list { font-size: 11px; }
.access-window { min-height: 52px; padding: 12px 13px; border-color: #dce5ee; background: #f8fafc; }
.status { min-height: 27px; padding: 5px 10px; font-size: 9px; }

.metric-grid { gap: 16px; }
.metric-card { padding: 20px; border-radius: 15px; box-shadow: 0 12px 34px rgba(15,36,64,.06); }
.metric-card strong { font-size: 32px; }
.compact-product { padding: 17px; border-radius: 14px; box-shadow: 0 8px 25px rgba(15,36,64,.045); }
.table-wrap { border-color: #dce5ee; border-radius: 14px; box-shadow: 0 9px 28px rgba(15,36,64,.04); }
th { color: #65798e; background: #f7f9fc; }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: #f9fbfd; }

/* Profile and security centre */
.profile-main { max-width: none; }
.verified-chip { display: flex; align-items: center; gap: 10px; padding: 10px 13px; border: 1px solid #a8dbc6; border-radius: 13px; color: #096d49; background: #f0fbf6; }
.verified-chip .ui-icon { width: 22px; height: 22px; }
.verified-chip > span { display: grid; }
.verified-chip strong { font-size: 11px; }
.verified-chip small { color: #578073; font-size: 9px; }
.profile-overview { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(420px, .9fr); align-items: center; gap: 24px; padding: 24px; border: 1px solid #d8e3ed; border-radius: 18px; color: #fff; background: linear-gradient(120deg, #0a1d3d 0%, #0e3f71 58%, #087f82 100%); box-shadow: 0 18px 46px rgba(7,34,66,.16); }
.profile-identity { display: flex; align-items: center; gap: 16px; }
.profile-avatar { display: grid; place-items: center; width: 66px; height: 66px; flex: 0 0 66px; border: 1px solid rgba(255,255,255,.26); border-radius: 19px; background: rgba(255,255,255,.13); font-size: 27px; font-weight: 780; backdrop-filter: blur(12px); }
.profile-identity .eyebrow { color: #69d8ff; }
.profile-identity h2 { margin-bottom: 3px; font-size: 26px; }
.profile-identity p { margin-bottom: 0; color: rgba(255,255,255,.72); }
.profile-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.profile-facts span { display: grid; gap: 3px; padding: 13px; border: 1px solid rgba(255,255,255,.14); border-radius: 12px; background: rgba(255,255,255,.075); }
.profile-facts small { color: rgba(255,255,255,.56); font-size: 8px; font-weight: 750; letter-spacing: .09em; }
.profile-facts strong { font-size: 11px; }
.profile-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(330px, .75fr); align-items: start; gap: 20px; margin-top: 20px; }
.profile-side-stack { display: grid; gap: 20px; }
.settings-card { padding: 24px; border: 1px solid #dce5ee; border-radius: 17px; background: #fff; box-shadow: 0 13px 36px rgba(15,36,64,.06); }
.settings-card-head { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid #e6edf3; }
.settings-card-head h2, .settings-card-head p { margin-bottom: 0; }
.settings-card-head h2 { font-size: 18px; }
.settings-card-head p { margin-top: 3px; color: var(--muted); font-size: 11px; }
.settings-icon { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 12px; color: #106fab; background: #eaf5fc; }
.settings-icon.secure { color: #08784b; background: #eaf9f2; }
.settings-icon .ui-icon { width: 21px; height: 21px; }
.profile-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; margin-top: 20px; }
.field-with-icon { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 9px; color: #50667a; font-size: 10px; font-weight: 750; }
.field-with-icon > span:first-child { padding-top: 31px; color: #7d91a5; }
.field-with-icon > span:last-child { display: grid; gap: 6px; }
.field-with-icon .ui-icon { width: 17px; height: 17px; }
.field-with-icon small { color: #7c8ea1; font-size: 9px; font-weight: 500; }
.read-only-field input { color: #6b7e91; background: #f2f5f8; }
.profile-form-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 13px; padding-top: 4px; }
.profile-form-actions span { color: var(--muted); font-size: 9px; }
.password-form { display: grid; gap: 13px; margin-top: 18px; }
.password-form label { display: grid; gap: 6px; color: #50667a; font-size: 10px; font-weight: 750; }
.password-form small { color: var(--muted); font-size: 9px; font-weight: 500; }
.google-password-state { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 12px; margin: 18px 0; padding: 13px; border: 1px solid #dce5ee; border-radius: 12px; background: #f8fafc; }
.google-password-state img { width: 25px; height: 25px; }
.google-password-state p { display: grid; margin: 0; }
.google-password-state strong { font-size: 11px; }
.google-password-state span { color: var(--muted); font-size: 9px; }
.session-state { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 10px; margin: 18px 0 12px; padding: 13px; border: 1px solid #b9dfcf; border-radius: 12px; background: #f2fbf7; }
.live-dot { width: 9px; height: 9px; border: 2px solid #c7f4df; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(7,151,95,.12); }
.session-state div { display: grid; }
.session-state strong { color: #08764c; font-size: 11px; }
.session-state small { color: #5e7d70; font-size: 9px; }
.session-details { display: grid; margin: 0 0 17px; }
.session-details div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #edf1f5; }
.session-details dt { color: var(--muted); font-size: 9px; }
.session-details dd { margin: 0; font-size: 9px; font-weight: 700; text-align: right; }

/* Public and authentication polish */
.public-header { box-shadow: 0 6px 24px rgba(15,36,64,.045); }
.hero-section { background: radial-gradient(circle at 82% 16%, rgba(11,185,165,.16), transparent 30rem), radial-gradient(circle at 12% 12%, rgba(20,121,255,.15), transparent 34rem), #f8fbff; }
.hero-copy h1 { color: #071b37; }
.trust-row span { display: inline-flex; align-items: center; gap: 6px; }
.trust-row .ui-icon { width: 16px; height: 16px; color: var(--green); }
.auth-page .auth-card { border-color: transparent; box-shadow: none; }

@media (max-width: 1160px) {
  .profile-overview { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .profile-side-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .portal-shell { grid-template-columns: 1fr; }
  .sidebar { padding: 13px 16px; overflow: visible; box-shadow: 0 7px 28px rgba(7,21,47,.14); }
  .sidebar::after, .sidebar-caption, .sidebar-footer { display: none; }
  .sidebar-logo { width: 148px; margin-bottom: 10px; }
  .sidebar-logo img { width: 116px; }
  .sidebar nav { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
  .sidebar .nav-heading { display: none; }
  .nav-link { flex: 0 0 auto; min-height: 40px; padding: 8px 10px; }
  .portal-main { padding: 24px 16px 46px; }
  .account-status-strip { grid-template-columns: 1fr; }
  .account-status-strip > a { justify-self: start; }
}

@media (max-width: 680px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .user-chip, .verified-chip { width: 100%; }
  .profile-facts, .profile-form, .profile-side-stack { grid-template-columns: 1fr; }
  .profile-overview, .settings-card { padding: 18px; border-radius: 15px; }
  .profile-identity { align-items: flex-start; }
  .profile-avatar { width: 54px; height: 54px; flex-basis: 54px; border-radius: 15px; }
  .profile-form-actions { align-items: stretch; flex-direction: column; }
  .profile-form-actions .button { width: 100%; }
  .product-card { padding: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
