/* AGcompliance Pro — estilos propios (Bootstrap 5 + tokens de la marca). */
:root {
  --ag-navy: #051C4B;
  --ag-blue: #0F5EF7;
  --ag-blue-dark: #0B4BD0;
  --ag-cyan: #00B8D9;
  --ag-green: #36B37E;
  --ag-red: #FF5630;
  --ag-amber: #FFAB00;
  --ag-bg: #F7F8FA;
  --ag-text: #1F2A44;
  --ag-muted: #8392AB;
  --ag-border: #E6EAF0;
  --ag-radius: 18px;
  --ag-shadow: 0 6px 24px rgba(23, 43, 77, .06);
  --ag-sidebar-w: 250px;
  --bs-body-font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bs-body-color: var(--ag-text);
  --bs-body-bg: var(--ag-bg);
  --bs-primary: var(--ag-blue);
  --bs-primary-rgb: 15, 94, 247;
}

html { font-size: 14px; }
body { background: var(--ag-bg); }
a { color: var(--ag-blue); }

/* ---------- Layout de la app ---------- */
.ag-sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--ag-sidebar-w);
  background: var(--ag-navy); color: #fff;
  border-bottom-right-radius: 32px;
  height: 100vh; overflow-y: auto; z-index: 1030;
  transition: transform .2s ease;
}
.ag-brand { padding: 2.25rem 1.75rem 1.5rem; text-align: center; }
.ag-org-logo { max-width: 110px; max-height: 110px; display: block; margin: 0 auto; }
.ag-org-name { font-weight: 700; font-size: 1.1rem; }
.ag-product {
  margin-top: .9rem; padding-top: .75rem; border-top: 3px solid #fff;
  font-weight: 700; font-size: 1rem; letter-spacing: .01em;
}
.ag-nav { padding: 1.5rem 1.25rem; display: flex; flex-direction: column; gap: .25rem; }
.ag-nav-link {
  display: flex; align-items: center; gap: 1rem;
  padding: .8rem 1.25rem; border-radius: 4px;
  color: #fff; font-weight: 600; text-decoration: none;
}
.ag-nav-link i { width: 18px; text-align: center; opacity: .75; font-size: .95rem; }
.ag-nav-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.ag-nav-link.active { background: var(--ag-blue); box-shadow: inset 4px 0 0 rgba(255,255,255,.35); }
.ag-nav-link.active i { opacity: 1; }

.ag-main { margin-left: var(--ag-sidebar-w); min-height: 100vh; display: flex; flex-direction: column; transition: margin .2s ease; }
body.sidebar-collapsed .ag-sidebar { transform: translateX(-100%); }
body.sidebar-collapsed .ag-main { margin-left: 0; }

.ag-topnav {
  display: flex; align-items: center; gap: 1.25rem;
  padding: 1rem 2rem; border-bottom: 1px solid var(--ag-border); background: var(--ag-bg);
}
.ag-icon-btn { border: 0; background: transparent; color: var(--ag-muted); font-size: 1.05rem; padding: .4rem .5rem; border-radius: 10px; }
.ag-icon-btn:hover { color: var(--ag-navy); background: #fff; }
.ag-bell { background: #fff; box-shadow: var(--ag-shadow); width: 44px; height: 44px; border-radius: 50%; }
.ag-user-pill {
  display: flex; align-items: center; gap: .6rem; border: 0;
  background: #fff; padding: .45rem 1.1rem .45rem .5rem; border-radius: 14px; box-shadow: var(--ag-shadow);
}
.ag-user-name { color: var(--ag-blue); font-weight: 600; font-size: .85rem; }
.ag-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.ag-avatar-initials { display: inline-grid; place-items: center; background: var(--ag-navy); color: #fff; font-size: .8rem; font-weight: 700; }
.ag-dropdown { border: 0; border-radius: 14px; box-shadow: 0 10px 30px rgba(23,43,77,.14); padding: .5rem; min-width: 260px; }
.ag-dropdown .dropdown-item { border-radius: 8px; font-size: .9rem; padding: .5rem .75rem; }
.ag-dropdown .dropdown-item.active { background: rgba(15, 94, 247, .1); color: var(--ag-blue); font-weight: 600; }
.ag-dot { font-size: .45rem; vertical-align: middle; margin-right: .6rem; color: var(--ag-muted); }
.dropdown-item.active .ag-dot { color: var(--ag-blue); }
.ag-program-badge { color: var(--ag-muted); font-size: .85rem; font-weight: 600; }

.ag-content { flex: 1; padding: 1.75rem 2rem 2rem; }
.ag-footer { padding: 1.5rem 2rem 2rem; color: var(--ag-muted); font-size: .9rem; }

/* ---------- Componentes ---------- */
.ag-page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.ag-page-title { font-size: 1.75rem; font-weight: 500; color: var(--ag-navy); margin: 0; }
.ag-headline { font-size: 2rem; font-weight: 500; color: #3C4858; margin: 0 0 1.5rem; }

.ag-card { background: #fff; border-radius: var(--ag-radius); box-shadow: var(--ag-shadow); height: 100%; }
.ag-card-head { padding: 1.4rem 1.6rem 1rem; border-bottom: 1px solid var(--ag-border); }
.ag-card-head h3 { font-size: 1.05rem; font-weight: 500; margin: 0; color: #3C4858; }
.ag-card-head small { color: var(--ag-muted); }
.ag-card-body { padding: 1.4rem 1.6rem; }

.ag-kpi { display: flex; align-items: center; gap: 1rem; padding: 1.25rem 1.4rem; }
.ag-kpi-icon { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none; }
.ag-kpi-label { flex: 1; line-height: 1.25; color: var(--ag-navy); font-weight: 500; }
.ag-kpi-label small { display: block; color: var(--ag-muted); font-size: .8rem; }
.ag-kpi-value { font-size: 1.4rem; font-weight: 700; color: var(--ag-navy); }
.kpi-navy { background: var(--ag-navy); }
.kpi-cyan { background: var(--ag-cyan); }
.kpi-green { background: var(--ag-green); }
.kpi-red { background: var(--ag-red); }

.ag-progress { height: 10px; border-radius: 10px; background: #EEF1F6; }
.ag-progress .progress-bar { background: var(--ag-blue); border-radius: 10px; }

.ag-status { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .6rem; }
.ag-status-ongoing { background: var(--ag-cyan); }
.ag-status-onhold { background: var(--ag-amber); }
.ag-status-finished { background: var(--ag-green); }

.ag-timeline { list-style: none; margin: 0; padding: 0; }
.ag-timeline li { padding: .55rem 0; border-bottom: 1px dashed var(--ag-border); }
.ag-timeline li:last-child { border-bottom: 0; }

.ag-empty { padding: 3.5rem 2rem; text-align: center; height: auto; }
.ag-empty i { font-size: 2.2rem; color: var(--ag-amber); margin-bottom: 1rem; }
.ag-empty h3 { font-size: 1.2rem; color: var(--ag-navy); }

.btn.ag-btn-primary { background: var(--ag-blue); border-color: var(--ag-blue); color: #fff; font-weight: 600; border-radius: 6px; padding: .6rem 1.25rem; }
.btn.ag-btn-primary:hover { background: var(--ag-blue-dark); border-color: var(--ag-blue-dark); color: #fff; }
.ag-input { border: 1px solid var(--ag-blue); border-radius: 6px; padding: .65rem 1rem; font-size: .9rem; }
.ag-input::placeholder { color: #A0AEC0; font-weight: 500; }
.form-control:focus, .form-check-input:focus { box-shadow: 0 0 0 .2rem rgba(15, 94, 247, .2); border-color: var(--ag-blue); }

/* ---------- Login ---------- */
body.auth {
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 20%, rgba(15, 94, 247, .06) 0 220px, transparent 221px),
    radial-gradient(circle at 85% 80%, rgba(5, 28, 75, .05) 0 260px, transparent 261px),
    var(--ag-bg);
}
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 400px; background: #fff; border-radius: 16px; box-shadow: 0 20px 50px rgba(23, 43, 77, .1); padding: 3rem 5rem; }
.auth-title { font-size: 1.85rem; font-weight: 500; color: var(--ag-navy); text-align: center; margin-bottom: 2rem; }
.auth-label { display: block; color: var(--ag-blue); font-weight: 600; font-size: .85rem; margin-bottom: .6rem; }
.auth-footer { margin-top: 1.25rem; color: var(--ag-muted); font-size: .85rem; }

@media (max-width: 991.98px) {
  .ag-sidebar { transform: translateX(-100%); }
  .ag-main { margin-left: 0; }
  body.sidebar-open .ag-sidebar { transform: none; }
  .ag-topnav, .ag-content, .ag-footer { padding-left: 1rem; padding-right: 1rem; }
  .auth-card { padding: 2.5rem 1.75rem; }
}

/* ---------- Fase 3: mesas, hitos, archivos ---------- */
.btn.ag-btn-muted { background: #A0AEC0; border-color: #A0AEC0; color: #fff; font-weight: 600; border-radius: 6px; padding: .6rem 1.25rem; }
.btn.ag-btn-muted:hover { background: #8392AB; color: #fff; }
.btn.ag-btn-danger { background: var(--ag-red); border-color: var(--ag-red); color: #fff; border-radius: 6px; }
.btn.btn-sm.ag-btn-primary, .btn.btn-sm.ag-btn-muted { padding: .45rem .9rem; font-size: .8rem; }
.kpi-amber { background: var(--ag-amber); }

.ag-alert { border: 0; border-radius: 12px; box-shadow: var(--ag-shadow); font-weight: 500; }
.ag-alert-ok { background: #E6F6EF; color: #1E7B53; }
.ag-alert-error { background: #FFECE8; color: #B23A1E; }

.ag-badge { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 600; white-space: nowrap; vertical-align: middle; }
.ag-badge-amber { background: #FFF4D6; color: #A06A00; }
.ag-badge-green { background: #E3F5EC; color: #1E7B53; }
.ag-badge-red { background: #FFE5DF; color: #B23A1E; }
.ag-badge-cyan { background: #DFF7FB; color: #00788D; }
.ag-badge-gray { background: #EEF1F6; color: #5B6B84; }

.ag-segmented { display: inline-flex; background: #EEF1F6; border-radius: 8px; padding: 3px; }
.ag-segmented a { padding: .5rem 1rem; border-radius: 6px; color: var(--ag-navy); font-weight: 600; font-size: .85rem; text-decoration: none; }
.ag-segmented a.active { background: #fff; box-shadow: 0 1px 4px rgba(23,43,77,.12); }

.ag-plan-card { display: flex; flex-direction: column; }
.ag-plan-link { display: flex; flex-direction: column; align-items: center; gap: .65rem; padding: 1.25rem 1rem 1rem; text-decoration: none; color: inherit; flex: 1; text-align: center; position: relative; }
.ag-plan-status { position: absolute; top: 1rem; left: 1rem; }
.ag-plan-avatar { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 1.5rem; font-weight: 600; margin-top: 1.25rem; }
.ag-plan-name { font-size: 1rem; color: #3C4858; }
.ag-program-tag { background: #EEF1F6; color: var(--ag-navy); font-weight: 700; font-size: .78rem; padding: .2rem .5rem; border-radius: 4px; }
.ag-plan-stats { color: var(--ag-muted); font-size: .8rem; }
.ag-plan-stats strong { color: #5B6B84; }
.ag-plan-actions { display: flex; justify-content: space-around; border-top: 1px solid var(--ag-border); padding: .8rem; }
.ag-plan-actions a { color: var(--ag-muted); padding: .2rem .6rem; }
.ag-plan-actions a:hover { color: var(--ag-blue); }

.ag-avatars { display: flex; }
.ag-avatars .ag-avatar + .ag-avatar { margin-left: -8px; }
.ag-avatar-sm { width: 30px; height: 30px; font-size: .7rem; border: 2px solid #fff; }
.ag-avatar-more { display: inline-grid; place-items: center; background: #EEF1F6; color: #5B6B84; font-weight: 700; }

.ag-sq-btn { width: 28px; height: 28px; border: 0; border-radius: 6px; display: inline-grid; place-items: center; color: #fff; font-size: .75rem; text-decoration: none; }
.ag-sq-btn:hover { filter: brightness(.92); color: #fff; }
.ag-sq-blue { background: var(--ag-blue); }
.ag-sq-red { background: var(--ag-red); }
.ag-sq-cyan { background: var(--ag-cyan); }
form:has(> .ag-sq-btn), form:has(> input + .ag-sq-btn) { display: inline; margin: 0; }

.ag-plan-desc { color: var(--ag-muted); border-bottom: 1px solid var(--ag-border); white-space: pre-line; }
.ag-plan-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.ag-plan-meta small, .ag-mini-kpi small { display: block; color: var(--ag-muted); font-size: .78rem; }
.ag-plan-meta strong { color: #3C4858; font-weight: 600; }
.ag-mini-kpi { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.1rem; }
.ag-mini-kpi strong { font-size: 1.15rem; color: var(--ag-navy); }
.ag-mini-kpi .ag-kpi-icon { width: 40px; height: 40px; }

.ag-control-list { list-style: none; margin: 0; padding: 0; }
.ag-control-list li { display: grid; grid-template-columns: 1fr 150px auto; align-items: center; gap: 1rem; padding: .9rem 1.6rem; border-bottom: 1px solid var(--ag-border); }
.ag-control-list li:last-child { border-bottom: 0; }
.ag-control-list li:target { background: #F2F7FF; }
.ag-control-main { border: 0; background: none; text-align: left; padding: 0; display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; }
.ag-control-title { color: var(--ag-navy); font-weight: 500; }
.ag-control-main:hover .ag-control-title { color: var(--ag-blue); }
.ag-control-progress { color: var(--ag-muted); font-size: .8rem; }
.ag-control-actions { display: flex; align-items: center; gap: .4rem; }
.ag-clip { color: #5B6B84; font-size: .8rem; margin-right: .25rem; }
.ag-clip i { margin-right: .2rem; }
.ag-code { background: var(--ag-navy); color: #fff; font-size: .7rem; font-weight: 700; padding: .1rem .4rem; border-radius: 4px; margin-right: .45rem; vertical-align: 1px; }

.ag-file-list { list-style: none; margin: 0; padding: 0; }
.ag-file-list li { display: flex; align-items: center; gap: .6rem; padding: .55rem 0; border-bottom: 1px dashed var(--ag-border); flex-wrap: wrap; }
.ag-file-list li:last-child { border-bottom: 0; }
.ag-file-list i { color: var(--ag-navy); width: 16px; text-align: center; }
.ag-file-list a { color: var(--ag-text); font-weight: 500; word-break: break-all; }
.ag-dropzone { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; border: 2px dashed #B8CCF5; border-radius: 12px; padding: 1rem; margin-top: 1rem; }
.ag-hash { font-family: ui-monospace, Menlo, monospace; font-size: .7rem; color: var(--ag-muted); }

.ag-member-list, .ag-activity { list-style: none; margin: 0; padding: 0; }
.ag-member-list li { display: flex; align-items: center; gap: .75rem; padding: .85rem 1.6rem; border-bottom: 1px solid var(--ag-border); }
.ag-member-list li:last-child { border-bottom: 0; }
.ag-activity li { display: flex; gap: .8rem; padding: .6rem 0; font-size: .85rem; }
.ag-activity-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--ag-blue); margin-top: .35rem; box-shadow: 0 0 0 4px rgba(15,94,247,.12); }

/* Modal con el estilo de la app actual: título fuera de la tarjeta y botón "Cerrar" */
.ag-modal .modal-content { background: transparent; border: 0; }
.ag-modal .modal-header { border: 0; padding: 0 .25rem 1rem; }
.ag-modal .modal-title { color: var(--ag-navy); font-size: 1.6rem; font-weight: 500; margin: 0; }
.ag-modal .modal-body { background: #fff; border-radius: 18px; padding: 2rem 2.25rem; box-shadow: 0 20px 50px rgba(23,43,77,.12); }
.modal-backdrop.show { opacity: .75; background: #F7F8FA; }
.ag-modal-close { margin-left: auto; border: 0; background: none; color: var(--ag-blue); font-weight: 600; font-size: .85rem; display: flex; align-items: center; gap: .5rem; }
.ag-modal-close span { width: 26px; height: 26px; border-radius: 50%; background: var(--ag-blue); color: #fff; display: grid; place-items: center; font-size: .7rem; }

.ag-form .form-label { font-weight: 600; font-size: .85rem; color: var(--ag-navy); }
.ag-form .form-control, .ag-form .form-select { border-color: #C9D3E0; border-radius: 8px; padding: .6rem .9rem; }
.ag-addon { background: var(--ag-blue); color: #fff; border-color: var(--ag-blue); font-weight: 700; }
.ag-check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .5rem; max-height: 240px; overflow-y: auto; }
.ag-check { display: flex; align-items: center; gap: .6rem; padding: .5rem .7rem; border: 1px solid var(--ag-border); border-radius: 10px; cursor: pointer; font-size: .85rem; }
.ag-check:has(input:checked) { border-color: var(--ag-blue); background: #F2F7FF; }

.ag-detail-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 1rem; }
.ag-detail-grid small { display: block; font-weight: 600; color: var(--ag-navy); margin-bottom: .3rem; }
.ag-detail-grid span { color: #5B6B84; }
.ag-section-title { font-size: .95rem; font-weight: 600; color: var(--ag-navy); margin: 1rem 0 .5rem; }
.ag-prewrap { white-space: pre-line; color: #5B6B84; }

@media (max-width: 767.98px) {
  .ag-control-list li { grid-template-columns: 1fr; gap: .4rem; }
  .ag-detail-grid, .ag-plan-meta { grid-template-columns: 1fr 1fr; }
  .ag-modal .modal-body { padding: 1.25rem; }
}
/* Tarjetas apiladas en columna: alto según su contenido (no estirar al alto de la columna) */
.d-flex.flex-column > .ag-card { height: auto; }

/* ---------- Tableros kanban ---------- */
.ag-crumb { color: var(--ag-muted); font-size: .85rem; text-decoration: none; }
.ag-crumb:hover { color: var(--ag-blue); }
.ag-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(280px, 1fr); gap: 1rem; overflow-x: auto; padding-bottom: 1rem; align-items: start; }
.ag-col { background: #fff; border-radius: 14px; box-shadow: var(--ag-shadow); display: flex; flex-direction: column; min-height: 320px; }
.ag-col-head { display: flex; justify-content: space-between; align-items: center; background: #8392AB; color: #fff; padding: .85rem 1.1rem; border-radius: 14px 14px 0 0; font-weight: 500; border-left: 5px solid var(--stage, #8392AB); }
.ag-col-count { background: #fff; color: var(--ag-navy); border-radius: 50%; min-width: 24px; height: 24px; display: grid; place-items: center; font-size: .75rem; font-weight: 700; padding: 0 .3rem; }
.ag-col-body { padding: .9rem; display: flex; flex-direction: column; gap: .75rem; flex: 1; border-radius: 0 0 14px 14px; transition: background .15s; }
.ag-col-body.ag-drop-target { background: #F2F7FF; outline: 2px dashed #B8CCF5; outline-offset: -6px; }
.ag-col-empty { display: none; border: 1px dashed #C9D3E0; border-radius: 10px; padding: 1.1rem; text-align: center; color: #A0AEC0; font-size: .85rem; }
.ag-col-body:not(:has(.ag-kcard)) .ag-col-empty { display: block; }
.ag-col-add { border: 0; background: none; color: var(--ag-blue); font-weight: 600; font-size: .82rem; padding: .7rem; border-top: 1px solid var(--ag-border); }
.ag-col-add:hover { background: #F2F7FF; border-radius: 0 0 14px 14px; }

.ag-kcard { background: #fff; border: 1px solid var(--ag-border); border-radius: 12px; padding: .85rem 1rem; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.ag-kcard:hover, .ag-kcard:focus { box-shadow: 0 6px 18px rgba(23,43,77,.1); outline: none; }
.ag-kcard[draggable="true"] { cursor: grab; }
.ag-kcard.ag-dragging { opacity: .45; transform: rotate(1deg); }
.ag-kcard.ag-overdue { border-left: 4px solid var(--ag-red); }
.ag-kcard-title { font-size: .92rem; font-weight: 600; color: var(--ag-navy); margin: .45rem 0 .35rem; word-break: break-word; }
.ag-kcard-control { font-size: .75rem; color: #5B6B84; margin-bottom: .35rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-kcard-dates { display: flex; justify-content: space-between; color: var(--ag-muted); font-size: .8rem; }
.ag-kcard-foot { display: flex; justify-content: space-between; align-items: center; margin-top: .55rem; }
.ag-kcard-meta { display: flex; gap: .7rem; color: var(--ag-muted); font-size: .8rem; }
.ag-kcard-meta i { margin-right: .2rem; }

.ag-prio { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .7rem; font-weight: 700; color: #fff; }
.ag-prio-low { background: var(--ag-green); }
.ag-prio-medium { background: var(--ag-amber); }
.ag-prio-high { background: var(--ag-red); }

.ag-item-title { font-size: 1.15rem; color: var(--ag-navy); margin: 0; }
.ag-label { display: block; font-weight: 600; color: var(--ag-navy); margin-bottom: .3rem; }
.flex-none { flex: none; }
.ag-tabs { border: 1px solid var(--ag-blue); border-radius: 10px; padding: 2px; gap: 2px; }
.ag-tabs button { border: 0; background: none; color: var(--ag-blue); font-weight: 600; font-size: .85rem; padding: .5rem .9rem; border-radius: 8px; }
.ag-tabs button.active { background: var(--ag-blue); color: #fff; }
.ag-comments { list-style: none; padding: 0; margin: 0 0 1rem; }
.ag-comments li { display: flex; gap: .7rem; padding: .7rem 0; border-bottom: 1px dashed var(--ag-border); }
.ag-link-btn { border: 0; background: none; color: var(--ag-muted); padding: .1rem .35rem; }
.ag-link-btn:hover:not(:disabled) { color: var(--ag-red); }
.ag-checklist { list-style: none; padding: 0; margin: 0; }
.ag-checklist li { display: flex; align-items: center; gap: .6rem; padding: .45rem 0; border-bottom: 1px dashed var(--ag-border); }
.ag-checklist li form { display: inline; margin: 0; }
.ag-checklist li .ag-link-btn i.fa-check-square { color: var(--ag-green); }
.ag-checklist li.done span { text-decoration: line-through; color: var(--ag-muted); }

/* ---------- Dashboard ---------- */
a.ag-kpi-link { text-decoration: none; color: inherit; transition: box-shadow .15s; }
a.ag-kpi-link:hover { box-shadow: 0 10px 28px rgba(23,43,77,.12); }
.ag-kpi-label small + small, .ag-kpi-label small:last-child:not(:first-child) { display: block; color: var(--ag-muted); font-size: .72rem; font-weight: 400; }
.ag-big-pct { font-size: 2.6rem; font-weight: 600; color: var(--ag-navy); line-height: 1; margin-bottom: .75rem; }
.ag-big-pct span { font-size: 1.2rem; margin-left: .2rem; color: var(--ag-muted); }
.ag-split { display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; border-top: 1px solid var(--ag-border); padding-top: .9rem; }
.ag-split strong { display: block; font-size: 1.15rem; color: var(--ag-navy); }
.ag-split small { color: var(--ag-muted); font-size: .75rem; }
.ag-table { font-size: .85rem; }
.ag-table th { color: var(--ag-muted); font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .02em; border-bottom-color: var(--ag-border); padding: .75rem 1rem; }
.ag-table td { padding: .7rem 1rem; vertical-align: middle; border-bottom-color: var(--ag-border); }
.ag-table td a { color: var(--ag-navy); font-weight: 600; text-decoration: none; }
.ag-table td a:hover { color: var(--ag-blue); }
.ag-row-current td { background: #F2F7FF; }
.ag-table .ag-progress { height: 6px; min-width: 80px; }
.ag-pct { min-width: 38px; text-align: right; color: #5B6B84; }

/* ---------- Lista de tareas ---------- */
.ag-filters { padding: 1.1rem 1.25rem; height: auto; }
.ag-filters .form-label { font-size: .75rem; font-weight: 600; color: var(--ag-muted); margin-bottom: .25rem; }
.ag-filters .form-select, .ag-filters .form-control { border-radius: 8px; border-color: #C9D3E0; font-size: .85rem; }
.ag-row-closed td { color: var(--ag-muted); }
.ag-row-closed td a { color: var(--ag-muted); text-decoration: line-through; }
.pagination .page-link { color: var(--ag-navy); border-color: var(--ag-border); }
.pagination .page-item.active .page-link { background: var(--ag-blue); border-color: var(--ag-blue); color: #fff; }

/* ---------- Procesos ---------- */
.ag-alert-warn { background: #FFF4D6; color: #8A5A00; }
.ag-alert-warn a { color: #8A5A00; }
.ag-badge-dark { background: #3C4858; color: #fff; }
.ag-ellipsis { max-width: 340px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-detail-grid-3 { grid-template-columns: repeat(3, 1fr); row-gap: 1.1rem; }
.ag-meta-list > div { padding: .6rem 0; border-bottom: 1px dashed var(--ag-border); }
.ag-meta-list > div:last-child { border-bottom: 0; }
.ag-meta-list small:first-child { display: block; font-weight: 600; color: var(--ag-navy); }
.ag-meta-list span { display: block; }
.ag-card.ag-card-body { height: auto; }
/* El resumen de validación solo se ve cuando hay errores. */
.validation-summary-valid { display: none; }
.validation-summary-errors ul { margin: 0; padding-left: 1.1rem; }

/* ---------- Versionamiento de procesos ---------- */
.ag-mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85em; letter-spacing: .01em; }
.ag-code-title { background: var(--ag-navy); color: #fff; padding: .15rem .5rem; border-radius: 6px; margin-right: .6rem; font-size: .6em; vertical-align: middle; }
.ag-version { display: inline-block; font-family: ui-monospace, Menlo, monospace; font-weight: 700; font-size: .78rem; color: var(--ag-blue); background: #E8F0FF; border-radius: 6px; padding: .1rem .45rem; text-decoration: none; }
.ag-version-lg { font-size: 1.3rem; padding: .3rem .7rem; }
.ag-version-draft { color: #8A5A00; background: #FFF4D6; }
.ag-version-old { color: #5B6B84; background: #EEF1F6; text-decoration: line-through; }
.btn.ag-btn-success { background: var(--ag-green); border-color: var(--ag-green); color: #fff; font-weight: 600; border-radius: 6px; }
.btn.ag-btn-success:hover { filter: brightness(.93); color: #fff; }
.btn.ag-btn-outline { border: 1px solid var(--ag-blue); color: var(--ag-blue); background: #fff; font-weight: 600; border-radius: 6px; }
.btn.ag-btn-outline:hover { background: #F2F7FF; }
.ag-alert-info { background: #E8F0FF; color: #1D4FB8; }
.ag-panel { border: 2px solid #B8E3CF; }
.ag-radio { display: block; border: 1px solid var(--ag-border); border-radius: 10px; padding: .5rem .7rem; margin-bottom: .4rem; cursor: pointer; }
.ag-radio:has(input:checked) { border-color: var(--ag-green); background: #F0FAF5; }
.ag-radio small { display: block; color: var(--ag-muted); margin-left: 1.3rem; }
.ag-change { background: #F7F8FA; border-left: 4px solid var(--ag-blue); border-radius: 6px; padding: .6rem .9rem; white-space: pre-line; }
.ag-change small { display: block; font-weight: 700; color: var(--ag-navy); }
.ag-hist { padding: .7rem 0; border-bottom: 1px dashed var(--ag-border); }
.ag-hist:last-child { border-bottom: 0; }
.ag-hist-current { background: #F2F7FF; margin: 0 -1.6rem; padding: .7rem 1.6rem; }
.ag-hist-review i { color: var(--ag-green); }

/* ---------- Usuarios y Mi cuenta ---------- */
.ag-alert-key { background: #E6F6EF; color: #1E5B42; border: 1px solid #B8E3CF; }
.ag-temp-pass { font-size: 1.1rem; background: #fff; color: var(--ag-navy); padding: .35rem .7rem; border-radius: 8px; border: 1px dashed #36B37E; letter-spacing: .05em; }
.ag-inline-select { width: auto; min-width: 150px; display: inline-block; border-radius: 8px; }
.ag-avatar-xl { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; font-size: 2rem; display: inline-grid; place-items: center; }

/* ---------- Gantt ---------- */
.ag-gantt { display: flex; height: auto; overflow: hidden; }
.ag-gantt-side { flex: none; width: 280px; border-right: 1px solid var(--ag-border); background: #fff; z-index: 2; }
.ag-gantt-corner { height: 58px; display: flex; align-items: flex-end; padding: 0 1rem .5rem; font-size: .72rem; font-weight: 700; color: var(--ag-muted); text-transform: uppercase; border-bottom: 1px solid var(--ag-border); }
.ag-gantt-label { height: 38px; line-height: 38px; padding: 0 1rem; font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-bottom: 1px solid #F0F3F7; }
.ag-gantt-label.ag-gantt-group { font-weight: 700; color: var(--ag-navy); background: #F7F9FC; }
.ag-gantt-scroll { flex: 1; overflow-x: auto; }
.ag-gantt-canvas { position: relative; }
.ag-gantt-head { position: relative; height: 58px; border-bottom: 1px solid var(--ag-border); background: #fff; }
.ag-gantt-months, .ag-gantt-units { position: relative; height: 29px; }
.ag-gantt-months > div, .ag-gantt-units > div { position: absolute; top: 0; height: 29px; line-height: 29px; font-size: .72rem; color: #5B6B84; border-left: 1px solid var(--ag-border); padding-left: 4px; white-space: nowrap; overflow: hidden; text-transform: capitalize; }
.ag-gantt-months > div { font-weight: 700; color: var(--ag-navy); }
.ag-gantt-units > div.we { background: #F4F6FA; }
.ag-gantt-body { position: relative; }
.ag-gantt-body.scale-dias { background-image: repeating-linear-gradient(to right, transparent 0 calc(var(--day) - 1px), #F0F3F7 calc(var(--day) - 1px) var(--day)); }
.ag-gantt-body.scale-semanas { background-image: repeating-linear-gradient(to right, transparent 0 calc(var(--day) * 7 - 1px), #EEF1F6 calc(var(--day) * 7 - 1px) calc(var(--day) * 7)); }
.ag-gantt-row { position: relative; height: 38px; border-bottom: 1px solid #F0F3F7; }
.ag-gantt-row.ag-gantt-group { background: rgba(247, 249, 252, .7); }
.ag-gantt-period { position: absolute; top: 0; bottom: 0; background: rgba(15, 94, 247, .05); border-left: 2px dashed rgba(15, 94, 247, .35); border-right: 2px dashed rgba(15, 94, 247, .35); pointer-events: none; }
.ag-gantt-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ag-red); z-index: 1; pointer-events: none; }
.ag-gantt-bar { position: absolute; top: 7px; height: 24px; border-radius: 6px; overflow: hidden; color: #fff; font-size: .72rem; font-weight: 600; cursor: pointer; box-shadow: 0 1px 3px rgba(23,43,77,.2); min-width: 4px; user-select: none; }
.ag-gantt[data-can-edit="1"] .ag-gantt-bar { cursor: grab; }
.ag-gantt-bar.dragging { cursor: grabbing; opacity: .85; box-shadow: 0 6px 16px rgba(23,43,77,.3); z-index: 3; }
.ag-gantt-bar.saving { opacity: .6; }
.gb-open { background: var(--ag-blue); }
.gb-late { background: var(--ag-red); }
.gb-done { background: var(--ag-green); }
.ag-gantt-progress { position: absolute; inset: 0 auto 0 0; background: rgba(255,255,255,.28); }
.ag-gantt-text { position: relative; padding: 0 .5rem; line-height: 24px; white-space: nowrap; }
.ag-gantt-handle { position: absolute; top: 0; right: 0; bottom: 0; width: 8px; cursor: ew-resize; background: rgba(0,0,0,.15); }
.ag-gantt-diamond { position: absolute; top: 12px; width: 14px; height: 14px; margin-left: -7px; background: var(--ag-amber); transform: rotate(45deg); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.ag-gantt-diamond.ok { background: var(--ag-green); }
.ag-gantt-diamond.late { background: var(--ag-red); }
.ag-gantt-legend { display: flex; flex-wrap: wrap; gap: 1.2rem; align-items: center; font-size: .8rem; color: #5B6B84; }
.gb-sw { display: inline-block; width: 22px; height: 10px; border-radius: 3px; margin-right: .4rem; vertical-align: middle; }
.gb-diamond-sw { display: inline-block; width: 10px; height: 10px; background: var(--ag-amber); transform: rotate(45deg); margin-right: .5rem; vertical-align: middle; }
.gb-today-sw { display: inline-block; width: 2px; height: 14px; background: var(--ag-red); margin-right: .5rem; vertical-align: middle; }
@media (max-width: 767.98px) { .ag-gantt-side { width: 150px; } }
/* Barra angosta: el título se muestra a la derecha de la barra. */
.ag-gantt-bar.gb-narrow { overflow: visible; }
.ag-gantt-bar.gb-narrow .ag-gantt-text { position: absolute; left: 100%; color: var(--ag-text); font-weight: 600; padding-left: .4rem; }
.ag-gantt-bar.gb-narrow .ag-gantt-progress { border-radius: 6px; }
.ag-gantt-months > div { text-transform: none; }

/* ---------- Calendario ---------- */
.ag-cal-title { font-size: 1.15rem; min-width: 170px; text-align: center; }
.ag-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.ag-cal-dow { padding: .5rem; font-size: .72rem; font-weight: 700; color: var(--ag-muted); text-transform: uppercase; text-align: center; border-bottom: 1px solid var(--ag-border); }
.ag-cal-day { min-height: 112px; padding: .35rem .4rem; border-right: 1px solid #F0F3F7; border-bottom: 1px solid #F0F3F7; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ag-cal-day:nth-child(7n) { border-right: 0; }
.ag-cal-day.we { background: #FAFBFD; }
.ag-cal-day.out { background: #F7F8FA; }
.ag-cal-day.out .ag-cal-num { color: #C3CBD8; }
.ag-cal-num { font-size: .78rem; font-weight: 600; color: #5B6B84; align-self: flex-end; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.ag-cal-day.today .ag-cal-num { background: var(--ag-blue); color: #fff; }
.ag-cal-ev { display: block; font-size: .7rem; line-height: 1.25; padding: 2px 5px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; border-left: 3px solid; }
.ag-cal-ev:hover { filter: brightness(.95); }
.ce-task { background: #E8F0FF; color: #1D4FB8; border-color: var(--ag-blue); }
.ce-control { background: #FFF4D6; color: #8A5A00; border-color: var(--ag-amber); }
.ce-plan { background: #EEF1F6; color: #3C4858; border-color: var(--ag-navy); }
.ce-process { background: #E6F6F0; color: #1E5B42; border-color: var(--ag-green); }
.ag-cal-ev.ce-late { background: #FFE5DF; color: #B23A1E; border-color: var(--ag-red); font-weight: 700; }
.ag-cal-ev.ce-done { opacity: .6; text-decoration: line-through; }
.ag-cal-more summary { font-size: .7rem; color: var(--ag-blue); cursor: pointer; list-style: none; }
.ag-cal-more[open] { display: flex; flex-direction: column; gap: 3px; }
.ag-cal-toggle { font-size: .75rem; font-weight: 600; padding: .25rem .55rem; border-radius: 999px; border: 1px solid; cursor: pointer; display: inline-flex; align-items: center; gap: .3rem; }
.ag-cal-toggle input { margin: 0; }
.ag-cal-toggle:has(input:not(:checked)) { opacity: .45; }
.ag-cal-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; border: 0; margin-top: .35rem; }
.ag-cal-dot.ce-task { background: var(--ag-blue); } .ag-cal-dot.ce-control { background: var(--ag-amber); }
.ag-cal-dot.ce-plan { background: var(--ag-navy); } .ag-cal-dot.ce-process { background: var(--ag-green); }
.ag-agenda { display: flex; flex-direction: column; gap: .2rem; }
.ag-agenda-item { display: flex; gap: .55rem; padding: .45rem 0; border-bottom: 1px dashed var(--ag-border); text-decoration: none; color: var(--ag-text); font-size: .82rem; }
.ag-agenda-item:hover strong { color: var(--ag-blue); }
.ag-agenda-date { flex: none; width: 74px; font-size: .75rem; color: #5B6B84; font-weight: 600; }
@media (max-width: 767.98px) { .ag-cal-day { min-height: 70px; } .ag-cal-ev { font-size: .62rem; } }

/* ---------- Configuración ---------- */
a.ag-tab-link { display: inline-block; color: var(--ag-blue); font-weight: 600; font-size: .85rem; padding: .5rem .9rem; border-radius: 8px; text-decoration: none; }
a.ag-tab-link.active { background: var(--ag-blue); color: #fff; }
.ag-logo-box { background: #EEF1F6; border-radius: 12px; padding: 1rem; display: flex; align-items: center; justify-content: center; min-height: 110px; }
.ag-logo-box img { max-height: 90px; max-width: 100%; }
.ag-stage-row { display: flex; align-items: center; gap: .6rem; padding: .55rem 0; border-bottom: 1px dashed var(--ag-border); flex-wrap: wrap; }
.ag-stage-order { display: flex; flex-direction: column; width: 26px; }
.ag-stage-order form { margin: 0; }
.ag-stage-form { display: flex; align-items: center; gap: .6rem; flex: 1; min-width: 280px; }
.ag-stage-form .form-control:not(.form-control-color) { max-width: 320px; }
.ag-stage-form .form-control-color { width: 42px; padding: .2rem; border-radius: 8px; }
.ag-stage-del { display: flex; align-items: center; gap: .4rem; margin: 0; }
.ag-stage-del .form-select { width: auto; }
.ag-check-inline { display: inline-flex; align-items: center; gap: .3rem; font-size: .82rem; font-weight: 600; color: var(--ag-navy); white-space: nowrap; }
.ag-stage-new { border-bottom: 0; padding-top: 1rem; }
.ag-stage-del { margin-left: auto; flex-wrap: nowrap; }
.ag-stage-del .form-select { min-width: 140px; }

/* ---------- Campana y buzón ---------- */
.ag-bell { position: relative; }
.ag-bell-dot { position: absolute; top: 9px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--ag-red); box-shadow: 0 0 0 2px #fff; }
.ag-bell-menu { width: 340px; max-width: 92vw; }
.ag-bell-item { display: flex; flex-direction: column; white-space: normal; border-left: 3px solid transparent; }
.ag-bell-item.unread { border-left-color: var(--ag-blue); background: #F2F7FF; }
.ag-bell-item-title { font-size: .82rem; line-height: 1.3; }
.ag-bell-item.unread .ag-bell-item-title { font-weight: 600; }
.ag-inbox { list-style: none; margin: 0; padding: 0; }
.ag-inbox li a { display: flex; align-items: center; gap: .9rem; padding: .85rem 1.6rem; border-bottom: 1px solid var(--ag-border); text-decoration: none; color: var(--ag-text); }
.ag-inbox li a:hover { background: #F7F9FC; }
.ag-inbox li.unread a { background: #F2F7FF; }
.ag-inbox li.unread .ag-inbox-title { font-weight: 700; }
.ag-inbox-icon { flex: none; width: 36px; height: 36px; border-radius: 50%; background: #EEF1F6; color: var(--ag-navy); display: grid; place-items: center; }
.ag-inbox li.unread .ag-inbox-icon { background: var(--ag-blue); color: #fff; }
.ag-inbox-title { display: block; font-size: .88rem; }
.ag-inbox-body { display: block; font-size: .8rem; color: var(--ag-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-inbox-time { flex: none; font-size: .75rem; color: var(--ag-muted); }
.ag-unread-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--ag-blue); }
.min-w-0 { min-width: 0; }
