:root{
  --bg:#081223;
  --bg2:#0f1f39;
  --card:#ffffff;
  --surface:#f8fafc;
  --text:#0f172a;
  --muted:#64748b;
  --line:#dbe4f0;
  --navy:#0f274a;
  --navy2:#193760;
  --blue:#1d4ed8;
  --blue2:#143ea9;
  --green:#1f7a4d;
  --green2:#17613d;
  --danger:#cf254f;
  --danger2:#ab1b40;
  --gold:#f5d27a;
  --shadow:0 18px 45px rgba(2,10,25,.28);
  --radius:16px;
  font-family: Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}
*{box-sizing:border-box}
html,body{min-height:100%}
body{
  margin:0;
  color:var(--text);
  background:linear-gradient(90deg, #030712 0%, #081223 26%, #10233f 50%, #081223 74%, #030712 100%);
}
.hidden{display:none !important}
.wrap{max-width:1180px;margin:34px auto;padding:0 16px}
.card{background:rgba(255,255,255,.96);border:1px solid rgba(255,255,255,.5);border-radius:22px;box-shadow:var(--shadow);padding:18px}
.title{font-size:18px;letter-spacing:.6px;margin:0;text-transform:uppercase;color:#ffffff}
.row{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.row-between{display:flex;justify-content:space-between;gap:12px;align-items:center;flex-wrap:wrap}
.btn{border:0;border-radius:12px;padding:12px 16px;font-weight:800;cursor:pointer;display:inline-flex;align-items:center;gap:8px;transition:.16s ease;white-space:nowrap;box-shadow:0 8px 22px rgba(15,23,42,.08)}
.btn:hover{transform:translateY(-1px)}
.btn-blue{background:var(--blue);color:#fff}
.btn-blue:hover{background:var(--blue2)}
.btn-green{background:var(--green);color:#fff}
.btn-green:hover{background:var(--green2)}
.btn-ghost{background:#eef3fb;color:#12345e}
.btn-ghost:hover{background:#e5edf8}
.btn-danger{background:var(--danger);color:#fff}
.btn-danger:hover{background:var(--danger2)}
.btn-small{padding:8px 10px;font-size:12px}
.transparentBtn{background:transparent !important;color:#fff !important;box-shadow:none}
.topActions{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-top:14px}
.userBadge{display:inline-flex;align-items:center;gap:8px;padding:10px 14px;background:#eef3fb;color:#163b67;border:1px solid #c6d7ee;border-radius:999px;font-weight:800}
.smallNote{color:#334155;font-size:14px;line-height:1.55;margin-top:10px}
.filtersBar{display:flex;gap:12px;flex-wrap:wrap;align-items:end;margin-top:16px}
.filtersBar label{font-size:13px;color:#193b64;font-weight:800}
.filtersBar select{display:block;margin-top:6px;min-width:120px}
.meta{color:#4b5f7d;font-size:14px;font-weight:800;margin:10px 0}
.muted{color:var(--muted);font-size:14px}
.search{display:flex;gap:8px;align-items:center}
.input,select,textarea{width:100%;border:1px solid #c9d6e7;border-radius:12px;padding:11px 12px;font:inherit;background:#fff;color:#0f172a}
.input:focus,select:focus,textarea:focus{outline:2px solid rgba(29,78,216,.18);border-color:#7aa2ef}
textarea{min-height:96px;resize:vertical}
select{appearance:auto}
table{width:100%;border-collapse:separate;border-spacing:0 12px}
thead th{text-align:left;font-size:13px;color:#385274;padding:0 12px 4px;text-transform:uppercase;letter-spacing:.04em}
tbody tr{background:#fff;box-shadow:0 1px 0 #e2e8f0 inset,0 -1px 0 #e2e8f0 inset}
tbody td{padding:14px 12px;vertical-align:middle}
tbody tr td:first-child{border-top-left-radius:14px;border-bottom-left-radius:14px}
tbody tr td:last-child{border-top-right-radius:14px;border-bottom-right-radius:14px}
.linkBtn{color:#123f91;font-weight:900;cursor:pointer;text-decoration:none}
.linkBtn:hover{text-decoration:underline}
.badge{display:inline-flex;align-items:center;justify-content:center;padding:7px 12px;border-radius:999px;background:#eef3fb;color:#123f91;font-size:12px;font-weight:900}
.badge-btn{border:none;cursor:pointer}
.badge-btn:hover{filter:brightness(.98)}
.empty{padding:18px;border:1px dashed #cbd5e1;border-radius:14px;color:#64748b;background:#f8fafc}
.subheader{display:flex;justify-content:space-between;gap:20px;align-items:flex-start;flex-wrap:wrap;margin-bottom:8px}
.left p{margin:4px 0}
.backdrop{position:fixed;inset:0;background:rgba(3,10,24,.55);display:none;align-items:center;justify-content:center;padding:18px;z-index:999}
.backdrop.show{display:flex}
.modal{width:min(980px,100%);max-height:min(92dvh,1000px);display:flex;flex-direction:column;background:#fff;border-radius:18px;overflow:hidden;box-shadow:0 24px 60px rgba(15,23,42,.35)}
.modalWide{width:min(1120px,100%)}
.modalHeader{background:linear-gradient(90deg,var(--navy),#142d52 58%,#0b1e39);color:#fff;padding:16px 18px;display:flex;justify-content:space-between;align-items:center;font-weight:900;letter-spacing:.03em}
.modalBody{padding:18px;overflow:auto;-webkit-overflow-scrolling:touch}
.modalFooter{padding:14px 18px;border-top:1px solid #e5e7eb;display:flex;justify-content:flex-end;gap:10px;background:#fff;position:sticky;bottom:0}
.grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
.field label{display:block;color:#173f70;font-weight:900;margin-bottom:6px}
.hint{margin-top:5px;color:#64748b;font-size:12px;line-height:1.45}
.msg{margin-top:10px;padding:12px 14px;border-radius:12px;background:#fff1f2;border:1px solid #fecdd3;color:#be123c;font-weight:700}
.msg.success{background:#f0fdf4;border-color:#bbf7d0;color:#15803d}
.authScreen{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:24px}
.authCard{width:min(820px,100%);background:rgba(255,255,255,.96);border:1px solid rgba(255,255,255,.5);border-radius:24px;box-shadow:var(--shadow);padding:26px}
.brandBlock{display:grid;grid-template-columns:180px 1fr;gap:24px;align-items:center;margin-bottom:18px}
.brandLogoWrap{background:#000;border-radius:22px;padding:18px;display:flex;align-items:center;justify-content:center;border:1px solid #1f2937;box-shadow:0 10px 24px rgba(0,0,0,.28)}
.brandLogoAuth{max-width:100%;max-height:220px;object-fit:contain;display:block}
.brandEyebrow,.heroEyebrow{font-size:13px;font-weight:900;letter-spacing:.12em;color:#16345c;text-transform:uppercase}
.authTitle{margin:6px 0 8px;font-size:40px;line-height:1.05;color:#0d2242}
.authCard p{color:#42556f;line-height:1.6;font-size:16px}
.authForm{display:grid;gap:12px;margin-top:16px}
.authForm label{font-weight:800;color:#1c3555}
.appHero{border-radius:22px;background:linear-gradient(90deg,#071528 0%, #12294d 60%, #0a1930 100%);padding:18px 18px 20px;border:1px solid rgba(255,255,255,.12)}
.appHeroBrand{display:grid;grid-template-columns:86px 1fr;gap:18px;align-items:center}
.brandLogoMiniWrap{width:86px;height:86px;border-radius:18px;background:#000;display:flex;align-items:center;justify-content:center;border:1px solid rgba(255,255,255,.18);padding:10px;box-shadow:0 8px 18px rgba(0,0,0,.28)}
.brandLogoMini{max-width:100%;max-height:100%;object-fit:contain;display:block;filter:drop-shadow(0 2px 10px rgba(255,255,255,.22))}
.heroTitle{margin-top:4px;font-size:34px;line-height:1.08;color:#ffffff;text-shadow:0 1px 0 rgba(0,0,0,.15)}
.comboWrap,.multiWrap{position:relative}
.comboMenu,.multiMenu{position:absolute;left:0;right:0;top:calc(100% + 6px);max-height:260px;overflow:auto;background:#fff;border:1px solid #cbd5e1;border-radius:14px;box-shadow:0 16px 30px rgba(15,23,42,.18);z-index:30}
.comboItem{padding:10px 12px;cursor:pointer;border-bottom:1px solid #eef2f7;font-size:14px}
.comboItem:last-child{border-bottom:none}
.comboItem:hover{background:#eff6ff}
.comboEmpty{padding:10px 12px;color:#64748b;font-size:13px}
.multiSearchWrap{padding:10px;border-bottom:1px solid #edf2f7;background:#f8fafc;position:sticky;top:0}
.multiOption{display:flex;gap:10px;align-items:center;padding:10px 12px;border-bottom:1px solid #eef2f7;cursor:pointer;font-size:14px}
.multiOption:last-child{border-bottom:none}
.multiOption:hover{background:#f8fbff}
.chipsBar{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.chip{display:inline-flex;align-items:center;gap:6px;padding:8px 10px;border-radius:999px;background:#eef3fb;color:#123f91;font-size:12px;font-weight:800}
.photoSummary{margin-bottom:8px;color:#173f70}
.photoActions,.photoCardActions{display:flex;gap:8px;flex-wrap:wrap}
.photosList{display:grid;gap:12px}
.photoCard{border:1px solid #dbe4f0;border-radius:14px;padding:14px;background:#f8fbff;display:flex;justify-content:space-between;gap:16px;align-items:center;flex-wrap:wrap}
.exportEmployees{display:flex;gap:10px;flex-wrap:wrap}
.exportBtn{min-width:180px;justify-content:center}
.adminFilters{display:flex;gap:12px;align-items:end}
.input[readonly]{background:#f8fafc;color:#334155;font-weight:700}

@media (max-width:900px){
  .brandBlock,.appHeroBrand,.grid,.grid-3{grid-template-columns:1fr}
  .brandLogoWrap{max-width:260px;margin:0 auto}
  .brandLogoMiniWrap{width:110px;height:110px}
  .authTitle,.heroTitle{font-size:28px}
  .topActions .btn,.topActions .userBadge{width:100%;justify-content:center}
  table{display:block;overflow-x:auto}
}
@media (max-width:800px){
  .backdrop{align-items:flex-end;padding:0;background:rgba(15,23,42,.4)}
  .modal,.modalWide{width:100%;max-height:100dvh;border-radius:18px 18px 0 0}
  .modalBody{padding:16px 16px 100px}
  .modalFooter{padding:12px 16px calc(12px + env(safe-area-inset-bottom));display:grid;grid-template-columns:1fr 1fr}
  .modalFooter .btn{width:100%;justify-content:center}
  .comboMenu,.multiMenu{max-height:40dvh}
}

.lineTitleCell.clickable{cursor:pointer;}
.lineTitleCell.clickable strong{text-decoration:underline;}
.requiredMark{color:#c62828;font-weight:800;}

.mutedLabel{color:#6b7b95;font-weight:600;font-size:.92em;}


.logoutTopBtn{margin-left:auto}
.readonlyWrap{pointer-events:none;opacity:.92}
.readonlyWrap .comboInput{background:#f8fafc}
@media (max-width: 800px){
  .logoutTopBtn{margin-left:0}
}

.topRightLogout{display:flex;justify-content:flex-end;margin-top:14px;margin-bottom:10px}
.logoutTopBtn{margin-left:auto;background:#d62828 !important;color:#fff !important;box-shadow:0 10px 24px rgba(214,40,40,.25) !important}
.logoutTopBtn:hover{background:#b71c1c !important}
.lineRowClickable{cursor:pointer}
.lineRowClickable:hover td{background:#f8fbff}


.btn-orange{background:#f59e0b;color:#fff}
.btn-orange:hover{background:#d97706}

.btn:disabled{opacity:.55;cursor:not-allowed;transform:none !important}


.validationItems{display:flex;flex-direction:column;gap:10px}
.validationItem{
  width:100%;
  text-align:left;
  border:1px solid #f2c185;
  background:#fff7ed;
  border-radius:14px;
  padding:14px 16px;
  cursor:pointer;
  transition:.18s ease;
}
.validationItem:hover{
  background:#ffedd5;
  transform:translateY(-1px);
}
.validationItemTitle{
  font-weight:900;
  color:#9a3412;
  margin-bottom:4px;
}
.validationItemText{
  color:#7c2d12;
  line-height:1.45;
}


/* Header refinado */
.appHero{
  background:linear-gradient(90deg,#143763 0%, #1d4778 60%, #153861 100%) !important;
  padding:14px 16px !important;
  border-radius:20px !important;
}
.appHeroBrand{
  grid-template-columns:72px 1fr !important;
  gap:14px !important;
}
.brandLogoMiniWrap{
  width:72px !important;
  height:72px !important;
  border-radius:16px !important;
}
.heroTitle{
  font-size:24px !important;
  margin-top:2px !important;
}
.heroEyebrow{
  font-size:11px !important;
}
@media (max-width: 768px){
  .appHero{
    padding:10px 12px !important;
    border-radius:16px !important;
  }
  .appHeroBrand{
    grid-template-columns:58px 1fr !important;
    gap:10px !important;
  }
  .brandLogoMiniWrap{
    width:58px !important;
    height:58px !important;
    border-radius:14px !important;
    padding:8px !important;
  }
  .heroTitle{
    font-size:18px !important;
    line-height:1.15 !important;
  }
  .heroEyebrow{
    font-size:10px !important;
    letter-spacing:.08em !important;
  }
}

/* Resaltado visual de campos pendientes */
.fieldMissing label{
  color:#c1121f !important;
  font-weight:900 !important;
}
.fieldMissing .input,
.fieldMissing select,
.fieldMissing textarea,
.fieldMissing .comboInput,
.fieldMissing .multiWrap{
  border:2px solid #e63946 !important;
  box-shadow:0 0 0 4px rgba(230,57,70,.10) !important;
  background:#fff5f5 !important;
}
.missingHint{
  margin-top:6px;
  color:#c1121f;
  font-size:13px;
  font-weight:800;
}
