/* ---------------------------------------------------
   VARIABLES GLOBALES
--------------------------------------------------- */

:root {
    --fondo-claro: #f5f7fb;
    --fondo-oscuro: #020617;

    --tarjeta-claro: #ffffff;
    --tarjeta-oscuro: #0f172a;

    --texto-claro: #1e293b;
    --texto-oscuro: #f1f5f9;

    --sidebar-gradiente: linear-gradient(180deg, #0f172a, #020617);
}

/* ---------------------------------------------------
   BASE
--------------------------------------------------- */

body {
    margin: 0;
    font-family: Arial, sans-serif;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Tema claro */

body {
    background: var(--fondo-claro);
    color: var(--texto-claro);
}

/* Tema oscuro */

html[data-tema="oscuro"] body {
    background: var(--fondo-oscuro);
    color: var(--texto-oscuro);
}

/* ---------------------------------------------------
   LOGIN
--------------------------------------------------- */

.pantalla-login {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.tarjeta-login {
    width: 380px;
    padding: 35px;
    border-radius: 18px;
    background: var(--tarjeta-claro);
}

html[data-tema="oscuro"] .tarjeta-login {
    background: var(--tarjeta-oscuro);
}

/* ---------------------------------------------------
   LAYOUT APP
--------------------------------------------------- */

.layout-app {
    display: flex;
    min-height: 100vh;
}

/* ---------------------------------------------------
   LOGO
--------------------------------------------------- */
.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-sidebar {
    width: 96px;
    height: 86px;
    object-fit: contain;
}

.logo-texto {
    font-weight: bold;
    font-size: 16px;
    white-space: nowrap;
}

/* Cuando sidebar está colapsado */
.sidebar.collapsed .logo-texto {
    display: none;
}

/* ---------------------------------------------------
   SIDEBAR MODERNA
--------------------------------------------------- */

.sidebar {
    width: 280px;
    background: var(--sidebar-gradiente);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    transition: width 0.3s ease;
}

/* Header */

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}


/* Botón toggle */

#toggleSidebar {
    position: absolute;
    top: 50px;
    right: -18px;

    background: #0f172a;
    border: 1px solid rgba(255,255,255,0.2);
    color: white;

    width: 38px;
    height: 38px;
    border-radius: 10px;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
}

#toggleSidebar:hover {
    background: #1e293b;
    transform: scale(1.05);
}



/* Menú */

.sidebar-menu {
    margin-top: 25px;
}



.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #cbd5f5;
    text-decoration: none;
    transition: all 0.25s ease;
}

.sidebar-menu a:hover {
    background: rgba(255,255,255,0.08);
    color: white;
    transform: translateX(5px);
}

.menu-grupo {
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.menu-titulo {
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.menu-titulo:hover {
    background: rgba(255,255,255,0.05);
}

.submenu {
    display: none;
    flex-direction: column;
}

.submenu a {
    padding: 8px 20px;
    font-size: 13px;
    opacity: 0.9;
}

.menu-grupo.activo .submenu {
    display: flex;
}

.flecha {
    transition: transform 0.2s;
}

.menu-grupo.activo .flecha {
    transform: rotate(90deg);
}

/* Iconos */

.icono {
    font-size: 18px;
    min-width: 22px;
    text-align: center;
}

/* Footer */

.sidebar-footer {
    margin-top: 30px;
}

.sidebar-footer .cerrar {
    display: block;
    text-align: center;
    color: #f87171;
    text-decoration: none;
    margin-top: 10px;
}

/* ---------------------------------------------------
   SIDEBAR COLAPSADA
--------------------------------------------------- */

.sidebar.colapsada #toggleSidebar {
    right: 18px;
}


.sidebar.colapsada .sidebar-header {
    justify-content: center;
}

/* Botón centrado */

.sidebar.colapsada #toggleSidebar {
    margin: 10px auto;
}


/* ================= SIDEBAR COLLAPSED ================= */
/* Reducir ancho */
.sidebar.collapsed {
    width: 120px;
}

.sidebar.collapsed .texto {
    display: none;
}

.sidebar.collapsed .icono {
    text-align: center;
}

/* ---------------------------------------------------
   CONTENIDO
--------------------------------------------------- */

.contenido {
    flex: 1;
    padding: 30px;
    background: var(--fondo-claro);
    transition: background 0.3s ease;
}

html[data-tema="oscuro"] .contenido {
    background: var(--fondo-oscuro);
}

/* ---------------------------------------------------
   TARJETAS
--------------------------------------------------- */

.tarjeta {
    background: var(--tarjeta-claro);
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    animation: fadeSlide 0.4s ease;
}

html[data-tema="oscuro"] .tarjeta {
    background: var(--tarjeta-oscuro);
    color: var(--texto-oscuro);
}

/* ---------------------------------------------------
   EFECTOS
--------------------------------------------------- */

.sombra-suave {
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.animacion-entrada {
    animation: fadeSlide 0.6s ease;
}

/* Animación */

@keyframes fadeSlide {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}


/* SWITCH PRO */

.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #334155;
    transition: .3s;
    border-radius: 30px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #22c55e;
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.toast-pro {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 320px;
    padding: 14px 18px;
    border-radius: 14px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.18);
    z-index: 9999;
    animation: toastEntrada 0.35s ease;
    overflow: hidden;
}

.toast-icono {
    font-size: 20px;
    margin-right: 8px;
}

.toast-barra {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: rgba(255,255,255,0.35);
    animation: toastTiempo 2.5s linear forwards;
}

@keyframes toastEntrada {
    from { opacity: 0; transform: translateY(-10px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastTiempo {
    from { width: 100%; }
    to   { width: 0%; }
}

/* Tema oscuro */
html[data-tema="oscuro"] .toast-pro {
    background: #0f172a;
    color: white;
}


/* SweetAlert modo oscuro personalizado */
.swal2-dark {
    background: #0f172a !important;
    color: #f1f5f9 !important;
    border-radius: 14px;
}

.swal2-dark .swal2-title,
.swal2-dark .swal2-html-container {
    color: #f1f5f9 !important;
}

.swal2-dark .swal2-confirm {
    background: #2563eb !important;
    border-radius: 8px;
}


[data-tema="oscuro"] .card {
    background:#1f1f1f!important;
    color:#fff!important;
}

[data-tema="oscuro"] .form-control {
    background:#2a2a2a!important;
    color:#fff!important;
    border:1px solid #444!important;
}

/* ================= QUILL DARK ================= */

[data-tema="oscuro"] .ql-toolbar {
    background: #2a2a2a !important;
    border: 1px solid #444 !important;
}

[data-tema="oscuro"] .ql-container {
    background: #1f1f1f !important;
    color: #ffffff !important;
    border: 1px solid #444 !important;
}

[data-tema="oscuro"] .ql-editor {
    color: #ffffff !important;
}


/* ================= SIDEBAR BLOQUEADO ================= */

.sidebar-menu.bloqueado a {
    pointer-events: none;
    opacity: 0.4;
    cursor: not-allowed;
}

.sidebar-menu.bloqueado a::after {
    content: " 🔒";
    font-size: 12px;
}

/* ================= CHAT PROFESIONAL ================= */

.chat-box {
    height: 320px;
    overflow-y: auto;
    padding: 15px;
    border-radius: 14px;
    background: #0f172a;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message {
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 75%;
    font-size: 14px;
    position: relative;
    animation: fadeIn 0.2s ease;
}

.chat-left {
    align-self: flex-start;
    background: #1f2937;
    color: #e5e7eb;
}

.chat-right {
    align-self: flex-end;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
}

.chat-meta {
    font-size: 11px;
    opacity: 0.7;
    margin-bottom: 4px;
}

.chat-text {
    font-size: 14px;
    margin-bottom: 6px;
}

.chat-time {
    font-size: 10px;
    opacity: 0.5;
    text-align: right;
}

/* Colores por rol */
.chat-postproduccion { border-left: 4px solid #2563eb; }
.chat-traduccion { border-left: 4px solid #16a34a; }
.chat-qc { border-left: 4px solid #f59e0b; }
.chat-mezcla { border-left: 4px solid #ef4444; }

/* Nuevo mensaje */
.chat-nuevo {
    box-shadow: 0 0 0 2px rgba(255,255,255,0.15);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}


/* ===== CHAT INPUT ===== */

.chat-input-container {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

#chat-input {
    resize: none;
    border-radius: 14px;
    padding: 10px 14px;
}

#chat-enviar {
    border-radius: 14px;
    min-width: 90px;
}

/* ===== NOTIFICACION DE CAMPANA ===== */

.notificacion-campana {
    position: relative;
    font-size: 20px;
    margin-bottom: 15px;
}
.notificacion-campana .badge {
    position: absolute;
    top: -6px;
    right: -10px;
}


/* ===== Historial reportes ===== */

.historial-popup{
    border-radius:12px !important;
}


/* ===== FIX SCROLL TABLA ===== */

.contenido{
    min-width:0;
    overflow-x:hidden;
}

#tabla-wrapper{
    width:100%;
    overflow:hidden;
}

#tabla-scroll{
    width:100%;
    overflow-x:auto;
}

#tabla-revision{
    min-width:1600px;
}

