:root {
  color-scheme: light;
  --navy: #082a56;
  --navy-2: #0b356e;
  --sidebar-start: #082a56;
  --sidebar-end: #0b356e;
  --blue: #2563eb;
  --blue-2: #1d4ed8;
  --blue-soft: #eaf1ff;
  --green: #15966b;
  --green-soft: #e9f8f1;
  --amber: #c97808;
  --amber-soft: #fff5df;
  --red: #d94655;
  --ink: #12213b;
  --muted: #66758e;
  --line: #dce5f1;
  --surface: #ffffff;
  --canvas: #f3f7fc;
  --shadow: 0 12px 34px rgba(31, 62, 104, .08);
  --radius: 18px;
  font-family: "Roboto", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
  font-family: "Roboto", Arial, sans-serif;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .24);
  outline-offset: 2px;
}
svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-page.is-loading .workspace { visibility: hidden; }
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--muted);
  background: var(--canvas);
  font-size: 13px;
}
.dashboard-page:not(.is-loading) .loading-screen { display: none; }
.loading-screen.auth-recovery { padding: 24px; text-align: center; }
.auth-recovery h2 { margin: 0; color: var(--ink, #18345a); font-size: 24px; }
.auth-recovery p { max-width: 480px; margin: 0; line-height: 1.7; }
.auth-recovery button { min-height: 44px; padding: 11px 24px; border: 0; border-radius: 10px; background: var(--blue, #2563eb); color: white; font: inherit; font-weight: 700; cursor: pointer; }
.auth-recovery button:focus-visible { outline: 3px solid #96b9ff; outline-offset: 3px; }
.loader-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  background: transparent;
  box-shadow: none;
  animation: loaderPulse 1.2s ease-in-out infinite;
}
.loader-mark img {
  width: 100%;
  height: 100%;
  padding: 0;
  object-fit: contain;
}
@keyframes loaderPulse {
  50% { transform: translateY(-4px); }
}

.workspace { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: 252px;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  color: #fff;
  background:
    radial-gradient(circle at 22% 8%, rgba(65, 142, 255, .28), transparent 28%),
    linear-gradient(180deg, var(--sidebar-start) 0%, var(--sidebar-end) 100%);
  box-shadow: 12px 0 36px rgba(12, 42, 78, .08);
  transition: transform .22s ease;
}
.brand {
  display: block;
  padding: 0 8px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  color: #fff;
  text-decoration: none;
}
.brand-mark {
  width: 100%;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  color: var(--navy);
}
.brand-mark svg {
  width: 44px;
  height: 44px;
  padding: 8px;
  border-radius: 13px;
  background: linear-gradient(135deg, #fff, #d7e8ff);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .17);
  stroke-width: 1.9;
}
.brand-mark img {
  width: 100%;
  height: 100%;
  padding: 0;
  object-fit: contain;
  object-position: left center;
}

.nav-label {
  margin: 24px 12px 8px;
  color: #91afd6;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
}
.side-nav { display: grid; gap: 5px; }
.side-nav a {
  min-height: 44px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-radius: 11px;
  color: #d7e8ff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
  transition: background .16s ease, color .16s ease;
}
.side-nav a:hover { background: rgba(255, 255, 255, .08); }
.side-nav a.is-active {
  color: #fff;
  background: linear-gradient(90deg, var(--blue-2), var(--blue));
  box-shadow: 0 8px 18px rgba(5, 26, 55, .2);
}
.nav-icon {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 7px;
}
.nav-icon svg { width: 14px; height: 14px; stroke-width: 1.9; }
.nav-meta {
  margin-left: auto;
  min-width: 23px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, .13);
  text-align: center;
  font-size: 9px;
}
.sidebar-footer {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 14px;
  background: rgba(255, 255, 255, .06);
}
.sidebar-footer strong { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.sidebar-footer small { display: block; margin-top: 6px; color: #a9c6ec; font-size: 10px; line-height: 1.5; }
.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #54e2a4;
  box-shadow: 0 0 0 5px rgba(84, 226, 164, .14);
}

.main-column { margin-left: 252px; min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 76px;
  padding: 0 30px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid rgba(220, 229, 241, .92);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(16px);
}
.menu-button {
  display: none;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
}
.menu-button svg { width: 19px; height: 19px; stroke-width: 2; }
.search {
  position: relative;
  flex: 1;
  max-width: 490px;
}
.search svg {
  position: absolute;
  left: 14px;
  top: 12px;
  width: 18px;
  height: 18px;
  color: #7888a0;
  stroke-width: 2;
}
.search input {
  width: 100%;
  height: 44px;
  padding: 0 48px 0 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: #f8fafe;
}
.search input::placeholder { color: #8c9bb0; }
.search-kbd {
  position: absolute;
  right: 10px;
  top: 10px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: #fff;
  font-size: 9px;
}
.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.icon-button {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
}
.icon-button svg { width: 19px; height: 19px; stroke-width: 1.9; }
.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 5px;
}
.avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--navy), #3475d4);
  font-size: 12px;
  font-weight: 800;
}
.user-copy { min-width: 120px; }
.user-copy strong, .user-copy small { display: block; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-copy strong { font-size: 12px; }
.user-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.logout-button {
  padding: 8px 10px;
  border: 0;
  color: var(--blue);
  background: transparent;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.dashboard-main {
  width: min(1540px, 100%);
  margin: 0 auto;
  padding: 30px 30px 64px;
}
.hero {
  position: relative;
  overflow: hidden;
  padding: 29px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-radius: 22px;
  color: #fff;
  background:
    radial-gradient(circle at 80% 10%, rgba(68, 153, 255, .45), transparent 25%),
    linear-gradient(112deg, var(--navy) 0%, var(--navy-2) 65%, var(--blue) 120%);
  box-shadow: var(--shadow);
}
.hero::after {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  right: -80px;
  bottom: -140px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 50%;
  box-shadow: 0 0 0 34px rgba(255, 255, 255, .04), 0 0 0 68px rgba(255, 255, 255, .025);
}
.hero > * { position: relative; z-index: 1; }
.eyebrow {
  margin: 0 0 8px;
  color: #9fc8ff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
}
.hero h1 { margin: 0; font-size: clamp(25px, 3vw, 38px); letter-spacing: -.04em; }
.hero p { max-width: 680px; margin: 10px 0 0; color: #d8e8fb; font-size: 13px; line-height: 1.65; }
.system-status {
  min-width: 225px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 15px;
  background: rgba(255, 255, 255, .1);
  backdrop-filter: blur(8px);
}
.status-line { display: flex; align-items: center; gap: 9px; font-size: 11px; font-weight: 750; }
.system-status small { display: block; margin-top: 8px; color: #c2daf7; font-size: 10px; line-height: 1.55; }

.status-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
}
.status-card {
  min-height: 135px;
  padding: 18px 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 5px 18px rgba(38, 65, 105, .04);
}
.status-card__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.status-card__label { color: var(--muted); font-size: 11px; font-weight: 700; }
.status-icon {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--blue);
  background: var(--blue-soft);
}
.status-icon svg { width: 18px; height: 18px; stroke-width: 1.9; }
.status-value { margin-top: 13px; font-size: 25px; font-weight: 800; letter-spacing: -.04em; }
.status-foot { margin-top: 7px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.status-foot strong { color: var(--green); }

.section-heading {
  margin: 30px 0 15px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}
.section-heading h2 { margin: 0; font-size: 19px; letter-spacing: -.025em; }
.section-heading p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.section-note { color: var(--muted); font-size: 10px; }

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}
.module-card {
  --module-color: var(--blue);
  --module-soft: var(--blue-soft);
  min-height: 192px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 5px 18px rgba(38, 65, 105, .04);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.module-card:hover {
  transform: translateY(-3px);
  border-color: #bbcff0;
  box-shadow: var(--shadow);
}
.module-card.is-locked { opacity: .76; }
.module-card.is-locked:hover { transform: none; box-shadow: 0 5px 18px rgba(38, 65, 105, .04); }
.module-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.module-icon {
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--module-color);
  background: var(--module-soft);
}
.module-icon svg { width: 23px; height: 23px; stroke-width: 1.8; }
.module-badge {
  padding: 5px 8px;
  border-radius: 999px;
  color: #708097;
  background: #f0f3f7;
  font-size: 9px;
  font-weight: 800;
}
.module-badge.is-ready { color: var(--green); background: var(--green-soft); }
.module-badge.is-granted { color: var(--amber); background: var(--amber-soft); }
.module-card h3 { margin: 14px 0 5px; font-size: 15px; }
.module-card p { min-height: 34px; margin: 0; color: var(--muted); font-size: 10.5px; line-height: 1.55; }
.module-card__footer {
  margin-top: 15px;
  padding-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid #edf1f6;
}
.module-domain { overflow: hidden; color: var(--muted); font-size: 9px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.module-link {
  padding: 8px 11px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: var(--module-color);
  text-decoration: none;
  font-size: 10px;
  font-weight: 800;
}
.module-link[aria-disabled="true"] {
  color: #7c8798;
  background: #edf1f5;
  cursor: not-allowed;
}
.empty-search {
  grid-column: 1 / -1;
  padding: 38px;
  border: 1px dashed #cbd7e6;
  border-radius: 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, .55);
  text-align: center;
  font-size: 12px;
}

.foundation {
  margin-top: 16px;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 1.2fr repeat(3, minmax(150px, .6fr));
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.foundation-copy h3 { margin: 0; font-size: 13px; }
.foundation-copy p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.foundation-item {
  padding: 12px 14px;
  border-left: 1px solid var(--line);
}
.foundation-item strong { display: block; font-size: 11px; }
.foundation-item span { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; }
.foundation-item .ok { color: var(--green); }

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  max-width: 360px;
  padding: 14px 16px;
  border: 1px solid #c9d9ee;
  border-radius: 14px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 18px 50px rgba(20, 44, 80, .2);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: .2s ease;
  font-size: 11px;
  line-height: 1.5;
}
.toast.is-visible { opacity: 1; transform: translateY(0); }
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(8, 31, 62, .45);
}

@media (max-width: 1120px) {
  .status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foundation { grid-template-columns: 1fr 1fr; }
  .foundation-item:nth-child(2) { border-left: 0; }
}
@media (max-width: 820px) {
  .sidebar { transform: translateX(-100%); }
  body.menu-open .sidebar { transform: translateX(0); }
  body.menu-open .overlay { display: block; }
  .main-column { margin-left: 0; }
  .menu-button { display: grid; }
  .topbar { padding: 0 16px; }
  .search { display: none; }
  .user-copy { display: none; }
  .dashboard-main { padding: 20px 16px 48px; }
  .hero { align-items: flex-start; flex-direction: column; }
  .system-status { width: 100%; }
}
@media (max-width: 600px) {
  .status-grid, .module-grid, .foundation { grid-template-columns: 1fr; }
  .hero { padding: 23px 20px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .foundation-item { border-left: 0; border-top: 1px solid var(--line); }
  .toast { left: 16px; right: 16px; bottom: 16px; }
  .logout-button { padding-right: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}


/* Full command-center layout */
.store-switcher {
  height: 43px;
  min-width: 196px;
  padding: 0 36px 0 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  background: #f8fafe;
  font-size: 11px;
  font-weight: 700;
}
.store-switcher:disabled { opacity: 1; cursor: not-allowed; }
.notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 2px #fff;
}
.icon-button { position: relative; }
.nav-meta.is-empty { background: rgba(255,255,255,.09); color: #a9c6ec; }
.lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr);
  gap: 16px;
}
.panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 5px 18px rgba(38,65,105,.04);
}
.panel-head {
  min-height: 58px;
  padding: 16px 19px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}
.panel-head h3 { margin: 0; font-size: 13px; }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 9.5px; }
.text-button {
  border: 0;
  color: var(--blue);
  background: transparent;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}
.text-button:disabled { color: #98a5b7; cursor: not-allowed; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 13px 18px;
  border-bottom: 1px solid #edf1f6;
  text-align: left;
  white-space: nowrap;
}
th {
  color: var(--muted);
  background: #f8fafe;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}
td { font-size: 10.5px; }
tr:last-child td { border-bottom: 0; }
.empty-table td { padding: 0; }
.empty-state {
  min-height: 215px;
  padding: 34px 24px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: var(--muted);
  text-align: center;
}
.empty-state__icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: var(--blue);
  background: var(--blue-soft);
}
.empty-state__icon svg { width: 25px; height: 25px; stroke-width: 1.8; }
.empty-state strong { color: var(--ink); font-size: 12px; }
.empty-state span { max-width: 430px; font-size: 10px; line-height: 1.55; white-space: normal; }
.empty-state .module-link { margin-top: 3px; }
.activity-empty { min-height: 260px; }
.module-link.is-secondary {
  color: var(--blue);
  background: var(--blue-soft);
}
.module-link.is-disabled {
  color: #7c8798;
  background: #edf1f5;
  cursor: not-allowed;
}
.footer-note {
  margin-top: 22px;
  color: var(--muted);
  text-align: center;
  font-size: 9px;
}
@media (max-width: 1120px) {
  .lower-grid { grid-template-columns: 1fr; }
}
@media (max-width: 940px) {
  .store-switcher { min-width: 150px; max-width: 180px; }
}
@media (max-width: 700px) {
  .store-switcher { display: none; }
}
