:root {
  --orange: #ff962d;
  --orange-deep: #de5c09;
  --orange-soft: #fff4e8;
  --charcoal: #202020;
  --charcoal-2: #2b2b2b;
  --gray: #797471;
  --muted: #65696d;
  --line: #dedbd7;
  --line-soft: #ece9e5;
  --surface: #ffffff;
  --canvas: #f7f6f3;
  --canvas-warm: #fcfaf7;
  --success: #23835d;
  --success-soft: #e9f6f0;
  --warning: #b96017;
  --warning-soft: #fff3e4;
  --danger: #b7423b;
  --danger-soft: #fcecea;
  --shadow-sm: 0 1px 2px rgba(32, 32, 32, 0.04), 0 8px 28px rgba(32, 32, 32, 0.045);
  --shadow-md: 0 16px 50px rgba(32, 32, 32, 0.10);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --sidebar-width: 248px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--charcoal);
  background: var(--canvas);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
  color: var(--charcoal);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(255, 150, 45, 0.5);
  outline-offset: 3px;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  transform: translateY(-160%);
  border-radius: 8px;
  background: var(--surface);
  color: var(--charcoal);
  font-weight: 700;
  box-shadow: var(--shadow-md);
}

.skip-link:focus {
  transform: translateY(0);
}

/* Login */
.login-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(360px, 1.05fr) minmax(420px, 0.95fr);
  background: var(--surface);
}

.login-art {
  position: relative;
  display: flex;
  min-height: 100vh;
  align-items: flex-end;
  overflow: hidden;
  padding: clamp(48px, 6vw, 96px);
  background:
    radial-gradient(circle at 72% 22%, rgba(255, 150, 45, 0.42), transparent 30%),
    radial-gradient(circle at 18% 78%, rgba(255, 150, 45, 0.14), transparent 36%),
    linear-gradient(145deg, #121212 0%, #222222 56%, #111111 100%);
  color: #fff;
}

.login-art::before,
.login-art::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(255, 150, 45, 0.22);
  border-radius: 50%;
}

.login-art::before {
  width: 480px;
  height: 480px;
  top: -130px;
  right: -150px;
}

.login-art::after {
  width: 320px;
  height: 320px;
  top: -50px;
  right: -70px;
}

.login-art__mesh {
  position: absolute;
  inset: 0;
  opacity: 0.08;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.3) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom right, transparent 8%, #000 60%, transparent 100%);
}

.login-art__copy {
  position: relative;
  z-index: 1;
  max-width: 620px;
}

.login-art__copy h2 {
  max-width: 600px;
  margin: 20px 0 20px;
  font-size: clamp(44px, 5.2vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.login-art__copy > p {
  max-width: 560px;
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: clamp(17px, 1.6vw, 21px);
  line-height: 1.6;
}

.trust-list {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 38px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  font-weight: 650;
}

.trust-list span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.trust-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 4px rgba(255, 150, 45, 0.13);
}

.login-panel {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 48px;
  background: linear-gradient(160deg, #fff 0%, var(--canvas-warm) 100%);
}

.login-card {
  width: min(100%, 470px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 16px;
  isolation: isolate;
}

.brand-lockup--login {
  width: 100%;
  justify-content: center;
}

.brand-logo {
  display: block;
  position: relative;
  z-index: 1;
  width: 92px;
  height: 66px;
  object-fit: contain;
  object-position: center;
  border-radius: 10px;
  filter: drop-shadow(0 3px 6px rgba(32, 32, 32, 0.22));
}

.brand-lockup--login .brand-logo {
  width: min(324px, 78vw);
  height: auto;
  border-radius: 0;
  filter: drop-shadow(0 3px 8px rgba(32, 32, 32, 0.12));
}

.brand-product {
  margin: 0 0 5px;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.brand-subtitle {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
}

.login-copy {
  margin: 54px 0 30px;
}

.login-copy h1 {
  margin: 16px 0 12px;
  font-size: clamp(38px, 4vw, 52px);
  letter-spacing: -0.045em;
}

.login-copy p {
  max-width: 430px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.demo-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 7px 11px;
  border: 1px solid #f3c18f;
  border-radius: 999px;
  background: var(--orange-soft);
  color: #884215;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.demo-pill--compact {
  padding: 6px 9px;
  font-size: 9px;
}

.demo-account {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.demo-account__avatar,
.profile-avatar {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  background: var(--charcoal);
  color: var(--orange);
  font-size: 15px;
  font-weight: 900;
}

.demo-account span:nth-child(2) {
  display: grid;
  gap: 4px;
}

.demo-account strong {
  font-size: 14px;
}

.demo-account small {
  color: var(--muted);
  font-size: 12px;
}

.demo-account > svg {
  width: 20px;
  color: var(--gray);
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 13px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-button {
  width: 100%;
  padding: 0 20px;
  background: var(--orange);
  color: #1d1711;
  text-decoration: none;
  box-shadow: 0 10px 25px rgba(222, 92, 9, 0.2);
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
}

.primary-button:hover {
  background: #ff8c1a;
  box-shadow: 0 13px 30px rgba(222, 92, 9, 0.26);
}

.primary-button svg {
  width: 19px;
}

.login-note {
  margin: 20px auto 0;
  color: var(--gray);
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.login-error {
  margin-top: 16px;
  padding: 12px;
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
  font-weight: 650;
}

/* Application shell */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 50;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  overflow-y: auto;
  background: #171717;
  color: #fff;
  box-shadow: 10px 0 40px rgba(0, 0, 0, 0.06);
}

.sidebar::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: var(--orange);
  content: "";
}

.sidebar__brand {
  display: flex;
  min-height: 104px;
  align-items: center;
  gap: 12px;
  padding: 17px 18px 14px 14px;
  border-bottom: 2px solid var(--orange);
  background: var(--gray);
  isolation: isolate;
}

.brand-logo--sidebar {
  width: 82px;
  height: 62px;
  flex: 0 0 auto;
  border-radius: 0;
}

.sidebar__product {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.sidebar__product strong {
  color: #fff;
  font-size: 18px;
  line-height: 1.2;
}

.sidebar__product span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  line-height: 1.35;
}

.sidebar__nav {
  display: grid;
  gap: 6px;
  padding: 26px 14px;
}

.nav-item {
  display: grid;
  min-height: 48px;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: rgba(255, 255, 255, 0.64);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}

.nav-item svg {
  width: 20px;
}

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

.nav-item.is-active {
  background: var(--orange);
  color: #18130f;
  box-shadow: 0 8px 22px rgba(222, 92, 9, 0.18);
}

.sidebar__footer {
  display: grid;
  gap: 18px;
  margin-top: auto;
  padding: 16px 16px 22px;
}

.help-card {
  display: grid;
  gap: 8px;
  padding: 17px;
  border: 1px solid rgba(255, 150, 45, 0.28);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255, 150, 45, 0.1), rgba(255, 255, 255, 0.025));
}

.help-card__icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  background: var(--orange);
  color: #1b1510;
}

.help-card__icon svg {
  width: 17px;
}

.help-card strong {
  font-size: 12px;
}

.help-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: 10px;
  line-height: 1.5;
}

.sidebar__version {
  color: rgba(255, 255, 255, 0.3);
  font-size: 9px;
  text-align: center;
}

.workspace {
  display: flex;
  width: calc(100% - var(--sidebar-width));
  min-height: 100vh;
  flex-direction: column;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 clamp(24px, 4vw, 56px);
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
}

.topbar__context,
.topbar__actions {
  display: flex;
  align-items: center;
}

.topbar__context {
  gap: 12px;
  min-width: 0;
}

.topbar__tenant {
  overflow: hidden;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar__separator {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--orange);
}

.topbar__service {
  color: var(--muted);
  font-size: 12px;
}

.topbar__actions {
  gap: 11px;
}

.icon-button,
.mobile-menu,
.icon-link {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}

.icon-button {
  width: 40px;
  height: 40px;
  border-radius: 11px;
}

.icon-button:hover,
.icon-link:hover {
  border-color: #f0b374;
  background: var(--orange-soft);
}

.icon-button svg,
.mobile-menu svg {
  width: 18px;
}

.icon-button.is-spinning svg {
  animation: rotate 650ms linear infinite;
}

.profile-menu {
  position: relative;
}

.profile-button {
  display: grid;
  min-width: 176px;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 5px 8px 5px 5px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
}

.profile-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 12px;
}

.profile-copy {
  display: grid;
  gap: 2px;
}

.profile-copy strong {
  font-size: 11px;
}

.profile-copy small {
  color: var(--muted);
  font-size: 9px;
}

.profile-button > svg {
  width: 15px;
  color: var(--gray);
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 170px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  box-shadow: var(--shadow-md);
}

.profile-dropdown button {
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

.profile-dropdown button:hover {
  background: var(--orange-soft);
}

.mobile-menu {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 11px;
}

main {
  width: 100%;
  max-width: 1540px;
  flex: 1;
  margin: 0 auto;
  padding: 44px clamp(24px, 4vw, 56px) 56px;
}

.view-section {
  animation: fade-in 260ms ease both;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 30px;
}

.page-heading h1 {
  margin: 7px 0 8px;
  font-size: clamp(31px, 3vw, 43px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.page-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.eyebrow {
  color: var(--orange-deep);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.eyebrow--light {
  color: var(--orange);
}

.updated-chip {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.65);
}

.updated-chip > span:last-child {
  display: grid;
  gap: 2px;
}

.updated-chip strong {
  font-size: 10px;
}

.updated-chip small {
  color: var(--muted);
  font-size: 9px;
}

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border: 2px solid #ebe9e6;
  border-radius: 50%;
  background: #8d8985;
  box-shadow: 0 0 0 4px #ebe9e6;
}

.live-dot--healthy {
  border-color: var(--success-soft);
  background: var(--success);
  box-shadow: 0 0 0 4px var(--success-soft);
}

.live-dot--warning {
  border-color: var(--warning-soft);
  background: var(--warning);
  box-shadow: 0 0 0 4px var(--warning-soft);
}

.live-dot--danger {
  border-color: var(--danger-soft);
  background: var(--danger);
  box-shadow: 0 0 0 4px var(--danger-soft);
}

.live-dot--unknown {
  border-color: #ebe9e6;
  background: #8d8985;
  box-shadow: 0 0 0 4px #ebe9e6;
}

.hero-status {
  position: relative;
  display: grid;
  min-height: 174px;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  overflow: hidden;
  margin-bottom: 42px;
  padding: 34px 38px;
  border: 1px solid #3a3938;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 87% 30%, rgba(255, 150, 45, 0.18), transparent 28%),
    linear-gradient(135deg, #202020, #2b2927);
  color: #fff;
  box-shadow: 0 18px 50px rgba(32, 32, 32, 0.14);
}

.hero-status::after {
  position: absolute;
  width: 230px;
  height: 230px;
  top: -120px;
  right: -60px;
  border: 1px solid rgba(255, 150, 45, 0.25);
  border-radius: 50%;
  content: "";
}

.hero-status__signal {
  display: grid;
  width: 58px;
  padding: 8px;
  gap: 6px;
  justify-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 22px;
  background: rgba(0, 0, 0, 0.2);
}

.signal-light {
  display: block;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}

.hero-status--operativo .signal-light--green,
.hero-status--degradado .signal-light--amber,
.hero-status--incidente .signal-light--red,
.hero-status--sin-datos .signal-light--red {
  animation: signal-pulse 1.3s ease-in-out infinite;
}

.hero-status--operativo .signal-light--green { background: #63e1ae; box-shadow: 0 0 0 5px rgba(99, 225, 174, 0.16), 0 0 22px #63e1ae; }
.hero-status--degradado .signal-light--amber { background: #ffc88e; box-shadow: 0 0 0 5px rgba(255, 200, 142, 0.16), 0 0 22px #ffc88e; }
.hero-status--incidente .signal-light--red,
.hero-status--sin-datos .signal-light--red { background: #ff8178; box-shadow: 0 0 0 5px rgba(255, 129, 120, 0.16), 0 0 22px #ff8178; }

@keyframes signal-pulse {
  50% { opacity: 0.48; transform: scale(0.78); }
}

.status-label {
  color: var(--orange);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.hero-status__copy h2 {
  margin: 7px 0 7px;
  font-size: clamp(23px, 2.4vw, 34px);
  letter-spacing: -0.035em;
}

.hero-status__copy p {
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
}

.hero-status__meta {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: end;
  gap: 10px;
}

.hero-status__meta small {
  color: rgba(255, 255, 255, 0.45);
  font-size: 9px;
}

.status-badge,
.mini-status,
.metric-trend,
.readonly-label {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  font-weight: 800;
}

.status-badge {
  padding: 9px 13px;
  font-size: 10px;
}

.status-badge i,
.mini-status i {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-badge--healthy {
  border: 1px solid rgba(72, 196, 145, 0.28);
  background: var(--success-soft);
  color: #176a4a;
}

.status-badge--warning {
  border: 1px solid #efc79e;
  background: var(--warning-soft);
  color: #8a4614;
}

.status-badge--danger {
  border: 1px solid #edb9b5;
  background: var(--danger-soft);
  color: #92362f;
}

.status-badge--unknown {
  border: 1px solid var(--line);
  background: #f2f1ef;
  color: #625f5c;
}

.hero-status .status-badge--healthy {
  background: rgba(57, 166, 118, 0.14);
  color: #7ce0b4;
}

.hero-status .status-badge--warning {
  border-color: rgba(255, 191, 112, 0.3);
  background: rgba(185, 96, 23, 0.18);
  color: #ffc88e;
}

.hero-status .status-badge--danger {
  border-color: rgba(255, 142, 134, 0.3);
  background: rgba(183, 66, 59, 0.18);
  color: #ffaaa3;
}

.hero-status .status-badge--unknown {
  border-color: rgba(255, 255, 255, 0.17);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.72);
}

.section-title,
.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.section-title {
  margin-bottom: 17px;
}

.section-title h2,
.panel__header h2 {
  margin: 5px 0 0;
  font-size: 18px;
  letter-spacing: -0.025em;
}

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

.text-button:hover {
  color: var(--orange-deep);
}

.metric-grid {
  display: grid;
  gap: 16px;
}

.metric-grid--overview {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

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

.metric-card {
  min-height: 180px;
  padding: 20px;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: #e5cfb8;
  box-shadow: 0 12px 32px rgba(32, 32, 32, 0.075);
}

.metric-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 25px;
}

.metric-icon {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  background: #f3f2f0;
  color: var(--charcoal);
}

.metric-icon--orange {
  background: var(--orange-soft);
  color: var(--orange-deep);
}

.metric-icon svg {
  width: 18px;
}

.metric-trend {
  padding: 5px 8px;
  background: #f5f4f2;
  color: var(--gray);
  font-size: 9px;
}

.mini-status {
  color: #716d69;
  font-size: 9px;
}

.mini-status--healthy { color: var(--success); }
.mini-status--warning { color: var(--warning); }
.mini-status--danger { color: var(--danger); }
.mini-status--unknown { color: #716d69; }

.metric-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.metric-value {
  display: block;
  font-size: 27px;
  letter-spacing: -0.045em;
}

.metric-value--text {
  font-size: 20px;
}

.metric-card > p {
  margin: 6px 0 0;
  color: #92908d;
  font-size: 10px;
  line-height: 1.45;
}

.overview-columns {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  margin-top: 34px;
}

.panel {
  padding: 24px;
}

.icon-link {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.icon-link svg {
  width: 16px;
}

.availability-score {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 30px;
}

.availability-score strong {
  font-size: 38px;
  letter-spacing: -0.05em;
}

.availability-score span {
  color: var(--muted);
  font-size: 10px;
}

.mini-bars {
  display: flex;
  height: 74px;
  align-items: end;
  gap: 6px;
  margin: 20px 0 15px;
}

.mini-bar {
  min-width: 5px;
  flex: 1;
  border-radius: 4px 4px 2px 2px;
  background: linear-gradient(to top, var(--orange-deep), var(--orange));
  opacity: 0.92;
}

.chart-legend,
.availability-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 9px;
}

.chart-legend span,
.availability-foot span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.legend-dot--healthy {
  background: var(--success);
}

.legend-dot--muted {
  background: var(--line);
}

.compact-timeline {
  display: grid;
  gap: 6px;
  margin-top: 20px;
}

.compact-event {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-soft);
}

.compact-event:last-child {
  border-bottom: 0;
}

.compact-event__icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  background: var(--success-soft);
  color: var(--success);
}

.compact-event--active .compact-event__icon {
  background: var(--danger-soft);
  color: var(--danger);
}

.compact-event--active .compact-event__copy span {
  color: var(--danger);
  font-weight: 800;
}

.compact-event__icon svg {
  width: 15px;
}

.compact-event__copy {
  display: grid;
  gap: 4px;
}

.compact-event__copy strong {
  font-size: 11px;
}

.compact-event__copy span,
.compact-event time {
  color: var(--muted);
  font-size: 9px;
}

/* Service details */
.service-highlight {
  display: flex;
  min-height: 102px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  padding: 20px 24px;
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--orange);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.service-highlight > div {
  display: flex;
  align-items: center;
  gap: 16px;
}

.service-highlight__icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 15px;
  background: var(--charcoal);
  color: var(--orange);
}

.service-highlight__icon svg {
  width: 26px;
}

.service-highlight > div > span:last-child {
  display: grid;
  gap: 3px;
}

.service-highlight small {
  color: var(--orange-deep);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.service-highlight strong {
  font-size: 17px;
}

.service-highlight em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.readonly-label {
  padding: 8px 11px;
  background: #f3f2f0;
  color: var(--gray);
  font-size: 9px;
}

.readonly-label svg {
  width: 14px;
}

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

.detail-card {
  min-height: 190px;
}

.detail-card--wide {
  grid-column: 1 / -1;
}

.card-number {
  font-size: 28px;
  letter-spacing: -0.04em;
}

.card-number small {
  color: var(--gray);
  font-size: 13px;
}

.node-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.node-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--canvas-warm);
}

.node-item__number {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  background: var(--charcoal);
  color: var(--orange);
  font-size: 11px;
  font-weight: 900;
}

.node-item > span:nth-child(2) {
  display: grid;
  gap: 3px;
}

.node-item strong {
  font-size: 11px;
}

.node-item small {
  color: var(--success);
  font-size: 9px;
  font-weight: 750;
}

.node-item--unreachable {
  border-color: rgba(178, 62, 54, 0.38);
  background: var(--danger-soft);
}

.node-item--unreachable small {
  color: var(--danger);
}

.node-item--unreachable .node-item__number {
  background: rgba(178, 62, 54, 0.12);
  color: var(--danger);
}

.node-item .live-dot {
  width: 6px;
  height: 6px;
  margin-left: auto;
  border: 0;
}

.node-item .live-dot--healthy {
  box-shadow: 0 0 0 3px var(--success-soft);
}

.node-item .live-dot--danger {
  box-shadow: 0 0 0 3px var(--danger-soft);
}

.panel-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.panel-note .live-dot {
  width: 6px;
  height: 6px;
  border: 0;
}

.panel-note .live-dot--healthy {
  box-shadow: 0 0 0 3px var(--success-soft);
}

.panel-note .live-dot--danger {
  box-shadow: 0 0 0 3px var(--danger-soft);
}

.panel-note .live-dot--unknown {
  box-shadow: 0 0 0 3px #ebe9e6;
}

.friendly-value {
  display: block;
  margin-top: 35px;
  font-size: 23px;
  letter-spacing: -0.035em;
}

.detail-card > p:not(.panel-note) {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.detail-card--capacity {
  min-height: 175px;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  margin-top: 33px;
  border-radius: 999px;
  background: #eceae7;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange-deep), var(--orange));
  transition: width 500ms ease;
}

.capacity-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  color: var(--muted);
  font-size: 9px;
}

.capacity-caption strong {
  color: var(--success);
}

.freshness-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 18px 0 0;
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.freshness-note svg {
  width: 15px;
  flex: 0 0 auto;
  color: var(--orange-deep);
}

/* Availability */
.range-selector {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.range-selector button {
  min-width: 68px;
  padding: 9px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}

.range-selector button.is-active {
  background: var(--charcoal);
  color: #fff;
}

.availability-panel {
  padding: 28px;
}

.availability-panel__headline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.availability-panel__headline > div {
  display: grid;
}

.availability-panel__headline strong {
  margin-top: 10px;
  font-size: clamp(42px, 5vw, 64px);
  letter-spacing: -0.06em;
}

.availability-panel__headline p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.chart-wrap {
  width: 100%;
  margin: 22px 0 10px;
}

#availabilityChart {
  display: block;
  width: 100%;
  min-height: 240px;
  overflow: visible;
}

.chart-grid line {
  stroke: #ece9e5;
  stroke-width: 1;
}

.chart-area {
  fill: rgba(255, 150, 45, 0.11);
  stroke: none;
}

.chart-line {
  fill: none;
  stroke: var(--orange-deep);
  stroke-width: 4;
}

.chart-points circle {
  fill: var(--surface);
  stroke: var(--orange-deep);
  stroke-width: 3;
}

.info-callout {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-top: 18px;
  padding: 17px 18px;
  border: 1px solid #f0d2b2;
  border-radius: 13px;
  background: var(--orange-soft);
  color: #65320f;
}

.info-callout > svg {
  width: 19px;
  flex: 0 0 auto;
  color: var(--orange-deep);
}

.info-callout strong {
  font-size: 11px;
}

.info-callout p {
  margin: 4px 0 0;
  font-size: 10px;
  line-height: 1.55;
}

/* Incidents */
.empty-success {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 36px;
  padding: 26px;
  border: 1px solid #cce7da;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--success-soft), #f8fcfa);
}

.empty-success__icon {
  display: grid;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 15px;
  background: #fff;
  color: var(--success);
  box-shadow: 0 8px 22px rgba(35, 131, 93, 0.1);
}

.empty-success__icon svg {
  width: 29px;
  stroke-width: 2.2;
}

.empty-success h2 {
  margin: 0 0 5px;
  font-size: 17px;
}

.empty-success p {
  margin: 0;
  color: #547466;
  font-size: 11px;
  line-height: 1.5;
}

.incident-list {
  display: grid;
  gap: 12px;
}

.incident-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.incident-item__icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 12px;
  background: var(--success-soft);
  color: var(--success);
}

.incident-item__icon svg {
  width: 20px;
}

.incident-item__copy {
  display: grid;
  gap: 5px;
}

.incident-item__copy strong {
  font-size: 12px;
}

.incident-item__copy p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.incident-item__meta {
  display: grid;
  justify-items: end;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
}

.incident-item__meta strong {
  color: var(--success);
  font-size: 9px;
  text-transform: uppercase;
}

.incident-item--active {
  border-color: rgba(178, 62, 54, 0.32);
}

.incident-item--active .incident-item__icon {
  background: var(--danger-soft);
  color: var(--danger);
}

.incident-item--active .incident-item__meta strong {
  color: var(--danger);
}

/* Loading, errors and footer */
.loading-state,
.error-state {
  display: grid;
  min-height: 55vh;
  place-items: center;
  align-content: center;
  text-align: center;
}

.loading-state p {
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid #e7e3df;
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: rotate 700ms linear infinite;
}

.error-state__icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 17px;
  background: var(--warning-soft);
  color: var(--warning);
}

.error-state__icon svg {
  width: 30px;
}

.error-state h2 {
  margin: 20px 0 8px;
  font-size: 22px;
}

.error-state p {
  max-width: 440px;
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.secondary-button {
  min-height: 42px;
  padding: 0 17px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 11px;
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(24px, 4vw, 56px);
  border-top: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.6);
  color: var(--gray);
  font-size: 9px;
}

.toast {
  position: fixed;
  z-index: 200;
  right: 24px;
  bottom: 24px;
  max-width: 360px;
  padding: 13px 16px;
  border: 1px solid #d8d4cf;
  border-left: 4px solid var(--orange);
  border-radius: 11px;
  background: #fff;
  color: var(--charcoal);
  font-size: 11px;
  font-weight: 700;
  box-shadow: var(--shadow-md);
  animation: toast-in 220ms ease both;
}

.sidebar-overlay {
  position: fixed;
  z-index: 45;
  inset: 0;
  background: rgba(0, 0, 0, 0.44);
  backdrop-filter: blur(2px);
}

@keyframes rotate {
  to { transform: rotate(360deg); }
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

  .overview-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  :root {
    --sidebar-width: 238px;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-art {
    display: none;
  }

  .login-panel {
    padding: 32px;
  }

  .sidebar {
    transform: translateX(-105%);
    transition: transform 220ms ease;
  }

  .app-shell.menu-open .sidebar {
    transform: translateX(0);
  }

  .workspace {
    width: 100%;
    margin-left: 0;
  }

  .mobile-menu {
    display: inline-grid;
  }

  .topbar {
    padding-inline: 20px;
  }
}

@media (max-width: 720px) {
  main {
    padding: 28px 16px 40px;
  }

  .topbar {
    min-height: 66px;
    gap: 10px;
    padding-inline: 14px;
  }

  .topbar__context {
    flex: 1;
  }

  .topbar__service,
  .topbar__separator,
  .profile-copy,
  .profile-button > svg,
  .topbar .demo-pill {
    display: none;
  }

  .profile-button {
    min-width: 0;
    grid-template-columns: auto;
    padding: 4px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-heading .status-badge {
    align-self: flex-start;
  }

  .hero-status {
    grid-template-columns: auto 1fr;
    gap: 16px;
    padding: 25px 22px;
  }

  .hero-status__signal {
    width: 50px;
    border-radius: 15px;
  }

  .hero-status__meta {
    grid-column: 1 / -1;
    justify-items: start;
    padding-left: 66px;
  }

  .metric-grid--overview,
  .metric-grid--three,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-card--wide {
    grid-column: auto;
  }

  .node-list {
    grid-template-columns: 1fr;
  }

  .service-highlight,
  .availability-panel__headline {
    align-items: flex-start;
    flex-direction: column;
  }

  .incident-item {
    grid-template-columns: auto 1fr;
  }

  .incident-item__meta {
    grid-column: 2;
    justify-items: start;
  }

  .app-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .range-selector {
    width: 100%;
  }

  .range-selector button {
    flex: 1;
  }
}

@media (max-width: 470px) {
  .login-panel {
    align-items: start;
    padding: 24px 18px;
  }

  .login-copy {
    margin-top: 38px;
  }

  .brand-lockup--login {
    padding: 0;
  }

  .hero-status__copy h2 {
    font-size: 20px;
  }

  .metric-card {
    min-height: 162px;
  }

  .section-title {
    align-items: flex-end;
  }
}

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