:root {
  color-scheme: light;
  --bg: #f4f7f7;
  --surface: #ffffff;
  --surface-soft: #f7faf9;
  --ink: #0f1e20;
  --muted: #6c7b7d;
  --line: #dfe8e6;
  --green: #079d80;
  --green-dark: #067761;
  --green-soft: #e2f6f0;
  --nav: #102d2c;
  --nav-muted: #8fa9a6;
  --shadow: 0 18px 60px rgba(22, 55, 51, 0.08);
  --radius: 20px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--bg);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.dashboard-page {
  min-height: 100vh;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.dashboard-page.is-loading .app-shell {
  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(--bg);
  font-size: 14px;
}

.dashboard-page:not(.is-loading) .loading-screen {
  display: none;
}

.loader-mark,
.brand-mark {
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #10b895, #05765f);
  box-shadow: 0 10px 24px rgba(5, 139, 111, 0.26);
  font-weight: 850;
}

.loader-mark {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  animation: loaderPulse 1.2s ease-in-out infinite;
}

@keyframes loaderPulse {
  50% { transform: translateY(-4px); box-shadow: 0 18px 32px rgba(5, 139, 111, 0.3); }
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: 248px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 27px 18px 22px;
  color: #fff;
  background:
    radial-gradient(circle at 20% 5%, rgba(19, 182, 147, 0.16), transparent 30%),
    linear-gradient(180deg, #123433 0%, #0b2626 100%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 0 9px;
  color: #fff;
  text-decoration: none;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  font-size: 17px;
  letter-spacing: 0;
}

.side-nav {
  margin-top: 44px;
}

.nav-label {
  margin: 27px 12px 10px;
  color: #76918e;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  margin: 4px 0;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--nav-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
  transition: 160ms ease;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-item.is-active {
  color: #fff;
  border-color: rgba(23, 214, 172, 0.14);
  background: rgba(19, 184, 148, 0.13);
}

.nav-item svg,
.icon-button svg,
.date-chip svg,
.module-link svg,
.module-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-footer {
  padding: 16px 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #63817d;
  font-size: 11px;
}

.sidebar-footer p {
  margin: 9px 0 0;
}

.system-online {
  color: #a9c0bd;
  font-weight: 650;
}

.system-online span {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: #27d39d;
  box-shadow: 0 0 0 4px rgba(39, 211, 157, 0.09);
}

.main-column {
  grid-column: 2;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  border-bottom: 1px solid rgba(209, 222, 219, 0.8);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
}

.topbar-title strong {
  color: var(--ink);
}

.topbar-title span::after {
  content: "/";
  margin-left: 9px;
  color: #bcc8c6;
}

.topbar-actions,
.user-menu {
  display: flex;
  align-items: center;
}

.topbar-actions {
  gap: 16px;
}

.icon-button {
  position: relative;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: #607270;
  background: #fff;
  cursor: pointer;
}

.notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  border: 1.5px solid #fff;
  border-radius: 50%;
  background: #ef6d53;
}

.menu-button {
  display: none;
}

.user-menu {
  gap: 10px;
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.avatar {
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(145deg, #20b998, #087c65);
  font-size: 11px;
  font-weight: 800;
}

.user-copy {
  display: grid;
  min-width: 120px;
}

.user-copy strong {
  max-width: 190px;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-copy small {
  max-width: 190px;
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-button {
  padding: 8px 10px;
  border: 0;
  color: var(--green-dark);
  background: transparent;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}

.dashboard-main {
  width: min(1380px, 100%);
  margin: 0 auto;
  padding: 42px 36px 64px;
}

.welcome-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--green);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.14em;
}

.welcome-row h1 {
  margin: 0;
  color: #102627;
  font-size: clamp(27px, 3vw, 38px);
  line-height: 1.14;
  letter-spacing: -0.04em;
}

.welcome-row h1 span {
  color: var(--green-dark);
}

.welcome-row p:not(.eyebrow) {
  max-width: 670px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.date-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: #5d6f6d;
  background: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 650;
}

.date-chip svg {
  width: 16px;
  height: 16px;
  color: var(--green);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 34px;
}

.status-card {
  position: relative;
  min-height: 142px;
  overflow: hidden;
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 28px rgba(30, 66, 62, 0.035);
}

.status-card--primary {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(145deg, #0d9d80, #087561);
  box-shadow: 0 15px 36px rgba(6, 132, 105, 0.2);
}

.status-card--primary::after {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  right: -54px;
  bottom: -75px;
  border: 24px solid rgba(255, 255, 255, 0.07);
  border-radius: 50%;
}

.status-card > div {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 15px;
}

.status-card > div span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.status-card strong {
  font-size: 29px;
  line-height: 1;
  letter-spacing: -0.05em;
}

.status-card small {
  display: block;
  margin-top: 13px;
  color: #83908f;
  font-size: 10px;
}

.status-card--primary > div span,
.status-card--primary small {
  color: rgba(255, 255, 255, 0.72);
}

.status-card--primary > svg {
  position: absolute;
  right: 19px;
  bottom: 16px;
  width: 23px;
  height: 23px;
  opacity: 0.72;
}

.mini-status {
  position: absolute;
  left: 21px;
  bottom: 17px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #55736e;
  font-size: 10px;
  font-weight: 700;
}

.mini-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #16b889;
}

.mini-status--waiting {
  color: #a06a33;
}

.applications-section {
  margin-top: 42px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -0.025em;
}

.section-note {
  color: #82918f;
  font-size: 11px;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.module-card {
  position: relative;
  min-height: 224px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.module-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--module-color) 35%, var(--line));
  box-shadow: 0 22px 52px rgba(22, 55, 51, 0.11);
}

.module-card::after {
  content: "";
  position: absolute;
  top: -55px;
  right: -45px;
  width: 145px;
  height: 145px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--module-color) 7%, transparent);
}

.module-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
}

.module-icon {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: var(--module-color);
  background: color-mix(in srgb, var(--module-color) 10%, #fff);
}

.module-icon svg {
  width: 21px;
  height: 21px;
}

.module-badge {
  padding: 6px 9px;
  border: 1px solid #e6edeb;
  border-radius: 999px;
  color: #788683;
  background: #f7f9f9;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.module-badge--granted {
  border-color: #cdeae2;
  color: #08745f;
  background: #eaf8f4;
}

.module-badge--ready {
  border-color: #bde7d9;
  color: #05614f;
  background: #ddf7ef;
}

.module-badge--locked {
  border-color: #e8e8e8;
  color: #8c9694;
  background: #f6f7f7;
}

.module-card h3 {
  margin: 19px 0 7px;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.module-card p {
  min-height: 38px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.module-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #edf1f0;
}

.module-domain {
  overflow: hidden;
  color: #91a09e;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.module-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--module-color);
  text-decoration: none;
  font-size: 10px;
  font-weight: 800;
}

.module-link svg {
  width: 14px;
  height: 14px;
}

.module-card--highlight {
  border-color: rgba(116, 88, 211, 0.2);
  background: linear-gradient(150deg, #fff 50%, #f7f4ff 100%);
}

.module-card--locked {
  box-shadow: 0 12px 36px rgba(22, 55, 51, 0.05);
}

.module-card--locked:hover {
  transform: none;
  border-color: var(--line);
  box-shadow: 0 12px 36px rgba(22, 55, 51, 0.05);
}

.module-link[aria-disabled="true"] {
  color: #98a5a3;
  cursor: not-allowed;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  max-width: min(380px, calc(100vw - 32px));
  padding: 13px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  color: #fff;
  background: #122f2e;
  box-shadow: 0 18px 45px rgba(6, 31, 29, 0.24);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: 180ms ease;
  font-size: 12px;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1100px) {
  .status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .app-shell { display: block; }
  .main-column { min-width: 0; }
  .sidebar {
    transform: translateX(-100%);
    box-shadow: 25px 0 70px rgba(6, 29, 28, 0.24);
    transition: transform 190ms ease;
  }
  .sidebar.is-open { transform: translateX(0); }
  .menu-button { display: grid; }
  .topbar { padding: 0 18px; }
  .topbar-title { display: none; }
  .user-copy { display: none; }
  .user-menu { padding-left: 10px; }
  .dashboard-main { padding: 30px 18px 48px; }
}

@media (max-width: 620px) {
  .welcome-row { align-items: flex-start; flex-direction: column; }
  .date-chip { order: -1; }
  .status-grid,
  .module-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .section-note { display: none; }
  .topbar-actions { gap: 8px; }
  .text-button { padding-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

