@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --naranja:    #E8622A;
  --naranja-d:  #C4501F;
  --dark:       #1C2533;
  --dark-2:     #2D3748;
  --gris:       #64748B;
  --gris-l:     #F1F5F9;
  --border:     #E2E8F0;
  --text:       #1E293B;
  --text-m:     #64748B;
  --verde:      #1D9E75;
  --rojo:       #E24B4A;
  --amarillo:   #BA7517;
  --white:      #FFFFFF;
  --radius:     8px;
  --radius-lg:  12px;
}

body { font-family: 'Inter', sans-serif; font-size: 14px; color: var(--text); background: var(--gris-l); }

.login-body  { display:flex; align-items:center; justify-content:center; min-height:100vh; background: var(--dark); }
.login-wrap  { width: 100%; max-width: 380px; padding: 1rem; }
.login-card  { background: var(--white); border-radius: var(--radius-lg); padding: 2rem; box-shadow: 0 8px 32px rgba(0,0,0,0.25); }
.login-logo  { display:flex; align-items:center; gap:10px; font-size:20px; font-weight:600; color: var(--dark); margin-bottom:4px; }
.login-sub   { font-size:12px; color:var(--text-m); margin-bottom:1.5rem; }
.login-footer{ text-align:center; color:rgba(255,255,255,0.3); font-size:11px; margin-top:1rem; }

.app-layout  { display:flex; min-height:100vh; }
.sidebar     { width:220px; background:var(--dark); padding:1.25rem 1rem; flex-shrink:0; position:fixed; top:0; left:0; height:100vh; overflow-y:auto; z-index:100; }
.sidebar-logo{ color:var(--naranja); font-size:15px; font-weight:600; display:flex; align-items:center; gap:8px; margin-bottom:4px; }
.sidebar-sub { color:#475569; font-size:11px; margin-bottom:1.5rem; padding-left:26px; }
.sidebar-user{ background:var(--dark-2); border-radius:var(--radius); padding:8px 10px; margin-bottom:1.25rem; }
.sidebar-user .name { font-size:12px; font-weight:500; color:#E2E8F0; }
.sidebar-user .rol  { font-size:11px; color:#64748B; text-transform:capitalize; }
.sidebar-menu { list-style:none; display:flex; flex-direction:column; gap:2px; }
.sidebar-menu a { display:flex; align-items:center; gap:8px; padding:8px 10px; border-radius:var(--radius); color:#94A3B8; text-decoration:none; font-size:12px; transition: background 0.15s, color 0.15s; }
.sidebar-menu a:hover   { background:rgba(255,255,255,0.06); color:#E2E8F0; }
.sidebar-menu a.active  { background:rgba(232,98,42,0.18); color:var(--naranja); }

.main-content { margin-left:220px; flex:1; display:flex; flex-direction:column; }
.topbar { background:var(--white); border-bottom:1px solid var(--border); padding:.75rem 1.5rem; display:flex; align-items:center; justify-content:space-between; position:sticky; top:0; z-index:50; }
.topbar-title { font-size:15px; font-weight:500; }
.page-body { padding:1.5rem; flex:1; }

.card { background:var(--white); border:1px solid var(--border); border-radius:var(--radius-lg); }
.card-header { padding:.875rem 1.25rem; border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; }
.card-title  { font-size:14px; font-weight:500; }
.card-body   { padding:1.25rem; }

.form-section { margin-bottom:1.5rem; }
.form-section-title { font-size:11px; font-weight:500; color:var(--text-m); text-transform:uppercase; letter-spacing:.06em; margin-bottom:.75rem; padding-bottom:6px; border-bottom:1px solid var(--border); }
.form-grid   { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.form-grid.g3 { grid-template-columns:1fr 1fr 1fr; }
.form-grid.g1 { grid-template-columns:1fr; }
.field       { display:flex; flex-direction:column; gap:5px; }
.field label { font-size:12px; font-weight:500; color:var(--text-m); }
.field input, .field select, .field textarea {
  padding:8px 10px; border:1px solid var(--border); border-radius:var(--radius);
  font-size:13px; font-family:'Inter',sans-serif; color:var(--text); background:var(--white);
  transition:border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline:none; border-color:var(--naranja); box-shadow:0 0 0 3px rgba(232,98,42,.1);
}
.field input.error { border-color:var(--rojo); }
.field textarea { min-height:80px; resize:vertical; }
.required { color:var(--naranja); margin-left:2px; }

.radio-group { display:flex; gap:8px; }
.radio-card  { flex:1; border:1px solid var(--border); border-radius:var(--radius); padding:10px 12px; cursor:pointer; display:flex; align-items:center; gap:8px; font-size:13px; color:var(--text); }
.radio-card input { accent-color:var(--naranja); }
.radio-card.sel { border-color:var(--naranja); background:rgba(232,98,42,.05); }

.check-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.check-card { display:flex; align-items:center; gap:8px; padding:8px 10px; border:1px solid var(--border); border-radius:var(--radius); cursor:pointer; font-size:13px; }
.check-card input { accent-color:var(--naranja); width:15px; height:15px; }
.check-card.sel { border-color:var(--naranja); background:rgba(232,98,42,.04); }

.condicion-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.condicion-card { border:1px solid var(--border); border-radius:var(--radius); padding:12px 8px; text-align:center; cursor:pointer; font-size:12px; color:var(--text-m); }
.condicion-card.sel-b { border-color:var(--verde); background:rgba(29,158,117,.07); color:#065F46; }
.condicion-card.sel-r { border-color:var(--amarillo); background:rgba(186,117,23,.07); color:#713F12; }
.condicion-card.sel-m { border-color:var(--rojo); background:rgba(226,75,74,.07); color:#7F1D1D; }

.upload-zone { border:1px dashed var(--border); border-radius:var(--radius); padding:20px; text-align:center; cursor:pointer; color:var(--text-m); font-size:13px; }
.upload-zone:hover { border-color:var(--naranja); }
.file-list { margin-top:8px; display:flex; flex-direction:column; gap:4px; }
.file-item { display:flex; align-items:center; gap:8px; font-size:12px; color:var(--text-m); padding:5px 8px; background:var(--gris-l); border-radius:var(--radius); }
.file-rm   { margin-left:auto; cursor:pointer; color:var(--text-m); }

.btn-primary  { background:var(--naranja); color:#fff; border:none; padding:8px 20px; border-radius:var(--radius); font-size:13px; font-weight:500; cursor:pointer; font-family:'Inter',sans-serif; display:inline-flex; align-items:center; gap:6px; }
.btn-primary:hover { background:var(--naranja-d); }
.btn-secondary { background:transparent; color:var(--text-m); border:1px solid var(--border); padding:8px 16px; border-radius:var(--radius); font-size:13px; cursor:pointer; font-family:'Inter',sans-serif; }
.btn-secondary:hover { background:var(--gris-l); }
.w-full { width:100%; justify-content:center; }

.alert-error   { background:#FEF2F2; border:1px solid #FECACA; color:#991B1B; padding:8px 12px; border-radius:var(--radius); font-size:13px; margin-bottom:12px; }
.alert-success { background:#ECFDF5; border:1px solid #A7F3D0; color:#065F46; padding:8px 12px; border-radius:var(--radius); font-size:13px; margin-bottom:12px; }

.divider { height:1px; background:var(--border); margin:1.25rem 0; }
.form-footer { display:flex; align-items:center; justify-content:space-between; padding-top:1rem; border-top:1px solid var(--border); margin-top:1rem; }
.form-footer-note { font-size:11px; color:var(--text-m); }

.sidebar-stages { display:flex; flex-direction:column; }
.st-row  { display:flex; align-items:flex-start; gap:10px; padding:6px 0; }
.st-dot  { width:24px; height:24px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:600; flex-shrink:0; }
.st-done   { background:var(--verde); color:#fff; }
.st-active { background:var(--naranja); color:#fff; }
.st-pend   { background:#2D3748; color:#64748B; border:1px solid #374151; }
.st-label  { font-size:11px; line-height:1.4; color:#94A3B8; padding-top:4px; }
.st-label.act  { color:#F1F5F9; }
.st-label.done { color:#6EE7B7; }
.st-conn { width:1px; height:14px; background:#2D3748; margin-left:11px; }

.ref-banner { background:#1E293B; border:1px solid #334155; border-radius:var(--radius); padding:10px 14px; display:flex; flex-wrap:wrap; gap:12px; margin-bottom:1.25rem; }
.ref-item { font-size:12px; color:#94A3B8; display:flex; align-items:center; gap:5px; }
.ref-item strong { color:#E2E8F0; }

.badge { display:inline-flex; align-items:center; font-size:11px; padding:3px 9px; border-radius:20px; font-weight:500; }
.badge-naranja { background:#FFF3ED; color:#C2410C; border:1px solid #FED7AA; }
.badge-azul    { background:#EFF6FF; color:#1D4ED8; border:1px solid #BFDBFE; }
