:root {
  --blue-950: #03245c;
  --blue-900: #06347f;
  --blue-800: #0b4bb3;
  --blue-700: #155bdc;
  --blue-600: #2563eb;
  --blue-100: #eaf2ff;
  --text-main: #08245c;
  --text-muted: #587098;
  --bg: #f4f8ff;
  --card: #ffffff;
  --border: #dce7f7;
  --green: #22c55e;
  --orange: #f97316;
  --red: #ef4444;
  --purple: #7c3aed;
  --cyan: #0ea5e9;
  --shadow: 0 14px 35px rgba(15, 48, 105, 0.10);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text-main);
}

.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, #042b70 0%, #021d52 100%);
  color: #fff;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand-card {
  background: #fff;
  color: var(--blue-950);
  border-radius: 16px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 86px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.35);
}

.logo-card img {
  width:150%;
  height: 150%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.side-title {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: #b9cff7;
  margin: 6px 0 8px;
  text-transform: uppercase;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  border: 0;
  width: 100%;
  text-align: left;
  color: #eaf2ff;
  background: transparent;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255,255,255,0.14);
}

.badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
}

.team-card {
  margin-top: auto;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 16px;
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 18px 26px 10px;
}

.topbar-row {
  display: grid;
  grid-template-columns: 280px 1fr auto;
  align-items: center;
  gap: 20px;
}

.app-title h1 {
  margin: 0;
  font-size: 24px;
  color: var(--blue-900);
  line-height: 1.1;
}

.app-title span {
  display: block;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 600;
}

.search {
  position: relative;
}

.search input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 44px 14px 18px;
  font-size: 14px;
  outline: none;
}

.search-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--blue-800);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 20px;
}

.user-box {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 800;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd8a8, #60a5fa);
}

.module-tabs {
  display: grid;
  grid-template-columns: repeat(9, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.tab {
  border: 0;
  background: transparent;
  color: var(--text-main);
  border-radius: 10px;
  padding: 12px 10px;
  cursor: pointer;
  font-weight: 800;
  text-align: center;
}

.tab.active {
  background: var(--blue-700);
  color: #fff;
  box-shadow: 0 10px 18px rgba(37,99,235,0.25);
}

.content {
  padding: 24px 26px 0;
}

.welcome-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.welcome h2 {
  margin: 0 0 6px;
  font-size: 24px;
  color: var(--blue-900);
}

.welcome p {
  margin: 0;
  color: var(--text-muted);
  font-weight: 600;
}

.filters {
  display: flex;
  gap: 12px;
}

.filter-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 18px;
  min-width: 190px;
  font-weight: 700;
  color: var(--text-main);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}

.metric-card,
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 18px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  min-height: 126px;
}

.metric-icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 24px;
  background: var(--blue-100);
}

.metric-card h3 {
  margin: 0;
  font-size: 14px;
  color: var(--text-main);
}

.metric-card strong {
  display: block;
  font-size: 30px;
  margin: 8px 0;
  color: var(--blue-900);
}

.metric-card small {
  color: var(--text-muted);
  font-weight: 700;
}

.sparkline {
  height: 28px;
  margin-top: 6px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(34,197,94,0.10), rgba(34,197,94,0.25));
  position: relative;
  overflow: hidden;
}

.sparkline::after {
  content: "";
  position: absolute;
  inset: 12px 8px 8px;
  border-top: 3px solid var(--green);
  transform: skewX(-25deg);
}

.grid-main {
  display: grid;
  grid-template-columns: 2fr 0.95fr;
  gap: 18px;
}

.left-grid {
  display: grid;
  gap: 18px;
}

.two-col {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 18px;
}

.panel {
  padding: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.panel h3 {
  margin: 0;
  font-size: 16px;
  color: var(--blue-900);
  text-transform: uppercase;
}

.link {
  color: var(--blue-700);
  font-weight: 800;
  font-size: 13px;
  text-decoration: none;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}

.quick-card {
  min-height: 116px;
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-weight: 800;
  text-align: center;
  background: #fff;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.quick-card:hover,
.quick-card:focus {
  border-color: var(--blue-600);
  box-shadow: 0 12px 26px rgba(21, 91, 220, 0.16);
  transform: translateY(-2px);
  outline: none;
}

.quick-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 23px;
  background: var(--blue-700);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th, td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--blue-900);
}

.status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
  background: #dcfce7;
  color: #15803d;
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: #e7eefb;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--green);
}

.donut-wrap {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 20px;
  align-items: center;
}

.donut {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: conic-gradient(var(--blue-600) 0 76%, #f59e0b 76% 92%, #ef4444 92% 100%);
  display: grid;
  place-items: center;
}

.donut-inner {
  width: 108px;
  height: 108px;
  background: #fff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
  font-weight: 900;
}

.legend {
  display: grid;
  gap: 12px;
  font-weight: 700;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  display: inline-block;
  margin-right: 8px;
}

.right-col {
  display: grid;
  gap: 18px;
  align-content: start;
}

.alert-list {
  display: grid;
  gap: 0;
}

.alert-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.alert-item strong {
  display: block;
  font-size: 13px;
}

.alert-item span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 3px;
}

.severity {
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
}

.critical {
  background: #fee2e2;
  color: #dc2626;
}

.major {
  background: #ffedd5;
  color: #ea580c;
}

.minor {
  background: #fef9c3;
  color: #ca8a04;
}

.ai-card {
  background: linear-gradient(180deg, #f8fbff, #eef5ff);
  border-radius: 14px;
  padding: 16px;
}

.ai-question {
  display: block;
  width: fit-content;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
  margin: 8px 0;
  color: var(--blue-800);
  font-weight: 800;
  font-size: 13px;
}

.ai-input {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.ai-input input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  outline: none;
}

.activity-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.activity-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
}

.module-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.module-side {
  display: grid;
  gap: 12px;
}

.action-button {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--blue-900);
  border-radius: 12px;
  padding: 13px 14px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.action-button:hover,
.action-button:focus {
  border-color: var(--blue-600);
  background: var(--blue-100);
  outline: none;
}

.empty-state,
.module-placeholder {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.panel-heading {
  display: grid;
  gap: 8px;
}

.panel-heading h2,
.empty-state h1 {
  margin: 0;
  color: var(--blue-900);
}

.panel-heading p,
.empty-state p,
.module-page p {
  margin: 0;
  color: var(--text-muted);
  font-weight: 600;
}

.eyebrow {
  color: var(--blue-700);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.module-placeholder {
  display: grid;
  gap: 8px;
  min-height: 180px;
  place-items: center;
  text-align: center;
}

.module-placeholder strong {
  color: var(--blue-900);
  font-size: 28px;
}

.toast-container {
  position: fixed;
  right: 18px;
  top: 18px;
  z-index: 50;
  display: grid;
  gap: 10px;
  max-width: 360px;
}

.toast-item,
.alert-banner {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 5px solid var(--blue-600);
  border-radius: 12px;
  box-shadow: var(--shadow);
  color: var(--text-main);
  padding: 12px 14px;
}

.toast-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: start;
}

.toast-label {
  color: var(--blue-700);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.toast-item p {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.toast-close,
.alert-banner-close {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 900;
}

.alert-banner {
  position: fixed;
  left: 270px;
  right: 26px;
  bottom: 22px;
  z-index: 40;
  display: flex;
  gap: 12px;
  align-items: center;
}

.footer {
  margin-top: 18px;
  background: linear-gradient(90deg, #042b70, #073b91);
  color: #fff;
  padding: 18px 30px;
  display: grid;
  grid-template-columns: 220px 1.35fr 1fr 1fr;
  gap: 22px;
  align-items: center;
  font-size: 13px;
}

.footer-logo {
  background: #fff;
  border-radius: 16px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 74px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.35);
}

.footer-logo img {
  width: 150%;
  height: 150%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.footer-section {
  min-height: 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid rgba(255,255,255,0.25);
  padding-left: 22px;
  line-height: 1.65;
}

.footer-info {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.footer-info strong {
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}

.footer-owner {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.footer-owner strong {
  font-weight: 800;
}

.gmp-inline {
  display: grid;
  grid-template-columns: 68px 1fr;
  align-items: center;
  gap: 16px;
  white-space: nowrap;
}

.gmp-box {
  border: 1px solid rgba(255,255,255,0.65);
  border-radius: 14px;
  padding: 12px 10px;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 900;
  min-height: 58px;
}

.gmp-lines {
  display: grid;
  gap: 4px;
  line-height: 1.4;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}

@media (max-width: 1200px) {
  .app { grid-template-columns: 82px 1fr; }
  .sidebar { padding: 12px; }
  .brand-card div:not(.brand-mark), .nav-item span, .side-title, .team-card { display: none; }
  .metrics { grid-template-columns: repeat(3, 1fr); }
  .grid-main { grid-template-columns: 1fr; }
  .module-page { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: repeat(3, 1fr); }
  .module-tabs { grid-template-columns: repeat(3, 1fr); }
  .footer { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar-row, .welcome-row, .two-col, .donut-wrap { grid-template-columns: 1fr; display: grid; }
  .metrics { grid-template-columns: 1fr; }
  .quick-grid, .activity-row { grid-template-columns: 1fr 1fr; }
  .footer { grid-template-columns: 1fr; }
}
