/**
 * Estilos CSS - Sistema de Tickets e Inventario
 * Grupo SS
 */

/* =============================================
   VARIABLES Y RESET
   ============================================= */
:root {
    /* Colores principales - Grupo SS */
    --primary-color: #D2181F;
    --primary-dark: #A90B10;
    --primary-light: #FC1119;
    
    /* Colores de estado (semáforo) */
    --status-open: #22c55e;
    --status-in-progress: #eab308;
    --status-resolved: #3b82f6;
    --status-closed: #D2181F;
    
    /* Colores neutros - Grupo SS */
    --white: #FFFFFF;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #909090;
    --gray-500: #909090;
    --gray-600: #4A4A4A;
    --gray-700: #4A4A4A;
    --gray-800: #4A4A4A;
    --gray-900: #2d2d2d;
    
    /* Colores de alertas */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #D2181F;
    --info: #D2181F;
    
    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    
    /* Bordes */
    --radius-sm: 0.25rem;
    --radius: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    
    /* Transiciones */
    --transition-fast: 150ms ease;
    --transition: 200ms ease;
    --transition-slow: 300ms ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* =============================================
   TIPOGRAFÍA
   ============================================= */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.25;
    color: var(--gray-900);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

small {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* =============================================
   PÁGINAS DE AUTENTICACIÓN
   ============================================= */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, #4A4A4A 0%, #2d2d2d 100%);
    background-attachment: fixed;
    position: relative;
}

/* Fondo minimalista con formas geométricas */
.auth-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(210, 24, 31, 0.08) 0%, transparent 25%),
        radial-gradient(circle at 80% 20%, rgba(210, 24, 31, 0.06) 0%, transparent 25%),
        radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.03) 0%, transparent 20%),
        radial-gradient(circle at 90% 90%, rgba(169, 11, 16, 0.05) 0%, transparent 20%);
    pointer-events: none;
    z-index: 0;
}

/* Líneas decorativas sutiles */
.auth-page::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

.auth-container {
    display: flex;
    gap: 2rem;
    max-width: 900px;
    width: 100%;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-xl);
    flex: 1;
    max-width: 400px;
}

.auth-card-register {
    max-width: 480px;
}

/* Contenedor ancho para registro (sin panel rojo) */
.auth-container-wide {
    justify-content: center;
}

.auth-card-wide {
    max-width: 750px;
    width: 100%;
    flex: none;
    margin: auto 0;
}

.auth-card-wide .form-row {
    gap: 1.5rem;
}

.auth-card-wide .form-group input,
.auth-card-wide .form-group select {
    width: 100%;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header .logo {
    width: 120px;
    height: auto;
    max-height: 100px;
    background: transparent;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.auth-header .logo img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.auth-header .logo i {
    font-size: 2rem;
    color: var(--primary-color);
}

.auth-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.auth-header p {
    color: var(--gray-500);
    margin-bottom: 0;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.auth-footer p {
    color: var(--gray-600);
    margin-bottom: 0;
}

.auth-info {
    background: linear-gradient(135deg, #D2181F 0%, #A90B10 100%);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    color: var(--white);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Canvas de partículas conectadas */
.particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: auto;
    z-index: 1;
}

/* Contenido con z-index para estar sobre las animaciones */
.auth-info-content {
    position: relative;
    z-index: 2;
}

.auth-info h2 {
    color: var(--white);
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 2;
    font-size: 1.6rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.auth-info ul {
    list-style: none;
    position: relative;
    z-index: 2;
}

.auth-info li {
    padding: 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: fadeInRight 0.6s ease-out forwards;
    opacity: 0;
}

.auth-info li:nth-child(1) { animation-delay: 0.2s; }
.auth-info li:nth-child(2) { animation-delay: 0.4s; }
.auth-info li:nth-child(3) { animation-delay: 0.6s; }

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.auth-info li i {
    color: var(--white);
    background: rgba(255, 255, 255, 0.2);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.auth-info li:hover i {
    transform: scale(1.2) rotate(10deg);
    background: rgba(255, 255, 255, 0.3);
}

/* =============================================
   FORMULARIOS
   ============================================= */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group label i {
    color: var(--gray-400);
    font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input::placeholder {
    color: var(--gray-400);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.required {
    color: var(--error);
}

/* Password wrapper */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    padding-right: 2.75rem;
}

/* Ocultar el icono de mostrar contraseña del navegador */
.password-wrapper input::-ms-reveal,
.password-wrapper input::-ms-clear,
.password-wrapper input::-webkit-credentials-auto-fill-button,
.password-wrapper input::-webkit-clear-button,
.password-wrapper input::-webkit-textfield-decoration-container {
    display: none !important;
}

.toggle-password {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0.25rem;
    transition: color var(--transition-fast);
}

.toggle-password:hover {
    color: var(--gray-600);
}

/* Password strength */
.password-strength {
    margin-top: 0.5rem;
}

.strength-bar {
    height: 4px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0;
    transition: width var(--transition), background-color var(--transition);
}

.strength-fill.weak {
    width: 33%;
    background-color: var(--error);
}

.strength-fill.medium {
    width: 66%;
    background-color: var(--warning);
}

.strength-fill.strong {
    width: 100%;
    background-color: var(--success);
}

#strengthText {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* =============================================
   BOTONES
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-danger {
    background: var(--error);
    color: var(--white);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* =============================================
   ALERTAS
   ============================================= */
.alert {
    padding: 1rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.alert i {
    font-size: 1.25rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: #1d4ed8;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* =============================================
   BADGES DE ESTADO
   ============================================= */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-open {
    background: rgba(34, 197, 94, 0.1);
    color: var(--status-open);
}

.badge-in-progress {
    background: rgba(234, 179, 8, 0.1);
    color: var(--status-in-progress);
}

.badge-closed {
    background: rgba(239, 68, 68, 0.1);
    color: var(--status-closed);
}

.badge-active {
    background: rgba(34, 197, 94, 0.1);
    color: var(--status-open);
}

.badge-maintenance {
    background: rgba(234, 179, 8, 0.1);
    color: var(--status-in-progress);
}

.badge-inactive {
    background: rgba(239, 68, 68, 0.1);
    color: var(--status-closed);
}

/* =============================================
   LAYOUT - NAVBAR
   ============================================= */
.navbar {
    background: var(--white);
    box-shadow: var(--shadow);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    color: var(--gray-900);
}

.navbar-brand i {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.navbar-menu a {
    color: var(--gray-600);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.navbar-menu a:hover,
.navbar-menu a.active {
    background: var(--gray-100);
    color: var(--primary-color);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar-user .user-info {
    text-align: right;
}

.navbar-user .user-name {
    font-weight: 500;
    color: var(--gray-800);
}

.navbar-user .user-role {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.navbar-user .avatar {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 600;
}

/* =============================================
   LAYOUT - SIDEBAR
   ============================================= */
.layout {
    display: flex;
    min-height: calc(100vh - 65px);
}

.sidebar {
    width: 250px;
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    padding: 1.5rem 0;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--gray-600);
    transition: all var(--transition-fast);
}

.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    background: var(--gray-100);
    color: var(--primary-color);
    border-right: 3px solid var(--primary-color);
}

.sidebar-menu li a i {
    width: 20px;
    text-align: center;
}

.sidebar-section {
    margin-top: 2rem;
    padding: 0 1.5rem;
}

.sidebar-section h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--gray-400);
    margin-bottom: 0.75rem;
    letter-spacing: 0.05em;
}

/* =============================================
   LAYOUT - MAIN CONTENT
   ============================================= */
.main-content {
    flex: 1;
    padding: 2rem;
    background: var(--gray-50);
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--gray-500);
    margin-bottom: 0;
}

/* =============================================
   CARDS
   ============================================= */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.card-header h3 {
    margin: 0;
}

.card-body {
    padding: 0;
}

/* Stats cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-card .stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card .stat-icon.primary {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.stat-card .stat-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stat-card .stat-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.stat-card .stat-icon.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.stat-card .stat-info h3 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

.stat-card .stat-info p {
    color: var(--gray-500);
    margin: 0;
    font-size: 0.875rem;
}

/* =============================================
   TABLAS
   ============================================= */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table tbody tr:hover {
    background: var(--gray-50);
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

.table-actions .btn {
    padding: 0.5rem;
    min-width: 36px;
}

/* =============================================
   RATING (ESTRELLAS)
   ============================================= */
.rating {
    display: flex;
    gap: 0.25rem;
}

.rating i {
    color: var(--gray-300);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.rating i.active,
.rating i:hover {
    color: #fbbf24;
}

.rating.readonly i {
    cursor: default;
}

/* =============================================
   ENCUESTA DE SATISFACCION
   ============================================= */
.survey-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-slow), visibility var(--transition-slow);
}

.survey-overlay.show {
    opacity: 1;
    visibility: visible;
}

.survey-card {
    width: 100%;
    max-width: 640px;
    background: linear-gradient(135deg, #ffffff 0%, #fff6f6 100%);
    border-radius: 22px;
    box-shadow: 0 25px 60px -20px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(210, 24, 31, 0.08);
}

.confetti-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: visible;
    z-index: 3;
}

.survey-card::before {
    content: '';
    position: absolute;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(210, 24, 31, 0.12) 0%, transparent 60%);
    top: -120px;
    right: -80px;
    z-index: 0;
}

.survey-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: none;
    background: rgba(0, 0, 0, 0.04);
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.survey-close:hover {
    background: rgba(0, 0, 0, 0.07);
    transform: translateY(-1px);
}

.survey-header {
    padding: 1.75rem 1.75rem 0.5rem 1.75rem;
    position: relative;
    z-index: 1;
}

.survey-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    background: rgba(210, 24, 31, 0.08);
    color: #b01218;
    font-weight: 600;
    border-radius: 999px;
    font-size: 0.85rem;
}

.survey-header h3 {
    font-size: 1.5rem;
    margin: 0.75rem 0 0.25rem;
    color: var(--gray-900);
}

.survey-header p {
    margin: 0;
    color: var(--gray-600);
}

.survey-ticket-number {
    color: var(--primary-color);
    font-weight: 700;
}

.survey-body {
    padding: 0.75rem 1.75rem 1.1rem;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.survey-ticket-box {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 14px;
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-sm);
}

.survey-ticket-label {
    display: inline-block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-500);
}

.survey-ticket-id {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.survey-ticket-desc {
    margin-top: 0.4rem;
    color: var(--gray-600);
    line-height: 1.5;
}

.survey-rating-block {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 14px;
    padding: 1.05rem 1.25rem;
    box-shadow: var(--shadow-sm);
}

.survey-question {
    margin: 0 0 0.35rem 0;
    font-weight: 600;
    color: var(--gray-800);
}

.survey-rating-block .rating {
    display: flex;
    gap: 0.35rem;
}

.survey-rating-block .rating i {
    font-size: 2rem;
    color: #d4d4d8;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.15s ease, text-shadow 0.15s ease, filter 0.15s ease;
}

.survey-rating-block .rating i.active {
    color: #fbbf24;
    text-shadow: 0 4px 16px rgba(251, 191, 36, 0.5);
    filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.4));
}

.survey-rating-block .rating i.preview {
    color: #fcd34d;
    text-shadow: 0 3px 12px rgba(251, 191, 36, 0.4);
    transform: scale(1.1);
}

.survey-rating-block .rating i.bounce {
    animation: starBounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes starBounce {
    0% { transform: scale(1); }
    30% { transform: scale(1.3); }
    50% { transform: scale(0.9); }
    70% { transform: scale(1.15); }
    100% { transform: scale(1.05); }
}

.survey-hint {
    color: var(--gray-500);
    display: block;
    margin-top: 0.35rem;
}

.survey-comment-block {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.survey-comment-block label {
    font-weight: 600;
    color: var(--gray-800);
}

.survey-comment-block textarea {
    min-height: 110px;
    border-radius: 12px;
    border: 1px solid var(--gray-300);
    padding: 0.9rem 1rem;
    resize: vertical;
    font-family: inherit;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.survey-comment-block textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(210, 24, 31, 0.12);
}

.survey-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    align-items: center;
}

.survey-btn {
    border: none;
    border-radius: 12px;
    padding: 0.85rem 1.4rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.survey-btn.primary {
    background: linear-gradient(135deg, #D2181F 0%, #b01218 100%);
    color: #fff;
    box-shadow: 0 10px 25px -10px rgba(210, 24, 31, 0.6);
}

.survey-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px -12px rgba(210, 24, 31, 0.7);
}

.survey-btn.primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.survey-btn.ghost {
    background: #fff;
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
}

.survey-btn.ghost:hover {
    background: var(--gray-50);
}

.survey-btn.loading {
    position: relative;
}

.survey-btn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-top-color: #fff;
    animation: spin 1s linear infinite;
}

.survey-feedback {
    min-height: 18px;
    font-weight: 600;
    font-size: 0.95rem;
    margin-top: -0.2rem;
}

.survey-feedback.error {
    color: var(--error);
}

.survey-feedback.success {
    color: var(--success);
}

/* Celebración WOW al calificar 5 estrellas */
.celebration-particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: particleExplode var(--duration) cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes particleExplode {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0);
        opacity: 0;
    }
}

.sparkle-star {
    position: absolute;
    pointer-events: none;
    animation: sparklePop var(--duration) ease-out forwards;
}

.sparkle-star svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
    filter: drop-shadow(0 0 4px currentColor);
}

@keyframes sparklePop {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(1.2) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: translate(calc(-50% + var(--tx) * 1.5), calc(-50% + var(--ty) * 1.5)) scale(0) rotate(360deg);
        opacity: 0;
    }
}

.glow-ring {
    position: absolute;
    border-radius: 50%;
    border: 3px solid;
    pointer-events: none;
    animation: ringExpand 0.6s ease-out forwards;
}

@keyframes ringExpand {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(4);
        opacity: 0;
    }
}

.heart-float {
    position: absolute;
    pointer-events: none;
    animation: heartRise var(--duration) ease-out forwards;
    color: #ef4444;
}

@keyframes heartRise {
    0% {
        transform: translate(-50%, 0) scale(0);
        opacity: 1;
    }
    50% {
        transform: translate(calc(-50% + var(--tx)), calc(var(--ty) * 0.5)) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(calc(-50% + var(--tx)), var(--ty)) scale(0.5);
        opacity: 0;
    }
}

@media (max-width: 640px) {
    .survey-card {
        max-width: 100%;
    }

    .survey-header {
        padding: 1.25rem;
    }

    .survey-body {
        padding: 1.25rem 1.25rem 1rem;
        gap: 0.85rem;
    }

    .survey-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .survey-btn {
        width: 100%;
        justify-content: center;
    }
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
    .auth-container {
        flex-direction: column;
    }
    
    .auth-card {
        max-width: 100%;
    }
    
    .auth-info {
        display: none;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        display: none;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .navbar {
        padding: 1rem;
    }
    
    .navbar-menu {
        display: none;
    }
}

/* =============================================
   UTILIDADES
   ============================================= */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--error); }
.text-muted { color: var(--gray-500); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

.hidden { display: none; }

/* =============================================
   DASHBOARD CLIENTE - Diseño Simplificado
   ============================================= */
/* =============================================
   DASHBOARD CLIENTE - Nuevo Diseño Profesional
   ============================================= */

.dashboard-cliente {
    background: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Cliente Header */
.cliente-header {
    background: var(--white);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-logo {
    height: 42px;
    width: auto;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--gray-800);
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* Header Navigation */
.header-nav {
    display: flex;
    gap: 0.5rem;
}

.header-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    color: var(--gray-600);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-lg);
    transition: all 0.2s;
}

.header-nav .nav-link:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.header-nav .nav-link.active {
    background: rgba(210, 24, 31, 0.08);
    color: var(--primary-color);
}

.header-nav .nav-link i {
    font-size: 1rem;
}

/* Header User */
.header-user {
    position: relative;
}

.user-trigger {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s;
}

.user-trigger:hover {
    background: var(--gray-50);
    border-color: var(--gray-200);
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.95rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gray-800);
    line-height: 1.2;
}

.user-company {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.user-trigger i {
    color: var(--gray-400);
    font-size: 0.75rem;
    margin-left: 0.25rem;
}

/* Dropdown Content */
.dropdown-content {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    min-width: 260px;
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 1000;
    border: 1px solid var(--gray-100);
}

.dropdown-content.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius);
    background: var(--gray-50);
    margin-bottom: 0.5rem;
}

.dropdown-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.dropdown-user-info strong {
    display: block;
    font-size: 0.9rem;
    color: var(--gray-800);
}

.dropdown-user-info small {
    color: var(--gray-500);
    font-size: 0.8rem;
}

.dropdown-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 0.5rem 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.75rem;
    color: var(--gray-700);
    border-radius: var(--radius);
    transition: all 0.15s;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background: var(--gray-100);
}

.dropdown-item i {
    width: 18px;
    color: var(--gray-500);
}

.dropdown-item.logout {
    color: var(--error);
}

.dropdown-item.logout i {
    color: var(--error);
}

/* Main Content */
.cliente-content {
    flex: 1;
    padding: 2rem 0;
}

.content-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Content Header */
.content-header {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 2rem;
}

.content-header .btn-nuevo-ticket {
    justify-self: start;
}

.welcome-text h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.welcome-text p {
    color: var(--gray-500);
    font-size: 1rem;
    margin: 0;
}

.btn-nuevo-ticket {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-color);
    color: white !important;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.2s;
    border: none !important;
    cursor: pointer;
    outline: none !important;
    box-shadow: none !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.btn-nuevo-ticket:hover,
.btn-nuevo-ticket:focus,
.btn-nuevo-ticket:active {
    background: var(--primary-dark);
    color: white !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-left,
.dashboard-right {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* Status Overview */
.status-overview {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--gray-100);
}

.status-overview h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 1rem;
}

.status-alert {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
}

.status-alert.active {
    background: rgba(234, 179, 8, 0.08);
    border: 1px solid rgba(234, 179, 8, 0.2);
}

.status-alert.clear {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #eab308;
    flex-shrink: 0;
}

.status-indicator.pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}

.status-icon-ok {
    width: 36px;
    height: 36px;
    background: #22c55e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.status-text {
    display: flex;
    flex-direction: column;
}

.status-count {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1;
}

.status-label {
    font-size: 0.95rem;
    color: var(--gray-700);
    font-weight: 500;
}

.status-sublabel {
    font-size: 0.85rem;
    color: var(--gray-500);
}

.status-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--gray-600);
}

.status-item .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-item .dot.abierto {
    background: #22c55e;
}

.status-item .dot.proceso {
    background: #eab308;
}

/* Quick Actions Card - Grid 2x2 */
.quick-actions-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--gray-100);
}

.quick-actions-card h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 1rem;
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.quick-action-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 1.25rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 2px solid var(--gray-200);
    transition: all 0.25s ease;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    outline: none;
}

.quick-action-box:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(210, 24, 31, 0.15);
}

.quick-action-box:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(210, 24, 31, 0.2);
}

.quick-action-box:active {
    transform: translateY(-2px);
}

.quick-action-box:hover .qa-box-title {
    color: var(--primary-color);
}

.quick-action-box:hover .qa-box-desc {
    color: var(--gray-600);
}

.qa-box-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.qa-box-icon.red {
    background: rgba(210, 24, 31, 0.1);
    color: var(--primary-color);
}

.qa-box-icon.blue {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.qa-box-icon.green {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.qa-box-icon.purple {
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
}

.qa-box-content {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.qa-box-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-800);
    line-height: 1.2;
}

.qa-box-desc {
    font-size: 0.75rem;
    color: var(--gray-500);
    line-height: 1.4;
}

/* Tickets Card */
.tickets-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--gray-100);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header h3 i {
    color: var(--primary-color);
}

.ver-todos {
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 500;
}

.ver-todos:hover {
    text-decoration: underline;
}

/* Tickets List */
.tickets-card .tickets-list {
    flex: 1;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
}

.ticket-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-radius: var(--radius);
    transition: all 0.15s;
}

.ticket-item:hover {
    background: var(--gray-50);
}

.ticket-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ticket-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ticket-status.abierto {
    background: #22c55e;
}

.ticket-status.en_proceso {
    background: #eab308;
}

.ticket-status.cerrado {
    background: var(--gray-400);
}

.ticket-info {
    display: flex;
    flex-direction: column;
}

.ticket-id {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-family: monospace;
}

.ticket-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-800);
    line-height: 1.3;
}

.ticket-category {
    font-size: 0.8rem;
    color: var(--gray-500);
}

.ticket-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.ticket-badge {
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 500;
}

.ticket-date {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* Empty Tickets */
.empty-tickets {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.empty-tickets .empty-icon {
    width: 64px;
    height: 64px;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.empty-tickets .empty-icon i {
    font-size: 1.5rem;
    color: var(--gray-400);
}

.empty-tickets h4 {
    font-size: 1rem;
    color: var(--gray-700);
    margin-bottom: 0.25rem;
}

.empty-tickets p {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 1rem;
}

.btn-crear-primero {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-color);
    color: white !important;
    padding: 0.6rem 1rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.2s;
    border: none !important;
    cursor: pointer;
    outline: none !important;
    box-shadow: none !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.btn-crear-primero:hover,
.btn-crear-primero:focus,
.btn-crear-primero:active {
    background: var(--primary-dark);
    color: white !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Info Bar */
.info-bar {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    padding: 1rem 1.5rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--gray-100);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-600);
    font-size: 0.85rem;
}

.info-item i {
    color: var(--primary-color);
}

/* Cliente Footer */
.cliente-footer {
    background: var(--white);
    border-top: 1px solid var(--gray-100);
    padding: 1rem;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.cliente-footer p {
    color: var(--gray-500);
    font-size: 0.8rem;
    margin: 0;
}

/* =============================================
   NEW DASHBOARD LAYOUT - TICKETS TABLE
   ============================================= */

.dashboard-new-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
    align-items: start;
}

/* Tickets Table Card */
.tickets-main-section {
    min-width: 0;
}

.tickets-table-card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow: hidden;
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 3px solid var(--primary-color);
}

.table-header h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
}

.table-header h2 i {
    color: var(--primary-color);
}

.ticket-count {
    background: var(--gray-100);
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--gray-600);
    font-weight: 500;
}

/* Empty State */
.empty-state {
    padding: 4rem 2rem;
    text-align: center;
}

.empty-illustration {
    width: 80px;
    height: 80px;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.empty-illustration i {
    font-size: 2rem;
    color: var(--gray-400);
}

.empty-state h3 {
    font-size: 1.1rem;
    color: var(--gray-800);
    margin: 0 0 0.5rem 0;
}

.empty-state p {
    color: var(--gray-500);
    margin: 0 0 1.5rem 0;
    font-size: 0.9rem;
}

/* Tickets Table */
.tickets-table-container {
    overflow-x: auto;
}

.tickets-table {
    width: 100%;
    border-collapse: collapse;
}

.tickets-table thead {
    background: var(--gray-50);
}

.tickets-table th {
    padding: 0.875rem 1.25rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--gray-100);
}

.tickets-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

.ticket-row {
    cursor: pointer;
    transition: background 0.2s;
    animation: fadeInUp 0.4s ease forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ticket-row:hover {
    background: var(--gray-50);
}

.ticket-row:last-child td {
    border-bottom: none;
}

/* Acciones en tabla de tickets */
.acciones-cell {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.btn-accion-editar,
.btn-accion-ver {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-accion-editar {
    background: linear-gradient(135deg, #D2181F 0%, #A90B10 100%);
    color: white;
    border: none;
    cursor: pointer;
}

.btn-accion-editar:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(210, 24, 31, 0.4);
}

.btn-accion-disabled {
    background: var(--gray-100);
    color: var(--gray-400);
    cursor: not-allowed;
}

.btn-accion-ver {
    background: var(--gray-100);
    color: var(--gray-600);
}

.btn-accion-ver:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

/* Modal Editar Ticket */
.modal-editar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.modal-editar-overlay.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-editar-container {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    display: flex;
    flex-direction: column;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-editar-container .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    background: white;
    border-bottom: 3px solid #D2181F;
}

.modal-editar-container .modal-header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.modal-editar-container .modal-icon {
    width: 48px;
    height: 48px;
    background: #fef2f2;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #D2181F;
}

.modal-editar-container .modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: #333;
}

.modal-editar-container .modal-header p {
    font-size: 0.875rem;
    color: #888;
    margin: 0.25rem 0 0 0;
}

.modal-editar-container .modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.modal-editar-container .modal-close:hover {
    background: #eee;
    color: #333;
}

.modal-editar-body {
    padding: 1.5rem 2rem;
    max-height: 60vh;
    overflow-y: auto;
    flex: 1;
}

.tiempo-editar-aviso {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #b91c1c;
}

.tiempo-editar-aviso.urgente {
    background: #fee2e2;
    border-color: #f87171;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.modal-editar-body .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.modal-editar-body textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s, box-shadow 0.3s;
    min-height: 120px;
}

.modal-editar-body textarea:focus {
    outline: none;
    border-color: #D2181F;
    box-shadow: 0 0 0 3px rgba(210, 24, 31, 0.15);
}

.modal-editar-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.btn-cancelar-editar {
    padding: 0.75rem 1.25rem;
    background: #e2e8f0;
    color: #64748b;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.btn-cancelar-editar:hover {
    background: #cbd5e1;
}

.btn-guardar-editar {
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, #D2181F 0%, #A90B10 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.btn-guardar-editar:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(210, 24, 31, 0.4);
}

.btn-guardar-editar:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Dropzone para arrastrar imágenes */
.imagen-dropzone {
    border: 2px dashed #ccc;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    background: #fafafa;
    transition: all 0.3s;
    margin-bottom: 1rem;
}

.imagen-dropzone.dragover {
    border-color: #D2181F;
    background: #fef2f2;
}

.imagen-dropzone .dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.imagen-dropzone .dropzone-content i {
    font-size: 2.5rem;
    color: #999;
    transition: color 0.3s;
}

.imagen-dropzone.dragover .dropzone-content i {
    color: #D2181F;
}

.imagen-dropzone .dropzone-content p {
    margin: 0;
    color: #666;
    font-size: 0.95rem;
}

.btn-seleccionar-img {
    margin-top: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: #D2181F;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.btn-seleccionar-img:hover {
    background: #A90B10;
    transform: translateY(-1px);
}

.dropzone-hint {
    font-size: 0.8rem;
    color: #999;
    margin-top: 0.5rem;
}

/* Galería de imágenes múltiples */
.imagenes-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.imagen-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 2px solid #eee;
    transition: transform 0.2s, border-color 0.2s;
}

.imagen-item:hover {
    transform: scale(1.05);
    border-color: #D2181F;
}

.imagen-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Video items */
.imagen-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.imagen-item.video-item {
    position: relative;
}

.imagen-item .video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.imagen-item .video-overlay i {
    color: white;
    font-size: 1.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.imagen-item .btn-remove-img {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(210, 24, 31, 0.95);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    z-index: 2;
}

.imagen-item:hover .btn-remove-img {
    opacity: 1;
}

.imagen-item .btn-remove-img:hover {
    transform: scale(1.1);
    background: #A90B10;
}

.btn-add-imagen {
    width: 80px;
    height: 80px;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    transition: all 0.2s;
    color: #9ca3af;
}

.btn-add-imagen:hover {
    border-color: #D2181F;
    background: #fef2f2;
    color: #D2181F;
}

.btn-add-imagen i {
    font-size: 1.25rem;
}

.btn-add-imagen span {
    font-size: 0.65rem;
    font-weight: 500;
}

.imagenes-counter {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

/* Toast de edición */
.toast-edicion {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    color: white;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 2000;
    transition: transform 0.4s ease;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.toast-edicion.show {
    transform: translateX(-50%) translateY(0);
}

.toast-edicion.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.toast-edicion.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.toast-edicion.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* ============================================
   RESPONSIVE - MODAL EDITAR TICKET
   ============================================ */
@media (max-width: 768px) {
    .modal-editar-overlay {
        padding: 0;
        align-items: stretch;
    }
    
    .modal-editar-container {
        width: 100%;
        max-width: 100%;
        height: 100%;
        min-height: 100vh;
        min-height: 100dvh;
        border-radius: 0;
        margin: 0;
        display: flex;
        flex-direction: column;
    }
    
    .modal-editar-container .modal-header {
        padding: 0.75rem 1rem;
        flex-shrink: 0;
    }
    
    .modal-editar-container .modal-icon {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }
    
    .modal-editar-container .modal-header h2 {
        font-size: 1rem;
    }
    
    .modal-editar-container .modal-header p {
        font-size: 0.75rem;
    }
    
    .modal-editar-body {
        padding: 1rem;
        padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        flex: 1;
    }
    
    .modal-editar-body .form-group label {
        font-size: 0.8rem;
    }
    
    .modal-editar-body textarea {
        font-size: 0.9rem;
        min-height: 100px;
    }
    
    .modal-editar-footer {
        flex-direction: column-reverse;
        padding: 0.75rem 1rem;
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
        gap: 0.5rem;
        flex-shrink: 0;
        background: white;
        border-top: 1px solid #e5e7eb;
    }
    
    .modal-editar-footer button {
        width: 100%;
        justify-content: center;
        padding: 0.7rem;
    }
    
    .imagen-dropzone {
        padding: 1rem;
    }
    
    .imagen-dropzone .dropzone-content i {
        font-size: 1.75rem;
    }
    
    .imagen-dropzone .dropzone-content p {
        font-size: 0.8rem;
    }
    
    .imagen-dropzone .dropzone-content span {
        font-size: 0.7rem;
    }
    
    .imagen-preview {
        gap: 0.5rem;
    }
    
    .imagen-item {
        width: 70px;
        height: 70px;
    }
}

@media (max-width: 480px) {
    .modal-editar-container .modal-header {
        padding: 0.6rem 0.75rem;
    }
    
    .modal-editar-container .modal-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    .modal-editar-body {
        padding: 0.75rem;
    }
    
    .modal-editar-footer {
        padding: 0.5rem 0.75rem;
    }
    
    .imagen-item {
        width: 60px;
        height: 60px;
    }
}

/* Ticket Number Cell */
.ticket-number-cell {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ticket-num {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 0.9rem;
}

.ticket-desc {
    font-size: 0.8rem;
    color: var(--gray-500);
    line-height: 1.3;
}

/* Category Badge */
.category-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    background: var(--gray-100);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--gray-600);
    font-weight: 500;
}

/* Date Cell */
.date-cell {
    font-size: 0.85rem;
    color: var(--gray-500);
}

/* =============================================
   STATUS FLOW - ANIMATED PROGRESS
   ============================================= */

.status-flow {
    display: flex;
    align-items: center;
    gap: 0;
    position: relative;
}

.flow-step {
    display: flex;
    align-items: center;
    position: relative;
}

.flow-dot {
    width: 24px;
    height: 24px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dot-inner {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gray-200);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    position: relative;
}

.dot-inner i {
    font-size: 7px;
    color: white;
}

/* Pulse Ring Animation */
.pulse-ring {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    animation: pulseRing 2s ease-out infinite;
}

@keyframes pulseRing {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

/* Flow Line */
.flow-line {
    width: 20px;
    height: 3px;
    background: var(--gray-200);
    transition: background 0.3s ease;
    margin: 0 2px;
}

.flow-line.active {
    background: var(--status-in-progress);
}

/* Active States */
.flow-step.active .dot-inner {
    transform: scale(1.1);
}

.flow-step.active.abierto .dot-inner {
    background: var(--status-open);
}

.flow-step.active.en_proceso .dot-inner {
    background: var(--status-in-progress);
}

.flow-step.active.resuelto .dot-inner {
    background: #3b82f6 !important;
}

.flow-step.active.cerrado .dot-inner {
    background: var(--primary-color);
}

/* Pulse colors for current step */
.flow-step.current.abierto .pulse-ring {
    background: rgba(34, 197, 94, 0.3);
}

.flow-step.current.en_proceso .pulse-ring {
    background: rgba(234, 179, 8, 0.3);
}

.flow-step.current.resuelto .pulse-ring {
    background: rgba(59, 130, 246, 0.3);
}

.flow-step.current.cerrado .pulse-ring {
    background: rgba(210, 24, 31, 0.3);
}

/* Current step glow */
.flow-step.current .dot-inner {
    box-shadow: 0 0 0 4px rgba(0,0,0,0.1);
}

.flow-step.current.abierto .dot-inner {
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
}

.flow-step.current.en_proceso .dot-inner {
    box-shadow: 0 0 0 4px rgba(234, 179, 8, 0.2);
}

.flow-step.current.resuelto .dot-inner {
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
    background: #3b82f6 !important;
}

.flow-step.current.cerrado .dot-inner {
    box-shadow: 0 0 0 4px rgba(210, 24, 31, 0.2);
}

/* Status Label */
.status-label-text {
    margin-left: 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.status-label-text.abierto {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.status-label-text.en_proceso {
    background: rgba(234, 179, 8, 0.1);
    color: #ca8a04;
}

.status-label-text.resuelto {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.status-label-text.cerrado {
    background: rgba(210, 24, 31, 0.1);
    color: var(--primary-color);
}

/* =============================================
   ACTIONS SIDEBAR
   ============================================= */

.actions-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-card {
    background: var(--white);
    border-radius: 14px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.sidebar-card h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-700);
    margin: 0 0 1rem 0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Sidebar Actions */
.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.sidebar-action-btn {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem;
    background: var(--gray-50);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    width: 100%;
    outline: none;
}

.sidebar-action-btn:hover {
    background: var(--white);
    border-color: var(--primary-color);
    transform: translateX(4px);
}

.action-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.action-icon.red {
    background: rgba(210, 24, 31, 0.1);
    color: var(--primary-color);
}

.action-icon.blue {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.action-icon.purple {
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
}

.action-icon.orange {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.action-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.action-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-800);
}

.action-desc {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* Stats Card */
.stats-card .stats-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.stat-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.stat-dot.abierto {
    background: var(--status-open);
}

.stat-dot.proceso {
    background: var(--status-in-progress);
}

.stat-dot.cerrado {
    background: var(--primary-color);
}

.stat-label {
    flex: 1;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.stat-value {
    font-weight: 700;
    font-size: 1rem;
    color: var(--gray-800);
}

/* Contact Card */
.contact-card .contact-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.85rem;
    color: var(--gray-600);
}

.contact-item i {
    width: 20px;
    color: var(--gray-400);
    text-align: center;
}

.contact-item a {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.contact-item a:hover {
    text-decoration: underline;
}

.contact-item a.is-loading {
    pointer-events: none;
}

.contact-item a.is-loading::after {
    content: '';
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--gray-300);
    border-top-color: var(--gray-500);
    animation: spin 0.8s linear infinite;
}

/* Responsive */
@media (max-width: 1024px) {
    .dashboard-new-layout {
        grid-template-columns: 1fr;
    }
    
    .actions-sidebar {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        order: -1;
    }
}

@media (max-width: 768px) {
    .actions-sidebar {
        grid-template-columns: 1fr;
    }
    
    .status-flow {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .flow-line {
        display: none;
    }
    
    .tickets-table th:nth-child(3),
    .tickets-table td:nth-child(3) {
        display: none;
    }
}

/* Badges */
.badge-success {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.badge-warning {
    background: rgba(234, 179, 8, 0.1);
    color: #ca8a04;
}

.badge-danger {
    background: rgba(210, 24, 31, 0.1);
    color: var(--primary-color);
}

.badge-secondary {
    background: var(--gray-200);
    color: var(--gray-600);
}

/* Responsive Dashboard Cliente */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .header-nav span {
        display: none;
    }
    
    .user-info {
        display: none;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 0 1rem;
    }
    
    .brand-text {
        display: none;
    }
    
    .content-container {
        padding: 0 1rem;
    }
    
    .content-header {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        grid-template-columns: none;
    }
    
    .content-header .btn-nuevo-ticket {
        width: 100%;
        justify-content: center;
        box-sizing: border-box;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-actions-grid {
        grid-template-columns: 1fr;
    }
    
    .info-bar {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
}

/* =============================================
   CREAR TICKET - Formulario
   ============================================= */

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumb i.fa-chevron-right {
    font-size: 0.7rem;
    color: var(--gray-400);
}

.breadcrumb span {
    color: var(--gray-800);
    font-weight: 500;
}

/* Form Container */
.ticket-form-container {
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 2rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.form-header {
    background: linear-gradient(135deg, #D2181F 0%, #8B0000 100%);
    padding: 2.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
}

.form-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.form-header::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.form-header-icon {
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
    position: relative;
    z-index: 1;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.form-header-text {
    position: relative;
    z-index: 1;
}

.form-header-text h1 {
    color: white;
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.form-header-text p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    margin: 0;
}

/* Form Content */
.ticket-form {
    padding: 2.5rem;
}

.form-section {
    margin-bottom: 2.5rem;
}

.form-section:last-of-type {
    margin-bottom: 2rem;
}

.form-section-label {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 1.25rem;
}

.step-number {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #D2181F, #A90B10);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(210, 24, 31, 0.3);
    flex-shrink: 0;
}

/* Category Grid - Rediseñado */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.category-option {
    cursor: pointer;
}

.category-option input {
    display: none;
}

.category-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    min-height: 120px;
}

.category-content i {
    font-size: 2rem;
    color: #6c757d;
    transition: all 0.3s;
}

.category-content span {
    font-size: 0.85rem;
    color: #495057;
    font-weight: 600;
    line-height: 1.3;
}

.category-option:hover .category-content {
    border-color: #D2181F;
    background: #fff;
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(210, 24, 31, 0.15);
}

.category-option:hover .category-content i {
    color: #D2181F;
    transform: scale(1.1);
}

.category-option.selected .category-content {
    border-color: #D2181F;
    background: linear-gradient(135deg, rgba(210, 24, 31, 0.08), rgba(210, 24, 31, 0.03));
    box-shadow: 0 4px 20px rgba(210, 24, 31, 0.2);
}

.category-option.selected .category-content i {
    color: #D2181F;
    transform: scale(1.1);
}

.category-option.selected .category-content span {
    color: #D2181F;
}

/* Subcategory - Rediseñado */
.subcategory-section {
    animation: slideDown 0.4s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.subcategory-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.subcategory-option {
    cursor: pointer;
}

.subcategory-option input {
    display: none;
}

.subcategory-option span {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: #f1f3f4;
    border: 2px solid transparent;
    border-radius: 50px;
    font-size: 0.9rem;
    color: #495057;
    font-weight: 500;
    transition: all 0.25s;
}

.subcategory-option:hover span {
    background: #e9ecef;
    border-color: #dee2e6;
}

.subcategory-option.selected span {
    background: linear-gradient(135deg, #D2181F, #A90B10);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 15px rgba(210, 24, 31, 0.3);
}

/* Textarea - Rediseñado */
.textarea-wrapper {
    position: relative;
}

.textarea-wrapper textarea {
    width: 100%;
    padding: 1.25rem;
    border: 2px solid #e9ecef;
    border-radius: 16px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    min-height: 150px;
    transition: all 0.3s;
    background: #f8f9fa;
    line-height: 1.6;
}

.textarea-wrapper textarea:focus {
    outline: none;
    border-color: #D2181F;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(210, 24, 31, 0.1);
}

.textarea-wrapper textarea::placeholder {
    color: #adb5bd;
}

.char-counter {
    text-align: right;
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 0.75rem;
}

/* Form Actions - Rediseñado */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 2px solid #f1f3f4;
    margin-top: 1rem;
}

.btn-cancelar {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    color: #6c757d;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.25s;
    font-size: 0.95rem;
}

.btn-cancelar:hover {
    background: #f1f3f4;
    color: #495057;
}

.btn-enviar {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #D2181F, #A90B10);
    color: white !important;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(210, 24, 31, 0.3);
    font-size: 1rem;
}

.btn-enviar:hover {
    background: linear-gradient(135deg, #A90B10, #8B0000);
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(210, 24, 31, 0.4);
}

.btn-enviar:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Tips Card - Rediseñado */
.tips-card {
    background: linear-gradient(135deg, #e8f4fd, #f0f7ff);
    border: 1px solid #b8daff;
    border-radius: 16px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.tips-card h4 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    color: #0056b3;
    margin-bottom: 1rem;
    font-weight: 600;
}

.tips-card h4 i {
    font-size: 1.25rem;
}

.tips-card ul {
    margin: 0;
    padding-left: 1.5rem;
}

.tips-card li {
    font-size: 0.9rem;
    color: #495057;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.tips-card li:last-child {
    margin-bottom: 0;
}

/* Alert - Rediseñado */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin: 0 2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.alert-error {
    background: linear-gradient(135deg, #ffe5e5, #fff0f0);
    border: 1px solid #ffcccc;
    color: #D2181F;
}

.alert-error i {
    font-size: 1.25rem;
}

/* Responsive */
@media (max-width: 768px) {
    .ticket-form-container {
        margin: 0 -1rem;
        border-radius: 0;
    }
    
    .form-header {
        padding: 2rem 1.5rem;
        flex-direction: column;
        text-align: center;
    }
    
    .ticket-form {
        padding: 1.5rem;
    }
    
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .category-content {
        padding: 1rem 0.75rem;
        min-height: 100px;
    }
    
    .category-content i {
        font-size: 1.5rem;
    }
    
    .form-actions {
        flex-direction: column-reverse;
        gap: 1rem;
    }
    
    .btn-enviar, .btn-cancelar {
        width: 100%;
        justify-content: center;
    }
}

/* =============================================
   TICKET ÉXITO - Página de confirmación
   ============================================= */

.success-container {
    max-width: 520px;
    margin: 3rem auto;
    text-align: center;
    background: #fff;
    border-radius: 24px;
    padding: 3.5rem 2.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}

/* Checkmark Animation */
.success-animation {
    margin-bottom: 2rem;
}

.success-checkmark {
    width: 100px;
    height: 100px;
    margin: 0 auto;
}

.check-icon {
    width: 100px;
    height: 100px;
    position: relative;
    border-radius: 50%;
    box-sizing: content-box;
    border: 5px solid #22c55e;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    box-shadow: 0 10px 30px rgba(34, 197, 94, 0.3);
}

.check-icon::before {
    top: 3px;
    left: -2px;
    width: 30px;
    transform-origin: 100% 50%;
    border-radius: 100px 0 0 100px;
}

.check-icon::after {
    top: 0;
    left: 30px;
    width: 60px;
    transform-origin: 0 50%;
    border-radius: 0 100px 100px 0;
    animation: rotate-circle 4.25s ease-in;
}

.check-icon::before,
.check-icon::after {
    content: '';
    height: 100px;
    position: absolute;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    transform: rotate(-45deg);
}

.icon-line {
    height: 6px;
    background-color: white;
    display: block;
    border-radius: 3px;
    position: absolute;
    z-index: 10;
}

.icon-line.line-tip {
    top: 55px;
    left: 18px;
    width: 30px;
    transform: rotate(45deg);
    animation: icon-line-tip 0.75s;
}

.icon-line.line-long {
    top: 45px;
    right: 10px;
    width: 55px;
    transform: rotate(-45deg);
    animation: icon-line-long 0.75s;
}

.icon-circle {
    top: -5px;
    left: -5px;
    z-index: 10;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    position: absolute;
    box-sizing: content-box;
    border: 5px solid rgba(34, 197, 94, 0.3);
    animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.3); opacity: 0; }
}

.icon-fix {
    display: none;
}

@keyframes rotate-circle {
    0% { transform: rotate(-45deg); }
    5% { transform: rotate(-45deg); }
    12% { transform: rotate(-405deg); }
    100% { transform: rotate(-405deg); }
}

@keyframes icon-line-tip {
    0% { width: 0; left: 1px; top: 19px; }
    54% { width: 0; left: 1px; top: 19px; }
    70% { width: 50px; left: -8px; top: 37px; }
    84% { width: 20px; left: 25px; top: 58px; }
    100% { width: 30px; left: 18px; top: 55px; }
}

@keyframes icon-line-long {
    0% { width: 0; right: 46px; top: 54px; }
    65% { width: 0; right: 46px; top: 54px; }
    84% { width: 60px; right: 5px; top: 42px; }
    100% { width: 55px; right: 10px; top: 45px; }
}

.success-container h1 {
    font-size: 2rem;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.success-message {
    font-size: 1.15rem;
    color: #6c757d;
    margin-bottom: 2rem;
}

.ticket-number-display {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 2px dashed #dee2e6;
    border-radius: 16px;
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
}

.ticket-number-display .label {
    display: block;
    font-size: 0.8rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.ticket-number-display .number {
    display: block;
    font-size: 1.75rem;
    font-weight: 800;
    color: #D2181F;
    font-family: 'Consolas', 'Monaco', monospace;
    letter-spacing: 0.05em;
}

.success-info {
    font-size: 0.95rem;
    color: #6c757d;
    margin-bottom: 1.5rem;
    line-height: 1.7;
    padding: 0 1rem;
}

/* Aviso de edición en página de éxito */
.edit-notice {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border: 1px solid #667eea40;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
    text-align: left;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.edit-notice i {
    color: #667eea;
    font-size: 1.25rem;
    margin-top: 0.1rem;
}

.edit-notice-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.edit-notice-text strong {
    color: #4c5c9c;
    font-size: 0.9rem;
}

.edit-notice-text span {
    color: #6b7280;
    font-size: 0.82rem;
    line-height: 1.4;
}

.success-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: #f1f3f4;
    color: #495057 !important;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.25s;
}

.btn-secondary:hover {
    background: #e9ecef;
    color: #212529 !important;
    transform: translateY(-2px);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #D2181F, #A90B10);
    color: white !important;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.25s;
    box-shadow: 0 4px 15px rgba(210, 24, 31, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #A90B10, #8B0000);
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(210, 24, 31, 0.4);
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: none;
    background: linear-gradient(135deg, var(--error), var(--primary-dark));
    color: white !important;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.25s;
    box-shadow: 0 4px 15px rgba(210, 24, 31, 0.25);
}

.btn-danger:hover {
    background: linear-gradient(135deg, var(--primary-dark), #8B0000);
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(210, 24, 31, 0.35);
}

.btn-danger:disabled {
    opacity: 0.75;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fadeIn {
    animation: fadeIn 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.animate-shake {
    animation: shake 0.4s ease;
}

/* =============================================
   CREAR TICKET - FULL WIDTH LAYOUT
   ============================================= */

.crear-ticket-page {
    min-height: calc(100vh - 70px);
    background: #fff;
}

/* Main Form Area */
.crear-ticket-main {
    background: #fff;
    min-height: calc(100vh - 70px);
}

.page-top-bar {
    padding: 1rem 3rem;
    border-bottom: 1px solid #e9ecef;
    background: #fff;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}

.back-link:hover {
    color: #D2181F;
}

.form-content {
    padding: 2.5rem 4rem 4rem;
}

.form-intro {
    margin-bottom: 3rem;
}

.form-intro h1 {
    font-size: 2rem;
    color: #1a1a2e;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.form-intro h1 i {
    color: #D2181F;
}

.form-intro p {
    color: #6c757d;
    font-size: 1.1rem;
}

/* Form Steps */
.ticket-form-full {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.form-step {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid #e9ecef;
}

.step-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.step-badge {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #D2181F, #A90B10);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.step-title h2 {
    font-size: 1.25rem;
    color: #1a1a2e;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.step-title p {
    color: #6c757d;
    font-size: 0.95rem;
}

/* Category Buttons - Full Width Grid */
.category-buttons {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
}

.cat-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    min-height: 120px;
}

.cat-btn input {
    display: none;
}

.cat-btn i {
    font-size: 2rem;
    color: #6c757d;
    transition: all 0.25s;
}

.cat-btn span {
    font-size: 0.85rem;
    color: #495057;
    font-weight: 600;
    line-height: 1.3;
}

.cat-btn:hover {
    border-color: #D2181F;
    background: #fff;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(210, 24, 31, 0.15);
}

.cat-btn:hover i {
    color: #D2181F;
}

.cat-btn.active {
    border-color: #D2181F;
    background: linear-gradient(135deg, rgba(210, 24, 31, 0.08), rgba(210, 24, 31, 0.02));
    box-shadow: 0 4px 15px rgba(210, 24, 31, 0.2);
}

.cat-btn.active i {
    color: #D2181F;
    transform: scale(1.1);
}

.cat-btn.active span {
    color: #D2181F;
}

/* Subcategory Buttons */
.subcategory-step {
    animation: slideDown 0.3s ease;
}

.subcat-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.subcat-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #495057;
    font-weight: 500;
    transition: all 0.2s;
}

.subcat-btn input {
    display: none;
}

.subcat-btn:hover {
    border-color: #D2181F;
    color: #D2181F;
}

.subcat-btn.active {
    border-color: #D2181F;
    background: #D2181F;
    color: white;
}

/* Description Input - Full Width */
.desc-input-wrapper {
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.desc-input-wrapper:focus-within {
    border-color: #D2181F;
}

.desc-input-wrapper textarea {
    width: 100%;
    min-height: 200px;
    padding: 1.5rem;
    border: none;
    resize: vertical;
    font-size: 1rem;
    line-height: 1.6;
    font-family: inherit;
}

.desc-input-wrapper textarea:focus {
    outline: none;
}

.desc-input-wrapper textarea::placeholder {
    color: #adb5bd;
}

.textarea-footer {
    display: flex;
    justify-content: flex-end;
    padding: 0.75rem 1.5rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.char-info {
    font-size: 0.85rem;
    color: #6c757d;
}

/* Submit Section */
.form-submit-section {
    display: flex;
    justify-content: flex-end;
    padding-top: 0.5rem;
}

.submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.1rem 3rem;
    background: linear-gradient(135deg, #D2181F, #A90B10);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 4px 15px rgba(210, 24, 31, 0.3);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(210, 24, 31, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 1400px) {
    .category-buttons {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1024px) {
    .category-buttons {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .form-content {
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .form-content {
        padding: 1.5rem;
    }
    
    .category-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cat-btn {
        min-height: 100px;
        padding: 1.25rem 0.75rem;
    }
    
    .cat-btn i {
        font-size: 1.5rem;
    }
    
    .cat-btn span {
        font-size: 0.8rem;
    }
    
    .form-intro h1 {
        font-size: 1.5rem;
    }
    
    .page-top-bar {
        padding: 1rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .category-buttons {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    .form-content {
        padding: 1rem;
    }
    
    .form-step {
        padding: 1.25rem;
    }
    
    .submit-btn {
        width: 100%;
        justify-content: center;
    }
}

/* =============================================
   LISTA DE TICKETS
   ============================================= */

.tickets-page {
    max-width: 1000px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.page-title h1 {
    font-size: 1.5rem;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.page-title h1 i {
    color: var(--primary-color);
}

.page-title p {
    color: var(--gray-500);
    font-size: 0.9rem;
    margin: 0;
}

/* Stats Cards */
.tickets-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-card.active {
    border-color: var(--primary-color);
    background: rgba(210, 24, 31, 0.03);
}

.stat-card .stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-800);
}

.stat-card .stat-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card.stat-abierto .stat-number { color: #22c55e; }
.stat-card.stat-proceso .stat-number { color: #f59e0b; }
.stat-card.stat-resuelto .stat-number { color: #3b82f6; }
.stat-card.stat-cerrado .stat-number { color: var(--gray-400); }

/* Toolbar */
.tickets-toolbar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: center;
}

.search-box {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 0 1rem;
    transition: all 0.2s;
}

.search-box:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(210, 24, 31, 0.1);
}

.search-box i {
    color: var(--gray-400);
}

.search-box input {
    flex: 1;
    border: none;
    padding: 0.75rem;
    font-size: 0.95rem;
    background: transparent;
    outline: none;
}

.btn-limpiar {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--gray-100);
    color: var(--gray-600);
    border-radius: var(--radius-lg);
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-limpiar:hover {
    background: var(--gray-200);
}

/* Tickets List */
.tickets-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ticket-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
    border: 2px solid transparent;
}

.ticket-card:hover {
    border-color: var(--gray-200);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateX(4px);
}

.ticket-icon {
    width: 48px;
    height: 48px;
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ticket-icon i {
    font-size: 1.25rem;
    color: var(--gray-500);
}

.ticket-content {
    flex: 1;
    min-width: 0;
}

.ticket-header-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.ticket-id {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--gray-500);
}

.ticket-estado {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ticket-estado.estado-abierto {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.ticket-estado.estado-en-proceso {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.ticket-estado.estado-resuelto {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.ticket-estado.estado-cerrado {
    background: var(--gray-100);
    color: var(--gray-500);
}

.ticket-categoria {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0 0 0.35rem;
}

.ticket-subcategoria {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--gray-500);
    margin-left: 0.5rem;
}

.ticket-subcategoria::before {
    content: "•";
    margin-right: 0.5rem;
}

.ticket-descripcion {
    font-size: 0.85rem;
    color: var(--gray-600);
    margin: 0 0 0.5rem;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ticket-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--gray-400);
}

.ticket-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.ticket-arrow {
    color: var(--gray-300);
    transition: all 0.2s;
}

.ticket-card:hover .ticket-arrow {
    color: var(--primary-color);
    transform: translateX(3px);
}

/* Botón de edición en lista de tickets */
.ticket-acciones {
    display: flex;
    align-items: center;
    padding: 0 0.5rem;
}

.btn-editar-ticket {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-editar-ticket:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-editar-ticket .tiempo-edicion {
    background: rgba(255,255,255,0.25);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
}

.btn-editar-ticket.disabled {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-editar-ticket.disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Responsive para botón de edición */
@media (max-width: 768px) {
    .ticket-acciones {
        position: absolute;
        top: 0.75rem;
        right: 2.5rem;
    }
    
    .btn-editar-ticket {
        padding: 0.4rem 0.6rem;
        font-size: 0.7rem;
    }
    
    .ticket-card {
        position: relative;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--white);
    border-radius: var(--radius-xl);
}

.empty-icon {
    width: 80px;
    height: 80px;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.empty-icon i {
    font-size: 2rem;
    color: var(--gray-400);
}

.empty-state h3 {
    font-size: 1.25rem;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--gray-500);
    margin-bottom: 1.5rem;
}

/* =============================================
   DETALLE DE TICKET
   ============================================= */

.ticket-detail-page {
    max-width: 1100px;
}

.ticket-detail-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 900px) {
    .ticket-detail-layout {
        grid-template-columns: 1fr;
    }
}

/* Main Content */
.ticket-detail-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ticket-detail-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius-xl);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.ticket-detail-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ticket-detail-icon i {
    font-size: 1.5rem;
    color: white;
}

.ticket-detail-title {
    flex: 1;
}

.ticket-id-badge {
    display: inline-block;
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.25rem;
}

.ticket-detail-title h1 {
    font-size: 1.35rem;
    color: var(--gray-800);
    margin: 0 0 0.25rem;
}

.ticket-subcategoria-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--gray-500);
}

.ticket-estado-large {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    flex-shrink: 0;
}

.ticket-estado-large.estado-abierto {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.ticket-estado-large.estado-en-proceso {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.ticket-estado-large.estado-resuelto {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.ticket-estado-large.estado-cerrado {
    background: var(--gray-100);
    color: var(--gray-500);
}

/* Ticket Sections */
.ticket-section {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius-xl);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.ticket-section h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    color: var(--gray-700);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-100);
}

.ticket-section h2 i {
    color: var(--gray-400);
}

.comment-count {
    margin-left: auto;
    background: var(--gray-100);
    color: var(--gray-600);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
}

.ticket-descripcion-box {
    color: var(--gray-700);
    line-height: 1.7;
    white-space: pre-wrap;
}

/* Comments */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.comment-item {
    display: flex;
    gap: 0.75rem;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.comment-avatar.sistema {
    background: var(--gray-200);
    color: var(--gray-500);
}

.comment-avatar.admin {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.comment-avatar.user,
.comment-avatar.cliente {
    background: var(--gray-300);
    color: var(--gray-600);
}

.comment-avatar i {
    font-size: 0.9rem;
}

.comment-content {
    flex: 1;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1rem;
}

.comment-admin .comment-content {
    background: rgba(210, 24, 31, 0.05);
    border-left: 3px solid var(--primary-color);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}

.comment-author {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge-soporte {
    background: var(--primary-color);
    color: white;
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-transform: uppercase;
}

.comment-date {
    font-size: 0.75rem;
    color: var(--gray-400);
}

.comment-body {
    font-size: 0.9rem;
    color: var(--gray-600);
    line-height: 1.5;
}

/* Comment Form */
.comment-form {
    display: flex;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-100);
}

.comment-form-avatar {
    width: 36px;
    height: 36px;
    background: var(--gray-300);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    flex-shrink: 0;
}

.comment-form-input {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.comment-form-input textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 80px;
    transition: all 0.2s;
}

.comment-form-input textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(210, 24, 31, 0.1);
}

.btn-enviar-comentario {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    cursor: pointer;
    align-self: flex-end;
    transition: all 0.2s;
}

.btn-enviar-comentario:hover {
    background: var(--primary-dark);
}

.ticket-cerrado-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    color: var(--gray-500);
    font-size: 0.9rem;
}

/* Sidebar */
.ticket-detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-section {
    background: var(--white);
    padding: 1.25rem;
    border-radius: var(--radius-xl);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.sidebar-section h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin-bottom: 0.75rem;
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-100);
}

.info-list li:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 0.8rem;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.info-value {
    font-size: 0.85rem;
    color: var(--gray-700);
    font-weight: 500;
}

.solicitante-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.solicitante-avatar {
    width: 40px;
    height: 40px;
    background: var(--gray-200);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
}

.solicitante-details {
    display: flex;
    flex-direction: column;
}

.solicitante-details strong {
    font-size: 0.9rem;
    color: var(--gray-700);
}

.solicitante-details small {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn-sidebar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    background: var(--gray-100);
    color: var(--gray-700);
    border-radius: var(--radius-lg);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-sidebar:hover {
    background: var(--gray-200);
}

.btn-sidebar.btn-cerrar {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.btn-sidebar.btn-cerrar:hover {
    background: rgba(34, 197, 94, 0.2);
}

/* Alert Success */
.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #16a34a;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Responsive para stats */
@media (max-width: 600px) {
    .tickets-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .page-header {
        flex-direction: column;
    }
    
    .ticket-detail-header {
        flex-direction: column;
        text-align: center;
    }
    
    .ticket-estado-large {
        align-self: center;
    }
}

/* =============================================
   DASHBOARD ADMIN - Panel Completo
   ============================================= */
.admin-page {
    display: flex;
    min-height: 100vh;
    background: var(--gray-100);
}

/* Sidebar Admin */
.admin-sidebar {
    width: 260px;
    background: var(--gray-900);
    color: var(--white);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: all var(--transition);
}

.admin-sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    height: 35px;
    width: auto;
}

.sidebar-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-title {
    display: block;
    padding: 0 1.5rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    transition: color var(--transition);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.05);
    transition: width 0.3s ease;
    z-index: -1;
}

.nav-link:hover {
    color: var(--white);
}

.nav-link:hover::before {
    width: 100%;
}

.nav-link.active {
    color: var(--white);
    border-left: 3px solid var(--primary-color);
}

.nav-link.active::before {
    width: 100%;
    background: rgba(210, 24, 31, 0.2);
    animation: fillActive 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes fillActive {
    from { width: 0; opacity: 0; }
    to { width: 100%; opacity: 1; }
}

.nav-link i {
    width: 20px;
    text-align: center;
    font-size: 0.95rem;
}

.nav-badge {
    margin-left: auto;
    background: var(--primary-color);
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.admin-user-info {
    display: flex;
    flex-direction: column;
}

.admin-user-name {
    font-weight: 500;
    font-size: 0.9rem;
}

.admin-user-role {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.logout-btn {
    padding: 0.5rem;
    color: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius);
    transition: all var(--transition);
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-color);
}

/* Main Admin */
.admin-main {
    flex: 1;
    margin-left: 260px;
    transition: all var(--transition);
}

.admin-main.expanded {
    margin-left: 0;
}

/* Topbar */
.admin-topbar {
    background: var(--white);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--gray-600);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    display: none;
}

.sidebar-toggle:hover {
    background: var(--gray-100);
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-800);
}

.date-display {
    color: var(--gray-500);
    font-size: 0.9rem;
}

.date-display i {
    margin-right: 0.5rem;
    color: var(--primary-color);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.topbar-notifications {
    position: relative;
}

.notif-bell {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.notif-bell:hover {
    border-color: rgba(210, 24, 31, 0.3);
    color: var(--primary-color);
    background: rgba(210, 24, 31, 0.05);
}

.notif-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #D2181F;
    color: #fff;
    border-radius: 999px;
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    min-width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(210, 24, 31, 0.35);
}

.notif-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: 320px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.15);
    display: none;
    overflow: hidden;
    z-index: 1000;
}

.notif-dropdown.open {
    display: block;
}

.notif-dropdown-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eef2f7;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #475569;
}

.notif-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.notif-clear-all {
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #64748b;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.notif-clear-all:hover {
    border-color: rgba(210, 24, 31, 0.35);
    color: var(--primary-color);
    background: rgba(210, 24, 31, 0.05);
}

.notif-count {
    font-size: 0.75rem;
    color: #9ca3af;
}

.notif-dropdown-body {
    max-height: 360px;
    overflow-y: auto;
    overflow-x: hidden;
}

.notif-item {
    width: 100%;
    border: none;
    background: #fff;
    text-align: left;
    padding: 0.6rem 0.85rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.notif-item-main {
    flex: 1;
    border: none;
    background: transparent;
    text-align: left;
    padding: 0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.notif-item-delete {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #9ca3af;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.notif-item-delete:hover {
    border-color: rgba(210, 24, 31, 0.35);
    color: var(--primary-color);
    background: rgba(210, 24, 31, 0.05);
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item.unread {
    background: rgba(210, 24, 31, 0.04);
}

.notif-item-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-item-message {
    font-size: 0.78rem;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notif-empty {
    padding: 1rem;
    font-size: 0.85rem;
    color: #9ca3af;
    text-align: center;
}

/* Content */
.admin-content {
    padding: 2rem;
}

/* Stats */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.admin-stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow);
}

.stat-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.stat-card-icon.total {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.stat-card-icon.abiertos {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.stat-card-icon.proceso {
    background: rgba(234, 179, 8, 0.1);
    color: #eab308;
}

.stat-card-icon.resueltos {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.stat-card-icon.criticos {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.stat-card-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.stat-card-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1;
}

.stat-card-label {
    color: var(--gray-500);
    font-size: 0.8rem;
    margin-top: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Grid */
.admin-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
}

/* Cards */
.admin-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.admin-card .card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-card .card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-card .card-header h3 i {
    color: var(--primary-color);
}

.admin-card .card-body {
    padding: 1.5rem;
}

/* Tickets Table */
.admin-tickets-table {
    overflow-x: auto;
}

.admin-tickets-table table {
    width: 100%;
    border-collapse: collapse;
}

.admin-tickets-table th,
.admin-tickets-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-100);
}

.admin-tickets-table th {
    font-weight: 500;
    color: var(--gray-500);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-tickets-table tr:hover {
    background: var(--gray-50);
}

.ticket-id {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 500;
}

.cliente-info {
    display: flex;
    flex-direction: column;
}

.cliente-nombre {
    font-weight: 500;
    color: var(--gray-800);
    font-size: 0.9rem;
}

.cliente-empresa {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.ticket-asunto {
    color: var(--gray-700);
    font-size: 0.9rem;
}

.fecha {
    font-size: 0.8rem;
    color: var(--gray-500);
}

/* Priority Badges */
.priority-badge {
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.priority-low {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.priority-medium {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.priority-high {
    background: rgba(234, 179, 8, 0.1);
    color: #ca8a04;
}

.priority-critical {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    color: var(--gray-700);
    transition: all var(--transition);
    text-align: center;
}

.quick-action-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.quick-action-btn i {
    font-size: 1.5rem;
}

.quick-action-btn span {
    font-size: 0.8rem;
    font-weight: 500;
}

/* Resumen */
.resumen-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.resumen-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-100);
}

.resumen-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.resumen-label {
    color: var(--gray-600);
    font-size: 0.9rem;
}

.resumen-value {
    font-weight: 600;
    color: var(--gray-800);
}

/* Empty State Small */
.empty-state-small {
    text-align: center;
    padding: 2rem;
    color: var(--gray-500);
}

.empty-state-small i {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

/* Button Ghost */
.btn-ghost {
    background: none;
    border: none;
    color: var(--gray-500);
    padding: 0.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-ghost:hover {
    background: var(--gray-100);
    color: var(--primary-color);
}

/* Responsive Admin */
@media (max-width: 1400px) {
    .admin-stats {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.75rem;
    }
    
    .admin-stat-card {
        padding: 0.875rem 1rem;
    }
    
    .stat-card-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .stat-card-number {
        font-size: 1.35rem;
    }
}

@media (max-width: 1200px) {
    .admin-stats {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .admin-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-side-panel {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .sidebar-toggle {
        display: flex !important;
    }
    
    /* Sidebar oculto por defecto en móvil */
    .admin-sidebar {
        transform: translateX(-100%);
        box-shadow: 4px 0 20px rgba(0,0,0,0.3);
    }
    
    /* Sidebar visible cuando tiene clase 'mobile-open' */
    .admin-sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-left: 0;
        overflow-x: visible;
    }
    
    /* Permitir scroll horizontal en tablas */
    .admin-content {
        overflow-x: visible;
    }
    
    /* Stats cards compactas en móvil - 2 columnas */
    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .admin-stat-card {
        padding: 0.75rem;
        gap: 0.6rem;
    }
    
    .stat-card-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
        border-radius: 8px;
    }
    
    .stat-card-number {
        font-size: 1.25rem;
    }
    
    .stat-card-label {
        font-size: 0.7rem;
        margin-top: 0.1rem;
    }
    
    .admin-side-panel {
        grid-template-columns: 1fr;
    }
    
    .admin-content {
        padding: 1rem;
    }
    
    .admin-topbar {
        padding: 1rem;
    }
    
    /* Overlay para cerrar el menú */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
}

/* Estilos del botón toggle en topbar */
.sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: #f3f4f6;
    border-radius: 8px;
    cursor: pointer;
    color: #374151;
    font-size: 1.1rem;
    transition: all 0.2s;
}

.sidebar-toggle:hover {
    background: #e5e7eb;
    color: #1f2937;
}

/* =============================================
   RESPONSIVE MOBILE - Estilos adicionales
   ============================================= */
@media (max-width: 768px) {
    /* Header admin */
    .admin-topbar {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .topbar-left {
        flex: 1;
        min-width: 0;
    }
    
    .page-title {
        font-size: 1.1rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .topbar-right {
        display: none;
    }
    
    /* Tablas responsive */
    .admin-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Cards grid */
    .admin-grid,
    .content-grid,
    .inventory-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* Stats en móvil */
    .tickets-stats,
    .admin-stats,
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem;
    }
    
    /* Botones de acción */
    .action-buttons,
    .filter-buttons {
        flex-wrap: wrap;
    }
    
    /* Cards más pequeñas */
    .admin-card {
        padding: 1rem;
    }
    
    .card-header h3 {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    /* Stats en una columna en pantallas muy pequeñas */
    .tickets-stats,
    .admin-stats,
    .stats-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* Formularios */
    .form-row {
        flex-direction: column;
    }
    
    /* Filtros en columna */
    .filters-bar {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .filter-tabs {
        flex-wrap: wrap;
    }
}

/* =============================================
   WIDGET MANTENIMIENTOS DASHBOARD
   ============================================= */

.maintenance-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.maintenance-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;
    border-radius: 12px;
    text-align: center;
}

.maintenance-stat.danger {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.maintenance-stat.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.maintenance-stat i {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.maintenance-stat .stat-number {
    font-size: 1.5rem;
    font-weight: 700;
}

.maintenance-stat .stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
}

.maintenance-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.maintenance-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem;
    border-radius: 10px;
    background: #fafafa;
    transition: all 0.2s;
}

.maintenance-item:hover {
    background: #f3f4f6;
}

.maintenance-item.vencido {
    background: rgba(239, 68, 68, 0.05);
    border-left: 3px solid #dc2626;
}

.maintenance-item.proximo {
    background: rgba(245, 158, 11, 0.05);
    border-left: 3px solid #d97706;
}

.maintenance-item .item-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 8px;
    color: #6b7280;
    font-size: 1rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.maintenance-item .item-info {
    flex: 1;
    min-width: 0;
}

.maintenance-item .item-name {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.maintenance-item .item-detail {
    display: block;
    font-size: 0.75rem;
    margin-top: 0.15rem;
}

.maintenance-item .item-detail .text-danger {
    color: #dc2626;
}

.maintenance-item .item-detail .text-warning {
    color: #d97706;
}

.maintenance-item .item-action {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 8px;
    color: #6b7280;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.maintenance-item .item-action:hover {
    background: #D2181F;
    color: white;
}

.maintenance-ok {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem 1rem;
    color: #22c55e;
}

.maintenance-ok i {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.maintenance-ok span {
    font-weight: 600;
    color: #166534;
}

.maintenance-ok small {
    color: #6b7280;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.nav-badge.danger {
    background: #dc2626 !important;
    color: white !important;
}

/* Sección de calificar en sidebar */
.calificar-section {
    background: linear-gradient(135deg, #fef3c7, #fde68a) !important;
    border: 2px solid #f59e0b !important;
}

.calificar-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.calificar-header i {
    color: #f59e0b;
    font-size: 1.25rem;
}

.calificar-header h3 {
    margin: 0;
    font-size: 1rem;
    color: #92400e;
}

.btn-calificar {
    background: #f59e0b !important;
    color: white !important;
    font-weight: 600 !important;
}

.btn-calificar:hover {
    background: #d97706 !important;
}

/* Sección de calificación recibida */
.calificacion-section {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.rating-display-sidebar {
    display: flex;
    gap: 0.25rem;
    font-size: 1.25rem;
    margin-top: 0.5rem;
}

/* Estilos para estado resuelto en badges */
.estado-resuelto,
.ticket-estado.estado-resuelto {
    background: #dbeafe;
    color: #1e40af;
}

.stat-resuelto {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e40af;
}

.stat-resuelto:hover {
    background: linear-gradient(135deg, #bfdbfe, #93c5fd);
}

