@charset "UTF-8";
/* ============================================================
   CERTIFICADOS DIGITALES — MODERN STYLES
   ============================================================ */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
body{font-family:'DM Sans',-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;background:#f0f2f5;color:#1e293b;min-height:100vh;-webkit-font-smoothing:antialiased;display:flex;flex-direction:column}
.ico{width:18px;height:18px;display:inline-block;vertical-align:middle;fill:none;stroke:currentColor;flex-shrink:0}
.ico--sm{width:14px;height:14px}
.ico--2x{width:28px;height:28px}
.hidden{display:none!important}

/* Header */
header{background:#fff;border-bottom:1px solid #e2e8f0;padding:10px 32px;display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:100;flex-shrink:0}
.title{display:flex;align-items:center;gap:14px}
.title h1{font-size:20px;font-weight:700;color:#0f172a}
.backToSelector{color:#64748b;text-decoration:none;display:flex}
.backToSelector:hover{color:#10b981}
main{max-width:1100px;margin:0 auto;padding:24px 20px 20px;flex:1;width:100%}

/* Buttons */
.btnPrimary{background:#10b981;color:#fff;border:none;padding:10px 22px;border-radius:8px;font-size:13px;font-weight:600;cursor:pointer;display:inline-flex;align-items:center;gap:7px;transition:.15s}
.btnPrimary:hover{background:#059669}
.btnSecondary{background:#fff;color:#475569;border:1px solid #e2e8f0;padding:10px 22px;border-radius:8px;font-size:13px;font-weight:500;cursor:pointer;display:inline-flex;align-items:center;gap:7px}
.btnSecondary:hover{background:#f8fafc}
.btnDanger{background:#dc2626;color:#fff;border:none;padding:8px 16px;border-radius:8px;font-size:12px;font-weight:600;cursor:pointer}
.btnDanger:hover{background:#b91c1c}
.btnSmall{padding:6px 14px;font-size:12px}
.btnIcon{background:none;border:1px solid #e2e8f0;padding:6px 8px;border-radius:6px;cursor:pointer;color:#475569;display:inline-flex;align-items:center;gap:4px;font-size:12px}
.btnIcon:hover{background:#f1f5f9;color:#0f172a}

/* Toast */
.toastContainer{position:fixed;bottom:20px;right:20px;z-index:1000;display:flex;flex-direction:column;gap:8px}
.toast{padding:12px 20px;border-radius:10px;font-size:13px;color:#fff;animation:slideIn .25s ease;max-width:380px;box-shadow:0 4px 16px rgba(0,0,0,.12)}
.toast.success{background:#059669}
.toast.error{background:#dc2626}
.toast.warn{background:#f59e0b}
@keyframes slideIn{from{transform:translateX(100%);opacity:0}to{transform:none;opacity:1}}

/* Alerts panel */
.alertsPanel{margin-bottom:24px}
.alertCard{background:#fff;border:1px solid #e2e8f0;border-radius:10px;padding:14px 18px;margin-bottom:10px;display:flex;align-items:center;gap:12px;font-size:13px;cursor:pointer;transition:.15s}
.alertCard:hover{box-shadow:0 2px 8px rgba(0,0,0,.06)}
.alertCard.warn{border-left:4px solid #f59e0b}
.alertCard.danger{border-left:4px solid #dc2626}
.alertCard.info{border-left:4px solid #3b82f6}
.alertBadge{font-size:11px;font-weight:700;padding:3px 10px;border-radius:20px;white-space:nowrap}
.alertBadge.warn{background:#fef3c7;color:#92400e}
.alertBadge.danger{background:#fee2e2;color:#991b1b}
.alertBadge.info{background:#dbeafe;color:#1e40af}
.alertTitle{font-weight:600;flex:1}
.alertCount{font-size:18px;font-weight:700;color:#0f172a;min-width:30px;text-align:center}

/* ---- Client Searchable Dropdown ---- */
.clientSearchWrap{position:relative}
.clientSearchWrap input[type="text"]{width:100%;padding:10px 14px;border:1px solid #d1d5db;border-radius:8px;font-size:14px;font-family:inherit;box-sizing:border-box;color:#1e293b;background:#fff;transition:.15s}
.clientSearchWrap input[type="text"]:focus{outline:none;border-color:#10b981;box-shadow:0 0 0 3px rgba(16,185,129,.1)}
.clientSearchWrap input[type="text"]::placeholder{color:#94a3b8}
.clientDropdown{position:absolute;top:100%;left:0;right:0;z-index:50;background:#fff;border:1px solid #e2e8f0;border-radius:8px;box-shadow:0 8px 24px rgba(0,0,0,.12);max-height:260px;overflow-y:auto;margin-top:4px}
.clientDropdown.hidden{display:none}
.clientDropItem{padding:10px 14px;cursor:pointer;font-size:13px;color:#334155;border-bottom:1px solid #f8fafc;transition:background .1s;display:flex;justify-content:space-between;align-items:center}
.clientDropItem:last-child{border-bottom:none}
.clientDropItem:hover,.clientDropItem.highlighted{background:#f0fdf4}
.clientDropItem .cdName{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.clientDropItem .cdNif{font-size:11px;color:#64748b;font-family:monospace;flex-shrink:0;margin-left:12px}
.clientDropEmpty{padding:14px;text-align:center;font-size:13px;color:#94a3b8}
.clientInfoCard{background:#f0fdf4;border:1px solid #bbf7d0;border-radius:10px;padding:12px 16px;margin-top:10px;font-size:13px}

/* Certificates table */
.certSection{background:#fff;border:1px solid #e2e8f0;border-radius:12px;margin-top:20px;overflow:hidden}
.certSectionHeader{padding:16px 20px;border-bottom:1px solid #e2e8f0;display:flex;align-items:center;justify-content:space-between;gap:12px}
.certSectionTitle{font-size:14px;font-weight:700;display:flex;align-items:center;gap:8px}
.certTable{width:100%;border-collapse:collapse;font-size:13px}
.certTable th{text-align:left;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.5px;color:#64748b;padding:10px 16px;background:#f8fafc;border-bottom:1px solid #e2e8f0}
.certTable td{padding:10px 16px;border-bottom:1px solid #f1f5f9;vertical-align:middle}
.certTable tr:hover{background:#fafafa}
.certTable .numCol{text-align:right}
.certTable .actions{display:flex;gap:6px;justify-content:flex-end}

/* Status badges */
.statusBadge{font-size:11px;font-weight:600;padding:3px 10px;border-radius:20px;white-space:nowrap;display:inline-block}
.statusBadge.emitido{background:#dcfce7;color:#166534}
.statusBadge.creada{background:#dbeafe;color:#1e40af}
.statusBadge.pendiente{background:#fef3c7;color:#92400e}
.statusBadge.videoerror{background:#fee2e2;color:#991b1b}
.statusBadge.videoreview{background:#e0e7ff;color:#3730a3}
.statusBadge.caducado{background:#fecaca;color:#991b1b}
.statusBadge.revocado{background:#f3f4f6;color:#374151}
.statusBadge.renovado{background:#d1fae5;color:#065f46}

/* Expiry badges */
.expiryBadge{font-size:11px;font-weight:600;padding:2px 8px;border-radius:12px}
.expiryBadge.expired{background:#fee2e2;color:#991b1b}
.expiryBadge.soon{background:#fef3c7;color:#92400e}
.expiryBadge.ok{background:#dcfce7;color:#166534}

/* Password reveal */
.pwdWrap{display:inline-flex;align-items:center;gap:6px}
.pwdDots{font-family:monospace;letter-spacing:2px;color:#94a3b8}
.pwdValue{font-family:monospace;font-size:13px;color:#0f172a;user-select:all}

/* Modal */
.modalOverlay{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.45);z-index:500;display:flex;align-items:center;justify-content:center;animation:fadeIn .15s}
.modalBox{background:#fff;border-radius:14px;max-width:480px;width:95%;max-height:90vh;overflow-y:auto;box-shadow:0 20px 60px rgba(0,0,0,.2);animation:scaleIn .2s}
.modalHeader{padding:18px 24px;border-bottom:1px solid #e2e8f0;display:flex;align-items:center;justify-content:space-between}
.modalHeader h3{font-size:16px;font-weight:700}
.modalBody{padding:20px 24px}
.modalFooter{padding:14px 24px;border-top:1px solid #e2e8f0;display:flex;justify-content:flex-end;gap:10px}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
@keyframes scaleIn{from{transform:scale(.95);opacity:0}to{transform:scale(1);opacity:1}}

/* Form */
.formGroup{margin-bottom:14px}
.formGroup label{display:block;font-size:12px;font-weight:600;color:#475569;margin-bottom:4px}
.formGroup input,.formGroup select{width:100%;padding:9px 12px;border:1px solid #e2e8f0;border-radius:8px;font-size:13px;font-family:inherit}
.formGroup input:focus,.formGroup select:focus{outline:none;border-color:#10b981;box-shadow:0 0 0 3px rgba(16,185,129,.12)}
.formHint{font-size:11px;color:#94a3b8;margin-top:3px}

/* Filter bar */
.filterBar{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.filterBar select,.filterBar input{padding:8px 12px;border:1px solid #e2e8f0;border-radius:8px;font-size:13px;font-family:inherit}

/* Empty state */
.emptyState{text-align:center;padding:40px 20px;color:#94a3b8;font-size:13px}

/* Responsive */
@media(max-width:768px){
  header{padding:10px 16px}
  main{padding:16px 12px}
  .certTable{font-size:12px}
  .certTable th,.certTable td{padding:8px 10px}
  .filterBar{flex-direction:column;align-items:stretch}
}

/* ============ Styled Dialogs ============ */
.dlgOverlay{position:fixed;inset:0;background:rgba(15,23,42,.6);display:flex;align-items:center;justify-content:center;z-index:10001;padding:20px;animation:dlgFade .15s ease}
.dlgBox{background:#fff;border-radius:16px;box-shadow:0 25px 50px -12px rgba(0,0,0,.25);padding:28px 32px;max-width:400px;width:100%;text-align:center;animation:dlgSlide .2s ease}
.dlgMsg{font-size:15px;color:#374151;line-height:1.5;margin-bottom:20px;word-break:break-word}
.dlgInput{width:100%;padding:12px 14px;border:1.5px solid #d1d5db;border-radius:10px;font-size:14px;font-family:inherit;margin-bottom:20px}
.dlgInput:focus{outline:none;border-color:#6366f1;box-shadow:0 0 0 3px rgba(99,102,241,.15)}
.dlgActions{display:flex;gap:10px;justify-content:center}
.dlgBtn{padding:10px 24px;border-radius:10px;font-size:14px;font-weight:600;cursor:pointer;border:none;transition:all .15s ease}
.dlgBtn--cancel{background:#f3f4f6;color:#374151;border:1px solid #e5e7eb}
.dlgBtn--cancel:hover{background:#e5e7eb}
.dlgBtn--ok{background:#4f46e5;color:#fff}.dlgBtn--ok:hover{background:#4338ca}
.dlgBtn--danger{background:#dc2626;color:#fff}.dlgBtn--danger:hover{background:#b91c1c}
@keyframes dlgFade{from{opacity:0}to{opacity:1}}
@keyframes dlgSlide{from{transform:translateY(8px);opacity:0}to{transform:translateY(0);opacity:1}}
