/* =========================
   VARIABLES GLOBALES
   Colores principales del sistema
========================= */
:root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --surface-soft: #eef1f5;
    --line: #dde2e8;
    --text: #242a33;
    --muted: #596374;
    --muted-2: #7a8494;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --icon: #4b5563;
    --shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

/* =========================
   CONFIGURACIÓN GENERAL
========================= */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--text);
    background: var(--bg);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    overflow-x: hidden;
}

/* =========================
   ICONOS SVG
========================= */
svg {
    width: 1em;
    height: 1em;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: 0 0 auto;
}

/* =========================
   ENLACES Y FORMULARIOS BASE
========================= */
a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* =========================
   LAYOUT GENERAL DEL SISTEMA
========================= */
.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

/* =========================
   PANEL SUPERIOR / BARRA SUPERIOR
   Cambio aplicado: color oscuro y texto visible
========================= */
.topbar {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 10px 26px;
    background: #1f2937;
    border-bottom: 1px solid #111827;
}

/* Texto e iconos visibles dentro del panel superior */
.topbar,
.topbar a,
.topbar .brand strong,
.topbar .brand small,
.topbar .topnav {
    color: #ffffff;
}

.topbar svg,
.topbar .brand-icon {
    color: #e5e7eb;
}

/* =========================
   MARCA / NOMBRE DEL SISTEMA
========================= */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 230px;
}

.brand-icon {
    width: 34px;
    height: 34px;
    color: #111827;
}

.brand strong {
    display: block;
    font-size: 18px;
    line-height: 1.1;
}

.brand small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

/* =========================
   MENÚ SUPERIOR
========================= */
.topnav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    color: #374151;
    font-size: 14px;
    white-space: nowrap;
}

/* =========================
   LINKS DE NAVEGACIÓN Y ACCIONES
========================= */
.topnav-link,
.side-link,
.quick-actions a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.topnav-link svg {
    width: 16px;
    height: 16px;
}

/* =========================
   CONTENEDOR PRINCIPAL: SIDEBAR + CONTENIDO
========================= */
.workspace {
    flex: 1;
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    min-height: 0;
}

/* =========================
   MENÚ LATERAL
========================= */
.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--line);
    padding: 14px 12px;
}

.side-menu {
    display: grid;
    gap: 7px;
}

.side-link {
    min-height: 36px;
    padding: 8px 8px;
    border-radius: 6px;
    color: #374151;
    font-size: 15px;
    transition: background-color 160ms ease, color 160ms ease;
}

.side-link svg {
    width: 16px;
    height: 16px;
}

.side-link:hover,
.side-link.active {
    background: #e5e7eb;
    color: #171717;
}

/* =========================
   CONTENIDO PRINCIPAL
========================= */
.main-content {
    width: 100%;
    min-width: 0;
    padding: 18px 22px 24px;
}

/* =========================
   BARRA INTERNA DEL CONTENIDO
   Usuario + buscador
========================= */
.toolbar {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-weight: 700;
}

.user-chip svg {
    width: 16px;
    height: 16px;
}

/* =========================
   BUSCADOR
   Ajuste aplicado:
   - Ahora el buscador funciona como formulario GET.
   - La lupa es un botón real, pero queda integrada visualmente.
========================= */
.search-box {
    width: min(100%, 300px);
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 12px;
    background: var(--surface);
    border: 1px solid #cbd3dc;
    border-radius: 8px;
    color: #9aa3af;
}

.search-box input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    color: var(--text);
    background: transparent;
}

.search-box input::placeholder {
    color: #9aa3af;
}

.search-submit {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #9aa3af;
    cursor: pointer;
}

.search-submit svg {
    width: 18px;
    height: 18px;
}

.search-submit:hover {
    color: var(--primary);
}

/* =========================
   TEXTO DE BÚSQUEDA ACTIVA
========================= */
.search-results-text {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.search-results-text strong {
    color: #111827;
}

.search-results-text a {
    margin-left: 10px;
    color: var(--primary);
    font-weight: 700;
}

.search-results-text a:hover {
    color: var(--primary-dark);
}

/* =========================
   TARJETAS DE MÉTRICAS
========================= */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(190px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.metric-card {
    min-height: 82px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: var(--surface);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.metric-card > svg {
    width: 30px;
    height: 30px;
    color: var(--icon);
}

.metric-card strong {
    display: block;
    color: #2b2f36;
    font-size: 24px;
    line-height: 1;
}

.metric-card span {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.1;
}

/* =========================
   CONTENIDO PRINCIPAL DEL DASHBOARD
========================= */
.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 16px;
    align-items: start;
}

/* =========================
   PANELES / CONTENEDORES VISUALES
========================= */
.tickets-panel,
.summary-panel,
.quick-actions,
.description-panel {
    background: var(--surface);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.tickets-panel {
    min-width: 0;
    padding: 20px 20px 18px;
}

.tickets-panel h1,
.summary-panel h2,
.quick-actions h2,
.description-panel h2 {
    margin: 0;
    color: #2a2a2a;
    font-size: 20px;
    line-height: 1.2;
}

/* =========================
   TABLA DE TICKETS
========================= */
.table-wrap {
    width: 100%;
    margin-top: 18px;
    overflow-x: auto;
}

.panel-alert {
    margin: 14px 0 0;
    padding: 10px 12px;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #991b1b;
    background: #fef2f2;
    font-size: 13px;
}

table {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
}

th,
td {
    padding: 11px 14px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid #e5e7eb;
}

th {
    color: var(--muted-2);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

td {
    color: #111827;
    font-size: 14px;
}

tbody tr:last-child td {
    border-bottom: 0;
}

/* =========================
   ESTADO VACÍO DE TABLAS
========================= */
.empty-state {
    height: 80px;
    color: var(--muted);
    text-align: center;
}

/* =========================
   ETIQUETAS / BADGES
========================= */
.badge {
    min-width: 78px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 6px;
    color: #2b2f36;
    background: #e5e7eb;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

/* Estados de ticket */
.estado-abierto {
    background: #dbeafe;
}

.estado-en-proceso {
    background: #fef3c7;
}

.estado-cerrado {
    background: #dcfce7;
}

/* Estados de usuario */
.estado-activo {
    background: #dcfce7;
    color: #166534;
}

.estado-inactivo {
    background: #fee2e2;
    color: #991b1b;
}

/* Prioridades de ticket */
.prioridad-alta {
    background: #fee2e2;
}

.prioridad-media {
    background: #ffedd5;
}

.prioridad-baja {
    background: #dbeafe;
}

/* =========================
   BOTONES CON ICONOS
========================= */
.icon-button {
    width: 32px;
    height: 32px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 6px;
    color: var(--icon);
    background: transparent;
    cursor: pointer;
}

.icon-button:hover {
    background: var(--surface-soft);
}

.icon-button svg {
    width: 17px;
    height: 17px;
}

/* =========================
   BOTÓN CERRAR TICKET EN TABLA
   Ajuste visual mínimo:
   el botón de cierre ahora se siente más como finalizar/cerrar.
========================= */
.cerrar-ticket-btn:hover {
    color: #166534;
    background: #dcfce7;
}

/* =========================
   BOTÓN VER MÁS
========================= */
.more-button {
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 14px auto 0;
    padding: 6px 12px;
    border: 0;
    color: #262b33;
    background: transparent;
    cursor: pointer;
    font-size: 15px;
}

.more-button svg {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

/* =========================
   PANEL DERECHO
   Resumen y acciones rápidas
========================= */
.side-panels {
    display: grid;
    gap: 14px;
}

.summary-panel,
.quick-actions {
    padding: 20px 18px;
}

.summary-panel ul {
    display: grid;
    gap: 13px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.summary-panel li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #2b2f36;
    font-size: 14px;
}

.summary-panel li span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.summary-panel svg,
.quick-actions svg {
    width: 16px;
    height: 16px;
    color: var(--icon);
}

/* =========================
   ACCIONES RÁPIDAS
========================= */
.quick-actions {
    display: grid;
    gap: 14px;
}

.quick-actions a {
    color: var(--primary);
    font-size: 14px;
}

.quick-actions a:hover {
    color: var(--primary-dark);
}

.quick-actions a svg {
    color: currentColor;
}

/* =========================
   PANEL DE DESCRIPCIÓN
========================= */
.description-panel {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    margin-top: 18px;
    padding: 18px 24px;
}

.description-panel > svg {
    width: 34px;
    height: 34px;
    color: var(--icon);
}

.description-panel p {
    max-width: 900px;
    margin: 7px 0 0;
    color: #374151;
    font-size: 14px;
    line-height: 1.3;
}

/* =========================
   PIE DE PÁGINA
========================= */
.footer {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 10px 16px;
    color: var(--muted);
    background: var(--surface);
    border-top: 1px solid var(--line);
    text-align: center;
    font-size: 13px;
}

/* =========================
   RESPONSIVE: PANTALLAS MEDIANAS
========================= */
@media (max-width: 1180px) {
    .topbar {
        padding: 10px 18px;
    }

    .topnav {
        gap: 12px;
        font-size: 13px;
    }

    .workspace {
        grid-template-columns: 175px minmax(0, 1fr);
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .side-panels {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* =========================
   RESPONSIVE: TABLET
========================= */
@media (max-width: 900px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .topnav {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .workspace {
        grid-template-columns: 1fr;
    }

    .sidebar {
        border-right: 0;
        border-bottom: 1px solid var(--line);
        padding: 10px 14px;
        overflow-x: auto;
    }

    .side-menu {
        display: flex;
        gap: 8px;
        min-width: max-content;
    }

    .side-link {
        min-height: 36px;
        padding: 8px 10px;
        font-size: 14px;
    }

    .main-content {
        padding: 18px 14px 24px;
    }

    .toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .search-box {
        width: 100%;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .side-panels {
        grid-template-columns: 1fr;
    }
}

/* =========================
   RESPONSIVE: CELULAR
========================= */
@media (max-width: 640px) {
    .topbar {
        padding: 14px 14px;
    }

    .brand {
        min-width: 0;
    }

    .brand-icon {
        width: 32px;
        height: 32px;
    }

    .brand strong {
        font-size: 17px;
    }

    .topnav {
        font-size: 14px;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .metric-card {
        min-height: 78px;
        padding: 15px;
    }

    .metric-card strong {
        font-size: 23px;
    }

    .metric-card span,
    .more-button,
    .summary-panel li,
    .description-panel p {
        font-size: 14px;
    }

    .tickets-panel,
    .summary-panel,
    .quick-actions,
    .description-panel {
        padding: 18px 15px;
    }

    .tickets-panel h1,
    .summary-panel h2,
    .quick-actions h2,
    .description-panel h2 {
        font-size: 19px;
    }

    th,
    td {
        padding: 10px 12px;
    }

    .description-panel {
        grid-template-columns: 1fr;
    }

    .footer {
        min-height: 44px;
    }
}

/* =========================
   LOGIN Y CAMBIO DE CONTRASEÑA
========================= */
.login-body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f6f8;
}

.login-card {
    width: 100%;
    max-width: 430px;
    padding: 34px 30px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.10);
    text-align: center;
}

.login-card h1 {
    margin: 0 0 8px;
    color: #111827;
    font-size: 30px;
    line-height: 1.2;
}

.login-card h2 {
    margin: 0 0 26px;
    color: #111827;
    font-size: 24px;
    line-height: 1.2;
}

/* =========================
   FORMULARIOS DE LOGIN
========================= */
.login-form {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.login-form label {
    margin-bottom: 6px;
    color: #111827;
    font-size: 16px;
    font-weight: 600;
}

.login-form input {
    width: 100%;
    height: 50px;
    margin-bottom: 18px;
    padding: 0 12px;
    border: 1px solid #cbd3dc;
    border-radius: 6px;
    background: #ffffff;
    color: #111827;
    font-size: 16px;
    outline: none;
}

.login-form input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.login-form button {
    width: 100%;
    height: 52px;
    margin-top: 2px;
    border: 0;
    border-radius: 6px;
    background: #2563eb;
    color: #ffffff;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
}

.login-form button:hover {
    background: #1d4ed8;
}

/* =========================
   LINK RECUPERAR CONTRASEÑA
========================= */
.forgot-link {
    display: block;
    width: fit-content;
    margin: 16px auto 0;
    color: #374151;
    font-size: 14px;
    text-align: center;
}

/* =========================
   AJUSTE AUTOCOMPLETADO DEL NAVEGADOR
========================= */
input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
}

/* =========================
   MENSAJE DE ERROR EN LOGIN / CONTRASEÑA
========================= */
.login-error {
    margin-bottom: 16px;
    padding: 10px;
    border-radius: 6px;
    background: #fee2e2;
    color: #991b1b;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
}

/* =========================
   TEXTO DE APOYO EN CAMBIO DE CONTRASEÑA
========================= */
.login-card p {
    font-size: 14px;
    line-height: 1.4;
}

/* =========================
   FORMULARIO CREAR TICKET
========================= */
.ticket-form-card {
    width: 100%;
    max-width: 620px;
    padding: 34px 36px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.10);
    text-align: center;
}

.ticket-form-card h1 {
    margin: 0 0 8px;
    color: #111827;
    font-size: 34px;
    line-height: 1.2;
}

.ticket-form-card h2 {
    margin: 0 0 26px;
    color: #111827;
    font-size: 24px;
    line-height: 1.2;
}

.ticket-form {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.ticket-form label {
    margin: 0 0 6px;
    color: #111827;
    font-size: 16px;
    font-weight: 700;
}

.ticket-form input,
.ticket-form select,
.ticket-form textarea {
    width: 100%;
    margin-bottom: 18px;
    padding: 0 12px;
    border: 1px solid #cbd3dc;
    border-radius: 6px;
    background: #ffffff;
    color: #111827;
    font-size: 16px;
    outline: none;
}

.ticket-form input,
.ticket-form select {
    height: 50px;
}

.ticket-form textarea {
    min-height: 110px;
    padding-top: 12px;
    resize: vertical;
}

.ticket-form input:focus,
.ticket-form select:focus,
.ticket-form textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.ticket-form input[type="file"] {
    height: auto;
    padding: 12px;
}

.ticket-form button {
    width: 100%;
    height: 52px;
    margin-top: 4px;
    border: 0;
    border-radius: 6px;
    background: #2563eb;
    color: #ffffff;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
}

.ticket-form button:hover {
    background: #1d4ed8;
}

/* =========================
   BOTÓN VOLVER EN CREAR TICKET
========================= */
.ticket-form-top-actions {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 18px;
}

/* =========================
   CREAR TICKET: HARDWARE AFECTADO
   Campo que aparece solo cuando la categoría es "Problema técnico"
========================= */
.ticket-hardware-field {
    flex-direction: column;
}

.ticket-hardware-field label {
    margin: 0 0 6px;
    color: #111827;
    font-size: 16px;
    font-weight: 700;
}

.ticket-hardware-field select {
    width: 100%;
    height: 50px;
    margin-bottom: 18px;
    padding: 0 12px;
    border: 1px solid #cbd3dc;
    border-radius: 6px;
    background: #ffffff;
    color: #111827;
    font-size: 16px;
    outline: none;
}

.ticket-hardware-field select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* =========================
   MODAL DE DETALLE DE TICKET
   Ventana emergente utilizada para mostrar información del ticket
   sin cambiar de página
========================= */

/* CONTENEDOR DEL MODAL (fondo oscuro) */
.ticket-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1000;
}

.ticket-modal.is-visible {
    display: flex;
}

/* CAJA DEL MODAL */
.ticket-modal-content {
    position: relative;
    width: min(100%, 560px);
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.25);
}

/* TÍTULO */
.ticket-modal-content h2 {
    margin: 0 0 16px;
    color: #111827;
    font-size: 22px;
}

/* TEXTO */
.ticket-modal-content p {
    margin: 8px 0;
    color: #374151;
    font-size: 14px;
    line-height: 1.4;
}

.ticket-modal-content strong {
    color: #111827;
}

/* BOTÓN CERRAR (X) */
.ticket-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    border: 0;
    background: transparent;
    color: #4b5563;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease;
}

.ticket-modal-close:hover {
    color: #111827;
}

/* =========================
   ACCIONES DEL MODAL (CONTENEDOR DEL BOTÓN)
========================= */
.ticket-modal-actions {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
}

/* BOTÓN CERRAR (INFERIOR) */
.ticket-modal-button {
    min-height: 38px;
    padding: 8px 18px;
    border: none;
    border-radius: 8px;
    background: #2563eb;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* HOVER */
.ticket-modal-button:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

/* CLICK */
.ticket-modal-button:active {
    transform: scale(0.97);
}

/* =========================
   VISTA DETALLE DE TICKET
   Página completa para visualizar un ticket
========================= */
.ticket-detail-page {
    width: 100%;
    min-height: 100vh;
    padding: 34px 40px;
    background: var(--bg);
}

.ticket-detail-container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px 32px;
    background: var(--surface);
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.ticket-detail-title {
    margin: 0;
    font-size: 24px;
    color: #111827;
}

.ticket-detail-subtitle {
    margin: 6px 0 22px;
    color: var(--muted);
    font-size: 15px;
}

/* GRID */
.ticket-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

/* CONTENEDOR DE CADA CAMPO (LABEL FUERA) */
.ticket-detail-field {
    display: flex;
    flex-direction: column;
}

/* CAJAS */
.ticket-detail-box {
    min-height: 58px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
}

/* LABELS (AHORA FUERA DE LA CAJA) */
.ticket-detail-label {
    margin-bottom: 6px;
    color: #111827;
    font-size: 13px;
    font-weight: 700;
}

/* VALORES */
.ticket-detail-value {
    color: #111827;
    font-size: 14px;
    font-weight: 700;
}

/* DESCRIPCIÓN */
.ticket-detail-description {
    margin-top: 6px;
    padding: 14px 16px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid var(--line);
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    min-height: 120px;
    color: #374151;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
}

/* BOTÓN GENERAL DE VISTAS DETALLE */
.ticket-detail-actions {
    margin-top: 22px;
}

.ticket-detail-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 18px;
    border: 0;
    border-radius: 7px;
    background: var(--primary);
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
}

.ticket-detail-back:hover {
    background: var(--primary-dark);
}

/* =========================
   ARCHIVO ADJUNTO DEL TICKET
========================= */
.ticket-file-label {
    margin-top: 22px;
}

.ticket-file-box {
    margin-top: 6px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.ticket-file-image {
    display: block;
    max-width: 100%;
    max-height: 420px;
    border-radius: 8px;
    border: 1px solid var(--line);
    object-fit: contain;
}

.ticket-file-link {
    display: inline-flex;
    padding: 9px 14px;
    border-radius: 6px;
    background: var(--primary);
    color: #ffffff;
    font-weight: 700;
}

.ticket-file-link:hover {
    background: var(--primary-dark);
}

/* =====================================================
   VISTA: GESTIÓN DE USUARIOS
   Archivo HTML relacionado:
   templates/dashboard/usuarios.html
===================================================== */

/* =========================
   FORMULARIO CREAR USUARIO
========================= */

/* Caja principal del formulario de creación */
.users-create-section {
    margin-top: 26px;
    padding: 22px 22px 24px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f8fafc;
}

/* Encabezado del formulario de creación */
.users-create-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

/* Título del formulario de creación */
.users-create-title {
    margin: 0;
    color: #111827;
    font-size: 20px;
    font-weight: 700;
}

/* Texto de apoyo del formulario */
.users-create-subtitle {
    max-width: 860px;
    margin: 6px 0 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.4;
}

/* Grilla del formulario */
.users-create-form {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}

/* Grupo label + campo */
.users-form-group {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Etiquetas del formulario */
.users-form-group label {
    margin-bottom: 6px;
    color: #111827;
    font-size: 13px;
    font-weight: 700;
}

/* Campos del formulario */
.users-form-group input,
.users-form-group select {
    width: 100%;
    height: 40px;
    padding: 0 10px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    background: #ffffff;
    color: #111827;
    font-size: 13px;
    outline: none;
}

/* Placeholder del formulario */
.users-form-group input::placeholder {
    color: #9ca3af;
}

/* Efecto al seleccionar un campo */
.users-form-group input:focus,
.users-form-group select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

/* Contenedor del botón crear usuario */
.users-create-actions {
    display: flex;
    align-items: end;
}

/* Botón crear usuario */
.users-create-button {
    width: 100%;
    min-height: 40px;
    padding: 9px 14px;
    white-space: nowrap;
}

/* =========================
   SECCIONES DE USUARIOS
========================= */

/* Contenedor de cada grupo de usuarios:
   Administradores, TI y Usuarios */
.users-section {
    margin-top: 30px;
}

/* Primer grupo de usuarios.
   Se usa para que "Administradores" no quede tan separado
   del formulario de creación. */
.users-section-title-first {
    margin-top: 20px;
}

/* Título de cada sección de usuarios */
.users-section-title {
    margin: 0 0 4px 0;
    font-size: 19px;
    font-weight: 700;
    color: #111827;
}

/* Contenedor de tabla específico para esta vista */
.users-table-wrap {
    margin-top: 18px;
    overflow-x: auto;
}

/* Tabla de gestión de usuarios */
.users-table {
    width: 100%;
    min-width: 850px;
    border-collapse: collapse;
}

/* Encabezados de la tabla */
.users-table th {
    padding: 12px 12px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

/* Celdas de la tabla */
.users-table td {
    padding: 14px 12px;
    font-size: 13px;
    color: #111827;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

/* Efecto suave al pasar el mouse por una fila */
.users-table tbody tr:hover {
    background-color: #f8fafc;
}

/* Nombre del empleado.
   Se deja con más fuerza visual porque es el dato principal. */
.users-employee-name {
    font-weight: 600;
    color: #0f172a;
}

/* =========================
   FORMULARIO MODIFICAR ROL
========================= */

/* Formulario para cambiar rol */
.role-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Selector de rol */
.role-form select {
    height: 34px;
    min-width: 96px;
    padding: 0 8px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    background-color: #ffffff;
    color: #111827;
    font-size: 13px;
    outline: none;
}

/* Efecto al seleccionar el campo de rol */
.role-form select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

/* Botón guardar de cambio de rol */
.role-save-button {
    min-height: 34px;
    padding: 7px 15px;
    border: 0;
    font-size: 13px;
    border-radius: 7px;
    white-space: nowrap;
}

/* =========================
   FORMULARIO ACTIVAR / DESACTIVAR USUARIO
========================= */

/* Formulario de estado */
.user-state-form {
    display: flex;
    align-items: center;
}

/* Botón base para activar/desactivar */
.user-state-button {
    min-height: 34px;
    padding: 7px 14px;
    border: 0;
    border-radius: 7px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

/* Botón desactivar */
.user-state-button-danger {
    background: #dc2626;
}

/* Hover botón desactivar */
.user-state-button-danger:hover {
    background: #b91c1c;
}

/* Botón activar */
.user-state-button-success {
    background: #16a34a;
}

/* Hover botón activar */
.user-state-button-success:hover {
    background: #15803d;
}

/* Mensaje cuando una sección no tiene registros */
.empty-state {
    padding: 22px 12px;
    text-align: center;
    color: #64748b;
    font-size: 13px;
    background-color: #f8fafc;
}

/* =========================
   RESPONSIVE GESTIÓN DE USUARIOS
========================= */

/* Ajuste para pantallas medianas */
@media (max-width: 1180px) {
    .users-create-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .users-create-actions {
        grid-column: 1 / -1;
    }

    .users-create-button {
        width: auto;
    }
}

/* Ajuste responsive para pantallas pequeñas */
@media (max-width: 768px) {
    .ticket-detail-page {
        padding: 22px 14px;
    }

    .ticket-detail-container {
        padding: 22px 16px;
    }

    .users-create-section {
        padding: 18px 16px 20px;
    }

    .users-create-form {
        grid-template-columns: 1fr;
    }

    .users-create-button {
        width: 100%;
    }

    .users-table th,
    .users-table td {
        padding: 11px 10px;
        font-size: 12px;
    }

    .role-form {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .role-form select,
    .role-save-button,
    .user-state-button {
        width: 100%;
    }
}

/* =========================
   GESTIÓN DE USUARIOS
   Botón superior y mostrar más / menos
========================= */

/* Botón volver ubicado arriba de la vista */
.users-top-actions {
    display: flex;
    justify-content: flex-start;
    margin: 14px 0 24px;
}

/* Filas ocultas por defecto.
   Se usa para mostrar solo los primeros 3 usuarios por rol. */
.users-row-hidden {
    display: none;
}

/* Contenedor del botón mostrar más / menos */
.users-toggle-wrap {
    display: flex;
    justify-content: center;
    margin-top: 12px;
}

/* Botón mostrar más / menos */
.users-toggle-button {
    min-height: 36px;
    padding: 8px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    background: #ffffff;
    color: #2563eb;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

/* Efecto al pasar el mouse */
.users-toggle-button:hover {
    background: #eff6ff;
    border-color: #93c5fd;
}

/* =========================
   CERRAR TICKET CON COMENTARIO
========================= */
.ticket-close-textarea {
    width: 100%;
    margin-top: 8px;
    padding: 12px;
    border: 1px solid #cbd3dc;
    border-radius: 8px;
    color: #111827;
    background: #ffffff;
    font-size: 14px;
    line-height: 1.4;
    resize: vertical;
    outline: none;
}

.ticket-close-textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* =========================
   VISTA: ESTADÍSTICAS
   Archivo HTML relacionado:
   templates/dashboard/estadisticas.html
========================= */

/* Encabezado principal de estadísticas */
.statistics-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding: 22px 24px;
    background: var(--surface);
    border-radius: 10px;
    box-shadow: var(--shadow);
}

/* Título del encabezado */
.statistics-header h1 {
    margin: 0;
    color: #111827;
    font-size: 24px;
    line-height: 1.2;
}

/* Texto descriptivo */
.statistics-header p {
    max-width: 860px;
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.4;
}

/* Botón exportar Excel */
.statistics-export-button {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 16px;
    border-radius: 7px;
    background: var(--primary);
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.statistics-export-button:hover {
    background: var(--primary-dark);
}

/* Grilla de tarjetas superiores */
.statistics-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

/* Segunda fila de tarjetas destacadas */
.statistics-cards-secondary {
    margin-bottom: 18px;
}

/* Tarjeta individual */
.statistics-card {
    min-height: 92px;
    padding: 18px 18px;
    background: var(--surface);
    border-radius: 10px;
    box-shadow: var(--shadow);
}

/* Etiqueta de tarjeta */
.statistics-card-label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

/* Número o dato principal */
.statistics-card strong {
    display: block;
    color: #111827;
    font-size: 22px;
    line-height: 1.15;
}

/* Texto secundario */
.statistics-card small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
}

/* Grilla de paneles */
.statistics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

/* Panel de estadística */
.statistics-panel {
    min-width: 0;
    padding: 20px 20px 18px;
    background: var(--surface);
    border-radius: 10px;
    box-shadow: var(--shadow);
}

/* Título del panel */
.statistics-panel h2 {
    margin: 0;
    color: #111827;
    font-size: 19px;
    line-height: 1.2;
}

/* Texto bajo el título */
.statistics-panel-text {
    margin: 6px 0 16px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.4;
}

/* Contenedor de barras */
.statistics-bars {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

/* Fila de barra */
.statistics-bar-row {
    display: grid;
    gap: 7px;
}

/* Texto de cada barra */
.statistics-bar-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #111827;
    font-size: 13px;
}

/* Nombre del dato */
.statistics-bar-label span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Número de la barra */
.statistics-bar-label strong {
    color: #111827;
    font-size: 13px;
}

/* Fondo de barra */
.statistics-bar-track {
    width: 100%;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #e5e7eb;
}

/* Relleno de barra */
.statistics-bar-fill {
    width: 0;
    height: 100%;
    border-radius: 999px;
    background: var(--primary);
    transition: width 0.4s ease;
}

/* Tabla de estadísticas */
.statistics-table {
    width: 100%;
    min-width: 420px;
    border-collapse: collapse;
}

/* Mensaje vacío */
.statistics-empty {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 14px;
}

/* =========================
   RESPONSIVE: ESTADÍSTICAS
========================= */
@media (max-width: 1180px) {
    .statistics-cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .statistics-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .statistics-header {
        flex-direction: column;
        padding: 20px 16px;
    }

    .statistics-export-button {
        width: 100%;
    }

    .statistics-cards-grid {
        grid-template-columns: 1fr;
    }

    .statistics-panel {
        padding: 18px 15px;
    }

    .statistics-header h1 {
        font-size: 22px;
    }

    .statistics-card strong {
        font-size: 20px;
    }
}

/* =========================
   TRANSFERIR TICKET
   Bloque usado en la vista detalle para mover
   el ticket a otro técnico TI/Admin.
========================= */
.ticket-transfer-box {
    margin-top: 22px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.ticket-transfer-form {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.ticket-transfer-form select {
    width: 100%;
    max-width: 360px;
    height: 40px;
    padding: 0 10px;
    border: 1px solid #cbd3dc;
    border-radius: 7px;
    background: #ffffff;
    color: #111827;
    font-size: 14px;
    outline: none;
}

.ticket-transfer-form select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* =========================
   ESTADO: PENDIENTE USUARIO
   Se usa cuando soporte solicita más información
   y el ticket queda esperando respuesta del usuario.
========================= */
.estado-pendiente-usuario {
    background: #ede9fe;
    color: #5b21b6;
}

/* =========================
   COMENTARIOS DEL TICKET
   Bloque usado en la vista detalle para mostrar
   la conversación entre usuario y soporte TI.
   Ajuste aplicado: estilo tipo chat compacto.
========================= */
.ticket-comments-box {
    margin-top: 22px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.ticket-comments-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.ticket-comments-help,
.ticket-info-request-help,
.ticket-user-response-help {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.ticket-comments-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

/* Burbuja base */
.ticket-comment-item {
    width: fit-content;
    min-width: 220px;
    max-width: 420px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-left: 4px solid #cbd5e1;
    border-radius: 14px;
    background: #f8fafc;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

/* Soporte / solicitud */
.ticket-comment-solicitud_informacion {
    align-self: flex-start;
    border-left-color: #f59e0b;
    background: #fffbeb;
}

/* Usuario */
.ticket-comment-respuesta_usuario {
    align-self: flex-end;
    border-left-color: #2563eb;
    background: #eff6ff;
}

/* Cierre */
.ticket-comment-cierre {
    align-self: flex-start;
    border-left-color: #16a34a;
    background: #f0fdf4;
}

.ticket-comment-meta {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin-bottom: 6px;
}

.ticket-comment-meta strong {
    display: block;
    color: #111827;
    font-size: 13px;
    line-height: 1.2;
}

.ticket-comment-type {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.ticket-comment-date {
    color: var(--muted-2);
    font-size: 10px;
    white-space: nowrap;
}

.ticket-comment-text {
    margin: 8px 0 0;
    color: #111827;
    font-size: 13px;
    line-height: 1.35;
    white-space: normal;
    word-break: break-word;
    text-align: left;
}

.ticket-comments-empty {
    margin-top: 14px;
    padding: 14px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    color: var(--muted);
    background: #f8fafc;
    font-size: 13px;
    text-align: center;
}
/* =========================
   SOLICITAR / RESPONDER INFORMACIÓN
   Formularios usados en la vista detalle para pedir
   antecedentes adicionales y responder dentro del ticket.
========================= */
.ticket-info-request-box,
.ticket-user-response-box {
    margin-top: 22px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.ticket-info-request-form,
.ticket-user-response-form {
    margin-top: 12px;
}

.ticket-info-request-form textarea,
.ticket-user-response-form textarea {
    width: 100%;
    min-height: 105px;
    padding: 12px;
    border: 1px solid #cbd3dc;
    border-radius: 8px;
    background: #ffffff;
    color: #111827;
    font-size: 14px;
    line-height: 1.4;
    resize: vertical;
    outline: none;
}

.ticket-info-request-form textarea:focus,
.ticket-user-response-form textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.ticket-form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

/* =========================
   RESPONSIVE: COMENTARIOS DEL TICKET
========================= */
@media (max-width: 768px) {
    .ticket-comment-item {
        max-width: 100%;
    }

    .ticket-comment-meta {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .ticket-comment-date {
        white-space: normal;
    }

    .ticket-transfer-form {
        align-items: stretch;
        flex-direction: column;
    }

    .ticket-transfer-form select,
    .ticket-transfer-form .ticket-detail-back,
    .ticket-form-actions .ticket-detail-back {
        width: 100%;
        max-width: 100%;
    }

    .ticket-form-actions {
        justify-content: stretch;
    }
}

/* =========================
   CERRAR TICKET DESDE DETALLE
   Bloque usado en la vista completa del ticket
   para cerrar el caso con comentario.
========================= */
.ticket-close-box {
    margin-top: 22px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.ticket-close-help {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.ticket-close-form {
    margin-top: 12px;
}

/* =========================
   ID DEL TICKET COMO ENLACE
========================= */
.ticket-id-link {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 700;
}

.ticket-id-link:hover {
    color: var(--primary-dark);
}