:root {
  --rojo: #8B0000;
  --rojo-claro: #c0392b;
  --gris: #f5f5f5;
  --texto: #333;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', sans-serif; color: var(--texto); background: #f0f0f0; }

/* NAVBAR */
.navbar {
  background: var(--rojo);
  padding: 12px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.navbar .brand { font-size: 1.4rem; font-weight: bold; text-decoration: none; color: white; }
.navbar .brand span { font-size: 0.85rem; display: block; font-weight: normal; opacity: 0.85; }
.nav-links a {
  color: white; text-decoration: none; margin-left: 20px;
  font-size: 0.95rem; padding: 6px 14px; border-radius: 4px;
  transition: background 0.2s;
}
.nav-links a:hover, .nav-links a.active { background: rgba(255,255,255,0.2); }
.nav-links .btn-login {
  background: white; color: var(--rojo); font-weight: bold;
  padding: 6px 16px; border-radius: 4px;
}
.nav-links .btn-login:hover { background: #f0f0f0; }

/* CONTENEDOR */
.container { max-width: 1100px; margin: 30px auto; padding: 0 20px; }

/* CARDS */
.card {
  background: white; border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  padding: 28px; margin-bottom: 24px;
}
.card h2 { color: var(--rojo); margin-bottom: 16px; font-size: 1.3rem; border-bottom: 2px solid var(--rojo); padding-bottom: 8px; }

/* BOTONES */
.btn {
  display: inline-block; padding: 10px 22px; border-radius: 5px;
  text-decoration: none; font-size: 0.95rem; cursor: pointer;
  border: none; transition: all 0.2s;
}
.btn-primary { background: var(--rojo); color: white; }
.btn-primary:hover { background: var(--rojo-claro); }
.btn-secondary { background: #6c757d; color: white; }
.btn-secondary:hover { background: #5a6268; }
.btn-success { background: #28a745; color: white; }
.btn-success:hover { background: #218838; }
.btn-outline { background: white; color: var(--rojo); border: 2px solid var(--rojo); }
.btn-outline:hover { background: var(--rojo); color: white; }
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }

/* FORMULARIO */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 14px; border: 1px solid #ccc;
  border-radius: 5px; font-size: 0.95rem; font-family: inherit;
}
.form-group input:focus, .form-group select:focus {
  outline: none; border-color: var(--rojo); box-shadow: 0 0 0 3px rgba(139,0,0,0.1);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* TABLA */
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { background: var(--rojo); color: white; padding: 10px 14px; text-align: left; }
td { padding: 10px 14px; border-bottom: 1px solid #e0e0e0; }
tr:hover td { background: #fdf5f5; }

/* BADGE */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 12px;
  font-size: 0.8rem; font-weight: 600;
}
.badge-verde { background: #d4edda; color: #155724; }
.badge-amarillo { background: #fff3cd; color: #856404; }
.badge-rojo { background: #f8d7da; color: #721c24; }
.badge-azul { background: #d1ecf1; color: #0c5460; }
.badge-gris { background: #e2e3e5; color: #383d41; }

/* HERO */
.hero {
  background: linear-gradient(135deg, var(--rojo) 0%, #c0392b 100%);
  color: white; text-align: center; padding: 60px 20px;
  border-radius: 8px; margin-bottom: 30px;
}
.hero h1 { font-size: 2.2rem; margin-bottom: 12px; }
.hero p { font-size: 1.1rem; opacity: 0.9; max-width: 600px; margin: 0 auto 24px; }

/* GRID */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.stat-card { background: white; border-radius: 8px; padding: 20px; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,0.1); border-top: 4px solid var(--rojo); }
.stat-card .num { font-size: 2rem; font-weight: bold; color: var(--rojo); }
.stat-card .label { font-size: 0.9rem; color: #666; margin-top: 4px; }

/* ALERTA */
.alert { padding: 12px 16px; border-radius: 5px; margin-bottom: 16px; font-size: 0.9rem; }
.alert-info { background: #d1ecf1; color: #0c5460; border-left: 4px solid #17a2b8; }
.alert-warning { background: #fff3cd; color: #856404; border-left: 4px solid #ffc107; }
.alert-success { background: #d4edda; color: #155724; border-left: 4px solid #28a745; }

/* STEPPER */
.stepper { display: flex; margin-bottom: 28px; }
.step { flex: 1; text-align: center; position: relative; }
.step-circle {
  width: 36px; height: 36px; border-radius: 50%; background: #ddd;
  color: #999; display: flex; align-items: center; justify-content: center;
  font-weight: bold; margin: 0 auto 6px; font-size: 0.9rem;
}
.step.active .step-circle { background: var(--rojo); color: white; }
.step.done .step-circle { background: #28a745; color: white; }
.step-label { font-size: 0.8rem; color: #666; }
.step.active .step-label { color: var(--rojo); font-weight: 600; }
.step::before {
  content: ''; position: absolute; top: 18px; left: -50%; right: 50%;
  height: 2px; background: #ddd; z-index: -1;
}
.step:first-child::before { display: none; }

/* SIDEBAR LAYOUT */
.layout-sidebar { display: grid; grid-template-columns: 240px 1fr; gap: 24px; }
.sidebar { background: white; border-radius: 8px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); height: fit-content; }
.sidebar h3 { color: var(--rojo); font-size: 0.95rem; margin-bottom: 14px; text-transform: uppercase; letter-spacing: 0.5px; }
.sidebar-menu a {
  display: block; padding: 9px 12px; border-radius: 5px;
  text-decoration: none; color: var(--texto); font-size: 0.9rem; margin-bottom: 4px;
  transition: all 0.2s;
}
.sidebar-menu a:hover, .sidebar-menu a.active {
  background: #fdf5f5; color: var(--rojo); font-weight: 600;
  border-left: 3px solid var(--rojo); padding-left: 9px;
}

/* FOOTER */
footer { text-align: center; padding: 20px; color: #888; font-size: 0.85rem; margin-top: 30px; }

/* MODAL */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 1000;
  align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: white; border-radius: 8px; padding: 28px;
  max-width: 480px; width: 90%; box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.modal h3 { color: var(--rojo); margin-bottom: 16px; }

/* PASO ACTIVO - registro trámite */
.step.done::before { background: #28a745; }
.step.active::before { background: var(--rojo); }

/* LISTA REQUISITOS */
.req-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border: 1px solid #e0e0e0;
  border-radius: 6px; margin-bottom: 8px; background: #fafafa;
}
.req-num {
  background: var(--rojo); color: white; border-radius: 50%;
  width: 24px; height: 24px; display: flex; align-items: center;
  justify-content: center; font-size: 0.75rem; font-weight: bold; flex-shrink: 0;
}
/* HISTORIAL TIMELINE */
.timeline { list-style: none; padding: 0; }
.timeline li {
  padding: 12px 0 12px 32px; position: relative;
  border-left: 2px solid #e0e0e0; margin-left: 10px;
}
.timeline li:last-child { border-left-color: transparent; }
.timeline li::before {
  content: ''; position: absolute; left: -7px; top: 18px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--rojo); border: 2px solid white;
  box-shadow: 0 0 0 2px var(--rojo);
}
.timeline .tl-fecha { font-size: 0.78rem; color: #888; }
.timeline .tl-estado { font-weight: 600; color: var(--rojo); }
.timeline .tl-motivo { font-size: 0.85rem; color: #555; margin-top: 3px; background:#fff3cd; padding:4px 8px; border-radius:4px; }
