:root {
  --atlas-blue: #0057ad;
  --atlas-navy: #081a33;
  --atlas-line: #d9e2ef;
  --atlas-bg: #f4f7fb;
  --atlas-muted: #5e6d84;
  --atlas-green: #16803a;
  --atlas-orange: #b75c00;
  --atlas-red: #b42318;
  --atlas-gray: #526071;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  color: var(--atlas-navy);
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--atlas-bg);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.login-shell {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: 1fr 440px;
  gap: 56px;
  align-items: center;
}

.login-hero,
.login-card,
.dashboard-hero,
.card-panel,
.hero-status,
.project-header {
  background: #fff;
  border: 1px solid var(--atlas-line);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(8, 26, 51, 0.06);
}

.login-hero {
  padding: 48px;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 24px;
}

.hero-brand img,
.login-logo,
.topbar-brand img {
  height: 56px;
  width: auto;
}

.hero-brand span {
  width: 1px;
  height: 52px;
  background: var(--atlas-line);
}

.hero-brand p,
.hero-copy p,
.login-card p,
.dashboard-hero p,
.section-title-row p,
.project-header p {
  color: var(--atlas-muted);
  line-height: 1.55;
}

.hero-copy h1 {
  margin: 48px 0 12px;
  font-size: 32px;
}

.login-card {
  padding: 42px;
  text-align: center;
}

.login-card form {
  margin-top: 28px;
  display: grid;
  gap: 16px;
  text-align: left;
}

.login-card label {
  display: grid;
  gap: 8px;
  font-weight: 650;
  color: #44546a;
}

.field-shell {
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: center;
  border: 1px solid #c9d5e5;
  border-radius: 6px;
  background: #fff;
}

.field-shell input {
  border: 0;
  outline: 0;
  padding: 14px 14px 14px 0;
}

.field-icon.mail::before {
  content: "@";
  display: grid;
  place-items: center;
  color: #536274;
}

.field-icon.lock::before {
  content: "#";
  display: grid;
  place-items: center;
  color: #536274;
}

.app-view {
  min-height: 100vh;
}

.topbar {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid var(--atlas-line);
}

.topbar-brand,
.topbar-actions,
.side-nav a,
.db-status,
.breadcrumbs,
.section-title-row,
.tab-bar,
.project-picker {
  display: flex;
  align-items: center;
}

.topbar-brand {
  gap: 20px;
}

.topbar-brand span {
  width: 1px;
  height: 36px;
  background: var(--atlas-line);
}

.topbar-brand button {
  border: 0;
  background: transparent;
  font-weight: 750;
  color: var(--atlas-navy);
}

.topbar-actions {
  gap: 12px;
}

.session-pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: #edf5ff;
  color: var(--atlas-blue);
  font-weight: 700;
}

.dashboard-shell {
  display: grid;
  grid-template-columns: 196px 1fr;
  min-height: calc(100vh - 70px);
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 18px;
  background: #fff;
  border-right: 1px solid var(--atlas-line);
}

.side-nav nav {
  display: grid;
  gap: 8px;
}

.side-nav a {
  gap: 12px;
  min-height: 42px;
  padding: 10px 8px;
  text-decoration: none;
  color: #26354a;
  border-radius: 6px;
  font-weight: 650;
}

.side-nav a.active,
.side-nav a:hover {
  color: var(--atlas-blue);
  background: #eef5ff;
}

.nav-icon {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 6px;
  font-size: 10px;
}

.nav-icon.chart::before {
  content: "K";
  font-weight: 800;
}

.nav-icon.database::before {
  content: "DB";
  font-size: 9px;
}

.db-status {
  margin-top: auto;
  gap: 12px;
  padding: 14px 8px;
  border-top: 1px solid var(--atlas-line);
}

.db-status small,
.version-note {
  color: var(--atlas-muted);
}

.content-area {
  min-width: 0;
  padding: 24px;
}

.breadcrumbs {
  gap: 8px;
  color: var(--atlas-muted);
  font-size: 14px;
  margin-bottom: 18px;
}

.dashboard-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 24px;
  border-left: 5px solid var(--atlas-blue);
}

.dashboard-hero h1 {
  margin: 0 0 8px;
  font-size: 30px;
}

.dashboard-hero p {
  margin: 0;
}

.hero-status {
  min-width: 220px;
  padding: 16px;
}

.hero-status small {
  display: block;
  color: var(--atlas-muted);
}

.hero-status strong {
  display: block;
  margin-top: 6px;
}

.tab-bar {
  gap: 10px;
  margin: 20px 0;
}

.tab-bar button {
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid #c9d5e5;
  border-radius: 999px;
  background: #fff;
  color: #26354a;
  font-weight: 750;
}

.tab-bar button.active {
  color: #fff;
  background: var(--atlas-blue);
  border-color: var(--atlas-blue);
}

.dashboard-panel {
  display: grid;
  gap: 18px;
}

.section-title-row {
  justify-content: space-between;
  gap: 16px;
}

.section-title-row h2,
.card-panel h3 {
  margin: 0 0 6px;
}

.section-title-row p {
  margin: 0;
}

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

.metric-card {
  min-height: 106px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--atlas-line);
  border-radius: 8px;
}

.metric-card small {
  display: block;
  color: var(--atlas-muted);
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
  overflow-wrap: anywhere;
}

.metric-card span {
  display: block;
  margin-top: 8px;
  color: #526071;
  font-size: 13px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.card-panel {
  min-width: 0;
  padding: 18px;
}

.bar-list,
.stack-list,
.alert-list,
.action-list {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  gap: 7px;
}

.bar-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #344054;
  font-weight: 700;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f7;
}

.bar-fill {
  height: 100%;
  width: var(--bar-width, 0%);
  background: var(--atlas-blue);
}

.stack-item,
.alert-item,
.action-item,
.project-header {
  padding: 13px;
  border: 1px solid var(--atlas-line);
  border-radius: 8px;
  background: #fff;
}

.stack-item strong,
.alert-item strong,
.action-item strong {
  display: block;
  margin-bottom: 4px;
}

.stack-item small,
.alert-item small {
  color: var(--atlas-muted);
}

.alert-item.critica,
.alert-item.urgente {
  border-color: #f2b8b5;
  background: #fff6f5;
}

.alert-item.advertencia {
  border-color: #ffd8a8;
  background: #fff9ef;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #edf2f7;
  color: #475467;
  font-weight: 750;
  font-size: 12px;
}

.chip.ok {
  color: var(--atlas-green);
  background: #e8f7ee;
}

.chip.warning {
  color: var(--atlas-orange);
  background: #fff3df;
}

.chip.danger {
  color: var(--atlas-red);
  background: #fdeceb;
}

.project-picker {
  gap: 10px;
}

.project-picker select {
  min-width: 260px;
  max-width: 360px;
}

.project-picker select,
.primary-action,
.ghost-button,
.icon-button {
  min-height: 40px;
  border-radius: 6px;
  padding: 9px 14px;
  font-weight: 750;
}

.project-picker select {
  border: 1px solid #c9d5e5;
  background: #fff;
}

.project-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.project-header h3 {
  margin: 0;
  font-size: 24px;
}

.project-header p {
  margin: 6px 0 0;
}

.primary-action {
  border: 1px solid var(--atlas-blue);
  background: var(--atlas-blue);
  color: #fff;
}

.ghost-button,
.icon-button {
  border: 1px solid #c9d5e5;
  background: #fff;
  color: #203149;
}

.form-message {
  min-height: 24px;
  color: var(--atlas-red);
}

.empty-state {
  margin: 0;
  padding: 18px;
  border: 1px dashed #c9d5e5;
  border-radius: 8px;
  color: var(--atlas-muted);
  background: #fbfdff;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: 360px;
  padding: 14px 18px;
  border-radius: 8px;
  background: #0b1f3a;
  color: #fff;
  box-shadow: 0 16px 40px rgba(8, 26, 51, 0.25);
}

[hidden] {
  display: none !important;
}

@media (max-width: 1100px) {
  .login-shell,
  .dashboard-shell,
  .dashboard-grid,
  .project-header {
    grid-template-columns: 1fr;
  }

  .side-nav {
    border-right: 0;
    border-bottom: 1px solid var(--atlas-line);
  }

  .side-nav nav,
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-title-row,
  .dashboard-hero,
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    height: auto;
  }
}

@media (max-width: 640px) {
  .login-view,
  .content-area {
    padding: 16px;
  }

  .login-hero,
  .login-card,
  .card-panel {
    padding: 20px;
  }

  .side-nav nav,
  .metric-grid,
  .project-picker {
    grid-template-columns: 1fr;
    display: grid;
  }

  .project-picker select {
    min-width: 0;
    max-width: 100%;
  }
}
