/* gantt-dnd.css — v2.37.0 Gantt interactiva + plantillas de servicio. Solo tokens de tema (claro/oscuro). */
.gdnd { --gd-row: 34px; --gd-left: 270px; position: relative; color: var(--text); font-size: .875rem; }
.gdnd-toolbar { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: 0 0 .5rem; }
.gdnd-zoom { display: inline-flex; gap: .25rem; }
.gdnd-hint { flex: 1 1 240px; }
.gdnd-body { display: grid; grid-template-columns: var(--gd-left) minmax(0, 1fr); border: 1px solid var(--border, #e5e7eb); border-radius: 10px; background: var(--surface, #fff); overflow: hidden; }
.gdnd-left { position: relative; border-right: 1px solid var(--border, #e5e7eb); background: var(--surface, #fff); min-width: 0; }
.gdnd-lhead { height: 40px; display: flex; align-items: center; padding: 0 .75rem; font-weight: 600; font-size: .78rem; color: var(--table-head-text); background: var(--table-head); border-bottom: 1px solid var(--border, #e5e7eb); }
.gdnd-row { height: var(--gd-row); display: flex; align-items: center; gap: .3rem; padding-right: .35rem; border-bottom: 1px solid var(--border-soft, #f1f5f9); min-width: 0; }
.gdnd-row.is-summary .gdnd-name { font-weight: 600; }
.gdnd-row.is-grabbed { opacity: .45; }
.gdnd-row.is-critical .gdnd-name { color: var(--brand); }
.gdnd-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gdnd-meta { flex: 0 0 auto; font-size: .72rem; color: var(--text-muted); }
.gdnd-handle, .gdnd-toggle, .gdnd-more { flex: 0 0 auto; border: 0; background: transparent; color: var(--text-muted); cursor: grab; padding: .15rem .25rem; border-radius: 6px; line-height: 1; font-size: .9rem; min-width: 26px; min-height: 26px; touch-action: none; }
.gdnd-toggle, .gdnd-more { cursor: pointer; touch-action: manipulation; }
.gdnd-handle:hover, .gdnd-toggle:hover, .gdnd-more:hover { background: var(--surface-3); color: var(--text); }
.gdnd-handle:focus-visible, .gdnd-more:focus-visible, .gdnd-bar:focus-visible, .gdnd-ms:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.gdnd-handle-sp { width: 8px; flex: 0 0 auto; }
.gdnd-drop-line { position: absolute; left: 0; right: 0; height: 3px; background: var(--brand); border-radius: 2px; pointer-events: none; z-index: 5; }
.gdnd-right { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.gdnd-canvas { position: relative; min-height: 80px; }
.gdnd-thead { position: absolute; top: 0; left: 0; right: 0; height: 40px; background: var(--table-head); border-bottom: 1px solid var(--border, #e5e7eb); z-index: 2; }
.gdnd-months, .gdnd-weeks { position: relative; height: 20px; }
.gdnd-m { position: absolute; top: 3px; padding-left: 4px; font-size: .72rem; font-weight: 600; color: var(--table-head-text); white-space: nowrap; border-left: 1px solid var(--border, #e5e7eb); }
.gdnd-w { position: absolute; top: 2px; padding-left: 3px; font-size: .68rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; }
.gdnd-gridline { position: absolute; top: 40px; bottom: 0; width: 1px; background: var(--border-soft, #f1f5f9); }
.gdnd-weekend { position: absolute; top: 40px; bottom: 0; background: var(--surface-2); opacity: .7; }
.gdnd-today { position: absolute; top: 20px; bottom: 0; width: 2px; background: var(--brand); opacity: .55; z-index: 1; }
.gdnd-lane { position: absolute; left: 0; right: 0; height: var(--gd-row); border-bottom: 1px solid var(--border-soft, #f1f5f9); }
.gdnd-lane.is-alt { background: var(--table-stripe); }
.gdnd-bar { position: absolute; height: 22px; border-radius: 6px; background: var(--brand); color: var(--brand-contrast); cursor: grab; z-index: 3; box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,.12)); touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.gdnd-bar.is-done { opacity: .6; }
.gdnd-bar.is-active, .gdnd-ms.is-active { cursor: grabbing; outline: 2px solid var(--text); outline-offset: 1px; }
.gdnd-bar.is-link-target, .gdnd-ms.is-link-target { outline: 3px dashed var(--brand); outline-offset: 3px; }
.gdnd:not(.is-editable) .gdnd-bar { cursor: default; }
.gdnd-prog { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(0,0,0,.22); border-radius: 6px 0 0 6px; pointer-events: none; }
.gdnd-blabel { position: absolute; left: 8px; right: 14px; top: 3px; font-size: .72rem; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.gdnd-rs { position: absolute; top: 0; bottom: 0; width: 9px; cursor: ew-resize; touch-action: none; }
.gdnd-rs-l { left: -2px; border-radius: 6px 0 0 6px; }
.gdnd-rs-r { right: -2px; border-radius: 0 6px 6px 0; }
.gdnd-bar:hover .gdnd-rs { background: rgba(255,255,255,.35); }
.gdnd-link { position: absolute; right: -16px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface, #fff); border: 2px solid var(--brand); cursor: crosshair; opacity: 0; transition: opacity .12s; touch-action: none; }
.gdnd-bar:hover .gdnd-link, .gdnd-ms:hover .gdnd-link, .gdnd-bar:focus .gdnd-link, .gdnd.is-dragging .gdnd-link { opacity: 1; }
@media (hover: none) { .gdnd-link { opacity: 1; width: 16px; height: 16px; right: -22px; top: 3px; } }
.gdnd-ms { position: absolute; width: 16px; height: 16px; background: var(--text); transform: rotate(45deg); border-radius: 3px; z-index: 3; cursor: grab; touch-action: pan-y; }
.gdnd-ms .gdnd-link { transform: rotate(-45deg); right: -18px; top: -2px; }
.gdnd-sum { position: absolute; height: 8px; background: var(--text); border-radius: 2px; z-index: 3; opacity: .85; }
.gdnd-sum::before, .gdnd-sum::after { content: ''; position: absolute; bottom: -5px; border: 5px solid transparent; border-top-color: var(--text); }
.gdnd-sum::before { left: -1px; } .gdnd-sum::after { right: -1px; }
.gdnd-baseline { position: absolute; height: 4px; background: var(--text-muted); opacity: .45; border-radius: 2px; z-index: 2; }
.gdnd-arrows { position: absolute; top: 0; left: 0; z-index: 4; pointer-events: none; overflow: visible; }
.gdnd-dep { pointer-events: auto; cursor: pointer; }
.gdnd:not(.is-editable) .gdnd-dep { cursor: default; }
.gdnd-dep-hit { fill: none; stroke: transparent; stroke-width: 12; }
.gdnd-dep-line { fill: none; stroke: var(--text-muted); stroke-width: 1.5; }
.gdnd-dep:hover .gdnd-dep-line { stroke: var(--brand); stroke-width: 2.5; }
.gdnd-ah { fill: var(--text-muted); }
.gdnd-link-temp { stroke: var(--brand); stroke-width: 2; stroke-dasharray: 5 4; }
.gdnd-tip { position: absolute; z-index: 6; padding: .15rem .45rem; border-radius: 6px; font-size: .72rem; white-space: nowrap; background: var(--text); color: var(--surface, #fff); pointer-events: none; }
.gdnd.is-saving { cursor: progress; }
.gdnd.is-dragging, .gdnd.is-dragging * { user-select: none; -webkit-user-select: none; }
.gdnd-empty { padding: .75rem; }
.gdnd--compact { --gd-row: 26px; font-size: .78rem; }
.gdnd--compact .gdnd-bar { height: 16px; }
.gdnd--compact .gdnd-blabel { top: 0; }
.gdnd-overlay { position: fixed; inset: 0; z-index: 10050; background: var(--overlay); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.gdnd-dlg { width: min(520px, 100%); max-height: 88vh; overflow: auto; background: var(--surface, #fff); color: var(--text); border-radius: 12px; padding: 1rem 1.1rem; box-shadow: 0 12px 40px rgba(0,0,0,.25); border: 1px solid var(--border, #e5e7eb); }
.gdnd-dlg-title { margin: 0 0 .6rem; font-size: 1.05rem; }
.gdnd-dlg-body label { display: block; margin: 0 0 .6rem; font-size: .85rem; }
.gdnd-dlg-body input[type=text], .gdnd-dlg-body input[type=number], .gdnd-dlg-body input[type=search] { width: 100%; margin-top: .25rem; background: var(--input-bg); color: var(--input-text); border: 1px solid var(--input-border); border-radius: 8px; padding: .45rem .55rem; }
.gdnd-dlg-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .75rem; }
.gdnd-checklist { max-height: 46vh; overflow: auto; border: 1px solid var(--border, #e5e7eb); border-radius: 8px; padding: .3rem .5rem; margin: .5rem 0; }
.gdnd-check { display: flex !important; gap: .45rem; align-items: baseline; padding: .3rem 0; margin: 0 !important; border-bottom: 1px solid var(--border-soft, #f1f5f9); cursor: pointer; }
.gdnd-check small { margin-left: auto; }
.gdnd-menu { position: absolute; z-index: 10040; min-width: 210px; background: var(--surface, #fff); border: 1px solid var(--border, #e5e7eb); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: .3rem; }
.gdnd-menu-item { display: block; width: 100%; text-align: left; border: 0; background: transparent; color: var(--text); padding: .5rem .65rem; border-radius: 7px; cursor: pointer; font-size: .88rem; }
.gdnd-menu-item:hover, .gdnd-menu-item:focus { background: var(--surface-3); }
.gdnd-menu-item.is-danger { color: var(--badge-danger-text); }
.gdnd-toast { position: fixed; right: 1rem; bottom: 1rem; z-index: 10060; padding: .6rem .9rem; border-radius: 8px; background: var(--badge-ok-bg); color: var(--badge-ok-text); border: 1px solid var(--border, #e5e7eb); box-shadow: 0 6px 18px rgba(0,0,0,.18); font-size: .875rem; opacity: 0; transform: translateY(8px); transition: opacity .15s, transform .15s; pointer-events: none; max-width: min(420px, calc(100vw - 2rem)); }
.gdnd-toast.is-on { opacity: 1; transform: none; }
.gdnd-toast.is-error { background: var(--badge-danger-bg); color: var(--badge-danger-text); }
@media (max-width: 640px) {
  .gdnd { --gd-left: 170px; font-size: .8rem; }
  .gdnd-row { gap: .1rem; }
  .gdnd-handle-sp { width: 4px; }
  .gdnd-handle, .gdnd-more, .gdnd-toggle { min-width: 26px !important; padding: .1rem; }
  .gdnd-meta { display: none; }
  .gdnd-hint { display: none; }
  .gdnd-handle, .gdnd-more { min-height: 32px; }
}
/* —— Plantillas de servicio (popup «Desde plantilla» y admin) —— */
.svct-form { display: grid; gap: .75rem; }
.svct-vars { border: 1px solid var(--border, #e5e7eb); border-radius: 10px; padding: .5rem .75rem .75rem; margin: 0; }
.svct-vars legend { font-weight: 600; font-size: .85rem; padding: 0 .3rem; }
.svct-vars-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem .75rem; }
.svct-vars-grid label { font-size: .82rem; display: grid; gap: .2rem; }
.svct-opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .5rem .75rem; }
.svct-preview { border: 1px solid var(--border, #e5e7eb); border-radius: 10px; padding: .6rem .75rem; background: var(--surface-2); }
.svct-kpis { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin: 0 0 .5rem; }
.svct-kpi .k { display: block; font-size: .7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .02em; }
.svct-kpi .v { font-size: 1.05rem; font-weight: 700; }
.svct-phase-table { width: 100%; border-collapse: collapse; font-size: .8rem; margin: 0 0 .6rem; }
.svct-phase-table th, .svct-phase-table td { padding: .3rem .4rem; border-bottom: 1px solid var(--border-soft, #f1f5f9); text-align: left; }
.svct-phase-table th { color: var(--table-head-text); background: var(--table-head); font-weight: 600; }
.svct-phase-table td.num, .svct-phase-table th.num { text-align: right; white-space: nowrap; }
.svct-note { font-size: .78rem; color: var(--text-muted); margin: .25rem 0 0; }
.svct-acts-wrap { overflow-x: auto; }
.svct-acts { width: 100%; border-collapse: collapse; font-size: .8rem; min-width: 980px; }
.svct-acts th { text-align: left; font-weight: 600; color: var(--table-head-text); background: var(--table-head); padding: .3rem; }
.svct-acts td { padding: .2rem; border-bottom: 1px solid var(--border-soft, #f1f5f9); vertical-align: top; }
.svct-acts input[type=text], .svct-acts input[type=number], .svct-acts select { width: 100%; min-width: 0; padding: .3rem .35rem; font-size: .8rem; background: var(--input-bg); color: var(--input-text); border: 1px solid var(--input-border); border-radius: 6px; }
.svct-acts td.c-ms { text-align: center; }
.svct-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .75rem; }
.svct-card { border: 1px solid var(--border, #e5e7eb); border-radius: 12px; padding: .8rem .9rem; background: var(--surface, #fff); display: grid; gap: .35rem; }
.svct-card h3 { margin: 0; font-size: 1rem; }
.svct-card .svct-chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.svct-sched-card { margin: 1rem 0; }
.svct-sched-card .svct-phase-table { max-width: 720px; }
.gdnd-bar.is-critical { background: var(--badge-danger-text); color: var(--surface, #fff); }
.svct-mini { margin-top: .4rem; }
.gantt-below { display: grid; gap: 1rem; }
