:root {
  --navy: #0f172a;
  --navy-soft: #1e293b;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --accent: #38bdf8;
  --bg: #f1f5f9;
  --card: #ffffff;
  --line: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --danger: #dc2626;
  --ok: #16a34a;
  --warn: #d97706;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
  --sidebar-w: 276px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Poppins", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); }

.skip-link {
  position: absolute;
  left: -999px;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
  z-index: 100;
  background: #fff;
  padding: 8px 14px;
  border-radius: 8px;
}

.muted { color: var(--muted); }

/* ------------------------------------------------------------------ shell */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: linear-gradient(180deg, var(--navy) 0%, #172554 100%);
  color: #e2e8f0;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff;
  font-weight: 700;
  letter-spacing: .5px;
}
.brand-text { display: flex; flex-direction: column; font-weight: 600; line-height: 1.2; }
.brand-text small { font-weight: 400; font-size: 12px; color: #94a3b8; }

.profile-card {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--radius);
  padding: 18px 14px;
  text-align: center;
}
.avatar {
  width: 74px; height: 74px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto 10px;
  border: 2px solid rgba(255, 255, 255, .25);
}
.avatar--initials {
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff;
  font-size: 24px;
  font-weight: 600;
}
.profile-name { margin: 0; font-weight: 600; font-size: 15px; }
.profile-id { margin: 2px 0 0; font-size: 12px; color: #94a3b8; letter-spacing: .4px; }
.profile-meta { margin: 4px 0 0; font-size: 11.5px; color: #cbd5e1; }

.sidebar-logout {
  color: #94a3b8;
  font-size: 12.5px;
  text-decoration: none;
  border-top: 1px solid rgba(255, 255, 255, .1);
  padding-top: 10px;
}
.sidebar-logout:hover { color: #fff; }

.login-form { display: flex; flex-direction: column; gap: 8px; text-align: left; margin-top: 18px; }
.login-form label { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.login-form input {
  font: inherit;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  letter-spacing: 1px;
}
.login-form input:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.login-form .btn { margin-top: 6px; }
.denied-box .alert { text-align: left; margin-top: 16px; }

.menu { display: flex; flex-direction: column; gap: 4px; }
.menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px;
  border-radius: 10px;
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 500;
  transition: background .15s ease, color .15s ease;
}
.menu-item svg { width: 19px; height: 19px; flex: none; }
.menu-item:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.menu-item.is-active { background: var(--brand); color: #fff; box-shadow: 0 6px 18px rgba(37, 99, 235, .35); }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.sidebar-help { margin: 0; font-size: 12px; color: #94a3b8; }

.progress-head { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 6px; }
.progress-bar { height: 7px; border-radius: 99px; background: rgba(255, 255, 255, .15); overflow: hidden; }
.progress-bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--brand)); }
.progress--light .progress-head { color: var(--muted); }
.progress--light .progress-bar { background: var(--line); }

/* ---------------------------------------------------------------- content */
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 28px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.topbar h1 { margin: 0; font-size: 20px; font-weight: 700; }
.topbar-sub { margin: 0; font-size: 13px; color: var(--muted); }
.topbar .status-pill { margin-left: auto; }

.main { padding: 26px 28px 60px; display: flex; flex-direction: column; gap: 22px; max-width: 1200px; width: 100%; }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
}
.panel-title { margin: 0 0 6px; font-size: 16px; font-weight: 700; }
.panel-text { margin: 0 0 14px; color: var(--muted); }

.tool-links { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 0; padding: 0; }
.tool-links a {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 99px;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}

/* ------------------------------------------------------------------- grid */
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; }
.card--span3 { grid-column: span 3; }
.card--span4 { grid-column: span 4; }
.card--span6 { grid-column: span 6; }
.card--span8 { grid-column: span 8; }
.card--span12 { grid-column: span 12; }

/* ---------------------------------------------------------------- choices */
.choice { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 0; }
.choice legend { font-weight: 600; font-size: 14px; padding: 0 4px; }
.choice[disabled] { background: #f8fafc; }
.radio { display: flex; align-items: center; gap: 9px; padding: 4px 0; cursor: pointer; font-size: 14px; }
.radio input { accent-color: var(--brand); width: 16px; height: 16px; }
.readonly-hint { margin: 6px 0 0; font-size: 12px; color: var(--muted); }

/* ------------------------------------------------------------------ cards */
.card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card.is-done { border-color: #bbf7d0; background: #f6fefa; }
.card-head { display: flex; align-items: center; gap: 10px; }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.req { font-weight: 500; font-size: 12px; color: var(--muted); margin-left: 6px; }

.dropzone {
  display: flex; align-items: center; gap: 12px;
  border: 1.5px dashed #cbd5e1;
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  background: #f8fafc;
  transition: border-color .15s ease, background .15s ease;
}
.dropzone:hover, .dropzone.is-hover { border-color: var(--brand); background: #eff6ff; }
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone-icon svg { width: 24px; height: 24px; color: var(--brand); }
.dropzone-text { display: flex; flex-direction: column; font-size: 14px; }
.dropzone-text small { color: var(--muted); font-size: 12.5px; }

.rules { margin: 0; font-size: 12.5px; font-weight: 600; color: var(--danger); }

.uploaded { margin: 0; font-size: 13px; display: flex; flex-direction: column; }
.uploaded span { color: var(--muted); font-size: 12px; }
.review-note { margin: 0; font-size: 13px; color: var(--warn); }

.field-help { font-size: 13.5px; color: #475569; }
.field-help p { margin: 0 0 10px; }
.field-help strong { font-weight: 700; color: var(--text); }

/* ----------------------------------------------------------------- badges */
.badge {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  background: #e2e8f0;
  color: #334155;
}
.badge--pendiente { background: #fef3c7; color: #92400e; }
.badge--aprobado { background: #dcfce7; color: #166534; }
.badge--rechazado { background: #fee2e2; color: #991b1b; }

.status-pill {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 600;
  background: #e2e8f0;
  color: #334155;
  white-space: nowrap;
}
.status-pill--documentos_pendientes { background: #fef3c7; color: #92400e; }
.status-pill--en_revision { background: #dbeafe; color: #1e40af; }
.status-pill--ajustes_requeridos { background: #ffedd5; color: #9a3412; }
.status-pill--listo_para_radicar,
.status-pill--radicada { background: #e0e7ff; color: #3730a3; }
.status-pill--aprobada { background: #dcfce7; color: #166534; }
.status-pill--rechazada { background: #fee2e2; color: #991b1b; }
.status-current { margin: 0 0 16px; }

/* ----------------------------------------------------------------- alerts */
.alert { border-radius: 10px; padding: 12px 16px; font-size: 14px; border: 1px solid transparent; }
.alert--ok { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert--error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

.notice {
  border: 1px solid #f0b429;
  background: #fff8e1;
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 13.5px;
}
.notice p { margin: 0 0 8px; }
.notice p:last-child { margin: 0; }

/* --------------------------------------------------------------- buttons */
.btn {
  display: inline-block;
  border: 0;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-weight: 600;
  padding: 10px 20px;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease;
}
.btn:hover { background: var(--brand-dark); }
.btn--sm { padding: 8px 16px; font-size: 13.5px; align-self: flex-start; }

/* ------------------------------------------------------------ data lists */
.data-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 0 0 16px; }
.data-list dt { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.data-list dd { margin: 2px 0 0; font-weight: 600; }

.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.checklist li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; }
.checklist li.is-done { border-color: #bbf7d0; background: #f6fefa; }
.check { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #cbd5e1; display: grid; place-items: center; font-size: 13px; color: var(--ok); flex: none; }
.checklist li.is-done .check { border-color: var(--ok); }
.checklist-label { font-weight: 500; }
.checklist-state { margin-left: auto; font-size: 12.5px; color: var(--muted); }

.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 16px; }
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; left: -25px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.timeline time { display: block; font-size: 12px; color: var(--muted); }
.timeline p { margin: 2px 0 0; font-size: 13.5px; color: #475569; }

/* --------------------------------------------------------------- denied */
.denied { display: grid; place-items: center; min-height: 100vh; background: var(--navy); }
.denied-box { background: #fff; padding: 40px; border-radius: 18px; max-width: 460px; text-align: center; box-shadow: var(--shadow); }
.denied-box h1 { font-size: 21px; margin: 18px 0 10px; }
.denied-box .brand-mark { margin: 0 auto; }

/* -------------------------------------------------------------- responsive */
.nav-toggle, .nav-burger { display: none; }

@media (max-width: 980px) {
  .card--span3, .card--span4, .card--span6, .card--span8 { grid-column: span 6; }
}

@media (max-width: 760px) {
  .sidebar {
    position: fixed;
    z-index: 30;
    transform: translateX(-100%);
    transition: transform .2s ease;
  }
  .nav-toggle:checked ~ .shell .sidebar { transform: translateX(0); }
  .nav-burger {
    display: block;
    width: 34px; height: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    position: relative;
    cursor: pointer;
    flex: none;
  }
  .nav-burger span,
  .nav-burger::before,
  .nav-burger::after {
    content: "";
    position: absolute;
    left: 8px; right: 8px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
  }
  .nav-burger span { top: 16px; }
  .nav-burger::before { top: 10px; }
  .nav-burger::after { top: 22px; }
  .main, .topbar { padding-left: 16px; padding-right: 16px; }
  .grid { grid-template-columns: 1fr; }
  .card--span3, .card--span4, .card--span6, .card--span8, .card--span12 { grid-column: span 1; }
}
