/* InERP · calendario avanzado de los campos de fecha (js/erp-fecha-2026.js). Prefijo ifc-. */

/* El campo: mismo aspecto, icono propio y sin el selector del navegador. */
input[type="date"].ifc-on{ cursor:pointer; }
input[type="date"].ifc-on::-webkit-calendar-picker-indicator{
  pointer-events:none;
  cursor:pointer;
  width:18px; height:18px; padding:0; margin-left:6px;
  opacity:.8;
  color:transparent;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ba5452' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4.5' width='18' height='16.5' rx='2.5'/%3E%3Cpath d='M3 9.5h18M8 2.5v4M16 2.5v4'/%3E%3Ccircle cx='8' cy='14' r='.9' fill='%23ba5452'/%3E%3Ccircle cx='12' cy='14' r='.9' fill='%23ba5452'/%3E%3Ccircle cx='16' cy='14' r='.9' fill='%23ba5452'/%3E%3Ccircle cx='8' cy='17.5' r='.9' fill='%23ba5452'/%3E%3Ccircle cx='12' cy='17.5' r='.9' fill='%23ba5452'/%3E%3C/svg%3E") center/18px 18px no-repeat;
}
input[type="date"].ifc-on[aria-expanded="true"]{ border-color:var(--ix-brand,#ba5452) !important; box-shadow:0 0 0 3px rgba(186,84,82,.16); }
input[type="date"].ifc-on:disabled,
input[type="date"].ifc-on[readonly]{ cursor:default; }

html.ifc-lock, html.ifc-lock body{ overflow:hidden !important; }

/* ---------- Ventana ---------- */
.ifc-pop{
  --ifc-brand:var(--ix-brand,#ba5452);
  --ifc-brand-d:var(--ix-brand-hover,#933c3a);
  --ifc-soft:var(--ix-brand-soft,#f8eceb);
  --ifc-ink:var(--ix-text,#16202a);
  --ifc-muted:var(--ix-muted,#64717f);
  --ifc-line:var(--ix-line,#dfe5ea);
  --ifc-d:38px;
  position:fixed; z-index:10050;
  box-sizing:border-box;
  width:max-content; max-width:calc(100vw - 16px);
  background:#fff; color:var(--ifc-ink);
  border:1px solid var(--ifc-line); border-radius:14px;
  box-shadow:0 18px 50px rgba(20,31,42,.20), 0 2px 6px rgba(20,31,42,.08);
  font:14px/1.35 var(--ix-font,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif);
  padding:12px;
  animation:ifc-in .14s ease-out;
  outline:0;
}
.ifc-pop[hidden], .ifc-veil[hidden]{ display:none !important; }
.ifc-pop *, .ifc-pop *::before, .ifc-pop *::after{ box-sizing:border-box; }
@keyframes ifc-in{ from{ opacity:0; transform:translateY(-4px); } to{ opacity:1; transform:none; } }

.ifc-pop button{
  font:inherit; color:inherit; background:none; border:0; margin:0; padding:0;
  cursor:pointer; -webkit-tap-highlight-color:transparent;
}
.ifc-pop button:disabled{ cursor:not-allowed; }
.ifc-pop button:focus-visible, .ifc-pop input:focus-visible{ outline:2px solid var(--ifc-brand) !important; outline-offset:1px; }

.ifc-head{ display:flex; align-items:flex-start; gap:8px; margin:0 2px 10px; }
.ifc-tit{ flex:1; min-width:0; display:flex; flex-direction:column; gap:1px; }
.ifc-lbl{ font-size:11.5px; font-weight:600; letter-spacing:.02em; text-transform:uppercase; color:var(--ifc-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ifc-val{ font-size:15px; font-weight:650; color:var(--ifc-ink); }
.ifc-val::first-letter{ text-transform:uppercase; }
.ifc-x{ display:none; width:36px; height:36px; border-radius:50%; align-items:center; justify-content:center; flex:0 0 auto; color:var(--ifc-muted); }
.ifc-x:hover{ background:#f1f4f7; }
.ifc-pop svg{ width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round; }

/* Desde / Hasta */
.ifc-tabs{ display:grid; grid-template-columns:1fr 1fr; gap:6px; margin:0 0 10px; }
.ifc-tabs[hidden]{ display:none; }
.ifc-tab{
  display:flex !important; flex-direction:column; align-items:flex-start; gap:1px;
  padding:7px 10px !important; border:1px solid var(--ifc-line) !important; border-radius:10px;
  text-align:left; background:#fafbfc !important;
}
.ifc-tab span{ font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.03em; color:var(--ifc-muted); }
.ifc-tab b{ font-size:14px; font-weight:650; font-variant-numeric:tabular-nums; }
.ifc-tab[aria-pressed="true"]{ border-color:var(--ifc-brand) !important; background:var(--ifc-soft) !important; box-shadow:inset 0 0 0 1px var(--ifc-brand); }
.ifc-tab[aria-pressed="true"] span{ color:var(--ifc-brand-d); }

.ifc-body{ display:flex; gap:12px; align-items:stretch; }
.ifc-cal{ flex:0 0 auto; width:calc(var(--ifc-d) * 7 + 4px); }

.ifc-nav{ display:flex; align-items:center; gap:4px; margin-bottom:6px; }
.ifc-arr{ width:34px; height:34px; border-radius:9px; display:inline-flex !important; align-items:center; justify-content:center; color:var(--ifc-ink); flex:0 0 auto; }
.ifc-arr:hover{ background:#f1f4f7; }
.ifc-per{ flex:1; height:34px; border-radius:9px; font-weight:650 !important; font-size:15px !important; text-transform:capitalize; }
.ifc-per::after{ content:""; display:inline-block; width:6px; height:6px; margin:0 0 3px 8px; border-right:2px solid currentColor; border-bottom:2px solid currentColor; transform:rotate(45deg); opacity:.55; }
.ifc-per:hover{ background:#f1f4f7; }

/* Días */
.ifc-days{ border-collapse:separate; border-spacing:0 2px; width:100%; table-layout:fixed; margin:0; }
.ifc-days th{ height:26px; padding:0; text-align:center; font-size:11.5px; font-weight:650; color:var(--ifc-muted); border:0; background:none; }
.ifc-days th.is-we{ color:#9aa5b1; }
.ifc-days td{ padding:0; border:0; text-align:center; background:none; }
.ifc-d{
  position:relative; width:100%; height:var(--ifc-d); border-radius:10px;
  font-size:14px !important; font-variant-numeric:tabular-nums; color:var(--ifc-ink);
  transition:background .1s;
}
.ifc-d:hover:not(:disabled){ background:#f1f4f7; }
.ifc-d.is-we{ color:#5c6976; }
.ifc-d.is-out{ color:#a8b2bc; }
.ifc-d.is-today{ font-weight:700; color:var(--ifc-brand-d); box-shadow:inset 0 0 0 1.5px var(--ifc-brand); }
.ifc-d:disabled{ color:#c7ced5 !important; text-decoration:line-through; background:none !important; box-shadow:none; }
.ifc-d.is-in{ background:var(--ifc-soft); border-radius:0; color:var(--ifc-ink); }
.ifc-d.is-in:hover{ background:#f1d9d8 !important; }
.ifc-d.is-sel, .ifc-d.is-from, .ifc-d.is-to{
  background:var(--ifc-brand) !important; color:#fff !important; font-weight:700; box-shadow:none;
}
.is-range .ifc-d.is-from:not(.is-to){ border-radius:10px 0 0 10px; }
.is-range .ifc-d.is-to:not(.is-from){ border-radius:0 10px 10px 0; }
.ifc-d.is-sel:hover{ background:var(--ifc-brand-d) !important; }

/* Meses y años */
.ifc-list{ display:grid; grid-template-columns:repeat(3,1fr); gap:6px; padding-top:4px; }
.ifc-m{ height:48px; border-radius:10px; text-transform:capitalize; font-variant-numeric:tabular-nums; border:1px solid transparent !important; }
.ifc-m:hover:not(:disabled){ background:#f1f4f7; }
.ifc-m.is-today{ color:var(--ifc-brand-d); font-weight:700; }
.ifc-m.is-cur{ border-color:var(--ifc-line) !important; }
.ifc-m.is-sel{ background:var(--ifc-brand) !important; color:#fff !important; font-weight:700; }
.ifc-m:disabled{ color:#c7ced5; }
.ifc-grid{ min-height:calc(26px + 6 * (var(--ifc-d) + 2px)); }

/* Atajos */
.ifc-side{ width:150px; border-left:1px solid var(--ifc-line); padding-left:12px; display:flex; flex-direction:column; min-width:0; }
.ifc-side-t{ margin:2px 0 6px; font-size:11.5px; font-weight:650; text-transform:uppercase; letter-spacing:.03em; color:var(--ifc-muted); }
.ifc-side-n{ margin:-2px 0 8px; font-size:12px; line-height:1.3; color:var(--ifc-muted); }
.ifc-chips{ display:flex; flex-direction:column; gap:2px; }
.ifc-chip{
  text-align:left; padding:5px 9px !important; border-radius:8px; font-size:13.5px !important; line-height:1.25 !important; white-space:nowrap;
}
.ifc-pop.is-range:not(.is-sheet) .ifc-val{ display:none; }
.ifc-chip:hover:not(:disabled){ background:#f1f4f7; }
.ifc-chip.is-on{ background:var(--ifc-soft) !important; color:var(--ifc-brand-d); font-weight:650; }
.ifc-chip:disabled{ color:#c0c8d0; }

/* Pie: escribir la fecha, borrar y hoy */
.ifc-foot{ display:flex; align-items:flex-start; gap:8px; margin-top:10px; padding-top:10px; border-top:1px solid var(--ifc-line); }
.ifc-typewrap{ flex:1; min-width:0; }
.ifc-pop .ifc-type{
  width:100%; height:36px; padding:0 10px; margin:0;
  border:1px solid var(--ifc-line); border-radius:9px; background:#fafbfc;
  font:inherit; font-size:13.5px; color:var(--ifc-ink); box-shadow:none;
}
.ifc-pop .ifc-type:focus{ border-color:var(--ifc-brand); background:#fff; outline:0; box-shadow:0 0 0 3px rgba(186,84,82,.14); }
.ifc-msg{ display:block; margin-top:4px; font-size:12px; color:var(--ifc-muted); }
.ifc-msg[hidden]{ display:none; }
.ifc-msg::first-letter{ text-transform:uppercase; }
.ifc-acts{ display:flex; gap:6px; flex:0 0 auto; }
.ifc-btn{
  height:36px; padding:0 14px !important; border-radius:9px;
  background:var(--ifc-brand) !important; color:#fff !important; font-weight:650 !important;
}
.ifc-btn:hover{ background:var(--ifc-brand-d) !important; }
.ifc-btn.ifc-ghost{ background:#fff !important; color:var(--ifc-ink) !important; border:1px solid var(--ifc-line) !important; }
.ifc-btn.ifc-ghost:hover{ background:#f1f4f7 !important; }
.ifc-btn[hidden]{ display:none; }

/* ---------- Móvil: hoja desde abajo ---------- */
.ifc-veil{ position:fixed; inset:0; z-index:10049; background:rgba(16,24,32,.42); animation:ifc-fade .15s ease-out; }
@keyframes ifc-fade{ from{ opacity:0; } to{ opacity:1; } }
@keyframes ifc-up{ from{ transform:translateY(24px); opacity:.4; } to{ transform:none; opacity:1; } }
.ifc-pop.is-sheet{
  --ifc-d:44px;
  left:0 !important; right:0; bottom:0; top:auto !important;
  width:100%; max-width:none; max-height:92vh; max-height:92dvh; overflow-y:auto; overscroll-behavior:contain;
  border-radius:18px 18px 0 0; border-width:1px 0 0;
  padding:8px 14px calc(14px + env(safe-area-inset-bottom));
  animation:ifc-up .18s ease-out;
}
.ifc-pop.is-sheet::before{ content:""; display:block; width:40px; height:4px; border-radius:2px; background:#d5dbe1; margin:0 auto 10px; }
.ifc-pop.is-sheet .ifc-x{ display:inline-flex !important; }
.ifc-pop.is-sheet .ifc-val{ font-size:17px; }
.ifc-pop.is-sheet .ifc-body{ flex-direction:column-reverse; gap:10px; }
.ifc-pop.is-sheet .ifc-cal{ width:100%; max-width:420px; margin:0 auto; }
.ifc-pop.is-sheet .ifc-side{ width:auto; border:0; padding:0; }
.ifc-pop.is-sheet .ifc-side-t{ display:none; }
.ifc-pop.is-sheet .ifc-side-n{ margin:0 0 6px; }
.ifc-pop.is-sheet .ifc-chips{
  flex-direction:row; gap:6px; overflow-x:auto; scrollbar-width:none;
  margin:0 -14px; padding:0 14px 2px; -webkit-overflow-scrolling:touch;
}
.ifc-pop.is-sheet .ifc-chips::-webkit-scrollbar{ display:none; }
.ifc-pop.is-sheet .ifc-chip{ flex:0 0 auto; padding:8px 13px !important; border:1px solid var(--ifc-line) !important; border-radius:999px; background:#fff; }
.ifc-pop.is-sheet .ifc-chip.is-on{ border-color:var(--ifc-brand) !important; }
.ifc-pop.is-sheet .ifc-d{ font-size:16px !important; }
.ifc-pop.is-sheet .ifc-arr{ width:44px; height:44px; }
.ifc-pop.is-sheet .ifc-per{ height:44px; font-size:16px !important; }
.ifc-pop.is-sheet .ifc-m{ height:54px; font-size:15px; }
.ifc-pop.is-sheet .ifc-foot{ flex-direction:column; align-items:stretch; }
.ifc-pop.is-sheet .ifc-type{ height:44px; font-size:16px; }
.ifc-pop.is-sheet .ifc-acts{ display:grid; grid-auto-flow:column; grid-auto-columns:1fr; }
.ifc-pop.is-sheet .ifc-btn{ height:46px; font-size:15px !important; }
.ifc-pop.is-sheet .ifc-tab{ padding:9px 12px !important; }

@media (prefers-reduced-motion:reduce){
  .ifc-pop, .ifc-pop.is-sheet, .ifc-veil{ animation:none; }
}
@media print{ .ifc-pop, .ifc-veil{ display:none !important; } }
