* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--parchment-wash);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ── kappa mark ── */
.kappa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: 50%;
  border: 2px solid currentColor;
  flex-shrink: 0;
}
.kappa span {
  font-family: var(--font-serif);
  line-height: 1;
}
.kappa::after {
  content: "";
  position: absolute;
  bottom: -2px;
  right: 15%;
  width: 32%;
  height: 2px;
  background: var(--kappa-notch, var(--ink));
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-word {
  font-family: var(--font-serif);
  letter-spacing: 0.16em;
}

/* ── buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 30px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
  background: none;
  white-space: nowrap;
}
.btn-primary { background: var(--bronze); color: #12212F; }
.btn-primary:hover { background: #a3774a; }
.btn-ink { background: var(--ink); color: var(--parchment-2); }
.btn-ink:hover { background: #142639; }
.btn-outline-dark { border-color: #35485F; color: #E8DFD1; }
.btn-outline-dark:hover { border-color: var(--bronze); }
.btn-outline { border-color: var(--hairline); color: var(--ink-70); background: var(--card); }
.btn-outline:hover { border-color: var(--bronze); color: var(--gold-label); }
.btn-block { width: 100%; text-align: center; display: flex; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── app shell (sidebar + content) ── */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--ink);
  padding: 28px 0;
  display: flex;
  flex-direction: column;
  gap: 36px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .brand { padding: 0 24px; color: #F3EDE2; }
.sidebar .brand .kappa { width: 26px; height: 26px; color: #E8DFD1; }
.sidebar .brand .brand-word { font-size: 17px; color: #F3EDE2; }
.sidebar-nav { display: flex; flex-direction: column; font-size: 13px; }
.sidebar-nav a {
  padding: 12px 24px;
  color: var(--gray-4);
  border-left: 2px solid transparent;
}
.sidebar-nav a.active {
  color: #F3EDE2;
  background: var(--ink-panel-2);
  border-left-color: var(--bronze);
}
.app-main { flex: 1; padding: 40px 48px; display: flex; flex-direction: column; gap: 30px; min-width: 0; }

/* ── public topnav (landing) ── */
.public-shell { width: 100%; background: var(--ink); }
.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 72px;
  border-bottom: 1px solid var(--ink-hairline);
}
.topnav .brand .kappa { width: 30px; height: 30px; color: #E8DFD1; }
.topnav .brand .brand-word { font-size: 21px; color: #F3EDE2; }
.topnav-links { display: flex; align-items: center; gap: 36px; font-size: 14px; color: #B9C2CE; }

/* ── signer session bar ── */
.session-bar {
  background: var(--ink);
  padding: 18px 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.session-bar .brand .kappa { width: 24px; height: 24px; color: #E8DFD1; }
.session-bar .brand .brand-word { font-size: 16px; color: #F3EDE2; }
.session-bar .session-info { font-size: 12px; color: var(--gray-4); }

/* ── cards ── */
.card {
  background: var(--card);
  border: 1px solid var(--hairline);
  padding: 28px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-label);
}
.h-serif { font-family: var(--font-serif); color: var(--ink); }

/* ── stat tiles ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
}
.stat-tile { background: var(--card); padding: 22px 24px; display: flex; flex-direction: column; gap: 6px; }
.stat-tile .num { font-family: var(--font-serif); font-size: 32px; color: var(--ink); }
.stat-tile .label { font-size: 12px; color: var(--gray-3); }

/* ── table ── */
.table { border: 1px solid var(--hairline); background: var(--card); }
.table-row {
  display: grid;
  gap: 20px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--hairline-2);
  font-size: 13.5px;
  align-items: center;
}
.table-row.head {
  padding: 14px 24px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-label);
  border-bottom: 1px solid var(--hairline-2);
}
.table-row:last-child { border-bottom: none; }
.table-row.tint { background: var(--card-tint); }
.table-row.clickable { cursor: pointer; }
.table-row.clickable:hover { background: #F5F0E6; }
.doc-cols { grid-template-columns: 2.4fr 1.5fr 1.3fr 1fr 0.9fr; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.status-pendiente { color: var(--gray-3); }
.status-parcial { color: var(--gold-label); }
.status-completado { color: var(--valid); }

/* ── timeline ── */
.timeline-item { display: grid; grid-template-columns: 16px 1fr; gap: 16px; }
.timeline-rail { display: flex; flex-direction: column; align-items: center; }
.timeline-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; background: var(--valid); }
.timeline-dot.pending { background: none; border: 2px solid var(--bronze); }
.timeline-dot.future { background: none; border: 1px solid #CFC6B7; }
.timeline-line { flex: 1; width: 1px; background: var(--hairline-3); }
.timeline-body { padding-bottom: 22px; }
.timeline-title { font-size: 13.5px; color: var(--ink); font-weight: 600; }
.timeline-title.pending { color: var(--gold-label); }
.timeline-title.future { color: var(--gray-5); }
.timeline-meta { font-size: 12px; color: var(--gray-3); line-height: 1.6; }
.timeline-meta.future { color: var(--gray-5); }

/* ── forms ── */
.field-label { font-size: 12px; color: var(--gray-1); }
.text-input {
  border: 1px solid var(--hairline);
  background: var(--card);
  padding: 14px 16px;
  font-size: 13px;
  color: var(--ink);
  width: 100%;
}
.text-input:focus { outline: none; border-color: var(--ink); }
.radio-option {
  border: 1px solid var(--hairline);
  background: var(--card);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}
.radio-option.selected { border-color: var(--ink); }
.radio-dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid #CFC6B7; flex-shrink: 0; }
.radio-option.selected .radio-dot { border: 4px solid var(--ink); }

/* ── certificate ── */
.constancia-wrap {
  background: #E7E1D5;
  padding: 56px;
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 48px;
  align-items: start;
}
.constancia-card {
  background: #FFFDF9;
  border: 1px solid #D8CDB9;
  box-shadow: 0 1px 0 #D8CDB9, 0 18px 44px rgba(13,27,42,0.10);
  padding: 64px 72px;
  display: flex;
  flex-direction: column;
  gap: 34px;
  position: relative;
}
.constancia-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 5px;
  background: linear-gradient(90deg, var(--ink) 0 33%, var(--bronze) 33% 66%, var(--ink) 66% 100%);
}
.constancia-seal {
  width: 104px; height: 104px;
  border: 2px solid var(--bronze);
  border-radius: 50%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  flex-shrink: 0;
  background: #FBF3E8;
}
.mono { font-family: var(--font-mono); }
.fingerprint {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.8;
  color: #2A3746;
  background: #F7F2E8;
  border: 1px solid var(--hairline-4);
  padding: 14px 16px;
  word-break: break-all;
}

/* ── util ── */
.container { max-width: 1080px; margin: 0 auto; padding: 0 32px; }
.mt-auto { margin-top: auto; }
.hidden { display: none !important; }

/* Most layout in this site is written as inline styles that mirror the
   original design canvas (fixed 1440px artboards). These two rules keep
   any flex/grid built that way from forcing horizontal scroll: grid/flex
   children default to a min-width equal to their content, which is what
   actually causes overflow at narrower widths — this lets them shrink and
   wrap instead. */
[style*="display:flex"] > *,
[style*="display: flex"] > * { min-width: 0; }
[style*="display:grid"] > *,
[style*="display: grid"] > * { min-width: 0; }
[style*="justify-content:space-between"] { flex-wrap: wrap; row-gap: 6px; }

@media (max-width: 900px) {
  [style*="grid-template-columns:1.15fr 0.85fr"],
  [style*="grid-template-columns:1fr 400px"],
  [style*="grid-template-columns:minmax(0,1fr) 420px"],
  [style*="grid-template-columns:1fr 380px"] { grid-template-columns: 1fr !important; }
}

@media (max-width: 860px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; overflow-x: auto; padding: 16px; }
  .sidebar-nav { flex-direction: row; }
  .app-main { padding: 24px 20px; }
  .topnav { padding: 20px 24px; flex-wrap: wrap; gap: 16px; }
  .topnav-links { flex-wrap: wrap; gap: 16px; }
  .constancia-wrap { grid-template-columns: 1fr; padding: 24px; }
  .constancia-card { padding: 32px 24px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .doc-cols { grid-template-columns: 1fr; gap: 6px; }
  [style*="padding:96px 72px"] { padding: 48px 24px !important; }
  [style*="padding:80px 72px"] { padding: 48px 24px !important; }
  [style*="padding:72px;"] { padding: 32px 24px !important; }
}
