@font-face {
  font-family: Aegea;
  src: url('../aegea-assets/AEGEASans-Regular.otf') format('opentype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Aegea;
  src: url('../aegea-assets/AEGEASans-Bold.otf') format('opentype');
  font-weight: 700;
  font-display: swap;
}

:root {
  --blue: #0027bd;
  --turquoise: #00e5cc;
  --navy: #04164e;
  --ink: #112244;
  --muted: #64718b;
  --line: #dfe5f0;
  --bg: #f2f5fb;
  --cyan: #00b6df;
  --green: #0f8a68;
  --amber: #c2780c;
  --red: #c43650;
  --shadow: 0 8px 28px rgba(10, 29, 86, 0.055);
  --shadow-hover: 0 16px 38px rgba(0, 39, 189, 0.11);
  --pcm-lilac: #eef0fb;
  --pcm-teal: #0d8f7d;
  --pcm-sky: #5b86c6;
  --pcm-navy: #07115f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% -6%, rgba(0, 39, 189, 0.09), transparent 30%),
    radial-gradient(circle at 96% 8%, rgba(0, 229, 204, 0.08), transparent 26%),
    var(--bg);
  color: var(--ink);
  font-family: Aegea, Arial, sans-serif;
  font-size: 14px;
}

button, input, select {
  font: inherit;
}

button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 8px;
  transition: background .16s ease, box-shadow .16s ease, transform .16s ease, border-color .16s ease;
}

button:hover {
  background: #eef3ff;
  box-shadow: 0 3px 10px #0027bd0f;
}

button:disabled {
  opacity: .5;
  cursor: wait;
}

button.primary {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
  font-weight: 700;
}

button.primary:hover {
  background: #001f99;
  box-shadow: 0 6px 18px #0027bd30;
}

button:focus-visible, a:focus-visible {
  outline: 3px solid var(--turquoise);
  outline-offset: 3px;
}

input, select {
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 10px;
  color: var(--ink);
}

input:focus, select:focus {
  outline: 2px solid #0027bd44;
  outline-offset: 1px;
}

h1, h2, h3, p {
  margin: 0;
}

h2 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.4px;
}

h3 {
  font-size: 15px;
}

p {
  line-height: 1.6;
}

small, .small-note {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.eyebrow {
  font-size: 10px;
  letter-spacing: 1.8px;
  font-weight: 700;
  display: block;
  margin-bottom: 8px;
}

.blue {
  color: var(--blue);
}

[hidden] {
  display: none !important;
}

/* TELA DE ACESSO CORPORATIVA AEGEA */
.access {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.18fr 1fr;
  background: white;
}

.access-art {
  background: var(--blue) url('../aegea-assets/aegea-fundo-azul.png') center/cover;
  color: white;
  min-height: 100vh;
  padding: 52px 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.access-art:before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 25, 130, 0.88) 0%, rgba(0, 39, 189, 0.62) 60%, rgba(0, 229, 204, 0.16) 100%);
  z-index: -2;
}

.access-orb {
  position: absolute;
  pointer-events: none;
  z-index: -1;
}

.access-orb-a {
  width: 380px;
  right: -110px;
  top: -80px;
  opacity: 0.08;
}

.access-orb-b {
  width: 260px;
  left: -80px;
  bottom: 90px;
  opacity: 0.05;
  transform: rotate(35deg);
}

.access-brand-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.access-logo {
  height: 44px;
  width: auto;
  object-fit: contain;
}

.access-pill {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.4px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 229, 204, 0.16);
  border: 1px solid rgba(0, 229, 204, 0.45);
  color: var(--turquoise);
}

.access-hero .eyebrow {
  color: var(--turquoise);
}

.access-art h1 {
  font-size: clamp(36px, 4.2vw, 60px);
  line-height: 1.07;
  letter-spacing: -1.8px;
  margin: 18px 0 22px;
}

.access-art h1 span {
  color: var(--turquoise);
}

.access-art p {
  max-width: 460px;
  opacity: .9;
  font-size: 16px;
}

.access-brand-bottom {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.access-regional-logo {
  height: 26px;
  width: auto;
  object-fit: contain;
  align-self: flex-start;
  opacity: 0.92;
}

.access-art small {
  color: #d6e4ff;
}

.access-form {
  display: grid;
  place-items: center;
  padding: 40px;
  background: radial-gradient(circle at 90% 10%, rgba(0, 39, 189, 0.04), transparent 35%), white;
}

.access-form form {
  width: 100%;
  max-width: 375px;
}

.form-brand-logo {
  height: 36px;
  width: auto;
  object-fit: contain;
  margin-bottom: 24px;
}

.access-form h2 {
  font-size: 30px;
  margin: 12px 0 8px;
}

.access-form p {
  color: var(--muted);
  margin-bottom: 26px;
}

.access-form label {
  display: block;
  margin: 18px 0 8px;
  font-size: 13px;
  font-weight: 700;
}

.access-form input {
  width: 100%;
  margin-top: 8px;
  padding: 13px 14px;
  font-weight: 400;
}

.access-form button {
  width: 100%;
  margin-top: 14px;
  padding: 15px;
  display: flex;
  justify-content: space-between;
}

.access-form small {
  display: block;
  margin-top: 22px;
}

.message {
  white-space: pre-line;
  color: var(--blue);
  margin: 16px 0 !important;
}

.message.error {
  color: var(--red) !important;
}

/* SIDEBAR OFICIAL AEGEA */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  background: linear-gradient(180deg, var(--blue) 0%, #001a82 65%, var(--navy) 100%);
  color: white;
  padding: 30px 18px 24px;
  display: flex;
  flex-direction: column;
  z-index: 20;
  overflow-y: auto;
  overflow-x: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-orb {
  position: absolute;
  width: 240px;
  right: -95px;
  bottom: 45px;
  opacity: 0.055;
  pointer-events: none;
}

.sidebar-brand {
  padding: 0 10px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.logo {
  width: 175px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  margin-bottom: 10px;
}

.sidebar-sub {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--turquoise);
}

.rail-title {
  font-size: 9px;
  letter-spacing: 1.6px;
  font-weight: 700;
  opacity: .6;
  margin: 24px 10px 10px;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sidebar nav button {
  text-align: left;
  border: 0;
  background: transparent;
  color: #dce4ff;
  font-size: 12px;
  padding: 12px 11px;
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.35;
  border-radius: 9px;
}

.sidebar nav button span {
  font-size: 17px;
  width: 22px;
  text-align: center;
  color: var(--turquoise);
}

.sidebar nav button.active {
  background: white;
  color: var(--blue);
  box-shadow: 0 6px 20px rgba(0, 14, 70, 0.28);
  font-weight: 700;
}

.sidebar nav button.active span {
  color: var(--blue);
}

.sidebar nav button:hover:not(.active) {
  background: rgba(255, 255, 255, 0.11);
}

.rail-bottom {
  margin-top: auto;
  padding: 26px 10px 0;
  font-size: 10px;
  color: #c3d3ff;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.user-chip {
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 9px;
  padding: 9px 10px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.role-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  background: var(--turquoise);
  color: var(--navy);
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
}

.user-email {
  font-size: 11px;
  color: white;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-bottom button {
  display: block;
  background: transparent;
  border: 0;
  color: #dce4ff;
  padding: 7px 0;
  font-size: 11px;
  text-align: left;
}

.rail-bottom button:hover {
  color: var(--turquoise);
  background: transparent;
  box-shadow: none;
}

.sidebar-regional {
  width: 100%;
  max-width: 195px;
  height: auto;
  object-fit: contain;
  opacity: 0.72;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--turquoise);
  border-radius: 100%;
  margin-right: 6px;
  box-shadow: 0 0 8px var(--turquoise);
}

/* CONTEÚDO PRINCIPAL */
main {
  margin-left: 248px;
  padding: 0 34px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 0 22px;
  flex-wrap: wrap;
}

.header-title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-cell-mark {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}

header h1 {
  font-size: 28px;
  letter-spacing: -.8px;
  margin-bottom: 5px;
}

header p {
  color: var(--muted);
  font-size: 12px;
}

.sep {
  color: #b4bdd0;
  margin: 0 8px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.period-presets {
  display: inline-flex;
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
}

.preset-btn {
  border: 0;
  background: transparent;
  padding: 6px 11px;
  font-size: 11px;
  border-radius: 6px;
  color: var(--muted);
}

.preset-btn:hover {
  background: #f2f5fc;
  color: var(--ink);
  box-shadow: none;
}

.preset-btn.active {
  background: var(--blue);
  color: white;
  font-weight: 700;
}

/* FILTROS */
.filters {
  display: flex;
  align-items: end;
  gap: 12px;
  background: white;
  padding: 16px 19px;
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}

.filters > label,
.filter-picker {
  display: flex;
  flex: 1 1 115px;
  flex-direction: column;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: .4px;
}

.filter-label {
  display: block;
}

.filters input,
.filter-picker summary {
  font-size: 12px;
  font-weight: 400;
  text-transform: none;
  width: 100%;
  padding: 9px 8px;
}

.filter-picker {
  position: relative;
  min-width: 150px;
}

.filter-picker details {
  position: relative;
}

.filter-picker summary {
  list-style: none;
  cursor: pointer;
  background: #fff;
  border: 1px solid #dce3f2;
  border-radius: 7px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 27px;
}

.filter-picker summary::-webkit-details-marker {
  display: none;
}

.filter-picker summary::after {
  content: '⌄';
  position: absolute;
  right: 9px;
  color: var(--blue);
  font-weight: 700;
}

.filter-picker details[open] summary {
  border-color: #8ca8f5;
  box-shadow: 0 0 0 3px #dce6ff;
}

.filter-options {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow: auto;
  padding: 7px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 12px 30px #071b5030;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 7px;
  border-radius: 6px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
}

.filter-option:hover {
  background: #f1f5ff;
}

.filter-option input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--blue);
}

.filter-empty {
  display: block;
  padding: 9px 7px;
  color: var(--muted);
  font-size: 11px;
}

.filters button {
  font-size: 12px;
}

.statusline {
  padding: 16px 2px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  color: var(--muted);
  flex-wrap: wrap;
}

/* KPIS */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin: 0 0 22px;
}

.kpi {
  background: white;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 20px 22px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}

.kpi:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.kpi:before {
  content: '';
  position: absolute;
  width: 4px;
  left: 0;
  top: 18px;
  bottom: 18px;
  background: var(--accent, var(--blue));
  border-radius: 4px;
}

.kpi span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
}

.kpi strong {
  display: block;
  font-size: 36px;
  letter-spacing: -1px;
  margin: 9px 0 4px;
  color: var(--accent, var(--ink));
  font-weight: 700;
}

.kpi small {
  font-size: 11px;
}

/* CARDS E MAPA */
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 21px 24px;
  border-bottom: 1px solid #f2f5fa;
}

.card-top .eyebrow {
  color: var(--blue);
  font-size: 9px;
  margin-bottom: 5px;
}

.card-top button {
  font-size: 11px;
  border: 0;
  color: var(--blue);
  font-weight: 700;
  padding: 7px 11px;
  background: #eff3ff;
}

.card-top button:hover {
  background: #dfe8ff;
}

.card-actions {
  display: flex;
  gap: 6px;
}

.card-top h2 {
  font-size: 17px;
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 20px;
}

.map-card.is-fullscreen {
  position: fixed;
  inset: 16px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 90px #061d6066;
}

.map-card.is-fullscreen #map {
  flex: 1;
  height: auto;
}

#map {
  height: 415px;
  z-index: 1;
  background: #e8edf5;
}

.map-note {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  font-size: 10px;
  color: var(--muted);
  flex-wrap: wrap;
}

.map-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 100%;
  margin-right: 5px;
}

.blue-dot { background: var(--blue); }
.good-dot { background: var(--green); }
.warn-dot { background: var(--amber); }
.critical-dot { background: var(--red); }

.map-pin {
  width: 16px;
  height: 16px;
  background: var(--blue);
  border: 3px solid white;
  border-radius: 100%;
  box-shadow: 0 0 0 5px #0027bd25, 0 2px 7px #15264944;
  transition: transform .15s ease;
}

.map-pin.good {
  background: var(--green);
  box-shadow: 0 0 0 5px #0f8a682a, 0 2px 7px #15264944;
}

.map-pin.warn {
  background: var(--amber);
  box-shadow: 0 0 0 5px #c2780c2a, 0 2px 7px #15264944;
}

.map-pin.critical {
  background: var(--red);
  box-shadow: 0 0 0 5px #c4365030, 0 2px 7px #15264944;
}

.leaflet-tooltip.point-label {
  font: 700 10px Aegea, Arial, sans-serif;
  border: 0;
  background: #ffffffea;
  padding: 4px 7px;
  color: var(--ink);
  box-shadow: 0 1px 6px #0002;
  border-radius: 4px;
}

.leaflet-popup-content {
  font-family: Aegea, Arial, sans-serif;
  font-size: 12px;
  margin: 17px;
  width: 245px !important;
}

.hover-title {
  font-size: 16px;
  margin-bottom: 6px;
}

.hover-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 8px;
}

.hover-grid small {
  font-size: 10px;
}

.hover-grid b {
  display: block;
  font-size: 19px;
  color: var(--blue);
}

.hover-footer {
  font-size: 11px;
  color: var(--muted);
  margin-top: 10px;
}

.count {
  background: #eef2ff;
  color: var(--blue);
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

.systems-toolbar {
  padding: 12px 16px 8px;
}

.systems-toolbar input {
  width: 100%;
  font-size: 12px;
  padding: 8px 11px;
  background: #f8faff;
}

#systemsList {
  max-height: 400px;
  overflow: auto;
  padding: 0 14px 14px;
}

.system-row {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid #edf0f5;
  border-radius: 7px;
  text-align: left;
  padding: 12px 10px;
  background: white;
}

.system-row:hover {
  background: #f4f7ff;
  box-shadow: none;
}

.system-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.system-row b {
  font-size: 12px;
  display: block;
  line-height: 1.4;
}

.system-row .system-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 10px;
  color: var(--muted);
  margin-top: 6px;
}

.system-row .system-reliability {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
}

.system-row .system-reliability b {
  display: inline;
  color: var(--ink);
  font-size: inherit;
}

.mini-track {
  height: 4px;
  background: #edf1fa;
  border-radius: 4px;
  margin-top: 8px;
  overflow: hidden;
  display: block;
}

.mini-track i {
  display: block;
  height: 100%;
  background: var(--blue);
  border-radius: 4px;
}

.mini-track i.good { background: var(--green); }
.mini-track i.warn { background: var(--amber); }
.mini-track i.critical { background: var(--red); }

/* PAINÉIS INFERIORES */
.overview-bottom {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.overview-extra {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.plan-card {
  background: linear-gradient(135deg, var(--blue) 0%, #001a80 100%);
  color: white;
  position: relative;
  padding: 26px 28px;
  isolation: isolate;
}

.plan-card-orb {
  position: absolute;
  width: 240px;
  right: -65px;
  bottom: -65px;
  opacity: 0.08;
  pointer-events: none;
  z-index: -1;
}

.plan-card .eyebrow {
  color: var(--turquoise);
}

.plan-number {
  font-size: 48px;
  letter-spacing: -2px;
  display: block;
  margin: 12px 0 6px;
}

.plan-card p {
  font-size: 11px;
  color: #c4d3ff;
  margin-top: 15px;
  max-width: 340px;
}

.plan-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.plan-card button {
  background: rgba(255, 255, 255, 0.12);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.24);
  padding: 9px 13px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 7px;
}

.plan-card button:hover {
  background: var(--turquoise);
  color: var(--navy);
  border-color: var(--turquoise);
}

.plan-card .sub {
  font-size: 12px;
  color: #d9e5ff;
}

/* GRÁFICO MENSAL */
.monthly {
  height: 195px;
  display: flex;
  align-items: stretch;
  gap: 9px;
  padding: 14px 24px 22px;
  overflow-x: auto;
}

.month {
  flex: 1;
  min-width: 32px;
  display: flex;
  flex-direction: column;
  justify-content: end;
  align-items: center;
  gap: 5px;
}

.month strong {
  font-size: 10px;
  color: var(--ink);
}

.month .pct-tag {
  font-size: 9px;
  color: var(--muted);
}

.month .column {
  width: 72%;
  min-height: 4px;
  background: #dce5ff;
  border-radius: 5px 5px 0 0;
  position: relative;
  overflow: hidden;
}

.month .column i {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--blue);
  border-radius: 5px 5px 0 0;
  transition: height .25s ease;
}

.month small {
  font-size: 9px;
  white-space: nowrap;
}

/* DISTRIBUIÇÃO POR TIPO & TOP ATIVOS */
.type-list, .asset-list {
  padding: 10px 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.type-row, .asset-row {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid #f0f3f9;
  border-radius: 7px;
  padding: 11px 10px;
  text-align: left;
  background: white;
}

.type-row:last-child, .asset-row:last-child {
  border-bottom: 0;
}

.type-row:hover, .asset-row:hover {
  background: #f5f8ff;
  box-shadow: none;
}

.type-row.active-filter {
  background: #eef2ff;
  outline: 1px solid #b8c8ff;
}

.row-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 12px;
}

.row-head b {
  color: var(--ink);
}

.row-sub {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
}

/* ABA 2: ENGENHARIA & DECISÃO */
.mix-body {
  padding: 20px 24px 24px;
}

.mix-bar-track {
  height: 22px;
  border-radius: 999px;
  background: #edf1f8;
  display: flex;
  overflow: hidden;
  gap: 2px;
  margin-bottom: 16px;
}

.mix-seg {
  height: 100%;
  transition: width .3s ease;
}

.mix-seg.prev { background: var(--blue); }
.mix-seg.pred { background: var(--cyan); }
.mix-seg.eng { background: var(--green); }
.mix-seg.cplan { background: var(--amber); }
.mix-seg.serv { background: #8592ad; }
.mix-seg.cemerg { background: var(--red); }

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

.mix-item {
  background: #f8faff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 66px;
}

.mix-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
}

.mix-item small {
  font-size: 10px;
}

.decision-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.decision-card {
  background: white;
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue);
  border-radius: 13px;
  padding: 20px 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.decision-card.good { border-left-color: var(--green); }
.decision-card.warn { border-left-color: var(--amber); }
.decision-card.critical { border-left-color: var(--red); }

.decision-card h3 {
  font-size: 16px;
  margin: 4px 0 8px;
}

.decision-card p {
  font-size: 12px;
  color: var(--muted);
}

.decision-action {
  background: #f5f8ff;
  border: 1px solid #dce6ff;
  border-radius: 9px;
  padding: 10px 13px;
  font-size: 11px;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.decision-action b {
  color: var(--blue);
}

.decision-action button {
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--blue);
  border-color: #c3d4ff;
  flex-shrink: 0;
}

/* ICM & RANKINGS */
.section-intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding: 4px 0 22px;
  flex-wrap: wrap;
}

.section-intro h2 {
  font-size: 25px;
  margin-bottom: 6px;
}

.section-intro p {
  font-size: 12px;
  color: var(--muted);
}

.section-actions {
  display: flex;
  gap: 10px;
}

.icm-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.icm-grid .card {
  padding-bottom: 14px;
}

.rank-list {
  padding: 8px 20px 6px;
}

.rank {
  display: block;
  width: 100%;
  border: 0;
  background: white;
  padding: 11px 6px;
  border-radius: 7px;
  text-align: left;
}

.rank:hover {
  background: #f4f7ff;
  box-shadow: none;
}

.rank-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  line-height: 1.45;
}

.rank-label b {
  color: var(--blue);
  white-space: nowrap;
}

.rank-bar {
  margin-top: 7px;
  height: 6px;
  background: #edf1fa;
  border-radius: 3px;
  display: block;
}

.rank-bar i {
  display: block;
  height: 100%;
  background: var(--blue);
  border-radius: 3px;
}

.rank:nth-child(2) .rank-bar i { background: #2c4fd1; }
.rank:nth-child(n+3) .rank-bar i { background: #6886e2; }

.icm-grid + .small-note {
  margin-top: 15px;
}

.no-data {
  padding: 35px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

/* TABELAS */
.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

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

th {
  text-align: left;
  font-size: 10px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  background: #f8faff;
  padding: 12px 20px;
  white-space: nowrap;
}

td {
  padding: 13px 20px;
  border-bottom: 1px solid #edf0f5;
  line-height: 1.4;
}

tr:hover td {
  background: #fafbff;
}

tr:last-child td {
  border-bottom: 0;
}

td button.link {
  border: 0;
  padding: 0;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  background: transparent;
  text-align: left;
}

td button.link:hover {
  text-decoration: underline;
  box-shadow: none;
}

td.description {
  min-width: 210px;
  max-width: 360px;
}

/* A tabela dentro do detalhamento precisa caber na janela sem cortar a última coluna. */
#detail .table-wrap {
  padding-bottom: 6px;
}

#detail .table-wrap table {
  table-layout: fixed;
  min-width: 0;
}

#detail .table-wrap th,
#detail .table-wrap td {
  padding: 10px 8px;
  white-space: normal;
  overflow-wrap: anywhere;
}

#detail .table-wrap th:nth-child(1), #detail .table-wrap td:nth-child(1) { width: 12%; }
#detail .table-wrap th:nth-child(2), #detail .table-wrap td:nth-child(2) { width: 22%; }
#detail .table-wrap th:nth-child(3), #detail .table-wrap td:nth-child(3) { width: 15%; }
#detail .table-wrap th:nth-child(4), #detail .table-wrap td:nth-child(4) { width: 16%; }
#detail .table-wrap th:nth-child(5), #detail .table-wrap td:nth-child(5) { width: 11%; }
#detail .table-wrap th:nth-child(6), #detail .table-wrap td:nth-child(6) { width: 11%; }
#detail .table-wrap th:nth-child(7), #detail .table-wrap td:nth-child(7) { width: 13%; }

#detail .table-wrap td.description {
  min-width: 0;
  max-width: none;
}

#detail .table-wrap .badge {
  white-space: normal;
  text-align: center;
}

.adherence-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 130px;
}

.adherence-bar {
  flex: 1;
  height: 6px;
  background: #edf1fa;
  border-radius: 4px;
  overflow: hidden;
  max-width: 90px;
}

.adherence-bar i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--blue);
}

.adherence-bar i.good { background: var(--green); }
.adherence-bar i.warn { background: var(--amber); }
.adherence-bar i.critical { background: var(--red); }

.availability-cell {
  display: grid;
  gap: 6px;
  min-width: 110px;
}

.availability-cell > b {
  font-variant-numeric: tabular-nums;
}

.availability-bar {
  display: block;
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1fa;
}

.availability-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  transition: width .35s ease;
}

.availability-bar i.good { background: var(--green); }
.availability-bar i.warn { background: var(--amber); }
.availability-bar i.critical { background: var(--red); }

.reliability-rank {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: #eef2ff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.reliability-ranking-cards {
  display: none;
}

.asset-reliability-ranking-cards,
.preventive-ranking-cards {
  display: none;
}

.badge {
  font-size: 10px;
  font-weight: 700;
  display: inline-block;
  padding: 4px 8px;
  border-radius: 5px;
  white-space: nowrap;
  background: #eef1f6;
  color: var(--muted);
}

.badge.done, .badge.good {
  background: #e7f6f0;
  color: var(--green);
}

.badge.open, .badge.warn {
  background: #fff4df;
  color: var(--amber);
}

.badge.notdone, .badge.critical {
  background: #fff0f2;
  color: var(--red);
}

.table-filters {
  display: flex;
  gap: 12px;
  padding: 16px 22px 18px;
  flex-wrap: wrap;
}

.table-filters input {
  flex: 1;
  min-width: 220px;
}

.table-filters select {
  max-width: 230px;
}

.pagination {
  display: flex;
  justify-content: end;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  font-size: 11px;
}

.pagination button {
  font-size: 11px;
}

.explanation {
  padding: 27px;
}

.explanation h2 {
  margin: 14px 0;
}

.explanation p {
  font-size: 12px;
  color: var(--muted);
  margin: 12px 0;
}

.inset {
  padding: 0 24px 22px;
}

.comparison-row {
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #f0f2f7;
  font-size: 12px;
}

.comparison-row b {
  color: var(--blue);
}

footer {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 28px 2px;
  margin-top: 24px;
  border-top: 1px solid var(--line);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-logo {
  height: 22px;
  width: auto;
  object-fit: contain;
}

.empty {
  text-align: center;
  padding: 65px 24px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.empty-icon {
  display: inline-grid;
  place-items: center;
  background: #edf2ff;
  color: var(--blue);
  width: 70px;
  height: 70px;
  font-size: 35px;
  border-radius: 18px;
  margin-bottom: 25px;
}

.empty h2 {
  font-size: 26px;
}

.empty p {
  max-width: 490px;
  margin: 16px auto 25px;
  color: var(--muted);
  font-size: 13px;
}

/* MODAIS E IMPORTAÇÃO */
dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  max-width: 960px;
  width: calc(100% - 48px);
  max-height: 88vh;
  color: var(--ink);
  box-shadow: 0 25px 100px #061d6033;
}

dialog::backdrop {
  background: #071b5070;
  backdrop-filter: blur(4px);
}

.modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.modal-top button {
  border: 0;
  background: #f3f5fa;
}

.modal-top .eyebrow {
  margin: 0;
}

#importDialog {
  max-width: 650px;
}

#importDialog > p {
  margin: 15px 0;
  color: var(--muted);
  font-size: 13px;
}

.file-zone {
  display: block;
  padding: 25px;
  background: #f5f8ff;
  border: 2px dashed #a9b9ed;
  border-radius: 10px;
  color: var(--blue);
  font-size: 14px;
  text-align: center;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}

.file-zone.dragover {
  background: #e6eeff;
  border-color: var(--blue);
}

.file-zone input {
  display: block;
  margin: 15px auto 0;
  max-width: 100%;
  font-size: 12px;
}

.file-checklist {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.file-check-item {
  font-size: 11px;
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #fafbfe;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.file-check-item.ready {
  border-color: #b7e4d4;
  background: #f1fbf7;
  color: var(--green);
}

.modal-actions {
  display: flex;
  justify-content: end;
  gap: 12px;
  margin-top: 20px;
}

.detail-heading h2 {
  font-size: 28px;
  margin-bottom: 8px;
}

.detail-heading p {
  font-size: 12px;
  color: var(--muted);
}

.detail-heading {
  margin-bottom: 24px;
}

.detail-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 22px 0;
}

.detail-kpis > div {
  padding: 15px;
  background: #f4f7ff;
  border-radius: 9px;
}

.detail-kpis small {
  display: block;
}

.detail-kpis b {
  font-size: 26px;
  color: var(--blue);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin: 20px 0;
}

.detail-block {
  background: #f7f9fc;
  border: 1px solid var(--line);
  padding: 15px;
  border-radius: 9px;
}

.detail-block p {
  font-size: 12px;
  margin: 8px 0;
  overflow-wrap: anywhere;
}

.detail-block h3 {
  margin-bottom: 12px;
  color: var(--blue);
}

.detail-section {
  margin: 24px 0 12px;
}

.order-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 20px 0;
}

.order-info dt {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 5px;
}

.order-info dd {
  font-size: 13px;
  margin: 0;
  overflow-wrap: anywhere;
}

#toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: white;
  padding: 14px 22px;
  border-radius: 9px;
  z-index: 1000;
  box-shadow: 0 8px 30px #0027bd33;
  max-width: 90%;
  font-size: 13px;
}

/* RESPONSIVIDADE */
@media (min-width: 1650px) {
  main {
    max-width: 1640px;
    margin-right: auto;
  }
  .map-layout {
    grid-template-columns: minmax(0, 1fr) 350px;
  }
  #map {
    height: 470px;
  }
  #systemsList {
    max-height: 460px;
  }
}

@media (max-width: 1200px) {
  .sidebar {
    width: 215px;
    padding: 26px 12px;
  }
  main {
    margin-left: 215px;
    padding: 0 24px;
  }
  .header-actions button {
    font-size: 11px;
  }
  .map-layout {
    grid-template-columns: minmax(0, 1fr) 280px;
  }
  .kpi {
    padding: 18px 16px;
  }
  .kpi strong {
    font-size: 30px;
  }
  .card-top {
    padding: 18px 17px;
  }
  .icm-grid, .decision-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .rank-list {
    padding: 0 15px;
  }
  .overview-extra {
    grid-template-columns: 1fr;
  }
  .mix-legend {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 950px) {
  .sidebar {
    width: 72px;
    padding: 25px 8px;
  }
  .sidebar-brand {
    padding: 0 0 18px;
  }
  .sidebar .logo {
    width: 52px;
    margin: 0;
  }
  .sidebar-sub, .rail-title, .rail-bottom {
    display: none;
  }
  .sidebar nav button {
    font-size: 0;
    justify-content: center;
    padding: 15px 4px;
  }
  .sidebar nav button span {
    font-size: 22px;
  }
  main {
    margin-left: 72px;
    padding: 0 22px;
  }
  header h1 {
    font-size: 25px;
  }
  .map-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  #systemsList {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    max-height: 240px;
  }
  .overview-bottom, .overview-extra, .decision-grid {
    grid-template-columns: 1fr;
  }
  .icm-grid {
    grid-template-columns: 1fr;
  }
  .access-art {
    padding: 40px;
  }
  .access-art h1 {
    font-size: 40px;
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .kpis {
    gap: 10px;
  }
  .kpi span {
    font-size: 10px;
  }
  .mix-legend {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .access {
    grid-template-columns: 1fr;
  }
  .access-art {
    min-height: 260px;
    padding: 26px;
  }
  .access-art h1 {
    font-size: 30px;
    letter-spacing: -.8px;
    margin: 15px 0;
  }
  .access-art p, .access-brand-bottom {
    display: none;
  }
  .access-form {
    padding: 35px 26px;
  }
  .access-form h2 {
    font-size: 25px;
  }
  .sidebar {
    inset: auto 0 0;
    width: auto;
    height: 65px;
    flex-direction: row;
    padding: 7px 12px;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -5px 30px #00174522;
  }
  .sidebar-brand, .sidebar-orb {
    display: none;
  }
  .sidebar nav {
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
  }
  .sidebar nav button {
    width: 19%;
    padding: 8px;
  }
  main {
    margin-left: 0;
    padding: 0 16px 75px;
  }
  header {
    padding: 20px 0;
    gap: 8px;
  }
  .header-cell-mark {
    display: none;
  }
  header h1 {
    font-size: 22px;
  }
  .kpis {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
  }
  .kpi strong {
    font-size: 28px;
  }
  .kpi {
    padding: 15px;
  }
  #map {
    height: 350px;
  }
  #systemsList {
    grid-template-columns: 1fr;
  }
  .table-filters {
    flex-direction: column;
    padding: 14px 16px;
  }
  .table-filters select {
    max-width: none;
  }
  footer {
    font-size: 9px;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .order-info, .detail-kpis, .file-checklist {
    grid-template-columns: 1fr;
  }
  .mix-legend {
    grid-template-columns: 1fr;
  }
  dialog {
    padding: 21px;
    width: calc(100% - 22px);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* Visual mais sóbrio para leitura diária do painel. */
:root {
  --bg: #f4f6f8;
  --line: #e1e5ea;
  --muted: #667085;
  --ink: #1d2939;
  --blue: #0039a6;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.045);
  --shadow-hover: 0 2px 8px rgba(16, 24, 40, 0.08);
}

body {
  background: var(--bg);
  color: var(--ink);
}

button {
  border-radius: 6px;
  transition: background-color .14s ease, border-color .14s ease, color .14s ease;
}

button:hover {
  box-shadow: none;
}

.sidebar {
  background: #082653;
  border-right: 0;
  padding: 26px 16px 20px;
}

.sidebar-orb,
.plan-card-orb {
  display: none;
}

.sidebar-brand {
  padding-bottom: 18px;
}

.sidebar-sub {
  letter-spacing: 1px;
}

.rail-title {
  margin-top: 20px;
  letter-spacing: 1px;
}

.sidebar nav {
  gap: 2px;
}

.sidebar nav button {
  border-radius: 6px;
  padding: 11px 10px;
}

.sidebar nav button.active {
  box-shadow: none;
}

main {
  max-width: 1760px;
  padding: 0 32px;
}

header {
  padding: 24px 0 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}

header h1 {
  font-size: 25px;
  letter-spacing: -.45px;
}

header p {
  font-size: 12px;
}

.eyebrow {
  letter-spacing: 1.1px;
}

.filters {
  gap: 10px;
  padding: 13px 15px;
  border-radius: 8px;
  box-shadow: none;
}

.filters > label,
.filter-picker {
  letter-spacing: 0;
}

.filter-picker summary,
.filters input,
input,
select {
  border-radius: 6px;
}

.statusline {
  padding: 12px 2px 16px;
}

.kpis {
  gap: 12px;
  margin-bottom: 18px;
}

.kpi {
  border-radius: 8px;
  box-shadow: none;
  padding: 17px 18px;
}

.kpi:hover {
  transform: none;
  box-shadow: var(--shadow);
}

.kpi:before {
  top: 13px;
  bottom: 13px;
  width: 3px;
}

.kpi span {
  letter-spacing: .2px;
  font-size: 10px;
}

.kpi strong {
  font-size: 31px;
  letter-spacing: -.5px;
  margin: 7px 0 2px;
}

.card,
.decision-card {
  border-radius: 8px;
  box-shadow: none;
}

.card-top {
  padding: 17px 20px;
  border-bottom-color: #edf0f2;
}

.card-top .eyebrow {
  letter-spacing: 1px;
}

.card-top h2 {
  font-size: 16px;
}

.section-intro {
  padding-bottom: 18px;
}

.section-intro h2 {
  font-size: 22px;
  letter-spacing: -.25px;
}

.section-intro p {
  max-width: 760px;
}

.decision-card {
  border-left-width: 3px;
  padding: 18px 20px;
}

.decision-action {
  border-radius: 6px;
  background: #f7f8fa;
  border-color: #e7eaee;
}

.plan-card {
  background: #123b83;
}

.plan-card button {
  border-radius: 5px;
}

.table-wrap {
  border-radius: 0 0 8px 8px;
}

table {
  font-size: 12px;
}

th {
  background: #f5f6f8;
  letter-spacing: .25px;
  padding: 11px 16px;
}

td {
  padding: 11px 16px;
}

tr:hover td {
  background: #f7f9fb;
}

.empty {
  border-radius: 8px;
  box-shadow: none;
}

.empty-icon {
  border-radius: 12px;
}

.access-art {
  background: #07358c;
}

.access-art:before {
  background: linear-gradient(135deg, rgba(3, 25, 77, .72), rgba(0, 39, 130, .2));
}

.access-pill {
  background: transparent;
  border-color: rgba(255, 255, 255, .3);
  color: white;
  letter-spacing: .8px;
}

.access-art h1 {
  font-size: clamp(34px, 3.7vw, 52px);
  letter-spacing: -1px;
}

.access-art h1 span {
  color: #d6e2ff;
}

.access-form {
  background: white;
}

.access-form h2 {
  letter-spacing: -.5px;
}

.access-form input {
  border-radius: 6px;
}

.access-form button {
  border-radius: 6px;
}

.admin-page {
  background: var(--bg);
}

.admin-card {
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.admin-note {
  background: #f5f7fa;
  border-radius: 6px;
}

section[data-view]:not([hidden]) {
  animation: view-enter .18s ease-out both;
}

.card,
.decision-card,
.system-row {
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.card:hover,
.decision-card:hover {
  border-color: #d5dbe3;
  box-shadow: var(--shadow);
}

.system-row:hover {
  transform: translateY(-1px);
}

@keyframes view-enter {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  section[data-view]:not([hidden]) {
    animation: none;
  }

  .card,
  .decision-card,
  .system-row {
    transition: none;
  }
}

.filters {
  align-items: end;
  gap: 12px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.filters-heading {
  display: flex;
  flex: 1 0 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 2px;
}

.filters-heading strong,
.filters-heading span {
  display: block;
}

.filters-heading strong {
  color: var(--ink);
  font-size: 14px;
}

.filters-heading div > span,
.active-filter-count {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  text-transform: none;
}

.filters > label,
.filter-picker {
  flex: 1 1 150px;
  min-width: 130px;
  gap: 7px;
  font-size: 11px;
  text-transform: none;
}

.filters input,
.filter-picker summary {
  min-height: 40px;
  padding: 10px 11px;
  border-color: #d9e0e8;
  border-radius: 6px;
  font-size: 13px;
}

.filter-picker summary {
  padding-right: 30px;
}

.filter-picker details[open] summary,
.filters input:focus {
  border-color: #8da9df;
  box-shadow: 0 0 0 3px rgba(0, 57, 166, .09);
}

.filter-options {
  border-radius: 6px;
  box-shadow: 0 8px 22px rgba(16, 24, 40, .12);
}

.filter-options-tools {
  position: sticky;
  top: -7px;
  z-index: 1;
  display: grid;
  gap: 7px;
  padding: 3px 0 8px;
  margin-bottom: 4px;
  background: #fff;
  border-bottom: 1px solid #edf0f4;
}

.filter-options-tools input.filter-search {
  min-height: 34px;
  padding: 7px 9px;
  border-radius: 5px;
  font-size: 12px;
}

.filter-options-tools > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.filter-options-tools button {
  min-height: 27px;
  padding: 4px 7px;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 11px;
}

.filter-options-tools button:hover {
  background: #f2f5fa;
}

.filter-options-list {
  display: grid;
  gap: 1px;
}

.filter-option[hidden] {
  display: none;
}

.clear-filters {
  min-height: 40px;
  padding: 9px 13px;
  color: var(--muted);
  white-space: nowrap;
}

.clear-filters:disabled {
  opacity: .48;
  cursor: default;
  background: #fff;
}

.active-filters {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 2px 0;
  color: var(--muted);
  font-size: 11px;
}

.active-filters[hidden] {
  display: none;
}

#activeFilterChips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.active-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 27px;
  padding: 4px 8px;
  border: 1px solid #dce4ef;
  border-radius: 5px;
  background: #fff;
  color: #344054;
  font-size: 11px;
}

.active-filter-chip:hover {
  border-color: #aebed5;
  background: #f7f9fc;
}

.active-filter-chip span {
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
}

.filter-date-help {
  margin: 7px 2px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

@media (max-width: 640px) {
  .filters {
    align-items: stretch;
    gap: 10px;
    padding: 13px;
  }

  .filters > label,
  .filter-picker {
    flex: 1 1 calc(50% - 10px);
    min-width: 0;
  }

  .clear-filters {
    flex: 1 1 100%;
  }

  .active-filters {
    flex-direction: column;
    gap: 6px;
  }
}

@media (max-width: 1200px) {
  main {
    padding-right: 24px;
    padding-left: 24px;
  }
}

@media (max-width: 950px) {
  main {
    padding-right: 20px;
    padding-left: 20px;
  }

  .sidebar nav button {
    border-radius: 6px;
  }
}

@media (max-width: 640px) {
  main {
    padding: 0 14px 82px;
  }

  #reliabilityTable .reliability-ranking-table {
    display: none;
  }

  #reliabilityTable .reliability-ranking-cards {
    display: grid;
    gap: 9px;
  }

  #assetReliabilityTable .asset-reliability-ranking-table,
  #planTable .preventive-ranking-table {
    display: none;
  }

  #assetReliabilityTable .asset-reliability-ranking-cards,
  #planTable .preventive-ranking-cards {
    display: grid;
    gap: 9px;
  }

  .reliability-rank-card {
    display: grid;
    gap: 9px;
    padding: 12px;
    border: 1px solid #e6ebf3;
    border-radius: 10px;
    background: #fff;
  }

  .reliability-rank-heading {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
  }

  .reliability-rank-plant {
    display: grid;
    gap: 2px;
    min-width: 0;
    flex: 1;
  }

  .reliability-rank-plant b {
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .reliability-rank-plant small {
    color: var(--muted);
    font-size: 10px;
  }

  .reliability-rank-value {
    font-size: 15px;
    font-variant-numeric: tabular-nums;
  }

  .reliability-rank-bar .availability-cell {
    min-width: 0;
    gap: 0;
  }

  .reliability-rank-bar .availability-cell > b {
    display: none;
  }

  .reliability-rank-bar .availability-bar {
    height: 6px;
  }

  .reliability-rank-bar .adherence-bar {
    width: 100%;
    max-width: none;
    height: 6px;
  }

  .reliability-rank-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    color: var(--muted);
    font-size: 10px;
  }

  .reliability-rank-metrics b {
    margin-left: 3px;
    color: var(--ink);
  }

  .sidebar {
    height: 72px;
    padding: 6px 8px max(6px, env(safe-area-inset-bottom));
    border-radius: 0;
    box-shadow: 0 -1px 8px rgba(16, 24, 40, .12);
  }

  .sidebar nav {
    align-items: stretch;
    gap: 2px;
  }

  .sidebar nav button {
    width: auto;
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 4px 1px;
    font-size: 9px;
    line-height: 1.15;
    white-space: nowrap;
  }

  .sidebar nav button span {
    width: auto;
    font-size: 15px;
    line-height: 1;
  }

  header {
    margin-bottom: 14px;
    padding: 17px 0 14px;
  }

  header h1 {
    font-size: 21px;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .period-presets {
    max-width: 100%;
  }

  .preset-btn {
    padding: 6px 8px;
  }

  .kpi {
    border-radius: 7px;
    padding: 13px;
  }

  .kpi strong {
    font-size: 26px;
  }

  .card-top {
    padding: 14px 15px;
  }

  .section-intro h2 {
    font-size: 20px;
  }
}
