html,
body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-size: 14px;
}

a {
  color: var(--info);
  text-decoration: none;
}

.pigma-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 16px;
}

.pigma-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.pigma-header .navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.pigma-brand {
  padding-top: 0;
  padding-bottom: 0;
}

.pigma-logo {
  height: 46px;
  width: auto;
  margin-right: 12px;
}

.pigma-nav .navbar-nav {
  gap: 4px;
}

.pigma-nav a,
.pigma-nav .nav-link {
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-muted);
}

.pigma-nav a:hover,
.pigma-nav .nav-link:hover {
  background: rgba(15, 23, 42, 0.04);
  color: var(--text);
}

.pigma-nav a.is-active,
.pigma-nav .nav-link.is-active {
  color: var(--text);
  border-bottom: 2px solid var(--brand);
  border-radius: 0;
  font-weight: 600;
}

.pigma-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 20px rgba(15, 23, 42, 0.06);
}

.pigma-card__title {
  color: var(--text);
  font-weight: 600;
}

.pigma-card__muted {
  color: var(--text-muted);
}

.btn-pigma-primary {
  background: var(--brand);
  color: #fff;
  border-radius: 10px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid transparent;
}

.btn-pigma-primary:hover {
  background: var(--brand-hover);
  color: #fff;
}

.btn-pigma-secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  height: 40px;
  padding: 0 14px;
}

.btn-pigma-secondary:hover {
  background: var(--surface-2);
}

.input-pigma {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  height: 40px;
  padding: 0 12px;
}

.input-pigma:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--focus);
}

.table-pigma {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table-pigma thead th {
  background: var(--surface-2);
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.table-pigma td {
  border-bottom: 1px solid var(--border);
}

.table-pigma tbody tr:hover {
  background: rgba(15, 23, 42, 0.02);
}

.badge-pigma-success {
  background: var(--brand-soft);
  color: var(--brand);
}

.badge-pigma-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #92400e;
}

.badge-pigma-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.pigma-dropdown {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  min-width: 220px;
  padding: 6px;
}

.pigma-dropdown .dropdown-item {
  border-radius: 8px;
  color: var(--text-muted);
  padding: 8px 10px;
}

.pigma-dropdown .dropdown-item:hover {
  background: rgba(15, 23, 42, 0.04);
  color: var(--text);
}

.pigma-alert {
  border: 1px solid #9cb3cf;
  border-radius: 12px;
  background: #edf4ff;
  color: #1d3d67;
}

.pigma-alert--success {
  background: #e9f7ef;
  border-color: #67b786;
  color: #1f5a33;
}

.pigma-alert--error,
.pigma-alert--danger {
  background: #fbeaea;
  border-color: #d47676;
  color: #812c2c;
}

.pigma-alert--warning {
  background: #fff4df;
  border-color: #d7a453;
  color: #7a5208;
}

.pigma-alert--info,
.pigma-alert--debug {
  background: #edf4ff;
  border-color: #88acd5;
  color: #1d3d67;
}

.pigma-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.pigma-timeline__item {
  position: relative;
  border-left: 2px solid #dbe5f2;
  padding-left: 12px;
}

.pigma-timeline__item::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #7da5dc;
}

.pigma-timeline__meta {
  color: #7a8ba2;
  font-size: 12px;
}

.pigma-timeline__body {
  color: #4b5d77;
}

.pigma-user-chip {
  color: var(--text-subtle);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px !important;
}

.pigma-logout-btn {
  color: var(--text-muted);
}

.pigma-logout-btn:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.08) !important;
}

.auth-logo {
  width: min(220px, 78%);
  max-height: 64px;
  height: auto;
  object-fit: contain;
}

@media (max-width: 991.98px) {
  .pigma-page {
    padding: 16px;
  }

  .pigma-logo {
    height: 34px;
  }

  .pigma-user-chip {
    margin: 8px 0;
    width: fit-content;
  }
}

.dashboard-v2 {
  padding: 10px 0 6px;
}

.dashboard-v2__header {
  margin-bottom: 14px;
}

.dashboard-v2__title {
  margin: 0;
  color: #40506a;
  font-size: 36px;
  line-height: 1.1;
  letter-spacing: 0.2px;
  font-weight: 700;
}

.dashboard-v2__kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.dashboard-card {
  background: #ffffff;
  border: 1px solid #e9edf3;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.05);
}

.dashboard-kpi {
  padding: 14px 16px;
}

.dashboard-kpi--link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.dashboard-kpi--link:hover {
  color: inherit;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.08);
}

.dashboard-kpi--link:focus,
.dashboard-kpi--link:active,
.dashboard-kpi--link:visited {
  color: inherit;
  text-decoration: none;
}

.dashboard-kpi__label {
  margin: 0;
  color: #71839d;
  font-size: 14px;
  font-weight: 500;
}

.dashboard-kpi__value {
  margin: 6px 0 2px;
  color: #40506a;
  font-size: 42px;
  font-weight: 700;
  line-height: 1;
}

.dashboard-kpi__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-kpi__sub {
  color: #df7373;
  font-size: 13px;
  font-weight: 600;
}

.trend {
  font-size: 14px;
  font-weight: 600;
}

.trend-up {
  color: #58b67f;
}

.trend-down {
  color: #dc7373;
}

.sparkline {
  width: 90px;
  height: 26px;
  border-radius: 999px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.sparkline-peach {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 26'%3E%3Cpath d='M2 19 C17 18, 24 13, 40 14 C53 15, 62 16, 77 9' stroke='%23f0ba95' stroke-width='2' fill='none'/%3E%3Ccircle cx='40' cy='14' r='2.6' fill='%23f0ba95'/%3E%3Ccircle cx='77' cy='9' r='2.6' fill='%23f0ba95'/%3E%3C/svg%3E");
}

.sparkline-red {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 26'%3E%3Cpath d='M2 10 C17 11, 24 14, 40 15 C53 16, 62 13, 77 17' stroke='%23df8b8b' stroke-width='2' fill='none'/%3E%3Ccircle cx='40' cy='15' r='2.6' fill='%23df8b8b'/%3E%3Ccircle cx='77' cy='17' r='2.6' fill='%23df8b8b'/%3E%3C/svg%3E");
}

.sparkline-green {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 26'%3E%3Cpath d='M2 22 C17 20, 24 15, 40 12 C53 10, 62 7, 77 3' stroke='%2358b67f' stroke-width='2' fill='none'/%3E%3Ccircle cx='40' cy='12' r='2.6' fill='%2358b67f'/%3E%3Ccircle cx='77' cy='3' r='2.6' fill='%2358b67f'/%3E%3C/svg%3E");
}

.dashboard-v2__middle {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.dashboard-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
}

.dashboard-card__head h2 {
  margin: 0;
  color: #40506a;
  font-size: 25px;
  font-weight: 700;
}

.status-panel {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 14px;
  align-items: center;
  padding: 4px 16px 16px;
}

.donut-wrap {
  display: flex;
  justify-content: center;
}

.donut-chart {
  --completed-angle: calc((var(--completed) / var(--total)) * 360deg);
  --open-angle: calc((var(--open) / var(--total)) * 360deg);
  --late-angle: calc((var(--late) / var(--total)) * 360deg);
  --scheduled-angle: calc((var(--scheduled) / var(--total)) * 360deg);
  width: 182px;
  height: 182px;
  border-radius: 50%;
  background:
    conic-gradient(
      #5bbf8b 0deg var(--completed-angle),
      #73a9e7 var(--completed-angle) calc(var(--completed-angle) + var(--open-angle)),
      #efb890 calc(var(--completed-angle) + var(--open-angle)) calc(var(--completed-angle) + var(--open-angle) + var(--late-angle)),
      #f2d58a calc(var(--completed-angle) + var(--open-angle) + var(--late-angle)) 360deg
    );
  display: grid;
  place-items: center;
}

.donut-center {
  width: 124px;
  height: 124px;
  border-radius: 50%;
  background: #ffffff;
  display: grid;
  place-items: center;
  line-height: 1.1;
}

.donut-center strong {
  color: #40506a;
  font-size: 42px;
  font-weight: 700;
}

.donut-center span {
  color: #8997a8;
  font-size: 12px;
  font-weight: 600;
}

.status-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.status-list li {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center;
  gap: 10px;
  color: #6f829c;
  font-size: 22px;
  font-weight: 500;
}

.status-list strong {
  color: #41546e;
  font-size: 22px;
}

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

.dot-complete {
  background: #5bbf8b;
}

.dot-open {
  background: #73a9e7;
}

.dot-late {
  background: #efb890;
}

.dot-scheduled {
  background: #f2d58a;
}

.program-chart {
  padding: 2px 16px 16px;
}

.program-chart__grid {
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: stretch;
  gap: 10px;
}

.program-chart__axis {
  display: grid;
  align-content: stretch;
  justify-items: end;
  color: #7b8a9c;
  font-size: 11px;
  font-weight: 600;
}

.program-chart__axis-title {
  align-self: start;
  margin-bottom: 8px;
}

.program-chart__axis-label {
  align-self: center;
}

.program-chart__plot {
  height: 198px;
  border-radius: 8px;
  padding: 22px 12px 8px;
  background:
    linear-gradient(to top, rgba(86, 141, 235, 0.12), rgba(86, 141, 235, 0.02) 72%, transparent 72%),
    repeating-linear-gradient(to top, #eef2f8 0px, #eef2f8 1px, transparent 1px, transparent 36px);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  align-items: end;
}

.program-chart__bar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 100%;
}

.program-chart__value {
  color: #6f7f94;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.program-chart__bar {
  width: 34px;
  min-height: 8px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #4f8ef0 0%, #7ac3ff 100%);
}

.program-chart__bar-wrap span {
  color: #7b8a9c;
  font-size: 11px;
  font-weight: 500;
}

.dashboard-v2__table-wrap {
  background: #ffffff;
  border: 1px solid #e9edf3;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.05);
  overflow: hidden;
}

.dashboard-v2__table-head {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 10px;
}

.dashboard-v2__table-head h2 {
  margin: 0;
  color: #40506a;
  font-size: 30px;
  font-weight: 700;
}

.dashboard-v2__new-btn {
  height: 38px;
  display: inline-flex;
  align-items: center;
  font-size: 14px;
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
}

.dashboard-table thead th {
  background: #f7f9fc;
  color: #8a96a8;
  font-size: 12px;
  font-weight: 600;
  padding: 10px 14px;
  border-top: 1px solid #edf1f6;
  border-bottom: 1px solid #edf1f6;
}

.dashboard-table tbody td {
  color: #667891;
  font-size: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid #edf1f6;
}

.dashboard-table tbody tr:hover {
  background: #fbfcff;
}

.priority-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}

.priority-high {
  background: #f09393;
}

.priority-medium {
  background: #f3d07a;
}

.status-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
}

.status-open {
  color: #805f0f;
  background: #fff0cb;
  border: 1px solid #ebc573;
}

.status-in-progress {
  color: #1f5374;
  background: #dff0ff;
  border: 1px solid #91bde0;
}

.status-done {
  color: #1f5a33;
  background: #e7f7ee;
  border: 1px solid #7bc196;
}

.badge-status-abierta {
  background: #fff0cb;
  color: #7f5f12;
  border: 1px solid #e2c175;
}

.badge-status-en_curso {
  background: #dff0ff;
  color: #1f5374;
  border: 1px solid #91bde0;
}

.badge-status-cerrada,
.badge-status-ejecutada {
  background: #e7f7ee;
  color: #1f5a33;
  border: 1px solid #7bc196;
}

.badge-status-programada {
  background: #eaf2ff;
  color: #274f87;
  border: 1px solid #9dbbe2;
}

.badge-status-pospuesta {
  background: #fff0cb;
  color: #7f5f12;
  border: 1px solid #e2c175;
}

.badge-status-cancelada {
  background: #f4f0fb;
  color: #5f3f96;
  border: 1px solid #b9a2dd;
}

.text-danger-soft {
  color: #df7373;
}

.text-success-soft {
  color: #58b67f;
}

@media (max-width: 1200px) {
  .dashboard-v2__title {
    font-size: 30px;
  }

  .dashboard-kpi__value,
  .donut-center strong {
    font-size: 34px;
  }

  .status-list li,
  .status-list strong {
    font-size: 18px;
  }

  .dashboard-v2__table-head h2,
  .dashboard-card__head h2 {
    font-size: 24px;
  }
}

@media (max-width: 992px) {
  .dashboard-v2__kpis {
    grid-template-columns: 1fr;
  }

  .dashboard-v2__middle {
    grid-template-columns: 1fr;
  }

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

  .program-chart__plot {
    grid-template-columns: repeat(5, minmax(46px, 1fr));
    overflow-x: auto;
  }

  .program-chart__grid {
    grid-template-columns: 1fr;
  }

  .program-chart__axis {
    grid-auto-flow: column;
    justify-content: start;
    gap: 10px;
  }
}

.public-hero {
  background: linear-gradient(130deg, #ffffff 0%, #f4fbf6 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
}

.public-kicker {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #3c8f63;
  font-weight: 700;
}

.public-hero__title {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  color: #2f3f56;
  line-height: 1.1;
}

.public-hero__lead {
  margin-top: 10px;
  color: #5f6f86;
  font-size: 16px;
  max-width: 56ch;
}

.public-card,
.public-section,
.public-feature {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.public-card {
  padding: 16px;
}

.public-card ul {
  padding-left: 18px;
  color: #5f6f86;
}

.public-section {
  padding: 18px;
}

.public-section p {
  color: #5f6f86;
}

.public-feature {
  height: 100%;
  padding: 14px;
}

.public-feature p {
  color: #6a7b92;
  font-size: 14px;
}

@media (max-width: 992px) {
  .public-hero {
    grid-template-columns: 1fr;
  }
}
