: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;
  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 {
  background: #fff;
  border: 1px solid var(--atlas-line);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(8, 26, 51, 0.08);
}

.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,
.section-title-row p,
.notifications-hero 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::before {
  display: grid;
  place-items: center;
  color: #536274;
}

.field-icon.mail::before {
  content: "@";
}

.field-icon.lock::before {
  content: "#";
}

.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,
.action-bar {
  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;
}

.notifications-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: 11px;
}

.nav-icon.bell::before {
  content: "!";
  font-weight: 800;
}

.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 {
  padding: 24px;
  min-width: 0;
}

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

.notifications-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--atlas-line);
  border-left: 5px solid var(--atlas-blue);
  border-radius: 8px;
}

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

.notifications-hero p {
  margin: 0;
}

.hero-status,
.detail-summary,
.action-panel {
  padding: 16px;
  border: 1px solid var(--atlas-line);
  border-radius: 8px;
  background: #fff;
}

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

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

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

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

.metric-strip div {
  min-height: 92px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--atlas-line);
  border-radius: 8px;
}

.metric-strip small {
  color: var(--atlas-muted);
}

.metric-strip strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.notifications-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
}

.inbox-panel,
.detail-panel {
  min-width: 0;
}

.inbox-panel {
  padding: 20px;
  background: #fff;
  border: 1px solid var(--atlas-line);
  border-radius: 8px;
}

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

.section-title-row h2 {
  margin: 0 0 6px;
}

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

.filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr)) minmax(180px, 1.2fr) auto;
  gap: 10px;
  margin: 18px 0;
}

.filter-grid input,
.filter-grid select,
.postpone-field input {
  min-width: 0;
  border: 1px solid #c9d5e5;
  border-radius: 6px;
  padding: 11px 12px;
  background: #fff;
}

.notification-list {
  display: grid;
  gap: 10px;
}

.notification-card {
  width: 100%;
  text-align: left;
  padding: 14px;
  border: 1px solid var(--atlas-line);
  border-radius: 8px;
  background: #fff;
}

.notification-card.active {
  border-color: var(--atlas-blue);
  box-shadow: inset 4px 0 0 var(--atlas-blue);
}

.notification-card h3 {
  margin: 8px 0;
  font-size: 17px;
}

.notification-card p,
.notification-detail p {
  color: #42526a;
  line-height: 1.5;
}

.card-row,
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.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;
}

.level-informativa,
.state-leida {
  background: #eaf4ff;
  color: var(--atlas-blue);
}

.level-operativa,
.state-cerrada {
  background: #e9f8ef;
  color: var(--atlas-green);
}

.level-advertencia,
.state-pospuesta {
  background: #fff3df;
  color: var(--atlas-orange);
}

.level-critica,
.state-pendiente {
  background: #fdeceb;
  color: var(--atlas-red);
}

.level-auditoria,
.state-archivada {
  background: #eef1f4;
  color: var(--atlas-gray);
}

.detail-panel {
  display: grid;
  align-content: start;
  gap: 14px;
}

.action-panel h2 {
  margin: 0 0 12px;
}

.action-bar {
  flex-wrap: wrap;
  gap: 8px;
}

.postpone-field {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  color: #44546a;
  font-weight: 650;
}

.notification-detail {
  padding: 18px;
  background: #fff;
  border: 1px solid var(--atlas-line);
  border-radius: 8px;
  overflow-wrap: anywhere;
}

.notification-detail pre {
  padding: 12px;
  overflow: auto;
  border-radius: 6px;
  background: #f7fafc;
  color: #253348;
}

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

.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;
}

.danger-button {
  border: 1px solid var(--atlas-red);
  background: #fff5f5;
  color: var(--atlas-red);
}

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

.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: 980px) {
  .login-shell,
  .notifications-shell,
  .notifications-workspace {
    grid-template-columns: 1fr;
  }

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

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

  .metric-strip,
  .filter-grid {
    grid-template-columns: 1fr 1fr;
  }

  .notifications-hero,
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    height: auto;
    gap: 12px;
    padding: 16px;
  }
}

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

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

  .metric-strip,
  .filter-grid,
  .side-nav nav {
    grid-template-columns: 1fr;
  }
}
