/* 
   TECNOLOGIA DE CERO - PORTAL DE GESTIÓN IT
   Sistema de Diseño CSS Premium
*/

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --font-primary: 'Outfit', sans-serif;
    
    /* Paleta de Colores Dark Mode */
    --bg-main: #060913;
    --bg-surface: rgba(13, 20, 38, 0.65);
    --bg-surface-solid: #0d1426;
    --bg-card: rgba(22, 30, 54, 0.45);
    --bg-card-solid: #161e36;
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(99, 102, 241, 0.15);
    
    /* Colores Acento */
    --primary: #6366f1; /* Indigo */
    --primary-glow: rgba(99, 102, 241, 0.35);
    --primary-dark: #4f46e5;
    
    --secondary: #06b6d4; /* Cyan */
    --secondary-glow: rgba(6, 182, 212, 0.35);
    
    --success: #10b981; /* Emerald */
    --success-glow: rgba(16, 185, 129, 0.2);
    
    --warning: #f59e0b; /* Amber */
    --warning-glow: rgba(245, 158, 11, 0.2);
    
    --danger: #ef4444; /* Rose */
    --danger-glow: rgba(239, 68, 68, 0.2);
    
    /* Colores de Texto */
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dark: #6b7280;
    
    /* Gradientes */
    --grad-primary: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --grad-cyan: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    --grad-emerald: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --grad-amber: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --grad-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --grad-dark: linear-gradient(135deg, #0d1426 0%, #060913 100%);
    
    /* Sombras y Efectos */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 15px 40px rgba(0, 0, 0, 0.45);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.25);
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset de Estilos */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg-main);
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.08) 0%, transparent 40%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

/* Scrollbar Personalizada */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* --- DISEÑO DE CONTENEDOR PRINCIPAL --- */
#app-container {
    display: flex;
    width: 100vw;
    min-height: 100vh;
}

/* Sidebar de Navegación */
.sidebar {
    width: 260px;
    background-color: var(--bg-surface-solid);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--grad-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
}

.logo-icon i {
    font-size: 20px;
    color: #fff;
}

.logo-text {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #fff 30%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text span {
    color: var(--secondary);
    -webkit-text-fill-color: initial;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: var(--transition);
    border: 1px solid transparent;
}

.nav-item a:hover {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.03);
}

.nav-item.active a {
    color: #fff;
    background: var(--bg-card-solid);
    border-color: var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    position: relative;
}

.nav-item.active a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 25%;
    height: 50%;
    width: 4px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 10px var(--primary);
}

.nav-item.active a i {
    color: var(--primary);
    text-shadow: 0 0 8px var(--primary-glow);
}

/* Panel de Sesión en el Sidebar */
.user-panel {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--grad-cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

.btn-logout {
    width: 100%;
    padding: 10px;
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-logout:hover {
    background: var(--danger);
    color: white;
}

/* Área de Contenido Principal */
.main-content {
    margin-left: 260px;
    flex-grow: 1;
    min-height: 100vh;
    padding: 40px;
    transition: var(--transition);
}

/* --- ESTILOS DE VISTAS (SPA) --- */
.view-section {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
}

.view-section.active {
    display: block;
}

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

/* Encabezado de la Vista */
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.view-title h1 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #ffffff, #9ca3af);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.view-title p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}

.view-actions {
    display: flex;
    gap: 12px;
}

/* --- BOTONES PREMIUM --- */
.btn {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 14px;
    border: 1px solid transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-primary {
    background: var(--grad-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--bg-card-solid);
    color: var(--text-main);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-muted);
}

.btn-success {
    background: var(--grad-emerald);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: var(--grad-danger);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-icon-only {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

/* --- DASHBOARD PRINCIPAL --- */

/* Grid de Estadísticas Rápidas */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(16px);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-3px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-icon.indigo {
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary);
}

.stat-icon.cyan {
    background: rgba(6, 182, 212, 0.12);
    color: var(--secondary);
}

.stat-icon.emerald {
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
}

.stat-icon.warning {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Tarjetas Principales del Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.dashboard-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    min-height: 380px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title i {
    font-size: 18px;
    color: var(--primary);
}

.card-title h2 {
    font-size: 18px;
    font-weight: 700;
}

/* Lista del Dashboard */
.dashboard-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    max-height: 280px;
    padding-right: 4px;
}

.dashboard-list-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 14px 16px;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
}

.dashboard-list-item:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.02);
    transform: translateX(4px);
}

.item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.item-badge-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--text-muted);
}

.item-title {
    font-weight: 600;
    font-size: 14px;
}

.item-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.item-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* --- SECCIÓN CLIENTES --- */

/* Barra de Herramientas */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: var(--radius-md);
    backdrop-filter: blur(16px);
}

.search-container {
    position: relative;
    flex-grow: 1;
    max-width: 400px;
}

.search-container i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dark);
}

.search-input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: white;
    font-family: var(--font-primary);
    font-size: 14px;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    background: rgba(255, 255, 255, 0.05);
}

/* Grid de Tarjetas de Clientes */
.clients-grid, .projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.client-card, .project-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 200px;
}

.client-card::after, .project-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--grad-cyan);
    opacity: 0;
    transition: var(--transition);
}

.client-card:hover, .project-card:hover {
    transform: translateY(-5px);
    border-color: rgba(6, 182, 212, 0.3);
    box-shadow: var(--shadow-md);
}

.client-card:hover::after, .project-card:hover::after {
    opacity: 1;
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.card-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: rgba(6, 182, 212, 0.1);
    color: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
}

.client-card:nth-child(2n) .card-avatar {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.card-body h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.3;
}

.card-info-item {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.card-info-item i {
    font-size: 12px;
    width: 14px;
}

/* Indicador de Horas (Circular o Barra) */
.card-hours-indicator {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.hours-bar-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 6px;
}

.hours-progress-bg {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

.hours-progress-fill {
    height: 100%;
    background: var(--grad-cyan);
    width: 0%;
    border-radius: 3px;
    transition: width 1s ease-in-out;
}

.hours-progress-fill.warning {
    background: var(--grad-amber);
}

.hours-progress-fill.danger {
    background: var(--grad-danger);
}

.hours-progress-fill.success {
    background: var(--grad-emerald);
}

/* --- DETALLE DEL CLIENTE --- */

.client-detail-header {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    backdrop-filter: blur(16px);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-profile {
    display: flex;
    align-items: center;
    gap: 20px;
}

.detail-avatar {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    background: var(--grad-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
}

.detail-info h2 {
    font-size: 22px;
    font-weight: 700;
}

.detail-info-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.detail-info-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Pestañas de Navegación del Cliente */
.detail-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1px;
}

.tab-btn {
    padding: 12px 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    transition: var(--transition);
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.02);
}

.tab-btn.active {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary);
}

/* Contenido de las pestañas */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

/* Pestaña: Bono de Horas */
.hours-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 24px;
}

.hours-dashboard {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hours-display-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.hours-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    position: relative;
}

.hours-card-value {
    font-size: 26px;
    font-weight: 800;
    margin-top: 6px;
}

.hours-card-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

.hours-card.hired {
    border-color: rgba(6, 182, 212, 0.2);
    color: var(--secondary);
}

.hours-card.spent {
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.hours-card.remaining {
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.hours-form-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 24px;
    border-radius: var(--radius-lg);
}

.hours-form-panel h3 {
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hours-history-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 24px;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
}

.hours-history-panel h3 {
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 700;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    max-height: 380px;
    padding-right: 4px;
}

.history-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-left {
    display: flex;
    flex-direction: column;
}

.history-desc {
    font-size: 13px;
    font-weight: 600;
}

.history-date {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.history-badge {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
}

.history-badge.added {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.history-badge.subtracted {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Pestaña: Tareas (Tablero Kanban) */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    align-items: start;
}

.kanban-column {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    min-height: 480px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 6px;
}

.column-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 15px;
}

.column-title.pending i { color: var(--warning); }
.column-title.progress i { color: var(--secondary); }
.column-title.completed i { color: var(--success); }

.column-counter {
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
}

.kanban-cards-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
    min-height: 400px;
}

.task-card {
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: grab;
    transition: var(--transition);
    position: relative;
    box-shadow: var(--shadow-sm);
}

.task-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.task-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.task-card h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.4;
}

.task-card p {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.task-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-dark);
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.task-date {
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-actions {
    display: flex;
    gap: 4px;
}

.task-actions button {
    background: none;
    border: none;
    color: var(--text-dark);
    cursor: pointer;
    padding: 2px;
    transition: var(--transition);
}

.task-actions button:hover {
    color: var(--text-main);
}

.task-actions button.delete:hover {
    color: var(--danger);
}

/* Pestaña: Contraseñas Cifradas */

/* Pantalla de Bloqueo */
.crypto-lock-screen {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 48px;
    text-align: center;
    max-width: 460px;
    margin: 40px auto;
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-lg);
}

.lock-icon {
    font-size: 40px;
    color: var(--primary);
    margin-bottom: 20px;
    animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(99, 102, 241, 0);
        transform: scale(1);
    }
    50% {
        text-shadow: 0 0 20px rgba(99, 102, 241, 0.6);
        transform: scale(1.05);
    }
}

.crypto-lock-screen h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.crypto-lock-screen p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Panel de Contraseñas Activo */
.passwords-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.crypto-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 14px 20px;
    border-radius: var(--radius-md);
}

.lock-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--success);
}

.lock-status i {
    font-size: 14px;
}

.password-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.password-item-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pw-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pw-label-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pw-category-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--text-muted);
}

.pw-label {
    font-weight: 700;
    font-size: 14px;
}

.pw-category-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.pw-fields {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--bg-card);
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.pw-field-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.pw-field-label {
    color: var(--text-muted);
    font-size: 11px;
}

.pw-field-value {
    font-family: monospace;
    font-weight: 600;
}

.pw-value-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-reveal-pw, .btn-copy-val {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    transition: var(--transition);
}

.btn-reveal-pw:hover, .btn-copy-val:hover {
    color: var(--text-main);
}

.pw-notes {
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 8px;
    margin-top: 4px;
}

/* Pestaña: Registro de Compras */
.purchases-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.purchases-table-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.purchases-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.purchases-table th {
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
    font-weight: 700;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.purchases-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.purchases-table tr:last-child td {
    border-bottom: none;
}

.purchases-table tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

.purchase-title {
    font-weight: 600;
}

.purchase-link {
    color: var(--secondary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
    transition: var(--transition);
}

.purchase-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.purchase-price {
    font-weight: 700;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.status-badge.completed {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-badge.pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* --- TABLERO PROYECTOS --- */
.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.project-client-name {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--secondary);
}

.project-status {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.project-status.not_started { background: rgba(107, 114, 128, 0.15); color: var(--text-muted); border: 1px solid rgba(107, 114, 128, 0.2); }
.project-status.active { background: rgba(6, 182, 212, 0.15); color: var(--secondary); border: 1px solid rgba(6, 182, 212, 0.2); }
.project-status.on_hold { background: rgba(245, 158, 11, 0.15); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.2); }
.project-status.completed { background: rgba(16, 185, 129, 0.15); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.2); }

.project-card p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 14px;
    flex-grow: 1;
}

.project-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-dark);
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

.project-actions {
    display: flex;
    gap: 4px;
}

.project-actions button {
    background: none;
    border: none;
    color: var(--text-dark);
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition);
}

.project-actions button:hover {
    color: var(--text-main);
}

.project-actions button.delete:hover {
    color: var(--danger);
}


/* --- MODALES / FORMULARIOS (VENTANAS DIÁLOGO) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(3, 7, 18, 0.8);
    backdrop-filter: blur(8px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeInBg 0.3s ease forwards;
}

.modal-overlay.active {
    display: flex;
}

@keyframes fadeInBg {
    from { background: rgba(3, 7, 18, 0); }
    to { background: rgba(3, 7, 18, 0.8); }
}

.modal-content {
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.modal-content.large {
    max-width: 650px;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 700;
}

.btn-close-modal {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-close-modal:hover {
    color: var(--danger);
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.01);
}

/* Campos de Formulario */
.form-group {
    margin-bottom: 16px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-main);
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: white;
    font-family: var(--font-primary);
    font-size: 14px;
    transition: var(--transition);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    background: rgba(255, 255, 255, 0.06);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* --- PANTALLA DE ACCESO GENERAL DE LA APP (LOGIN) --- */
#app-login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-main);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 420px;
    padding: 40px;
    box-shadow: var(--shadow-lg), 0 0 40px rgba(99, 102, 241, 0.15);
    text-align: center;
    animation: scaleUp 0.4s ease;
}

.login-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
}

.login-card h2 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 8px;
}

.login-card p {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 24px;
}

.login-alert {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--danger);
    padding: 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    margin-bottom: 16px;
    display: none;
    font-weight: 500;
}

/* --- AJUSTES DE RESPONSIVIDAD (MOBILE FIRST) --- */

@media (max-width: 992px) {
    .main-content {
        padding: 24px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .hours-layout {
        grid-template-columns: 1fr;
    }
    
    .kanban-board {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .kanban-column {
        min-height: auto;
    }
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100vw;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 16px 24px;
    }
    
    .logo-container {
        margin-bottom: 0;
    }
    
    .nav-menu {
        flex-direction: row;
        overflow-x: auto;
        gap: 4px;
        padding: 12px 0 0 0;
        border-top: 1px solid var(--border-color);
        margin-top: 12px;
        width: 100%;
        scrollbar-width: none; /* Ocultar scroll en firefox */
    }
    
    .nav-menu::-webkit-scrollbar {
        display: none; /* Ocultar scroll en chrome/safari */
    }
    
    .nav-item a {
        padding: 8px 12px;
        font-size: 13px;
        white-space: nowrap;
    }
    
    .nav-item.active a::before {
        display: none;
    }
    
    .user-panel {
        display: none; /* Escondido en móviles para simplificar o recolocado */
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px 16px;
    }
    
    .view-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .view-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-container {
        max-width: 100%;
    }
    
    .client-detail-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .detail-tabs {
        overflow-x: auto;
        scrollbar-width: none;
    }
    
    .detail-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .tab-btn {
        white-space: nowrap;
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .hours-display-grid {
        grid-template-columns: 1fr;
    }
}

/* --- ESTILOS ADICIONALES PARA EL CALENDARIO Y LA AGENDA --- */

.calendar-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.calendar-header-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.calendar-header-cell {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.calendar-day {
    min-height: 75px;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 4px;
    transition: var(--transition);
    cursor: pointer;
}

#dashboard-calendar-container .calendar-day {
    min-height: 52px;
}

.calendar-day:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(99, 102, 241, 0.25);
    transform: scale(1.02);
}

.calendar-day.empty {
    opacity: 0.15;
    background: transparent;
    border-color: transparent;
    pointer-events: none;
}

.calendar-day.today {
    background: rgba(99, 102, 241, 0.05);
    border-color: var(--primary);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.15);
}

.calendar-day.today .day-number {
    color: var(--primary);
    font-weight: 800;
}

.day-number {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
}

.day-events {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    max-height: 55px;
    scrollbar-width: none;
}

.day-events::-webkit-scrollbar {
    display: none;
}

.calendar-event-pill {
    font-size: 9px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
}

.calendar-event-pill:hover {
    filter: brightness(1.2);
    transform: translateX(2px);
}

/* Indicador de Tipo de Evento */
.event-type-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    display: inline-block;
}

.color-dot {
    transition: var(--transition);
}

.color-dot:hover {
    transform: scale(1.2);
}

.color-dot.active {
    border-color: #ffffff !important;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

/* Agenda List View items */
.agenda-list-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 12px 14px;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.agenda-list-item:hover {
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.agenda-list-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.agenda-list-item-color-bar {
    width: 4px;
    height: 32px;
    border-radius: 2px;
}

.agenda-list-item-info {
    display: flex;
    flex-direction: column;
}

.agenda-list-item-title {
    font-size: 13px;
    font-weight: 700;
}

.agenda-list-item-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.agenda-list-item-actions {
    display: flex;
    gap: 6px;
}

.agenda-list-item-actions button {
    background: none;
    border: none;
    color: var(--text-dark);
    cursor: pointer;
    font-size: 12px;
    transition: var(--transition);
}

.agenda-list-item-actions button:hover {
    color: var(--text-main);
}

.agenda-list-item-actions button.delete:hover {
    color: var(--danger);
}

@media (max-width: 768px) {
    .agenda-layout {
        grid-template-columns: 1fr !important;
    }
}

/* --- ESTILOS ADICIONALES PARA PORTAL DE CLIENTES --- */
.login-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.login-tab {
    flex: 1;
    padding: 10px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-family: var(--font-primary);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-tab:hover {
    color: var(--text-main);
}

.login-tab.active {
    border-bottom-color: var(--primary) !important;
    color: #fff !important;
}

#login-username-group {
    animation: slideDown 0.3s ease-out forwards;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- HISTORIAL DE BONOS CERRADOS --- */
.closed-bond-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.3s ease;
}

.closed-bond-header {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: background 0.3s ease;
}

.closed-bond-header:hover {
    background: rgba(255, 255, 255, 0.06);
}

.closed-bond-body {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.15);
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.closed-bond-card.active .toggle-chevron {
    transform: rotate(180deg);
}

/* --- ESTILOS PREMIUM MIREMOTO --- */
.miremoto-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(245, 158, 11, 0.08);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.15);
    padding: 8px 16px;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 24px;
}

.miremoto-status-badge.connected {
    background: rgba(16, 185, 129, 0.08);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.15);
}

.miremoto-dot {
    width: 8px;
    height: 8px;
    background-color: currentColor;
    border-radius: 50%;
    display: inline-block;
    animation: miremotoPulse 2s infinite;
}

@keyframes miremotoPulse {
    0% { transform: scale(0.95); opacity: 0.6; }
    50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 8px currentColor; }
    100% { transform: scale(0.95); opacity: 0.6; }
}

.miremoto-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}
.miremoto-status-dot.success {
    background-color: var(--success);
    box-shadow: 0 0 6px var(--success-glow);
}
.miremoto-status-dot.danger {
    background-color: var(--danger);
    box-shadow: 0 0 6px var(--danger-glow);
}

.miremoto-code-box {
    background: rgba(6, 9, 19, 0.9);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 30px;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
}

.miremoto-code-box:hover {
    background: rgba(6, 9, 19, 1);
    border-color: var(--primary);
}

.miremoto-copy-tooltip {
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--primary);
    color: white;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 4px;
    opacity: 0;
    transition: var(--transition);
    pointer-events: none;
    font-weight: 600;
}

.miremoto-copy-tooltip.active {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}


