:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --ink: #1f2937;
  --muted: #667085;
  --line: #d9e1ec;
  --blue: #0757a3;
  --blue-2: #0b74de;
  --green: #11845b;
  --amber: #b65f00;
  --red: #c4312f;
  --shadow: 0 18px 42px rgba(31, 41, 55, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 800;
  padding: 0 16px;
}

a {
  color: var(--blue);
  font-weight: 800;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 48px);
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

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

.brand strong {
  display: block;
  color: var(--blue);
  font-size: 20px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.brand span,
.page-heading p,
.empty-line {
  color: var(--muted);
}

.main-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-button,
.secondary,
.ghost {
  background: #eef4fb;
  color: #25527e;
}

.nav-button.active {
  background: var(--blue);
  color: #ffffff;
}

.lock-nav {
  min-width: 48px;
  padding: 0 14px;
  font-size: 18px;
}

.private-notice {
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #344054;
  font-weight: 800;
  padding: 10px 12px;
}

main {
  padding: 28px clamp(18px, 4vw, 48px) 56px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.page-heading {
  max-width: 860px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 8px;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.08;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
}

h3 {
  margin: 22px 0 10px;
  font-size: 17px;
}

.panel,
.detail-panel,
.confirmation {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
  padding: 22px;
}

.compact {
  padding-bottom: 8px;
}

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

.section-title p {
  margin: 4px 0 0;
  color: var(--muted);
}

.split {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.field-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

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

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

label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  padding: 10px 12px;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue-2);
  outline: 3px solid rgba(11, 116, 222, 0.16);
}

.actions,
.filters,
.inline-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.primary {
  background: var(--blue);
  color: #ffffff;
}

.primary:hover {
  background: #043f78;
}

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

.ghost {
  border: 1px solid var(--line);
  background: #ffffff;
  color: #475467;
}

.small {
  min-height: 34px;
  padding: 0 12px;
}

.hidden {
  display: none !important;
}

.message {
  min-height: 22px;
  margin: 10px 0;
  font-weight: 800;
}

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

.confirmation {
  border-left: 6px solid var(--green);
}

.confirmation h2 {
  margin-bottom: 10px;
}

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

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

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

th {
  background: #f8fafc;
  color: #475467;
  font-size: 12px;
  text-transform: uppercase;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 10px;
  background: #dbeafe;
  color: #174ea6;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.badge.resuelto,
.badge.cerrado {
  background: #dcfce7;
  color: var(--green);
}

.badge.rechazado,
.badge.en-espera-de-informacion {
  background: #fee2e2;
  color: var(--red);
}

.badge.asignado,
.badge.en-proceso-de-solucion,
.badge.en-revision {
  background: #ffedd5;
  color: var(--amber);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.metrics article {
  display: grid;
  gap: 4px;
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
  box-shadow: var(--shadow);
}

.metrics strong {
  font-size: 34px;
  line-height: 1;
}

.metrics span {
  color: var(--muted);
  font-weight: 800;
}

.filters {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  margin-bottom: 16px;
}

.stats-filters {
  grid-template-columns: 1fr 1fr auto;
  margin-bottom: 18px;
}

.internal-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tab-button {
  background: #eef4fb;
  color: #25527e;
}

.tab-button.active {
  background: var(--blue);
  color: #ffffff;
}

.internal-panel {
  display: none;
}

.internal-panel.active {
  display: block;
}

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

.detail-grid div {
  min-height: 72px;
  border: 1px solid #edf1f7;
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

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

.detail-grid strong {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.management-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 14px;
}

.management-form.wide {
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  align-items: end;
}

.comment-form {
  display: grid;
  gap: 10px;
  max-width: 760px;
}

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

.checkline input {
  width: auto;
  min-height: auto;
}

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

.timeline {
  display: grid;
  gap: 10px;
}

.timeline article {
  border-left: 4px solid #cfe2ff;
  background: #f8fafc;
  border-radius: 6px;
  padding: 12px;
}

.timeline small {
  display: block;
  color: var(--muted);
  margin: 4px 0 8px;
}

.timeline p {
  margin-bottom: 0;
}

.link-list {
  display: grid;
  gap: 8px;
  padding-left: 20px;
}

.stat-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 2fr 44px;
  gap: 10px;
  align-items: center;
  margin: 10px 0;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: #e5edf6;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--blue-2);
}

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

.brand-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 980px;
}

.brand-form button {
  align-self: end;
}

.logo-preview {
  max-width: 180px;
  max-height: 90px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #ffffff;
}

.template-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 14px;
  background: #ffffff;
}

@media (max-width: 1040px) {
  .field-grid.three,
  .metrics,
  .detail-grid,
  .management-form,
  .management-form.wide,
  .area-list,
  .brand-form,
  .stats-filters,
  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 700px) {
  .field-grid.three,
  .field-grid.two,
  .metrics,
  .detail-grid,
  .management-form,
  .management-form.wide,
  .filters,
  .columns,
  .area-list,
  .brand-form,
  .stats-filters {
    grid-template-columns: 1fr;
  }

  .split {
    display: grid;
  }

  main {
    padding-inline: 14px;
  }
}
