:root {
  --blue: #2D0FAF;
  --orange: #EB7A12;
  --white: #FFFFFF;
  --gray: #F4F6F9;
  --text: #1E293B;
  --muted: #64748B;
  --border: #DDE3EC;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--gray);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

.app-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  align-items: start;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(350px, 1fr) auto;
  align-items: center;
  gap: 28px;
  padding: 16px clamp(16px, 3vw, 38px);
  background: linear-gradient(135deg, var(--blue), #1e087e);
  color: var(--white);
  border-bottom: 6px solid var(--orange);
}

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

.logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--white);
  padding: 8px;
}

.logo.missing-logo {
  display: none;
}

.eyebrow {
  margin: 0 0 4px;
  color: #f7c390;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 5px;
  font-size: clamp(1.35rem, 2.3vw, 2rem);
  letter-spacing: 0;
}

.brand span {
  font-size: 1rem;
  opacity: 0.94;
}

.header-status {
  display: grid;
  grid-template-columns: 132px 230px 132px minmax(230px, auto);
  gap: 8px;
  align-items: stretch;
}

.status-card {
  min-width: 0;
  padding: 9px 11px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
}

.status-card strong {
  display: block;
  font-size: 1.05rem;
}

.status-card span {
  font-size: 0.7rem;
  opacity: 0.9;
}

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

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

.weather-grid span {
  display: block;
  padding: 4px 5px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  font-size: 0.64rem;
  line-height: 1.25;
}

.weather-grid b {
  display: block;
  margin-top: 2px;
  color: var(--white);
  font-size: 0.8rem;
}

.weather-grid .humidity-value {
  display: flex;
  align-items: center;
  gap: 5px;
}

.humidity-value em {
  font-style: normal;
}

.humidity-indicator {
  display: inline-block;
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  background: #94A3B8;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.14);
}

.humidity-indicator.ura-ideal { background: #38BDF8; }
.humidity-indicator.ura-aceitavel { background: #22C55E; }
.humidity-indicator.ura-atencao { background: #FACC15; }
.humidity-indicator.ura-alerta { background: #F97316; }
.humidity-indicator.ura-emergencia { background: #EF4444; }

.weather-card small {
  display: block;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.62rem;
}

.status-card.accent {
  background: var(--orange);
}

.user-status {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
}

.user-status strong,
.user-status span {
  display: block;
}

.user-status strong {
  font-size: 0.82rem;
}

.user-status span {
  margin-top: 2px;
  font-size: 0.62rem;
  opacity: 0.85;
}

.header-button {
  margin-left: auto;
  padding: 6px 9px;
  color: var(--white);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.app-shell {
  width: min(1220px, calc(100% - 28px));
  margin: 24px auto 42px;
}

.tabs {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: calc(100vh - 0px);
  padding: 22px 14px;
  background: #FFFFFF;
  border-right: 1px solid var(--border);
  box-shadow: 6px 0 20px rgba(15, 23, 42, 0.06);
}

.sidebar-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 12px;
  color: var(--muted);
  font-size: 0.72rem;
}

.sidebar-title button,
.menu-toggle {
  display: none;
  border: 0;
  cursor: pointer;
}

.tab-button, .btn, .icon-btn {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.tab-button {
  width: 100%;
  padding: 12px 16px;
  color: var(--blue);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}

.tab-button.active {
  color: var(--white);
  background: var(--blue);
  border-color: var(--blue);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-title {
  margin: 18px 0;
}

.section-title h2 {
  margin-bottom: 6px;
  font-size: 1.55rem;
}

.section-title p {
  color: var(--muted);
}

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

.alert-card {
  border-left-color: #DC2626;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.dashboard-backup-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
  padding: 12px 14px;
  color: #0f172a;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-left: 5px solid #16a34a;
  border-radius: 7px;
  box-shadow: var(--shadow);
}

.dashboard-backup-status strong,
.dashboard-backup-status span {
  display: block;
}

.dashboard-backup-status strong {
  color: #166534;
  font-size: 0.9rem;
}

.dashboard-backup-status span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.quick-action {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 12px 14px;
  color: var(--blue);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  text-align: left;
}

.quick-action strong {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--white);
  background: var(--orange);
  border-radius: 8px;
  font-size: 1.15rem;
}

.quick-action.primary-action {
  color: var(--white);
  background: var(--blue);
  border-color: var(--blue);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 16px;
}

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

.executive-title {
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.executive-title span {
  color: var(--orange);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.executive-title strong {
  padding: 10px 14px;
  color: var(--blue);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-size: 0.82rem;
}

.mayor-situation-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  margin-bottom: 18px;
  padding: 28px;
  border-left: 8px solid #16a34a;
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
}

.mayor-situation-card.attention { border-left-color: #facc15; background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%); }
.mayor-situation-card.alert { border-left-color: #f97316; background: linear-gradient(135deg, #ffffff 0%, #fff7ed 100%); }
.mayor-situation-card.emergency { border-left-color: #dc2626; background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%); }

.mayor-situation-card span,
.executive-card span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.mayor-situation-card h3 {
  margin: 8px 0;
  color: #15803d;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1;
}

.mayor-situation-card.attention h3 { color: #a16207; }
.mayor-situation-card.alert h3 { color: #c2410c; }
.mayor-situation-card.emergency h3 { color: #b91c1c; }

.mayor-situation-card p {
  max-width: 980px;
  margin: 0;
  color: var(--text);
  font-size: 1.02rem;
  line-height: 1.55;
}

.mayor-situation-card small {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-weight: 800;
}

.mayor-situation-card > strong {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  color: #fff;
  background: #16a34a;
  border-radius: 50%;
  font-size: 2rem;
  line-height: 1;
}

.mayor-situation-card.attention > strong { background: #facc15; color: #713f12; }
.mayor-situation-card.alert > strong { background: #f97316; }
.mayor-situation-card.emergency > strong { background: #dc2626; }

.executive-card {
  border-top: 4px solid var(--orange);
}

.executive-card strong {
  display: block;
  margin: 12px 0 8px;
  color: var(--blue);
  font-size: 1.35rem;
}

.executive-card p,
.executive-summary p {
  color: var(--muted);
  line-height: 1.55;
}

.executive-summary {
  margin-top: 20px;
}

.executive-weather {
  grid-column: span 1;
}

.executive-weather-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.executive-weather-grid div {
  padding: 10px;
  background: var(--gray);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.executive-weather-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.executive-weather-grid strong {
  margin: 3px 0 0;
  color: var(--text);
  font-size: 0.95rem;
}

.executive-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.executive-statement {
  margin-bottom: 18px;
  border-left: 5px solid var(--blue);
}

.executive-statement h3 {
  margin: 0 0 8px;
  color: var(--blue);
}

.executive-note {
  margin-top: 14px;
  border-left: 5px solid var(--orange);
}

.executive-footer {
  margin: 18px 0 0;
  padding: 16px 18px;
  color: #fff;
  background: var(--blue);
  border-radius: 8px;
  font-weight: 700;
  line-height: 1.45;
}

.executive-monitor-view {
  min-height: calc(100vh - 80px);
  margin: -8px;
  padding: 22px;
  color: #e5edf7;
  background:
    linear-gradient(135deg, rgba(45, 15, 175, 0.18), transparent 36%),
    radial-gradient(circle at top right, rgba(235, 122, 18, 0.16), transparent 32%),
    #071426;
  border-radius: 10px;
}

.executive-monitor-view .panel,
.executive-monitor-view .stat-card {
  color: #e5edf7;
  background: rgba(12, 29, 52, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.25);
}

.executive-monitor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 18px 20px;
  background: rgba(4, 13, 28, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 10px;
}

.executive-monitor-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.executive-monitor-brand img {
  width: 74px;
  height: 74px;
  object-fit: contain;
  background: #fff;
  border: 2px solid rgba(235, 122, 18, 0.9);
  border-radius: 10px;
}

.executive-monitor-brand span,
.executive-monitor-meta em,
.executive-monitor-view .executive-card span,
.executive-monitor-view .mayor-situation-card span {
  color: #fb923c;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.executive-monitor-brand h2 {
  margin: 4px 0;
  color: #fff;
  font-size: clamp(1.55rem, 3vw, 2.45rem);
  line-height: 1;
}

.executive-monitor-brand p,
.executive-monitor-meta span {
  margin: 0;
  color: #bfd0e5;
  font-weight: 700;
}

.executive-monitor-meta {
  display: grid;
  gap: 8px;
  justify-items: end;
  text-align: right;
}

.executive-monitor-meta strong {
  color: #fff;
  font-size: 1rem;
}

.executive-monitor-meta em {
  padding: 7px 10px;
  color: #bbf7d0;
  background: rgba(22, 163, 74, 0.16);
  border: 1px solid rgba(34, 197, 94, 0.38);
  border-radius: 999px;
  font-style: normal;
}

.executive-monitor-view .mayor-situation-card {
  border: 1px solid rgba(34, 197, 94, 0.38);
  border-left: 10px solid #22c55e;
  background: linear-gradient(135deg, rgba(20, 83, 45, 0.72), rgba(12, 29, 52, 0.95));
}

.executive-monitor-view .mayor-situation-card.attention {
  border-color: rgba(250, 204, 21, 0.45);
  border-left-color: #facc15;
  background: linear-gradient(135deg, rgba(113, 63, 18, 0.75), rgba(12, 29, 52, 0.95));
}

.executive-monitor-view .mayor-situation-card.alert {
  border-color: rgba(249, 115, 22, 0.46);
  border-left-color: #f97316;
  background: linear-gradient(135deg, rgba(124, 45, 18, 0.75), rgba(12, 29, 52, 0.95));
}

.executive-monitor-view .mayor-situation-card.emergency {
  border-color: rgba(220, 38, 38, 0.52);
  border-left-color: #ef4444;
  background: linear-gradient(135deg, rgba(127, 29, 29, 0.82), rgba(12, 29, 52, 0.95));
}

.executive-monitor-view .mayor-situation-card h3 {
  color: #bbf7d0;
  text-shadow: 0 0 24px rgba(34, 197, 94, 0.2);
}

.executive-monitor-view .mayor-situation-card.attention h3 { color: #fef08a; }
.executive-monitor-view .mayor-situation-card.alert h3 { color: #fed7aa; }
.executive-monitor-view .mayor-situation-card.emergency h3 { color: #fecaca; }

.executive-monitor-view .mayor-situation-card p,
.executive-monitor-view .mayor-situation-card small,
.executive-monitor-view .executive-card p,
.executive-monitor-view .executive-summary p,
.executive-monitor-view .executive-note p {
  color: #d6e3f3;
}

.executive-monitor-view .mayor-situation-card > strong {
  background: #22c55e;
  box-shadow: 0 0 34px rgba(34, 197, 94, 0.34);
}

.executive-monitor-view .mayor-situation-card.attention > strong { background: #facc15; }
.executive-monitor-view .mayor-situation-card.alert > strong { background: #f97316; }
.executive-monitor-view .mayor-situation-card.emergency > strong { background: #ef4444; }

.executive-monitor-view .executive-card {
  border-top: 4px solid #38bdf8;
}

.executive-monitor-view .executive-card strong,
.executive-monitor-view .stat-card strong,
.executive-monitor-view .panel-header h3 {
  color: #fff;
}

.executive-monitor-view .executive-weather-grid div {
  background: rgba(4, 13, 28, 0.62);
  border-color: rgba(148, 163, 184, 0.22);
}

.executive-monitor-view .executive-weather-grid span,
.executive-monitor-view .stat-card span {
  color: #93a9c4;
}

.executive-monitor-view .executive-weather-grid strong {
  color: #f8fafc;
}

.executive-monitor-view .executive-kpis .stat-card {
  position: relative;
  overflow: hidden;
  min-height: 128px;
  border-top: 4px solid #38bdf8;
}

.executive-monitor-view .executive-kpis .stat-card::after {
  content: "";
  position: absolute;
  right: -26px;
  bottom: -26px;
  width: 86px;
  height: 86px;
  background: rgba(45, 15, 175, 0.28);
  border-radius: 50%;
}

.executive-monitor-view .executive-kpis .stat-card strong {
  font-size: 2.4rem;
}

.executive-monitor-view .executive-statement {
  border-left-color: #38bdf8;
  background: rgba(8, 47, 73, 0.72);
}

.executive-monitor-view .executive-statement h3 {
  color: #bae6fd;
}

.executive-monitor-view .executive-note {
  background: rgba(15, 23, 42, 0.72);
  border-left-color: #fb923c;
}

.executive-monitor-view .executive-footer {
  color: #dbeafe;
  background: rgba(4, 13, 28, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.24);
}

.executive-monitor-view {
  background:
    linear-gradient(120deg, rgba(45, 15, 175, 0.22), transparent 34%),
    radial-gradient(circle at 88% 12%, rgba(235, 122, 18, 0.18), transparent 28%),
    linear-gradient(180deg, #06111f 0%, #0a1628 54%, #071020 100%);
}

.executive-monitor-view::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.65), transparent 72%);
}

.executive-monitor-view > * {
  position: relative;
  z-index: 1;
}

.executive-monitor-header {
  min-height: 104px;
  border-color: rgba(96, 165, 250, 0.25);
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.72)),
    linear-gradient(90deg, rgba(45, 15, 175, 0.2), rgba(235, 122, 18, 0.12));
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.32);
}

.executive-monitor-brand img {
  box-shadow: 0 0 0 4px rgba(235, 122, 18, 0.12), 0 18px 36px rgba(0, 0, 0, 0.26);
}

.executive-monitor-meta em {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.executive-monitor-meta em i {
  width: 10px;
  height: 10px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: executivePulse 1.8s infinite;
}

.executive-monitor-view .mayor-situation-card {
  min-height: 260px;
  padding: clamp(24px, 4vw, 42px);
  border-radius: 14px;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.34);
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.executive-monitor-view .mayor-situation-card h3 {
  margin: 12px 0;
  font-size: clamp(3rem, 7vw, 6.3rem);
  letter-spacing: 0;
}

.executive-monitor-view .mayor-situation-card p {
  max-width: 1060px;
  font-size: clamp(1rem, 1.5vw, 1.22rem);
}

.executive-monitor-view .mayor-situation-card > strong {
  position: relative;
  width: clamp(76px, 9vw, 118px);
  height: clamp(76px, 9vw, 118px);
  font-size: 0;
  border: 2px solid rgba(255, 255, 255, 0.35);
}

.executive-monitor-view .mayor-situation-card > strong::before {
  content: "✓";
  font-size: clamp(2rem, 4vw, 3.6rem);
  font-weight: 900;
}

.executive-monitor-view .mayor-situation-card.attention > strong::before,
.executive-monitor-view .mayor-situation-card.alert > strong::before,
.executive-monitor-view .mayor-situation-card.emergency > strong::before {
  content: "!";
}

.executive-monitor-view .mayor-situation-card > strong::after {
  content: "";
  position: absolute;
  inset: -9px;
  border: 2px solid currentColor;
  border-radius: inherit;
  opacity: 0.26;
  animation: executiveStatusPulse 2.2s infinite;
}

.executive-monitor-view .executive-grid {
  grid-template-columns: minmax(0, 1.55fr) minmax(240px, 0.85fr) minmax(240px, 0.75fr);
  align-items: stretch;
}

.executive-monitor-view .executive-card {
  min-height: 180px;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(15, 38, 68, 0.96), rgba(7, 20, 38, 0.96));
}

.executive-monitor-view .executive-card strong {
  font-size: clamp(1.25rem, 2vw, 1.85rem);
}

.executive-monitor-view .executive-weather-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.executive-monitor-view .executive-weather-grid div {
  position: relative;
  min-height: 88px;
  padding: 14px 12px 12px 46px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.82), rgba(15, 23, 42, 0.54));
}

.executive-monitor-view .executive-weather-grid div::before {
  position: absolute;
  top: 14px;
  left: 14px;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: #fb923c;
  background: rgba(251, 146, 60, 0.13);
  border: 1px solid rgba(251, 146, 60, 0.24);
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 900;
}

.executive-monitor-view .executive-weather-grid div:nth-child(1)::before { content: "M"; }
.executive-monitor-view .executive-weather-grid div:nth-child(2)::before { content: "T"; }
.executive-monitor-view .executive-weather-grid div:nth-child(3)::before { content: "S"; }
.executive-monitor-view .executive-weather-grid div:nth-child(4)::before { content: "U"; }
.executive-monitor-view .executive-weather-grid div:nth-child(5)::before { content: "V"; }
.executive-monitor-view .executive-weather-grid div:nth-child(6)::before { content: "C"; }
.executive-monitor-view .executive-weather-grid div:nth-child(7)::before { content: "%"; }
.executive-monitor-view .executive-weather-grid div:nth-child(8)::before { content: "H"; }

.executive-monitor-view .executive-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.executive-monitor-view .executive-kpis .stat-card {
  padding: 22px 22px 18px;
  border-radius: 12px;
}

.executive-monitor-view .executive-kpis .stat-card::before {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  margin-bottom: 18px;
  color: #fff;
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 900;
}

.executive-monitor-view .executive-kpis .stat-card:nth-child(1)::before { content: "#"; }
.executive-monitor-view .executive-kpis .stat-card:nth-child(2)::before { content: "!"; background: rgba(248, 113, 113, 0.16); border-color: rgba(248, 113, 113, 0.3); }
.executive-monitor-view .executive-kpis .stat-card:nth-child(3)::before { content: "M"; background: rgba(251, 146, 60, 0.16); border-color: rgba(251, 146, 60, 0.3); }
.executive-monitor-view .executive-kpis .stat-card:nth-child(4)::before { content: "A"; background: rgba(34, 197, 94, 0.16); border-color: rgba(34, 197, 94, 0.3); }

.executive-monitor-view .executive-summary {
  border-left: 5px solid #22c55e;
  background: linear-gradient(135deg, rgba(20, 83, 45, 0.26), rgba(15, 23, 42, 0.88));
}

.executive-monitor-view .executive-summary .panel-header h3::before {
  content: "✓ ";
  color: #22c55e;
}

.executive-monitor-view .executive-summary p {
  position: relative;
  padding-left: 30px;
  font-size: 1.02rem;
}

.executive-monitor-view .executive-summary p::before {
  content: "✓";
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: #052e16;
  background: #22c55e;
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 900;
}

.executive-monitor-view .executive-note {
  padding: 14px 16px;
  opacity: 0.78;
}

.executive-monitor-view .executive-note p {
  margin: 0;
  font-size: 0.82rem;
}

@keyframes executivePulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.62); }
  70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

@keyframes executiveStatusPulse {
  0% { transform: scale(0.92); opacity: 0.32; }
  70% { transform: scale(1.18); opacity: 0; }
  100% { transform: scale(0.92); opacity: 0; }
}

.executive-monitor-view,
.executive-monitor-view * {
  min-width: 0;
}

.executive-monitor-view .mayor-situation-card {
  min-height: 210px;
  padding: clamp(22px, 3vw, 34px);
  grid-template-columns: minmax(0, 1fr) auto;
}

.executive-monitor-view .mayor-situation-card h3 {
  font-size: clamp(3rem, 6.2vw, 5.25rem);
  overflow-wrap: anywhere;
}

.executive-monitor-view .mayor-situation-card p {
  max-width: 920px;
  font-size: clamp(0.9rem, 1.2vw, 1.04rem);
}

.executive-monitor-view .mayor-situation-card small {
  max-width: 900px;
  font-size: 0.78rem;
  line-height: 1.35;
}

.executive-monitor-view .mayor-situation-card > strong {
  width: clamp(64px, 7vw, 96px);
  height: clamp(64px, 7vw, 96px);
}

.executive-monitor-view .executive-grid {
  grid-template-columns: minmax(360px, 1.3fr) minmax(220px, 0.72fr) minmax(210px, 0.62fr);
}

.executive-monitor-view .executive-card {
  min-height: 168px;
}

.executive-monitor-view .executive-card strong {
  font-size: clamp(1.15rem, 1.55vw, 1.55rem);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.executive-monitor-view .executive-card p {
  font-size: 0.82rem;
  line-height: 1.45;
}

.executive-monitor-view .executive-card span {
  font-size: 0.68rem;
  line-height: 1.25;
}

.executive-monitor-view .executive-weather-grid {
  grid-template-columns: repeat(4, minmax(72px, 1fr));
  gap: 8px;
}

.executive-monitor-view .executive-weather-grid div {
  min-height: 78px;
  padding: 11px 8px 10px 38px;
}

.executive-monitor-view .executive-weather-grid div::before {
  top: 11px;
  left: 10px;
  width: 22px;
  height: 22px;
  font-size: 0.78rem;
}

.executive-monitor-view .executive-weather-grid span {
  font-size: 0.58rem;
  line-height: 1.1;
}

.executive-monitor-view .executive-weather-grid strong {
  font-size: clamp(0.9rem, 1.7vw, 1.28rem);
  line-height: 1.14;
  overflow-wrap: anywhere;
}

.executive-monitor-view .executive-kpis {
  gap: 12px;
}

.executive-monitor-view .executive-kpis .stat-card {
  min-height: 108px;
  padding: 15px 16px 14px;
}

.executive-monitor-view .executive-kpis .stat-card::before {
  width: 30px;
  height: 30px;
  margin-bottom: 12px;
  font-size: 0.82rem;
}

.executive-monitor-view .executive-kpis .stat-card strong {
  font-size: clamp(1.8rem, 3vw, 2.25rem);
  line-height: 1;
}

.executive-monitor-view .executive-kpis .stat-card span {
  font-size: 0.72rem;
  line-height: 1.25;
}

.executive-monitor-view .executive-summary {
  margin-top: 14px;
}

.executive-monitor-view .executive-summary .panel-header {
  align-items: center;
}

.executive-monitor-view .executive-summary p {
  font-size: 0.88rem;
  line-height: 1.55;
}

.executive-monitor-view .executive-note {
  padding: 10px 12px;
}

.executive-monitor-view .executive-note p {
  font-size: 0.68rem;
  line-height: 1.45;
}

.executive-monitor-view .executive-footer {
  padding: 12px 14px;
  font-size: 0.78rem;
  line-height: 1.45;
}

@media (max-width: 1280px) {
  .executive-monitor-view .executive-grid {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.68fr);
  }

  .executive-monitor-view .executive-card:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  .executive-monitor-view .executive-grid,
  .executive-monitor-view .executive-kpis {
    grid-template-columns: 1fr;
  }

  .executive-monitor-view .executive-weather-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.executive-monitor-view .executive-grid {
  grid-template-columns: 1fr;
}

.executive-monitor-view .executive-weather {
  grid-column: 1 / -1;
  min-height: auto;
}

.executive-weather-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.executive-weather-meta {
  display: grid;
  gap: 4px;
  justify-items: end;
  text-align: right;
}

.executive-monitor-view .executive-weather-meta small {
  color: #cbd5e1;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.25;
}

.executive-monitor-view .executive-weather-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.executive-monitor-view .executive-kpis {
  grid-template-columns: minmax(260px, 1.35fr) repeat(4, minmax(120px, 1fr));
  align-items: stretch;
}

.executive-monitor-view .executive-operational-summary {
  min-height: 108px;
  border-top: 4px solid #38bdf8;
}

.executive-monitor-view .executive-operational-summary strong {
  font-size: clamp(1.15rem, 1.45vw, 1.5rem);
}

.executive-monitor-view .executive-operational-summary p {
  font-size: 0.78rem;
}

@media (max-width: 1280px) {
  .executive-monitor-view .executive-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .executive-monitor-view .executive-operational-summary {
    grid-column: 1 / -1;
  }

  .executive-monitor-view .executive-weather-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .executive-weather-head {
    flex-direction: column;
  }

  .executive-weather-meta {
    justify-items: start;
    text-align: left;
  }

  .executive-monitor-view .executive-kpis,
  .executive-monitor-view .executive-weather-grid {
    grid-template-columns: 1fr;
  }
}

.executive-monitor-view .executive-kpis {
  display: grid;
  grid-template-columns: minmax(220px, 1.18fr) repeat(4, minmax(132px, 1fr));
  gap: 12px;
  align-items: stretch;
}

.executive-monitor-view .executive-kpi-card {
  position: relative;
  display: grid;
  grid-template-rows: 34px 32px 1fr 30px;
  min-height: 170px;
  padding: 16px;
  overflow: hidden;
  color: #e5edf7;
  background:
    linear-gradient(180deg, rgba(15, 38, 68, 0.96), rgba(7, 20, 38, 0.96));
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-top: 4px solid #38bdf8;
  border-radius: 12px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.25);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.executive-monitor-view .executive-kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.48);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.32);
}

.executive-monitor-view .executive-kpi-card::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -28px;
  width: 90px;
  height: 90px;
  background: rgba(45, 15, 175, 0.25);
  border-radius: 50%;
}

.executive-monitor-view .executive-kpi-card:nth-child(1) { border-top-color: #fb923c; }
.executive-monitor-view .executive-kpi-card:nth-child(2) { border-top-color: #38bdf8; }
.executive-monitor-view .executive-kpi-card:nth-child(3) { border-top-color: #f87171; }
.executive-monitor-view .executive-kpi-card:nth-child(4) { border-top-color: #fb923c; }
.executive-monitor-view .executive-kpi-card:nth-child(5) { border-top-color: #22c55e; }

.executive-monitor-view .kpi-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #fff;
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 9px;
  font-size: 0.92rem;
  font-weight: 900;
}

.executive-monitor-view .executive-kpi-card:nth-child(1) .kpi-icon { background: rgba(251, 146, 60, 0.16); border-color: rgba(251, 146, 60, 0.3); }
.executive-monitor-view .executive-kpi-card:nth-child(3) .kpi-icon { background: rgba(248, 113, 113, 0.16); border-color: rgba(248, 113, 113, 0.3); }
.executive-monitor-view .executive-kpi-card:nth-child(5) .kpi-icon { background: rgba(34, 197, 94, 0.16); border-color: rgba(34, 197, 94, 0.3); }

.executive-monitor-view .kpi-title {
  align-self: start;
  color: #aebed4;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.18;
  text-transform: uppercase;
}

.executive-monitor-view .executive-kpi-card > strong {
  align-self: center;
  color: #fff;
  font-size: clamp(1.9rem, 3vw, 2.45rem);
  font-weight: 900;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.executive-monitor-view .executive-kpi-card > p {
  align-self: end;
  margin: 0;
  color: #cbd5e1;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
}

.executive-monitor-view .executive-operational-summary > strong {
  font-size: clamp(1.2rem, 1.65vw, 1.55rem);
}

.executive-monitor-view .executive-operational-summary > p {
  font-size: 0.7rem;
}

.executive-monitor-view .executive-type-panel {
  padding: 16px;
  color: #e5edf7;
  background:
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(15, 38, 68, 0.98), rgba(7, 20, 38, 0.98));
  border-color: rgba(56, 189, 248, 0.22);
}

.executive-type-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.executive-type-head span {
  display: block;
  color: #fb923c;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.executive-type-head h3 {
  margin: 2px 0 0;
  color: #fff;
  font-size: 1rem;
}

.executive-type-head strong {
  max-width: 340px;
  padding: 7px 10px;
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.28);
  border-radius: 999px;
  font-size: 0.72rem;
  line-height: 1.25;
  text-align: right;
}

.executive-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 10px;
}

.executive-type-item {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  min-height: 62px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  overflow: hidden;
  background: rgba(2, 13, 29, 0.46);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
}

.executive-type-item::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: #38bdf8;
  content: "";
}

.executive-type-item.empty {
  opacity: 0.6;
}

.executive-type-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #fff;
  background: rgba(45, 15, 175, 0.88);
  border: 1px solid rgba(129, 140, 248, 0.42);
  border-radius: 9px;
  font-size: 1rem;
  font-weight: 900;
}

.executive-type-item strong {
  color: #e5edf7;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.executive-type-item em {
  color: #fb923c;
  font-size: 1.35rem;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
}

@media (max-width: 1280px) {
  .executive-monitor-view .executive-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .executive-monitor-view .executive-kpis {
    grid-template-columns: 1fr;
  }

  .executive-type-head {
    align-items: stretch;
    flex-direction: column;
  }

  .executive-type-head strong {
    max-width: none;
    text-align: left;
  }

  .executive-type-grid {
    grid-template-columns: 1fr;
  }
}

.monthly-chart {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  min-height: 220px;
  align-items: end;
  padding-top: 15px;
}

.chart-column {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 7px;
  height: 190px;
  align-items: end;
  text-align: center;
}

.chart-bar {
  position: relative;
  width: min(54px, 80%);
  min-height: 8px;
  margin: 0 auto;
  background: var(--blue);
  border-top: 5px solid var(--orange);
  border-radius: 6px 6px 0 0;
}

.chart-bar strong {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text);
  font-size: 0.78rem;
}

.chart-column span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.operational-list {
  display: grid;
  gap: 8px;
}

.pending-list,
.neighborhood-map {
  display: grid;
  gap: 8px;
}

.pending-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 9px;
  width: 100%;
  padding: 10px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 7px;
  color: #172033;
  cursor: pointer;
  text-align: left;
}

.pending-item strong {
  color: var(--orange);
  font-size: 0.86rem;
}

.pending-item span {
  font-weight: 800;
}

.pending-item small {
  grid-column: 1 / -1;
  color: #9a3412;
  font-weight: 700;
}

.neighborhood-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(120px, 2fr) auto;
  gap: 10px;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 800;
}

.neighborhood-row div {
  height: 10px;
  overflow: hidden;
  background: #E2E8F0;
  border-radius: 999px;
}

.neighborhood-row i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--orange));
  border-radius: inherit;
}

.neighborhood-row strong {
  color: var(--blue);
}

.operational-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.operational-item > strong {
  color: var(--blue);
}

.operational-item span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
}

.row-actions {
  display: flex;
  gap: 5px;
}

.row-action {
  width: 34px;
  height: 34px;
  color: var(--blue);
  background: #EEF2FF;
  border: 1px solid #C7D2FE;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
}

.toast-container {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1000;
  display: grid;
  gap: 8px;
  width: min(380px, calc(100% - 36px));
}

.toast {
  padding: 13px 15px;
  color: var(--white);
  background: #166534;
  border-left: 6px solid #4ADE80;
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-size: 0.88rem;
  font-weight: 700;
}

.toast.error {
  background: #991B1B;
  border-left-color: #F87171;
}

.menu-backdrop {
  display: none;
}

.metric-card, .panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 22px;
  border-left: 6px solid var(--orange);
}

.metric-card span {
  color: var(--muted);
  font-weight: 700;
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  color: var(--blue);
  font-size: 2.5rem;
}

.panel {
  padding: 20px;
  margin-bottom: 18px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.type-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.type-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.type-chip-label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.type-icon {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--white);
  background: var(--blue);
  border: 3px solid #E2E8F0;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 900;
}

.type-chip strong {
  flex: 0 0 auto;
  color: var(--orange);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

label, fieldset {
  color: var(--text);
  font-weight: 700;
}

input, select, textarea {
  width: 100%;
  margin-top: 7px;
  padding: 12px;
  color: var(--text);
  background: var(--white);
  border: 1px solid #C9D3E1;
  border-radius: 8px;
  font: inherit;
}

input[type="text"],
input[type="search"],
input[type="tel"],
textarea {
  text-transform: uppercase;
}

textarea {
  resize: vertical;
}

input:focus, select:focus, textarea:focus {
  outline: 3px solid rgba(45, 15, 175, 0.16);
  border-color: var(--blue);
}

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

.address-field {
  grid-column: span 2;
}

.checkbox-field, .source-field, .team-field {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px 18px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.source-field {
  grid-column: span 2;
}

.checkbox-field legend, .source-field legend, .team-field legend {
  padding: 0 8px;
}

.checkbox-field label, .source-field label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
}

.checkbox-field input, .source-field input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--blue);
}

.team-field {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
}

.team-field label {
  position: relative;
  display: block;
  cursor: pointer;
}

.team-field input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.team-field span {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  color: var(--blue);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-weight: 800;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.team-field input:checked + span {
  color: var(--white);
  background: var(--blue);
  border-color: var(--blue);
}

.team-field input:focus-visible + span {
  outline: 3px solid rgba(45, 15, 175, 0.16);
  outline-offset: 2px;
}

.photo-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 10px;
}

.photo-field {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.photo-capture-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 10px;
}

.photo-capture-button {
  display: grid;
  min-height: 54px;
  place-items: center;
  color: var(--blue);
  background: #EEF2FF;
  border: 2px dashed #A5B4FC;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 900;
  cursor: pointer;
}

.photo-capture-button.selected {
  color: #166534;
  background: #DCFCE7;
  border-color: #22C55E;
  border-style: solid;
}

.photo-capture-button input {
  display: none;
}

.photo-preview-item {
  position: relative;
  min-width: 0;
}

.photo-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--white);
  background: #B91C1C;
  border-radius: 50%;
  font-size: 1rem;
  font-weight: 900;
}

.photo-count {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.photo-count.valid {
  color: #15803D;
}

.photo-count.invalid {
  color: #B91C1C;
}

.photo-preview img, .modal-photos img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

@media (max-width: 700px) {
  .photo-capture-grid,
  .photo-preview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.form-actions, .button-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  min-height: 44px;
  padding: 11px 16px;
  border-radius: 8px;
  font-weight: 800;
}

.btn.primary {
  color: var(--white);
  background: var(--blue);
}

.btn.secondary {
  color: var(--blue);
  background: #EEF2FF;
  border: 1px solid #C7D2FE;
}

.btn.warning {
  color: #713F12;
  background: #FEF3C7;
  border: 1px solid #FCD34D;
}

.btn.danger {
  color: var(--white);
  background: #B91C1C;
}

.edit-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 14px 16px;
  color: #713F12;
  background: #FFFBEB;
  border: 1px solid #FCD34D;
  border-left: 6px solid var(--orange);
  border-radius: 8px;
}

.edit-notice[hidden] {
  display: none;
}

.edit-notice strong,
.edit-notice span {
  display: block;
}

.edit-notice span {
  margin-top: 4px;
  font-size: 0.85rem;
}

.backup-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-width: 0;
  border-left: 6px solid var(--orange);
}

.pendrive-panel {
  min-width: 0;
  border-left-color: #15803D;
}

.cloud-panel {
  display: grid;
  grid-template-columns: minmax(250px, 0.9fr) minmax(360px, 1.25fr);
  gap: 18px;
  border-left: 6px solid #0284C7;
}

.cloud-icon {
  background: #0284C7;
}

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

.cloud-config label {
  min-width: 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.cloud-config label:first-child {
  grid-column: 1 / -1;
}

.cloud-config input:not([type="checkbox"]) {
  width: 100%;
  margin-top: 5px;
}

.cloud-auto-option {
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: end;
  min-height: 44px;
}

.cloud-auto-option input {
  width: 18px;
  height: 18px;
}

.cloud-actions {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, minmax(145px, 1fr));
  gap: 8px;
}

.cloud-actions .btn {
  min-height: 40px;
  padding: 8px 10px;
  font-size: 0.78rem;
  line-height: 1.15;
  white-space: normal;
}

.pendrive-panel .backup-info {
  min-width: 220px;
  flex: 1 1 320px;
}

.pendrive-panel .backup-info > div:last-child {
  min-width: 0;
}

.pendrive-panel .backup-actions {
  display: grid;
  flex: 0 1 470px;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 8px;
}

.pendrive-panel .backup-actions .btn {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  font-size: 0.78rem;
  line-height: 1.15;
  white-space: normal;
}

.pendrive-icon {
  background: #15803D;
  font-size: 0.78rem;
}

.user-management {
  display: grid;
  gap: 18px;
  border-left: 6px solid var(--blue);
}

.security-icon {
  background: var(--orange);
}

.user-form {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.user-form input,
.user-form select {
  margin-top: 0;
}

.user-list-wrap {
  overflow-x: auto;
}

.user-table {
  min-width: 720px;
}

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

.user-actions .btn {
  min-height: 34px;
  padding: 6px 9px;
  font-size: 0.78rem;
}

.auth-modal {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: auto;
}

.auth-modal::backdrop {
  background: #041326;
}

.auth-screen[open] {
  display: grid;
  place-items: center;
  background:
    linear-gradient(90deg, rgba(2, 13, 31, 0.32), rgba(2, 13, 31, 0.05)),
    url("../img/login-background.png") center / cover no-repeat;
}

.auth-panel {
  width: min(420px, calc(100% - 36px));
  margin: 24px auto;
  padding: 28px;
  color: var(--white);
  background: rgba(4, 20, 43, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-top: 7px solid var(--orange);
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(8px);
}

.setup-panel {
  width: min(470px, calc(100% - 36px));
  margin: 24px auto;
}

.auth-panel > img {
  display: block;
  width: 92px;
  height: 92px;
  margin: 0 auto 16px;
  object-fit: contain;
}

.auth-panel h2,
.auth-panel > p {
  text-align: center;
}

.auth-panel h2 {
  margin-bottom: 7px;
}

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

.auth-panel label {
  color: var(--white);
}

.auth-panel input {
  color: var(--text);
}

.auth-form {
  display: grid;
  gap: 13px;
  margin-top: 20px;
}

.cloud-recovery-button {
  width: 100%;
  margin-top: 12px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.38);
}

.cloud-recovery-modal {
  width: min(580px, calc(100% - 24px));
}

.cloud-recovery-form {
  display: grid;
  gap: 12px;
}

.cloud-recovery-form label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.cloud-recovery-form input {
  width: 100%;
  margin-top: 5px;
}

.auth-form input {
  margin-top: 6px;
}

.auth-error {
  min-height: 18px;
  margin: 0;
  color: #B91C1C;
  font-size: 0.85rem;
  font-weight: 700;
  text-align: left !important;
}

.auth-footer {
  display: block;
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.7rem;
  font-weight: 800;
  text-align: center;
}

.auth-footer small {
  display: block;
  margin-top: 5px;
  color: #FFFFFF;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-entry {
  padding: 9px 10px;
  background: var(--white);
  border-left: 4px solid var(--orange);
  font-size: 0.85rem;
}

.history-entry strong {
  display: block;
  margin-bottom: 3px;
}

.badge.open {
  color: #991B1B;
  background: #FEE2E2;
}

.badge.progress {
  color: #854D0E;
  background: #FEF9C3;
}

.badge.done {
  color: #166534;
  background: #DCFCE7;
}

.backup-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.backup-icon {
  display: grid;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  place-items: center;
  color: var(--white);
  background: var(--blue);
  border-radius: 8px;
  font-size: 1.7rem;
  font-weight: 900;
}

.backup-info h3,
.backup-info p {
  margin-bottom: 4px;
}

.backup-info p,
.backup-info span {
  color: var(--muted);
  font-size: 0.85rem;
}

.backup-info small {
  display: block;
  margin-top: 5px;
  color: #0369A1;
  font-size: 0.78rem;
  font-weight: 800;
}

.backup-info span {
  font-weight: 700;
}

.backup-actions {
  display: flex;
  flex: 0 1 auto;
  max-width: 100%;
  gap: 10px;
  flex-wrap: wrap;
}

.cloud-users-diagnostic {
  border: 1px solid #d8e0ee;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
}

.cloud-users-diagnostic:empty {
  display: none;
}

.cloud-users-diagnostic strong,
.cloud-users-diagnostic b {
  color: var(--blue);
}

.cloud-users-diagnostic span,
.cloud-users-diagnostic li,
.cloud-users-diagnostic p {
  color: var(--muted);
  font-size: .9rem;
}

.cloud-official-scope {
  margin-top: 8px;
  font-size: 0.78rem !important;
  font-weight: 800;
  overflow-wrap: anywhere;
}

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

.cloud-users-columns ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.diagnostic-warning {
  background: #fff7ed;
  border-left: 4px solid var(--orange);
  border-radius: 6px;
  margin: 0;
  padding: 10px;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.report-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.report-summary-grid article {
  min-width: 0;
  padding: 13px;
  background: var(--white);
  border: 1px solid var(--border);
  border-top: 4px solid var(--orange);
  border-radius: 7px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.report-summary-grid span,
.report-summary-grid strong {
  display: block;
}

.report-summary-grid span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.report-summary-grid strong {
  margin-top: 4px;
  color: var(--navy);
  font-size: 1.65rem;
}

.filters-grid .button-row {
  grid-column: span 2;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th, td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--blue);
  background: #F8FAFC;
  font-size: 0.85rem;
  text-transform: uppercase;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: #FFF7ED;
}

.badge {
  display: inline-block;
  padding: 6px 10px;
  color: #7C2D12;
  background: #FFEDD5;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.78rem;
}

.empty-state {
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.modal {
  width: min(920px, calc(100% - 24px));
  max-height: 88vh;
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.modal::backdrop {
  background: rgba(15, 23, 42, 0.6);
}

.modal-header, .modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  background: var(--blue);
  color: var(--white);
}

.modal-actions {
  justify-content: flex-end;
  background: #F8FAFC;
}

.icon-btn {
  width: 38px;
  height: 38px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  font-size: 1.6rem;
}

.modal-content {
  padding: 20px;
  overflow: auto;
}

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

.detail-item {
  padding: 12px;
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.detail-item.full {
  grid-column: 1 / -1;
}

.detail-item span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.modal-photos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.success-modal {
  width: min(560px, calc(100% - 24px));
  overflow: hidden;
  text-align: center;
}

.success-mark {
  display: grid;
  width: 62px;
  height: 62px;
  margin: 24px auto 0;
  place-items: center;
  color: var(--white);
  background: #15803D;
  border-radius: 50%;
  font-size: 2rem;
  font-weight: 900;
}

.success-content {
  padding: 18px 24px 22px;
}

.success-content h2 {
  margin-bottom: 8px;
  color: var(--blue);
}

.backup-progress-modal {
  width: min(470px, calc(100% - 24px));
  padding: 28px;
  overflow: hidden;
  text-align: center;
}

.backup-progress-modal .success-content {
  padding-bottom: 4px;
}

.backup-spinner {
  width: 54px;
  height: 54px;
  margin: 4px auto 0;
  border: 6px solid #E2E8F0;
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: backup-spin 800ms linear infinite;
}

.backup-progress-track {
  height: 8px;
  margin-top: 18px;
  overflow: hidden;
  background: #E2E8F0;
  border-radius: 8px;
}

.backup-progress-track span {
  display: block;
  width: 15%;
  height: 100%;
  background: var(--blue);
  border-radius: inherit;
  transition: width 350ms ease;
}

.install-modal {
  max-width: 430px;
}

.install-app-content {
  padding: 28px 28px 10px;
  text-align: center;
}

.install-app-content img {
  width: 92px;
  height: 92px;
  margin-bottom: 14px;
  border-radius: 22px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.18);
}

.install-app-content h2 {
  margin: 6px 0 10px;
  color: var(--navy);
  font-size: 1.35rem;
}

.install-app-content p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.5;
}

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

.success-content p {
  color: var(--muted);
}

.filename-box {
  padding: 12px;
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: left;
}

.filename-box span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.filename-box strong {
  color: var(--text);
  overflow-wrap: anywhere;
}

.mobile-bottom-nav {
  display: none;
}

@media (max-width: 1400px) {
  .topbar {
    grid-template-columns: minmax(320px, 1fr) minmax(560px, auto);
    align-items: start;
  }

  .header-status {
    grid-template-columns: 120px minmax(220px, 1fr) 120px;
  }

  .user-status {
    grid-column: 1 / -1;
  }
}

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

  .menu-toggle {
    display: none;
  }

  .tabs {
    position: fixed;
    z-index: 1003;
    inset: 0 auto 0 0;
    width: min(290px, 86vw);
    transform: translateX(-105%);
    transition: transform 180ms ease;
    pointer-events: auto;
    touch-action: manipulation;
  }

  .tabs.open {
    transform: translateX(0);
  }

  .sidebar-title button {
    display: block;
    width: 34px;
    height: 34px;
    background: #EEF2FF;
    border-radius: 8px;
    color: var(--blue);
    font-size: 1.3rem;
  }

  .menu-backdrop.open {
    position: fixed;
    z-index: 1001;
    inset: 0;
    display: block;
    background: rgba(15, 23, 42, 0.56);
  }

  .tabs .tab-button {
    position: relative;
    z-index: 1004;
    touch-action: manipulation;
  }

  .mobile-bottom-nav {
    position: fixed;
    right: 10px;
    bottom: 10px;
    left: 10px;
    z-index: 1100;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(56px, 1fr));
    gap: 6px;
    padding: 7px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.24);
  }

  .mobile-bottom-nav button {
    display: grid;
    min-width: 0;
    min-height: 50px;
    place-items: center;
    gap: 2px;
    color: var(--blue);
    background: #f8fafc;
    border: 1px solid #dbe3ef;
    border-radius: 7px;
    font-size: 1rem;
    font-weight: 900;
    touch-action: manipulation;
  }

  .mobile-bottom-nav button span {
    max-width: 100%;
    overflow: hidden;
    font-size: 0.62rem;
    line-height: 1;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
  }

  .mobile-bottom-nav button.active {
    color: var(--white);
    background: var(--blue);
    border-color: var(--blue);
  }

  .app-shell {
    padding-bottom: 92px;
  }

  .topbar {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
  }

  .brand {
    align-items: flex-start;
  }

  .header-status {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.executive-panel-active .header-status {
    grid-template-columns: 1fr;
  }

  body.executive-panel-active .header-status .status-card {
    display: none;
  }

  body.executive-panel-active .header-status .user-status {
    grid-column: auto;
    width: 100%;
  }

  .pendrive-panel .backup-actions {
    width: 100%;
    flex-basis: auto;
  }

  .cloud-panel {
    grid-template-columns: 1fr;
  }

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

  .auth-screen[open] {
    background-position: 58% center;
  }

  .auth-panel,
  .setup-panel {
    margin: 24px auto;
  }

  .cards-grid, .form-grid, .dashboard-grid, .executive-grid, .executive-kpis {
    grid-template-columns: 1fr;
  }

  .mayor-situation-card {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .mayor-situation-card > strong {
    width: 54px;
    height: 54px;
    font-size: 1.5rem;
  }

  .executive-title {
    align-items: flex-start;
  }

  .executive-weather-grid {
    grid-template-columns: 1fr;
  }

  .executive-monitor-view {
    margin: -12px;
    padding: 14px;
    border-radius: 0;
  }

  .executive-monitor-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .executive-monitor-meta {
    justify-items: start;
    text-align: left;
  }

  .executive-monitor-brand img {
    width: 58px;
    height: 58px;
  }

  .quick-actions {
    grid-template-columns: 1fr;
  }

  .source-field {
    grid-column: 1 / -1;
  }

  .team-field {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

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

  .filters-grid .button-row {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .team-field {
    grid-template-columns: 1fr;
  }

  .app-shell {
    width: min(100% - 18px, 1220px);
    margin-top: 14px;
  }

  .topbar {
    padding: 18px 14px;
  }

  .brand {
    gap: 12px;
  }

  .logo {
    width: 64px;
    height: 64px;
  }

  .header-status, .status-card, .btn {
    width: 100%;
  }

  .header-status {
    grid-template-columns: 1fr;
  }

  .pendrive-panel .backup-actions {
    grid-template-columns: 1fr;
  }

  .cloud-config,
  .cloud-actions {
    grid-template-columns: 1fr;
  }

  .cloud-config label:first-child {
    grid-column: auto;
  }

  .user-status {
    width: 100%;
  }

  .weather-grid {
    grid-template-columns: repeat(2, minmax(72px, 1fr));
  }

  .filters-grid, .detail-grid {
    grid-template-columns: 1fr;
  }

  .form-actions, .button-row {
    flex-direction: column;
  }

  .edit-notice {
    align-items: stretch;
    flex-direction: column;
  }

  .backup-panel,
  .backup-info,
  .backup-actions,
  .user-management,
  .user-form {
    align-items: stretch;
    flex-direction: column;
  }

  .user-management,
  .user-form {
    display: flex;
  }
}

.operational-alerts-panel {
  margin-bottom: 20px;
}

.dashboard-weather-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding: 14px 16px;
  background: #ecfdf5;
  border: 1px solid #86efac;
  border-left: 7px solid #16a34a;
  border-radius: 8px;
}

.dashboard-weather-alert.attention { background: #fffbeb; border-color: #facc15; }
.dashboard-weather-alert.alert { background: #fff7ed; border-color: #f97316; }
.dashboard-weather-alert.emergency { background: #fef2f2; border-color: #dc2626; }
.dashboard-weather-alert span { color: var(--muted); font-size: 11px; font-weight: 800; }
.dashboard-weather-alert strong { display: block; margin-top: 2px; font-size: 17px; }
.dashboard-weather-alert p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }

.alert-conditions-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(90px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.alert-conditions-grid > div {
  padding: 10px;
  background: var(--white);
  border: 1px solid var(--border);
  border-top: 4px solid var(--orange);
  border-radius: 7px;
}

.alert-conditions-grid span,
.alert-conditions-grid strong {
  display: block;
}

.alert-conditions-grid span { color: var(--muted); font-size: 10px; }
.alert-conditions-grid strong { margin-top: 3px; color: var(--blue); font-size: 15px; }

.weather-alerts-list,
.forecast-alert-grid {
  display: grid;
  gap: 10px;
}

.weather-alert-card {
  padding: 14px;
  background: #fffbeb;
  border: 1px solid #facc15;
  border-left: 7px solid #eab308;
  border-radius: 8px;
}

.weather-alert-card.alert { background: #fff7ed; border-color: #f97316; }
.weather-alert-card.emergency { background: #fef2f2; border-color: #dc2626; }

.weather-alert-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.weather-alert-heading span { color: var(--muted); font-size: 10px; font-weight: 800; }
.weather-alert-heading h3 { margin: 3px 0 0; font-size: 16px; }
.weather-alert-card > p { margin: 7px 0 10px; color: var(--muted); font-size: 12px; }

.checklist-status {
  align-self: flex-start;
  padding: 6px 9px;
  color: #475569;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(100, 116, 139, 0.3);
  border-radius: 6px;
  font-size: 9px;
  white-space: nowrap;
}

.checklist-status.completed {
  color: #166534;
  background: #dcfce7;
  border-color: #86efac;
}

.checklist-progress {
  height: 5px;
  margin-bottom: 9px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.25);
  border-radius: 5px;
}

.checklist-progress span {
  display: block;
  height: 100%;
  background: #16a34a;
  border-radius: inherit;
  transition: width 180ms ease;
}

.alert-checklist {
  display: grid;
  gap: 6px;
}

.alert-checklist label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 9px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(100,116,139,.25);
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}

.alert-checklist label.completed {
  background: #f0fdf4;
  border-color: #86efac;
}

.alert-checklist label.locked {
  cursor: default;
}

.alert-checklist label.completed > span {
  color: #166534;
}

.alert-checklist label > b {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 3px 5px;
  color: #166534;
  background: #dcfce7;
  border-radius: 4px;
  font-size: 8px;
}

.alert-checklist input { width: 17px; height: 17px; accent-color: var(--blue); }
.alert-checklist input:disabled { opacity: 1; cursor: not-allowed; }
.alert-checklist small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }

.checklist-empty {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.alert-checklist-completed {
  display: grid;
  gap: 7px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #CBD5E1;
}

.alert-checklist-completed > strong {
  color: var(--blue);
  font-size: 11px;
  text-transform: uppercase;
}

.completed-action {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 7px;
  color: #1E3A8A;
  font-size: 12px;
  font-weight: 800;
}

.completed-action small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.completed-action b {
  color: #15803D;
  font-size: 10px;
  white-space: nowrap;
}

.weather-clear-message { margin: 0; padding: 20px; color: #15803d; text-align: center; font-weight: 900; }

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

.forecast-day {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 7px;
}

.forecast-day-head { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.forecast-day-head span { color: var(--muted); font-size: 10px; }
.forecast-day-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; margin: 8px 0; }
.forecast-day-metrics span { padding: 4px; background: #f1f5f9; border-radius: 4px; color: var(--muted); font-size: 9px; }
.forecast-risk { margin-top: 5px; padding: 6px; background: #fffbeb; border-left: 4px solid #eab308; font-size: 9px; }
.forecast-risk.alert { background: #fff7ed; border-color: #f97316; }
.forecast-risk.emergency { background: #fef2f2; border-color: #dc2626; }
.forecast-risk strong, .forecast-risk span { display: block; }
.forecast-risk span { margin-top: 2px; color: var(--muted); font-size: 8px; }
.forecast-clear { color: #15803d; font-size: 10px; font-weight: 700; }
.alert-history-list { max-height: 440px; overflow-y: auto; }
.alert-history-item.attention { border-left-color: #eab308; }
.alert-history-item.alert { border-left-color: #f97316; }
.alert-history-item.emergency { border-left-color: #dc2626; }

.operational-alerts,
.management-list {
  display: grid;
  gap: 9px;
}

.operational-alert,
.management-item {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-left: 5px solid #64748b;
  border-radius: 7px;
}

.operational-alert {
  align-items: flex-start;
  flex-direction: column;
}

.operational-alert.warning {
  border-left-color: #d97706;
  background: #fffbeb;
}

.operational-alert.danger {
  border-left-color: #dc2626;
  background: #fef2f2;
}

.operational-alert span,
.management-item span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.management-item > div:first-child {
  min-width: 0;
}

.audit-list {
  max-height: 430px;
  overflow-y: auto;
}

.audit-item {
  border-left-color: var(--blue);
}

.danger-action {
  color: #b91c1c;
}

/* Refinamento visual institucional v3 */
:root {
  --navy: #16076f;
  --navy-deep: #0e0647;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --border-strong: #cbd5e1;
  --shadow: 0 7px 20px rgba(15, 23, 42, 0.07);
}

body {
  background: #eef2f7;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
}

.topbar {
  position: relative;
  padding-block: 14px;
  background: var(--navy);
  border-bottom-width: 4px;
  box-shadow: 0 6px 20px rgba(14, 6, 71, 0.2);
}

.topbar::after {
  position: absolute;
  right: 0;
  bottom: -4px;
  width: 34%;
  height: 4px;
  background: #ff9b32;
  content: "";
}

.brand {
  gap: 14px;
}

.logo {
  width: 66px;
  height: 66px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.18);
}

.eyebrow {
  margin-bottom: 2px;
  color: #ffb463;
  font-size: 0.68rem;
  letter-spacing: 0;
}

h1 {
  margin-bottom: 2px;
  font-size: clamp(1.28rem, 2vw, 1.8rem);
}

.brand span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.88rem;
}

.status-card,
.user-status {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08);
}

.status-card.accent {
  background: #d76508;
  border-color: #ffad5a;
}

.header-button {
  background: rgba(255, 255, 255, 0.08);
}

.tabs {
  z-index: 20;
  gap: 4px;
  padding: 20px 12px;
  background: #f8fafc;
  border-right-color: var(--border-strong);
  box-shadow: 4px 0 18px rgba(15, 23, 42, 0.05);
}

.sidebar-title {
  margin-bottom: 5px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  color: #475569;
  letter-spacing: 0;
}

.tab-button {
  position: relative;
  padding: 12px 13px;
  color: #334155;
  background: transparent;
  border-color: transparent;
  border-radius: 6px;
  font-size: 0.88rem;
  transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.tab-button:hover {
  color: var(--blue);
  background: #eef2ff;
  transform: translateX(2px);
}

.tab-button.active {
  color: var(--white);
  background: var(--navy);
  border-color: var(--navy);
  box-shadow: 0 5px 12px rgba(45, 15, 175, 0.2);
}

.tab-button.active::before {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 0;
  width: 4px;
  background: var(--orange);
  border-radius: 0 4px 4px 0;
  content: "";
}

.app-shell {
  width: min(1320px, calc(100% - 34px));
  margin-top: 20px;
}

.section-title {
  position: relative;
  margin: 15px 0 18px;
  padding: 0 0 12px 14px;
  border-bottom: 1px solid var(--border-strong);
}

.section-title::before {
  position: absolute;
  top: 2px;
  bottom: 13px;
  left: 0;
  width: 4px;
  background: var(--orange);
  border-radius: 4px;
  content: "";
}

.section-title h2 {
  margin-bottom: 2px;
  color: #172033;
  font-size: 1.4rem;
}

.section-title p {
  margin-bottom: 0;
  font-size: 0.86rem;
}

.metric-card,
.panel {
  border-color: var(--border);
  border-radius: 7px;
  box-shadow: var(--shadow);
}

.metric-card {
  position: relative;
  min-height: 125px;
  padding: 19px;
  overflow: hidden;
  border-left: 1px solid var(--border);
  border-top: 4px solid var(--orange);
}

.metric-card::after {
  position: absolute;
  right: -16px;
  bottom: -28px;
  width: 76px;
  height: 76px;
  background: rgba(45, 15, 175, 0.045);
  border-radius: 50%;
  content: "";
}

.metric-card.alert-card {
  border-top-color: #dc2626;
}

.metric-card span {
  color: #475569;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.metric-card strong {
  margin-top: 7px;
  font-size: 2.2rem;
}

.panel {
  padding: 18px;
}

.panel-header {
  margin: -3px -3px 13px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.panel-header h3 {
  margin-bottom: 0;
  color: #273449;
  font-size: 1rem;
}

.quick-action {
  min-height: 56px;
  border-radius: 7px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.quick-action:hover {
  border-color: #a5b4fc;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1);
  transform: translateY(-2px);
}

.quick-action.primary-action {
  background: var(--navy);
  border-color: var(--navy);
}

.dashboard-weather-alert {
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.operational-item,
.type-chip,
.detail-item {
  border-radius: 6px;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.operational-item:hover,
.type-chip:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.type-icon {
  border-width: 1px;
  border-color: #c7d2fe;
  border-radius: 6px;
}

input,
select,
textarea {
  min-height: 43px;
  padding: 10px 11px;
  background: #fbfdff;
  border-color: var(--border-strong);
  border-radius: 6px;
  font-size: 0.9rem;
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

input:hover,
select:hover,
textarea:hover {
  background: var(--white);
  border-color: #94a3b8;
}

input:focus,
select:focus,
textarea:focus {
  background: var(--white);
  outline: 0;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(45, 15, 175, 0.12);
}

label,
fieldset {
  color: #334155;
  font-size: 0.84rem;
}

fieldset {
  background: #fbfdff;
}

.checkbox-field,
.source-field,
.team-field,
.photo-field {
  border-color: var(--border-strong);
  border-radius: 7px;
}

.checkbox-field legend,
.source-field legend,
.team-field legend,
.photo-field legend {
  color: var(--navy);
  background: var(--white);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.team-field span,
.photo-capture-button {
  border-radius: 6px;
}

.btn {
  min-height: 41px;
  padding: 9px 14px;
  border-radius: 6px;
  font-size: 0.84rem;
  transition: box-shadow 150ms ease, transform 150ms ease, filter 150ms ease;
}

.btn:hover {
  box-shadow: 0 5px 12px rgba(15, 23, 42, 0.12);
  filter: brightness(0.98);
  transform: translateY(-1px);
}

.btn.primary {
  background: var(--navy);
}

.table-wrap {
  border: 1px solid var(--border);
  border-radius: 7px;
}

.table-wrap.panel {
  padding: 0;
  overflow: auto;
}

th,
td {
  padding: 12px 13px;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: #334155;
  background: #f1f5f9;
  border-bottom: 2px solid #cbd5e1;
  font-size: 0.73rem;
}

tbody tr:nth-child(even) {
  background: #fbfdff;
}

tbody tr:hover {
  background: #fff7ed;
}

.modal {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 7px;
  box-shadow: 0 24px 65px rgba(15, 23, 42, 0.3);
}

.modal-header {
  background: var(--navy);
  border-bottom: 4px solid var(--orange);
}

.modal-actions {
  border-top: 1px solid var(--border);
}

.auth-panel {
  background: rgba(8, 20, 44, 0.95);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}

.weather-alert-card,
.forecast-day,
.management-item,
.operational-alert {
  border-radius: 7px;
  box-shadow: 0 3px 9px rgba(15, 23, 42, 0.04);
}

.alert-conditions-grid > div {
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.05);
}

.badge {
  padding: 5px 9px;
  border-radius: 5px;
  font-size: 0.7rem;
  text-transform: uppercase;
}

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

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

  .alert-conditions-grid {
    grid-template-columns: repeat(4, minmax(90px, 1fr));
  }

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

@media (max-width: 560px) {
  .dashboard-backup-status {
    align-items: stretch;
    flex-direction: column;
  }

  .quick-actions {
    grid-template-columns: 1fr;
  }

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

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

  .header-status .weather-card,
  .header-status .user-status {
    grid-column: 1 / -1;
  }

  .header-status .status-card {
    width: auto;
  }

  .address-field {
    grid-column: auto;
  }

  .dashboard-weather-alert {
    align-items: stretch;
    flex-direction: column;
  }

  .cloud-users-columns {
    grid-template-columns: 1fr;
  }

  .alert-conditions-grid,
  .forecast-alert-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .weather-alert-heading {
    flex-direction: column;
  }
}

@media print {
  body {
    background: var(--white);
  }

  .topbar, .tabs, .form-actions, .button-row, .modal-actions, .icon-btn {
    display: none !important;
  }

  .app-shell, .panel, .modal {
    width: 100%;
    margin: 0;
    box-shadow: none;
    border: 0;
  }
}
