:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --muted: #687385;
  --text: #111827;
  --line: #dfe4ea;
  --nav: #18233d;
  --nav-2: #10192c;
  --nav-text: #f8fafc;
  --red: #b4232f;
  --red-dark: #8f1c25;
  --green: #14804a;
  --bad: #b91c1c;
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  width: 276px;
  height: 100vh;
  overflow: hidden;
  background: linear-gradient(180deg, #263556 0%, var(--nav) 55%, var(--nav-2) 100%);
  color: var(--nav-text);
  border-right: 1px solid rgba(255, 255, 255, 0.09);
  transition: width 180ms ease;
}

.sidebar-stripe {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-logo {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 0 20px rgba(180, 35, 47, 0.25);
}

.brand-logo img {
  display: block;
  width: 31px;
  height: 31px;
  object-fit: contain;
}

.brand-copy {
  display: grid;
  min-width: 0;
  line-height: 1.05;
}

.brand-copy strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy small {
  margin-top: 4px;
  color: rgba(248, 250, 252, 0.56);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.nav-groups {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
}

.nav-group {
  margin: 7px 0 13px;
}

.nav-group h2 {
  margin: 0 0 7px;
  padding: 0 10px;
  color: rgba(248, 250, 252, 0.44);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.nav-group ul {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 37px;
  padding: 9px 10px;
  border-radius: 8px;
  color: rgba(248, 250, 252, 0.8);
  font-size: 13px;
  line-height: 1.25;
}

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

.nav-item.is-active {
  background: var(--red);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(180, 35, 47, 0.26);
}

.nav-item.is-active::before {
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 999px 999px 0;
  background: #fff;
  content: "";
}

.icon,
.module-icon,
.search-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  opacity: 0.88;
}

.icon-grid,
.icon-package,
.icon-building {
  border-radius: 4px;
}

.icon-truck,
.icon-fuel,
.icon-wallet,
.icon-invoice,
.icon-receipt {
  border-radius: 3px;
  border-top-width: 5px;
}

.icon-map,
.icon-calendar,
.icon-file,
.icon-kanban,
.icon-signature,
.icon-chart,
.icon-settings,
.icon-user-plus,
.icon-phone,
.icon-users,
.icon-wrench {
  border-radius: 999px;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(248, 250, 252, 0.6);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.sidebar-footer strong {
  margin-left: auto;
  color: rgba(248, 250, 252, 0.42);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--red);
  box-shadow: 0 0 12px rgba(180, 35, 47, 0.8);
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 57px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.icon-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #445066;
  cursor: pointer;
}

.icon-button:hover {
  background: #eef2f6;
}

.icon-button span {
  display: block;
  width: 16px;
  height: 2px;
  margin: 2px 0;
  border-radius: 999px;
  background: currentColor;
}

.bell::before,
.logout::before {
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 999px 999px 5px 5px;
  content: "";
}

.logout::before {
  border-radius: 3px;
}

.search {
  position: relative;
  display: flex;
  width: min(100%, 430px);
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 11px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  color: #738097;
}

.search input {
  width: 100%;
  height: 37px;
  padding: 0 12px 0 34px;
  border: 1px solid transparent;
  border-radius: 8px;
  outline: none;
  background: #eef2f6;
  color: var(--text);
  font-size: 14px;
}

.search input:focus {
  border-color: #b7c1d1;
  background: #fff;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.health-pill {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border-radius: 999px;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 800;
}

.health-pill.is-good {
  background: rgba(20, 128, 74, 0.1);
  color: var(--green);
}

.health-pill.is-bad {
  background: rgba(185, 28, 28, 0.1);
  color: var(--bad);
}

.user-email {
  color: var(--muted);
  font-size: 14px;
}

.content {
  width: 100%;
  padding: 26px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.12;
}

h2 {
  font-size: 19px;
}

.muted {
  max-width: 760px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.phase-card,
.kpi,
.module-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.phase-card {
  min-width: 250px;
  padding: 16px;
}

.phase-card span,
.kpi span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.phase-card strong {
  display: block;
  margin-top: 7px;
  font-size: 14px;
}

.kpi-grid,
.module-grid {
  display: grid;
  gap: 14px;
}

.kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.kpi {
  padding: 16px;
}

.kpi strong {
  display: block;
  margin-top: 9px;
  font-size: 27px;
  line-height: 1;
}

.kpi small,
.module-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.module-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 16px;
}

.module-card {
  display: grid;
  min-height: 136px;
  align-content: start;
  gap: 10px;
  padding: 16px;
  transition: transform 150ms ease, border-color 150ms ease;
}

.module-card:hover {
  border-color: rgba(180, 35, 47, 0.45);
  transform: translateY(-1px);
}

.module-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--red);
}

.module-card strong {
  font-size: 15px;
}

.panel {
  padding: 18px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}

.button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  border-radius: 7px;
  background: var(--red);
  color: #fff;
  padding: 0 13px;
  font-size: 13px;
  font-weight: 800;
}

.button:hover {
  background: var(--red-dark);
}

.checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-top: 16px;
  color: #344054;
  font-size: 14px;
}

.checklist div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.check {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 999px;
  background: rgba(20, 128, 74, 0.12);
}

.check::before {
  width: 8px;
  height: 4px;
  border-bottom: 2px solid var(--green);
  border-left: 2px solid var(--green);
  transform: rotate(-45deg);
  content: "";
}

.is-sidebar-collapsed .sidebar {
  width: 78px;
}

.is-sidebar-collapsed .brand-copy,
.is-sidebar-collapsed .nav-group h2,
.is-sidebar-collapsed .nav-item span:last-child,
.is-sidebar-collapsed .sidebar-footer span:not(.status-dot),
.is-sidebar-collapsed .sidebar-footer strong {
  display: none;
}

.is-sidebar-collapsed .brand {
  justify-content: center;
  padding-inline: 10px;
}

.is-sidebar-collapsed .nav-item {
  justify-content: center;
}

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

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

@media (max-width: 820px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
  }

  .nav-groups {
    display: none;
  }

  .sidebar-footer {
    display: none;
  }

  .topbar {
    gap: 8px;
    padding-inline: 12px;
  }

  .search {
    width: 100%;
  }

  .topbar-actions .user-email,
  .topbar-actions .bell {
    display: none;
  }

  .content {
    padding: 18px;
  }

  .page-header {
    display: grid;
  }

  .phase-card {
    min-width: 0;
  }

  .module-grid,
  .kpi-grid,
  .checklist {
    grid-template-columns: 1fr;
  }
}
