﻿:root {
  --bg: #f7f9ff;
  --panel: #ffffff;
  --ink: #111827;
  --muted: #5b6578;
  --accent: #00048e;
  --accent-dark: #00036f;
  --line: #dfe5f8;
}

html,
body {
  height: 100%;
}

html {
  font-size: 14px;
}

body {
  background: linear-gradient(135deg, #f2f6ff 0%, #ffffff 45%, #f4f7ff 100%);
  color: var(--ink);
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
  overflow: hidden;
}

body > .container {
  flex: 1 1 auto;
  min-height: 0;
}

.app-navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(6px);
}

.navbar-brand {
  font-weight: 700;
  color: var(--accent) !important;
}

main {
  height: calc(100vh - 128px);
  overflow: hidden;
}

.container {
  max-width: 100%;
  padding-left: 12px;
  padding-right: 12px;
}

.dashboard-169 {
  height: 100%;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 10px;
}

.compact-alert {
  margin-bottom: 8px;
  padding: 6px 10px;
  font-size: 0.85rem;
}

.compact-alert .btn-close {
  padding: 0.55rem;
}

.compact-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(122deg, #00048e 0%, #1637cb 100%);
  color: #fff;
  border-radius: 12px;
  padding: 10px 14px;
}

.compact-hero h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
}

.compact-hero p {
  margin: 4px 0 0;
  font-size: 0.88rem;
  opacity: 0.95;
}

.hero-right {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.logo-corner {
  display: flex;
  gap: 8px;
  align-items: center;
}

.logo-corner img {
  height: 34px;
  width: auto;
  border-radius: 6px;
  background: #ffffff;
  padding: 2px 6px;
}

.hero-progress {
  text-align: right;
}

.hero-progress span {
  display: block;
  font-size: 0.8rem;
  opacity: 0.9;
}

.hero-progress strong {
  font-size: 1.55rem;
  font-weight: 800;
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 8px;
}

.kpi-card {
  border-radius: 10px;
  padding: 8px 10px;
  box-shadow: 0 3px 12px rgba(17, 24, 39, 0.08);
  color: #fff;
}

.kpi-card span {
  display: block;
  font-size: 0.92rem;
  opacity: 0.92;
  color: #ffffff;
}

.kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kpi-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #ffffff;
}

.kpi-icon-glyph {
  display: inline-block;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  transform: none;
}

.kpi-card strong {
  font-size: 1.45rem;
  font-weight: 800;
  color: #ffffff;
}

.kpi-card.total { background: #2b3fa7; }
.kpi-card.done { background: #15803d; }
.kpi-card.run { background: #b45309; }
.kpi-card.maint { background: #c2410c; }
.kpi-card.service { background: #2563eb; }
.kpi-card.pending { background: #1e293b; }
.kpi-card.outroute { background: #8a3b0d; }

.workspace-169 {
  min-height: 0;
  display: grid;
  grid-template-columns: 2.3fr 1fr;
  gap: 10px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(17, 24, 39, 0.06);
}

.table-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto 1fr;
  padding: 10px;
  gap: 8px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-head h2 {
  margin: 0;
  font-size: 1rem;
  color: var(--accent);
  font-weight: 700;
}

.filters-compact {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1.2fr auto auto;
  gap: 6px;
}

.table-wrap-169 {
  min-height: 0;
  overflow: auto;
  border: 1px solid #e7ebfa;
  border-radius: 8px;
}

.compact-table {
  font-size: 0.85rem;
}

.compact-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background-color: #0b1c74 !important;
  color: #ffffff;
}

.sort-link {
  color: #ffffff !important;
  text-decoration: none;
  font-weight: 700;
}

.sort-link:hover {
  text-decoration: underline;
}

.activity-row-double td {
  padding-top: 0.62rem;
  padding-bottom: 0.62rem;
  vertical-align: middle;
}

.cell-area {
  font-weight: 600;
  color: #1f2a5a;
}

.cell-equipo {
  min-width: 250px;
  max-width: 290px;
}

.equipo-title {
  font-size: 0.98rem;
  font-weight: 750;
  color: #0f172a;
  line-height: 1.15;
}

.equipo-meta {
  margin-top: 4px;
  font-size: 0.79rem;
  color: #55607a;
  line-height: 1.15;
}

.tag-highlight {
  font-size: 1rem;
  font-weight: 800;
  color: #b91c1c;
  letter-spacing: 0.2px;
}

.cell-task {
  font-weight: 600;
  color: #1b274f;
}

.cell-date {
  font-size: 0.8rem;
  color: #334155;
  font-weight: 600;
}

.compact-table th:last-child,
.compact-table td:last-child {
  width: 120px;
  white-space: nowrap;
}

.mobile-status-btn {
  padding: 0.2rem 0.5rem;
}

.mobile-sort-bar {
  border: 1px solid #dbe4ff;
  border-radius: 8px;
  padding: 8px;
  background: #f7f9ff;
}

.mobile-cards {
  display: grid;
  gap: 8px;
}

.mobile-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.mobile-activity-card {
  border: 1px solid #dbe4ff;
  border-radius: 10px;
  background: #ffffff;
  padding: 10px;
}

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

.mobile-area {
  font-weight: 700;
  color: #1f2a5a;
}

.mobile-equipo {
  margin-top: 6px;
  font-weight: 700;
  color: #111827;
  line-height: 1.2;
}

.mobile-meta {
  margin-top: 4px;
  color: #475569;
  font-size: 0.82rem;
}

.side-169 {
  min-height: 0;
  display: grid;
  grid-template-rows: 1fr;
  gap: 10px;
}

.side-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 10px;
  gap: 8px;
  overflow: hidden;
}

.compact-scroll {
  min-height: 0;
  overflow: auto;
}

.area-progress-item {
  border-bottom: 1px solid #eef2ff;
  padding: 7px 0;
}

.row-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.area-name {
  font-size: 0.84rem;
}

.area-pill {
  background: #e1e8ff;
  color: #00048e;
  border: 1px solid #c7d4ff;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 0.76rem;
  font-weight: 700;
}

.progress {
  height: 0.55rem;
  background: #e6ecff;
}

.progress-bar {
  background: linear-gradient(90deg, #2f55ea, #00048e);
}

.notification-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 2px;
}

.notification-list li {
  border-bottom: 1px solid #eef2ff;
  padding: 6px 0;
  display: grid;
  gap: 2px;
}

.notification-list strong {
  font-size: 0.75rem;
  color: #263e95;
}

.notification-list span {
  font-size: 0.8rem;
}

.daily-list {
  min-height: 120px;
}

.area-progress-list,
.daily-list,
.notification-list {
  max-height: 185px;
  overflow: auto;
  padding-right: 2px;
}

.daily-item {
  border-bottom: 1px solid #eef2ff;
  padding: 6px 0;
}

.daily-area-wrap {
  max-height: 180px;
  border: 1px solid #e6ebff;
  border-radius: 8px;
}

.daily-area-wrap table {
  font-size: 0.76rem;
}

.daily-area-wrap thead th {
  position: sticky;
  top: 0;
  background: #eef2ff;
  z-index: 1;
}

.fuera-ruta-wrap {
  max-height: 170px;
  border: 1px solid #e6ebff;
  border-radius: 8px;
}

.fuera-ruta-wrap thead th {
  position: sticky;
  top: 0;
  background: #fff6dc;
  z-index: 1;
}

.collapse-card {
  border: 1px solid #e6ebff;
  border-radius: 8px;
  padding: 6px 8px;
  background: #fbfcff;
}

.collapse-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  color: #1f2a5a;
}

.collapse-summary small {
  font-weight: 600;
  color: #5b6578;
}

.collapse-card[open] .collapse-summary {
  margin-bottom: 6px;
}

.resumen-panel {
  background: #ffffff;
  border: 1px solid #dbe4ff;
  border-radius: 12px;
}

.indicadores-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.72fr 1.15fr;
  gap: 10px;
}

.resumen-table {
  font-size: 0.88rem;
  background: #ffffff;
}

.resumen-table th,
.resumen-table td {
  border-color: #d8e0f4 !important;
  text-align: center;
  background: #ffffff;
  vertical-align: middle;
  padding: 0.35rem 0.45rem;
}

.resumen-table .th-real {
  background: #dfe9ff !important;
  color: #0a1f66 !important;
}

.resumen-table .total-row td {
  background: #fef08a;
  font-weight: 800;
}

.resumen-table th {
  background: #eef3ff !important;
  color: #1f2a5a !important;
  font-weight: 700;
}

.resumen-table tbody tr:nth-child(even) td {
  background: #f9fbff;
}

.indicador-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1f2a5a;
  margin: 0 0 0.35rem 0.15rem;
}

.indicadores-head h1 {
  color: #1f2a5a;
}

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

.ring-card {
  border: 1px solid #d8deef;
  border-radius: 10px;
  padding: 8px;
  background: #fbfcff;
  text-align: center;
}

.ring-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #1f2a5a;
  min-height: 34px;
}

.ring {
  width: 84px;
  height: 84px;
  border-radius: 999px;
  margin: 4px auto;
  display: grid;
  place-items: center;
}

.ring-hole {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: #ffffff;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: #14532d;
}

.ring-meta {
  font-size: 0.8rem;
  font-weight: 700;
  color: #374151;
}

@media (max-width: 1200px) {
  .indicadores-grid {
    grid-template-columns: 1fr;
  }

  .indicadores-table-scroll {
    max-height: 340px;
    overflow: auto;
  }
}

.status-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #111827;
}

.status-completed {
  background: #22c55e;
  color: #052e16;
}

.status-running {
  background: #facc15;
  color: #3f2f00;
}

.status-maintenance {
  background: #f97316;
  color: #4a1f00;
}

.status-pending {
  background: #94a3b8;
  color: #0f172a;
}

.status-outroute {
  background: #fb923c;
  color: #431407;
}

.status-service {
  background: #93c5fd;
  color: #0c2d61;
}

.pie-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
}

.pie-chart {
  width: 108px;
  height: 108px;
  border-radius: 999px;
  display: grid;
  place-items: center;
}

.pie-hole {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: #ffffff;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #00048e;
  font-size: 0.86rem;
}

.pie-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
  font-size: 0.78rem;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  margin-right: 4px;
}

.legend-dot.done { background: #22c55e; }
.legend-dot.run { background: #facc15; }
.legend-dot.maint { background: #f97316; }
.legend-dot.service { background: #93c5fd; }
.legend-dot.pending { background: #64748b; }

.btn-primary {
  background-color: var(--accent);
  border-color: var(--accent);
}

.btn-primary:hover {
  background-color: var(--accent-dark);
  border-color: var(--accent-dark);
}

.btn-outline-primary {
  color: var(--accent);
  border-color: var(--accent);
}

.btn-outline-primary:hover {
  color: #fff;
  background-color: var(--accent);
  border-color: var(--accent);
}

.bulk-complete-bar {
  border: 1px solid #d7e2ff;
  border-radius: 8px;
  background: #f8faff;
  padding: 8px 10px;
}

.daily-plan-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  border: 1px solid #d7e2ff;
  border-radius: 8px;
  background: #f8faff;
  padding: 8px 10px;
}

.daily-plan-wrap {
  min-height: 520px;
  max-height: 82vh;
  overflow: auto;
}

.daily-plan-input {
  min-width: 72px;
}

.prevencion-thumb {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #dbe4ff;
}

.scroll-top-btn {
  position: fixed;
  right: 14px;
  bottom: 14px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: #00048e;
  color: #ffffff;
  font-size: 1.3rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 20px rgba(0, 4, 142, 0.35);
  z-index: 1060;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, background-color 0.18s ease;
}

.scroll-top-btn:hover {
  background: #00036f;
}

.scroll-top-btn.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

@media (max-width: 1200px) {
  body { overflow: auto; }
  main { height: auto; overflow: visible; }
  .dashboard-169 { height: auto; }
  .workspace-169 { grid-template-columns: 1fr; }
  .side-169 { grid-template-columns: 1fr; grid-template-rows: auto; }
  .filters-compact { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  body {
    overflow: auto;
  }

  .container {
    padding-left: 8px;
    padding-right: 8px;
  }

  .dashboard-169 {
    gap: 8px;
  }

  .compact-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 10px;
  }

  .hero-right {
    width: 100%;
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .logo-corner img {
    height: 30px;
  }

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

  .compact-hero p {
    display: none;
  }

  .kpi-card {
    padding: 8px;
  }

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

  .filters-compact .form-select-sm,
  .filters-compact .form-control-sm,
  .filters-compact .btn-sm,
  .mobile-sort-bar .form-select-sm,
  .mobile-sort-bar .btn-sm {
    font-size: 1rem;
    min-height: 44px;
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
  }

  .panel-head {
    align-items: flex-start;
    gap: 6px;
  }

  .panel-head .d-flex {
    width: 100%;
    justify-content: space-between;
  }

  .mobile-activity-card .btn {
    width: 100%;
  }

  .area-progress-list,
  .daily-list,
  .notification-list {
    max-height: 220px;
  }

  .side-panel {
    padding: 8px;
  }

  .equipo-title {
    font-size: 1rem;
  }

  .cell-equipo {
    min-width: 250px;
  }

  .compact-table {
    font-size: 0.82rem;
  }

  .pie-wrap {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .daily-plan-wrap {
    min-height: 420px;
    max-height: 74vh;
  }

  .daily-plan-toolbar {
    position: sticky;
    top: 0;
    z-index: 3;
  }

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

  .ring-card {
    padding: 6px 4px;
  }

  .ring {
    width: 70px;
    height: 70px;
  }

  .ring-hole {
    width: 42px;
    height: 42px;
    font-size: 0.68rem;
  }

  .ring-title {
    font-size: 0.68rem;
    min-height: 28px;
  }

  .ring-meta {
    font-size: 0.7rem;
  }

  .scroll-top-btn {
    right: 10px;
    bottom: 10px;
    width: 42px;
    height: 42px;
    font-size: 1.2rem;
  }
}

body.config-page {
  overflow: auto;
}

body.config-page main {
  height: auto;
  overflow: visible;
}

body.indicadores-page {
  overflow: auto;
}

body.indicadores-page main {
  height: auto;
  overflow: visible;
}
