:root {
  --teal: #00A499;
  --teal-dark: #00897B;
  --teal-light: #E0F2F1;
  --naranja: #EA7600;
  --naranja-light: #FFF3E0;
  --naranja-border: #FFE0B2;
  --gris: #394049;
  --gris-dark: #1E252D;
  --text: #1E293B;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --border: #E2E8F0;
  --border-light: #F1F5F9;
  --bg: #F4F6F8;
  --surface: #FFFFFF;
  --success: #16A34A;
  --success-bg: #F0FDF4;
  --success-border: #BBF7D0;
  --danger: #DC2626;
  --danger-bg: #FEF2F2;
  --danger-border: #FECACA;
  --warning-bg: #FFF3E0;
  --warning-border: #FFE0B2;
  --info: #498BCA;
}

* { box-sizing: border-box; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; color: var(--text); margin: 0; background: var(--bg); }

/* Layout */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 250px; background: var(--gris-dark); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 50; transition: transform 0.3s; }
.main { flex: 1; margin-left: 250px; display: flex; flex-direction: column; min-height: 100vh; }
.content { padding: 28px; flex: 1; }

/* Sidebar */
.sidebar-brand { padding: 18px 20px 14px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.sidebar-brand img { height: 36px; filter: brightness(0) invert(1); opacity: 0.85; }
.sidebar-brand small { display: block; font-size: 11px; color: rgba(255,255,255,0.3); margin-top: 6px; }
.sidebar-nav { padding: 12px 10px; flex: 1; }
.sidebar-link { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 8px; margin-bottom: 2px; color: rgba(255,255,255,0.4); font-size: 14px; text-decoration: none; transition: all 0.15s; font-weight: 400; }
.sidebar-link:hover { color: rgba(255,255,255,0.7); background: rgba(255,255,255,0.04); }
.sidebar-link.active { color: #4DB6AC; background: rgba(0,164,153,0.15); font-weight: 600; }
.sidebar-link i { width: 18px; text-align: center; font-size: 13px; }

/* Topbar */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); padding: 10px 28px; display: flex; justify-content: flex-end; align-items: center; gap: 14px; }
.topbar-avatar { width: 30px; height: 30px; border-radius: 7px; background: var(--teal-light); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--teal-dark); }
.topbar-email { font-size: 13px; color: var(--text-secondary); }
.topbar-logout { background: none; border: 1px solid var(--border); border-radius: 6px; padding: 5px 12px; font-size: 12px; color: var(--text-secondary); font-family: inherit; cursor: pointer; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 10px 20px; border-radius: 8px; font-weight: 600; font-size: 14px; font-family: inherit; cursor: pointer; border: none; text-decoration: none; transition: all 0.15s; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-xs { padding: 5px 10px; font-size: 12px; }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1.5px solid var(--border); }
.btn-secondary:hover { background: var(--bg); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }
.btn-success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-block { width: 100%; justify-content: center; }

/* Badges */
.badge { padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; display: inline-block; }
.badge-success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.badge-warning { background: var(--naranja-light); color: #B45309; border: 1px solid var(--naranja-border); }
.badge-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }
.badge-info { background: #EFF6FF; color: var(--info); border: 1px solid #BFDBFE; }
.badge-muted { background: var(--border-light); color: var(--text-secondary); border: 1px solid var(--border); }

/* Toast alerts */
.toast { border-radius: 10px; padding: 12px 16px; display: flex; align-items: center; gap: 10px; margin-bottom: 16px; font-size: 13px; font-weight: 500; animation: slideDown 0.3s ease; }
.toast-success { background: var(--success-bg); border: 1px solid var(--success-border); color: var(--text); }
.toast-success i { color: var(--success); }
.toast-error { background: var(--danger-bg); border: 1px solid var(--danger-border); color: var(--text); }
.toast-error i { color: var(--danger); }
.toast-warning { background: var(--warning-bg); border: 1px solid var(--warning-border); color: var(--text); }
.toast-warning i { color: var(--naranja); }
.toast-info { background: #EFF6FF; border: 1px solid #BFDBFE; color: var(--text); }
.toast-info i { color: var(--info); }
.toast .btn-close { background: none; border: none; color: var(--text-muted); cursor: pointer; margin-left: auto; font-size: 14px; }

/* Cards & Tables */
.card { background: var(--surface); border-radius: 12px; border: 1px solid var(--border); overflow: hidden; }
.card-header { padding: 14px 20px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 20px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table thead th { padding: 11px 14px; text-align: left; font-weight: 600; color: var(--text-secondary); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--border); background: var(--bg); }
.table tbody td { padding: 13px 14px; border-bottom: 1px solid var(--border-light); }
.table tbody tr:last-child td { border-bottom: none; }

/* Forms */
.form-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 5px; display: block; }
.form-control { width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 14px; font-family: inherit; background: var(--surface); color: var(--text); outline: none; transition: border 0.2s; }
.form-control:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0,164,153,0.1); }
.form-select { appearance: auto; }

/* Split screen login */
.split-layout { display: flex; min-height: 100vh; }
.split-brand { width: 42%; background: linear-gradient(160deg, var(--gris-dark) 0%, var(--gris) 40%, var(--teal-dark) 100%); padding: 48px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.split-brand::before { content: ''; position: absolute; top: -60px; right: -60px; width: 200px; height: 200px; border-radius: 50%; background: rgba(0,164,153,0.06); }
.split-brand .logo { height: 60px; filter: brightness(0) invert(1); opacity: 0.9; margin-bottom: 24px; }
.split-brand h1 { color: #fff; font-size: 26px; font-weight: 800; margin: 0 0 8px; line-height: 1.2; }
.split-brand .accent-line { width: 40px; height: 3px; background: var(--naranja); border-radius: 2px; margin-bottom: 12px; }
.split-brand p { color: rgba(255,255,255,0.45); font-size: 14px; line-height: 1.6; margin: 0; }
.split-brand .stats { display: flex; gap: 24px; margin-top: 32px; }
.split-brand .stat-number { font-size: 22px; font-weight: 800; }
.split-brand .stat-label { color: rgba(255,255,255,0.35); font-size: 11px; margin-top: 2px; }
.split-form { flex: 1; display: flex; align-items: center; justify-content: center; background: #fff; padding: 48px; }
.split-form-inner { width: 380px; max-width: 100%; }

/* Wizard sidebar */
.wizard-layout { display: flex; min-height: 100vh; }
.wizard-sidebar { width: 260px; background: #fff; border-right: 1px solid var(--border); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 50; }
.wizard-sidebar-brand { padding: 18px 22px 14px; border-bottom: 1px solid var(--border-light); }
.wizard-sidebar-brand img { height: 32px; }
.wizard-main { flex: 1; margin-left: 260px; background: var(--bg); padding: 32px; }
.wizard-step-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; margin-bottom: 2px; }
.wizard-step-item.active { background: var(--teal-light); }
.wizard-step-num { width: 28px; height: 28px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.wizard-step-num.active { background: var(--teal); color: #fff; }
.wizard-step-num.pending { background: var(--border-light); color: var(--text-muted); }
.wizard-step-num.done { background: var(--success); color: #fff; }
.wizard-step-label { font-size: 13px; }
.wizard-step-label.active { font-weight: 600; color: var(--teal-dark); }
.wizard-step-label.pending { color: var(--text-secondary); }
.step-indicator { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.step-indicator .line { width: 28px; height: 3px; background: var(--naranja); border-radius: 2px; }
.step-indicator span { font-size: 11px; color: var(--naranja); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }

/* Mobile hamburger */
.hamburger { display: none; background: none; border: none; font-size: 20px; color: var(--text); cursor: pointer; padding: 8px; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 40; }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .main { margin-left: 0; }
  .hamburger { display: block; }
  .topbar { justify-content: space-between; padding: 10px 16px; }
  .content { padding: 16px; }
  .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .split-layout { flex-direction: column; }
  .split-brand { width: 100%; padding: 28px 24px; }
  .split-brand h1 { font-size: 20px; }
  .split-brand .stats { gap: 16px; }
  .split-form { padding: 28px 24px; }
  .split-form-inner { width: 100%; }
  .wizard-layout { flex-direction: column; }
  .wizard-sidebar { position: relative; width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  .wizard-sidebar .wizard-steps { display: flex; overflow-x: auto; padding: 8px 12px; gap: 6px; }
  .wizard-sidebar .wizard-steps .wizard-step-item { white-space: nowrap; flex-shrink: 0; padding: 6px 12px; border-radius: 20px; }
  .wizard-sidebar .wizard-sidebar-footer { display: none; }
  .wizard-main { margin-left: 0; padding: 16px; }
  .hide-mobile { display: none !important; }
  .grid-2 { grid-template-columns: 1fr !important; }
}

@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* Lang toggle */
.lang-toggle { display:inline-flex; border:1.5px solid var(--border); border-radius:7px; overflow:hidden; }
.lang-btn { padding:5px 12px; background:transparent; border:none; font-size:12px; font-weight:700; font-family:inherit; cursor:pointer; color:var(--text-muted); transition:all 0.15s; }
.lang-btn.active { background:var(--teal); color:#fff; }
.lang-btn + .lang-btn { border-left:1.5px solid var(--border); }
/* Sidebar lang toggle overrides */
.sidebar .lang-toggle { border-color:rgba(255,255,255,0.1); }
.sidebar .lang-btn { color:rgba(255,255,255,0.3); }
.sidebar .lang-btn.active { background:rgba(0,164,153,0.3); color:#4DB6AC; }
.sidebar .lang-btn + .lang-btn { border-color:rgba(255,255,255,0.1); }

/* Login cross-links */
.login-crosslinks { margin-top:24px; padding:14px 16px; background:var(--border-light); border-radius:10px; border:1px solid var(--border); text-align:center; font-size:13px; }
.login-crosslinks a { color:var(--teal); text-decoration:none; font-weight:600; }
.login-crosslinks .sep { color:var(--border); margin:0 8px; }

/* Footer logos */
.footer-logos { display:flex; align-items:center; justify-content:center; gap:20px; margin-top:28px; padding-top:20px; border-top:1px solid var(--border-light); }
.footer-logos img { height:32px; width:auto; object-fit:contain; opacity:0.7; }
.footer-logos-sep { width:1px; height:22px; background:var(--border); }
