:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #172033;
  --muted: #647084;
  --line: #d9dee7;
  --brand: #165b5f;
  --brand-2: #0f4043;
  --ok: #176b45;
  --warn: #9f5b00;
  --danger: #a33a2c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

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

a:hover {
  text-decoration: underline;
}

.topbar {
  align-items: center;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 14px 24px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  color: var(--text);
  font-weight: 800;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

nav a {
  color: var(--muted);
  font-weight: 650;
}

.page {
  margin: 0 auto;
  max-width: 1180px;
  padding: 28px 20px 56px;
}

.section-head {
  align-items: flex-end;
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
}

h1,
h2 {
  letter-spacing: 0;
  margin: 0;
}

h1 {
  font-size: 34px;
}

h2 {
  font-size: 19px;
  margin-bottom: 14px;
}

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

.muted {
  color: var(--muted);
  margin: 8px 0 0;
}

.metrics {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 18px;
}

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

.metric {
  padding: 16px;
}

.metric span {
  color: var(--muted);
  display: block;
  font-size: 13px;
}

.metric strong {
  display: block;
  font-size: 30px;
  margin-top: 4px;
}

.grid {
  display: grid;
  gap: 16px;
}

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

.panel {
  overflow: hidden;
  padding: 18px;
}

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

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

th,
td {
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.pill,
.priority {
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  white-space: nowrap;
}

.pill {
  background: #eef1f5;
  color: #3d4a5f;
}

.priority.alta {
  background: #fde8e3;
  color: var(--danger);
}

.priority.media {
  background: #fff2d6;
  color: var(--warn);
}

.priority.baja {
  background: #e6f4ee;
  color: var(--ok);
}

.empty,
.message {
  border-radius: 8px;
  padding: 12px 14px;
}

.empty {
  background: #f1f4f8;
  color: var(--muted);
}

.empty.error,
.message.error {
  background: #fde8e3;
  color: var(--danger);
}

.message.success {
  background: #e6f4ee;
  color: var(--ok);
}

.messages {
  margin-bottom: 16px;
}

.login-shell {
  display: grid;
  min-height: calc(100vh - 130px);
  place-items: center;
}

.login-card {
  max-width: 420px;
  padding: 28px;
  width: 100%;
}

.form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.form.compact {
  margin-top: 0;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 700;
  gap: 6px;
}

input,
select {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  padding: 11px 12px;
  width: 100%;
}

button {
  background: var(--brand);
  border: 0;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 11px 14px;
}

button:hover {
  background: var(--brand-2);
}

button.secondary {
  background: #e8edf2;
  color: var(--text);
}

.button-row {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

.detail {
  display: grid;
  gap: 8px 14px;
  grid-template-columns: 160px 1fr;
  margin: 0;
}

.detail dt {
  color: var(--muted);
  font-weight: 800;
}

.detail dd {
  margin: 0;
}

.footer {
  color: var(--muted);
  display: flex;
  font-size: 12px;
  gap: 14px;
  justify-content: center;
  padding: 20px;
}

@media (max-width: 820px) {
  .topbar,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .metrics,
  .grid.two {
    grid-template-columns: 1fr;
  }

  .page {
    padding: 18px 12px 42px;
  }

  h1 {
    font-size: 28px;
  }

  .button-row {
    grid-template-columns: 1fr;
  }

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