:root {
  --red: #b71c1c;
  --red-dark: #8b1515;
  --red-soft: #fdecec;
  --ink: #1a1a1a;
  --ink-soft: #555;
  --line: #e6e2df;
  --bg-alt: #f7f5f3;
  --white: #ffffff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--white);
  color: var(--ink);
  font-family: "Roboto", -apple-system, sans-serif;
}

/* ---------- LOGIN ---------- */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #fff 0%, var(--bg-alt) 100%);
}
.login-card {
  width: 100%;
  max-width: 380px;
  padding: 2.5rem 2.25rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.06);
  text-align: center;
}
.login-badge {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-weight: 900;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  margin-bottom: 1.1rem;
}
.login-card h1 { font-size: 1.35rem; margin: 0 0 0.35rem; font-weight: 700; }
.login-sub { color: var(--ink-soft); font-size: 0.85rem; margin: 0 0 1.75rem; }
.login-form label { display: block; text-align: left; font-size: 0.8rem; font-weight: 500; margin-bottom: 0.3rem; color: var(--ink-soft); }
.login-form input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  margin-bottom: 1rem;
}
.login-form input:focus { outline: none; border-color: var(--red); }
.login-form button {
  width: 100%;
  background: var(--red);
  color: #fff;
  border: none;
  padding: 0.75rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s;
}
.login-form button:hover { background: var(--red-dark); }
.login-error { color: var(--red); font-size: 0.82rem; margin-top: 0.9rem; }
.login-notice { color: #999; font-size: 0.72rem; margin-top: 1.5rem; line-height: 1.4; }

/* ---------- TOPBAR ---------- */
.topbar {
  border-bottom: 3px solid var(--red);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-inner {
  max-width: 920px;
  margin: 0 auto;
  padding: 1.1rem 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.brand { display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; }
.brand-mark {
  font-weight: 900;
  font-size: 1.15rem;
  color: var(--red);
  letter-spacing: 0.04em;
}
.brand-sub { font-size: 0.82rem; color: var(--ink-soft); }
.tabs { display: flex; gap: 0.5rem; }
.tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 0.65rem 0.25rem;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  margin-right: 1.5rem;
  transition: color 0.15s;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--red); border-bottom-color: var(--red); font-weight: 700; }

/* ---------- LAYOUT ---------- */
.container { max-width: 920px; margin: 0 auto; padding: 2.25rem 1.5rem 4rem; }
.panel { display: none; }
.panel.active { display: block; }
.panel-head h1 { font-size: 1.5rem; margin: 0 0 0.4rem; }
.panel-desc { color: var(--ink-soft); font-size: 0.92rem; max-width: 640px; margin: 0 0 2rem; line-height: 1.5; }

/* ---------- TIMELINE ---------- */
.timeline { position: relative; padding-left: 1.7rem; border-left: 2px solid var(--line); }
.timeline-item { position: relative; padding-bottom: 2rem; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -2.03rem;
  top: 0.3rem;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--red);
}
.item-date { font-size: 0.78rem; font-weight: 700; color: var(--red); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 0.25rem; }
.item-title { font-size: 1.02rem; font-weight: 700; margin: 0 0 0.4rem; }
.item-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-left: 0.5rem;
  vertical-align: middle;
  background: var(--bg-alt);
  color: var(--ink-soft);
}
.item-badge.amenaza { background: var(--red-soft); color: var(--red-dark); }
.item-badge.plan { background: #fff4e0; color: #9a5b00; }
.item-badge.oficio { background: #eef2fb; color: #2b4a9e; }
.item-badge.evaluacion { background: #f0e8fb; color: #6b3fa0; }
.item-badge.logistica { background: #e7f6ec; color: #227a45; }
.item-desc { font-size: 0.9rem; line-height: 1.6; color: #333; margin: 0 0 0.75rem; }

.item-docs { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.doc-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.5rem 0.35rem 0.7rem;
  font-size: 0.8rem;
  background: #fff;
}
.doc-chip a { color: var(--ink); text-decoration: none; font-weight: 500; }
.doc-chip a:hover { color: var(--red); }
.doc-pw-toggle {
  border: none;
  background: var(--bg-alt);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  cursor: pointer;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
}
.doc-pw-toggle:hover { background: var(--red-soft); color: var(--red-dark); }
.doc-pw-value {
  font-family: "SFMono-Regular", Menlo, monospace;
  font-size: 0.78rem;
  background: var(--bg-alt);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  color: var(--red-dark);
}

.timeline-empty { color: var(--ink-soft); font-size: 0.9rem; padding: 1rem 0; }

/* ---------- FORM NUEVO ---------- */
.btn-primary {
  background: var(--red);
  color: #fff;
  border: none;
  padding: 0.65rem 1.1rem;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  margin-bottom: 1.75rem;
}
.btn-primary:hover { background: var(--red-dark); }
.btn-secondary {
  background: none;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  padding: 0.65rem 1.1rem;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 500;
  font-size: 0.88rem;
  cursor: pointer;
}
.form-nuevo {
  border: 1px solid var(--line);
  background: var(--bg-alt);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}
.form-row { display: flex; gap: 1rem; }
.form-field { flex: 1; margin-bottom: 1rem; }
.form-field label { display: block; font-size: 0.78rem; font-weight: 500; color: var(--ink-soft); margin-bottom: 0.3rem; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-family: inherit;
  font-size: 0.88rem;
  background: #fff;
}
.form-field textarea { resize: vertical; }
.form-actions { display: flex; gap: 0.75rem; margin-top: 0.5rem; }

.site-footer {
  text-align: center;
  color: #999;
  font-size: 0.75rem;
  padding: 2rem 1.5rem 3rem;
}

@media (max-width: 600px) {
  .form-row { flex-direction: column; gap: 0; }
}
