/* =====================================================================
   Mesa de Ayuda TI — Distriseguridad
   Ajustes institucionales sobre AdminLTE 3
   ===================================================================== */
:root {
  --ds-primary: #004884;      /* azul institucional (gov.co) */
  --ds-primary-2: #3366cc;
  --ds-primary-dark: #00325c;
  --ds-gold: #b8860b;         /* dorado del escudo, versión con contraste */
  --ds-ink: #1f2937;
  --ds-muted: #5b6573;
  --ds-bg: #f3f5f8;
  --ds-border: #dfe3ea;
  --ds-focus: #ffbf47;
}

body { color: var(--ds-ink); font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif; }
.content-wrapper { background: var(--ds-bg); }
a { color: var(--ds-primary-2); }
a:hover { color: var(--ds-primary); }

/* Foco visible para navegación con teclado (WCAG 2.4.7) */
a:focus-visible, button:focus-visible, .btn:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible, .custom-control-input:focus-visible ~ .custom-control-label::before {
  outline: 3px solid var(--ds-focus) !important;
  outline-offset: 2px;
  box-shadow: none !important;
}
.skip-link { position: absolute; left: -999px; top: 0; z-index: 2000; background: var(--ds-primary); color: #fff; padding: .6rem 1rem; }
.skip-link:focus { left: 8px; top: 8px; color: #fff; }
main:focus { outline: none; }

/* Botones y colores primarios */
.btn-primary { background-color: var(--ds-primary); border-color: var(--ds-primary); }
.btn-primary:hover, .btn-primary:focus { background-color: var(--ds-primary-dark); border-color: var(--ds-primary-dark); }
.btn-outline-primary { color: var(--ds-primary); border-color: var(--ds-primary); }
.btn-outline-primary:hover { background-color: var(--ds-primary); border-color: var(--ds-primary); }
.bg-primary, .badge-primary { background-color: var(--ds-primary) !important; }
.text-primary { color: var(--ds-primary) !important; }
.card-primary.card-outline { border-top-color: var(--ds-primary); }
.page-item.active .page-link { background-color: var(--ds-primary); border-color: var(--ds-primary); }
.page-link { color: var(--ds-primary); }

/* Barra superior */
.main-header { border-bottom: 3px solid var(--ds-primary); }
.app-title { font-weight: 600; color: var(--ds-primary) !important; }
.navbar-logo { height: 30px; width: auto; }

/* Menú lateral */
.brand-institucional { background: #fff; display: flex !important; align-items: center; padding: .55rem .5rem !important; border-bottom: 1px solid var(--ds-border) !important; min-height: 57px; }
.brand-institucional .brand-escudo { display: none; float: none; max-height: 36px; margin: 0 auto; box-shadow: none !important; opacity: 1; }
.brand-institucional .brand-text { display: block; width: 100%; }
.brand-logo-full { width: 100%; height: auto; display: block; }
.sidebar-collapse .main-sidebar:not(:hover) .brand-escudo { display: block; }
.sidebar-collapse .main-sidebar:not(:hover) .brand-text { display: none; }
.sidebar-subtitle { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ds-primary); padding: .75rem .5rem 0; white-space: nowrap; overflow: hidden; }
.sidebar-collapse .main-sidebar:not(:hover) .sidebar-subtitle { visibility: hidden; }
.sidebar-light-primary .nav-sidebar > .nav-item > .nav-link.active { background-color: var(--ds-primary); color: #fff; }
.nav-sidebar .nav-header { color: var(--ds-muted) !important; font-size: .72rem; font-weight: 700; letter-spacing: .05em; }
.main-sidebar .nav-link p { color: inherit; }

/* Títulos */
.page-title { font-size: 1.45rem; font-weight: 600; color: var(--ds-ink); }
.card-title { font-weight: 600; }
.card { box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08); }

/* Badges de estado (contraste AA sobre fondo blanco) */
.badge-estado { font-size: .8rem; font-weight: 600; padding: .35em .6em; }
.badge-estado-nuevo          { background: #0b6fa4; color: #fff; }   /* informativo */
.badge-estado-asignado       { background: #3949ab; color: #fff; }
.badge-estado-en_proceso     { background: #ffc107; color: #1f2937; } /* advertencia */
.badge-estado-pendiente_info { background: #c2410c; color: #fff; }
.badge-estado-solucionado    { background: #15803d; color: #fff; }   /* éxito */
.badge-estado-cerrado        { background: #4b5563; color: #fff; }   /* neutro */
.badge-estado-cancelado      { background: #b91c1c; color: #fff; }   /* peligro */
.badge-prio { font-weight: 600; }
.badge-light { border: 1px solid #c7ccd4; color: #374151; }

/* Tarjetas KPI */
.small-box .inner h3 { font-size: 2rem; }
.small-box .inner p { font-weight: 500; }
.small-box.bg-estado-nuevo { background: #0b6fa4 !important; color: #fff; }
.small-box.bg-estado-abiertos { background: var(--ds-primary) !important; color: #fff; }
.small-box.bg-estado-proceso { background: #ffc107 !important; color: #1f2937; }
.small-box.bg-estado-pendiente { background: #c2410c !important; color: #fff; }
.small-box.bg-estado-solucionado { background: #15803d !important; color: #fff; }
.small-box.bg-estado-cerrado { background: #4b5563 !important; color: #fff; }
.small-box.bg-mes { background: #3949ab !important; color: #fff; }
.small-box.bg-satisf { background: #fff !important; color: var(--ds-ink); border: 1px solid var(--ds-border); }
.small-box.bg-satisf .icon { color: var(--ds-gold); }
.small-box.bg-satisf .inner small { color: var(--ds-muted); font-weight: 500; }
.small-box.bg-satisf > .small-box-footer { color: var(--ds-primary); background: #f3f5f8; }
.small-box > .small-box-footer { color: inherit; }
.small-box .icon > i { font-size: 60px; top: 15px; }

/* Línea de tiempo */
.timeline > div > .timeline-item { box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.timeline-item .timeline-header { font-size: .95rem; }
.timeline-item.interno { border-left: 4px solid #6b7280; background: #f9fafb; }
.timeline-body { white-space: normal; word-wrap: break-word; }
.timeline > div > i.fas { font-size: 14px; }
.tl-solicitud { border-left: 4px solid #c2410c; }
.tl-solucion { border-left: 4px solid #15803d; }

/* Detalle de ticket */
.ticket-meta dt { font-weight: 600; color: var(--ds-muted); font-size: .85rem; }
.ticket-meta dd { margin-bottom: .6rem; }
.descripcion-original { white-space: normal; background: #fbfcfd; border: 1px solid var(--ds-border); border-radius: 4px; padding: .9rem 1rem; }

/* Formularios */
label { font-weight: 600; }
.form-text { color: var(--ds-muted); }
.required::after { content: " *"; color: #b91c1c; }
.invalid-feedback { display: block; }

/* Tablas */
.table thead th { border-bottom-width: 1px; font-size: .85rem; text-transform: uppercase; letter-spacing: .02em; color: var(--ds-muted); background: #f8fafc; }
.table td { vertical-align: middle; }
.table-hover tbody tr:hover { background-color: #f2f6fb; }

/* Encuesta */
.escala-satisfaccion { display: flex; flex-wrap: wrap; gap: .5rem; }
.escala-satisfaccion .opcion { flex: 1 1 110px; }
.escala-satisfaccion input { position: absolute; opacity: 0; }
.escala-satisfaccion label { display: block; text-align: center; border: 2px solid var(--ds-border); border-radius: 6px; padding: .8rem .4rem; cursor: pointer; font-weight: 500; background: #fff; margin: 0; }
.escala-satisfaccion label i { font-size: 1.8rem; display: block; margin-bottom: .35rem; color: var(--ds-muted); }
.escala-satisfaccion input:checked + label { border-color: var(--ds-primary); background: #eaf1fb; }
.escala-satisfaccion input:checked + label i { color: var(--ds-primary); }
.escala-satisfaccion input:focus-visible + label { outline: 3px solid var(--ds-focus); outline-offset: 2px; }

/* Login */
.login-page { background: linear-gradient(160deg, #eef2f7 0%, #dfe7f1 100%); }
.login-box { width: 420px; max-width: calc(100% - 32px); }
.login-logo-img { width: 100%; height: auto; }
.login-card-body { border-top: 4px solid var(--ds-primary); }

/* Gráficos */
.chart-box { position: relative; height: 280px; }

/* Impresión (exportar a PDF) */
@media print {
  .main-header, .main-sidebar, .main-footer, .no-print, .btn, form.filtros { display: none !important; }
  .content-wrapper { margin: 0 !important; background: #fff; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .print-only { display: block !important; }
  a[href]::after { content: none; }
}
.print-only { display: none; }

@media (max-width: 575.98px) {
  .page-title { font-size: 1.2rem; }
  .content-header { padding: 10px .5rem; }
  .small-box .inner h3 { font-size: 1.6rem; }
}

/* Botones de herramientas en encabezados de tarjeta: contraste AA */
.card-tools .btn-tool { color: #4b5563; }
.card-tools .btn-tool:hover { color: var(--ds-primary); }

/* Botones dentro de callouts (AdminLTE colorea y subraya los enlaces del callout) */
.callout a.btn { text-decoration: none; }
.callout a.btn-danger, .callout a.btn-success, .callout a.btn-primary { color: #fff; }
.callout a.btn-warning { color: #1f2937; }

/* Tarjeta de satisfacción: "/ 5" en línea y el icono detrás del texto */
.small-box .inner { position: relative; z-index: 1; }
.small-box .icon { z-index: 0; }
.small-box p > small.h6 { display: inline; margin: 0; font-size: 1rem; color: inherit; opacity: .75; }
.small-box.bg-satisf .icon { opacity: .35; }
