* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3b82f6;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--primary-color), #1e40af);
    color: white;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Quick Actions Bar */
.quick-actions {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.project-selector-wrapper {
    display: flex;
    gap: 10px;
    flex: 1;
    min-width: 300px;
}

.project-selector {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.project-selector:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Main Activities View */
.main-activities-view {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    min-height: 600px;
}

.activities-header {
    margin-bottom: 0px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.project-title-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.project-navigation-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.activities-header h2 {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.project-actions-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: flex-end;
}

/* Dropdown de acciones */
.actions-dropdown-container {
    position: relative;
    display: inline-block;
}

.actions-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 6px;
    z-index: 1000;
    min-width: 200px;
}

.actions-dropdown-menu.show {
    display: flex;
}

.actions-dropdown-menu .dropdown-item {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
    padding: 10px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.actions-dropdown-menu .dropdown-item:hover {
    transform: translateX(4px);
}

.actions-dropdown-menu .dropdown-item i {
    margin-right: 10px;
    font-size: 1.1rem;
}

/* Las reglas específicas de botones ya no son necesarias con la nueva estructura */

.project-summary {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    padding: 12px 16px;
    background-color: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.project-summary-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.project-summary-activities {
    gap: 12px;
}

.project-summary-costs {
    gap: 20px;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
    padding: 8px 12px;
    background-color: white;
    border-radius: 6px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.summary-item-small {
    flex-direction: row;
    gap: 6px;
    align-items: center;
    padding: 4px 10px;
}

.summary-item-small .summary-label {
    font-size: 0.65rem;
}

.summary-item-small .summary-value {
    font-size: 0.75rem;
}

.summary-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-value {
    font-size: 1.1rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Colores específicos para cada métrica */
.summary-item:has(#totalCompleted) {
    border-color: #dcfce7;
}

.summary-item:has(#totalCompleted) .summary-label {
    color: #166534;
}

.summary-item:has(#totalCompleted) .summary-value {
    color: #16a34a;
}

.summary-item:has(#totalPending) {
    border-color: #fef3c7;
}

.summary-item:has(#totalPending) .summary-label {
    color: #92400e;
}

.summary-item:has(#totalPending) .summary-value {
    color: #d97706;
}

.summary-item:has(#totalEffort) {
    border-color: #dbeafe;
}

.summary-item:has(#totalEffort) .summary-label {
    color: #1e40af;
}

.summary-item:has(#totalEffort) .summary-value {
    color: #2563eb;
}

.summary-item:has(#totalDays) {
    border-color: #e9d5ff;
}

.summary-item:has(#totalDays) .summary-label {
    color: #6b21a8;
}

.summary-item:has(#totalDays) .summary-value {
    color: #7c3aed;
}

.summary-item:has(#totalSubtotal) {
    border-color: #fef3c7;
}

.summary-item:has(#totalSubtotal) .summary-label {
    color: #92400e;
}

.summary-item:has(#totalSubtotal) .summary-value {
    color: #d97706;
}

.summary-item:has(#totalDiscount) {
    border-color: #fee2e2;
}

.summary-item:has(#totalDiscount) .summary-label {
    color: #991b1b;
}

.summary-item:has(#totalDiscount) .summary-value {
    color: #dc2626;
}

.summary-item:has(#totalCost) {
    border-color: #dcfce7;
    background-color: #f0fdf4;
}

.summary-item:has(#totalCost) .summary-label {
    color: #166534;
}

.summary-item:has(#totalCost) .summary-value {
    color: #16a34a;
}

.summary-item-small.summary-item:has(#totalCost) .summary-value {
    font-size: 0.85rem;
    font-weight: normal;
}

.activities-actions-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.main-tree {
    min-height: 400px;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.form-section, .projects-section {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

h2 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.5rem;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.form-row .form-group {
    margin-bottom: 0;
}

.form-row-3 {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.form-row-3 .form-group {
    margin-bottom: 0;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-hint {
    display: block;
    margin-top: 4px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="date"],
textarea,
select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

input[readonly] {
    background-color: #f1f5f9;
    color: #64748b;
    cursor: not-allowed;
    border-color: #e2e8f0;
}

input[readonly]:focus {
    border-color: #e2e8f0;
    box-shadow: none;
}

textarea {
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-icon {
    padding: 8px 12px;
    min-width: 40px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon i {
    font-size: 1.2rem;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-sm.btn-icon {
    padding: 6px 10px;
    min-width: 36px;
}

.btn-sm.btn-icon i {
    font-size: 1rem;
}

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

.btn-primary:hover {
    background-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.btn-secondary:hover {
    background-color: #475569;
}

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

.btn-success:hover {
    background-color: #059669;
}

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

.btn-warning:hover {
    background-color: #d97706;
}

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

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-edit {
    background-color: #06b6d4;
    color: white;
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-edit:hover {
    background-color: #0891b2;
}

.btn-info {
    background-color: #06b6d4;
    color: white;
}

.btn-info:hover {
    background-color: #0891b2;
}

.btn-autosave {
    background-color: #8b5cf6;
    color: white;
}

.btn-autosave:hover {
    background-color: #7c3aed;
}

.btn-autosave.active {
    background-color: #10b981;
}

.btn-autosave.active:hover {
    background-color: #059669;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    padding: 8px 12px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-link:hover {
    color: var(--primary-dark);
    background-color: #f0f9ff;
    border-radius: 6px;
}

.btn-link i {
    transition: transform 0.2s ease;
}

.toggle-details-btn {
    margin: 15px 0;
    width: 100%;
    justify-content: center;
}

.activity-details-section,
.project-details-section {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 1000px;
    }
}

.auto-save-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--success-color);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 999;
    animation: slideInUp 0.3s ease;
}

.auto-save-status.saving {
    background-color: var(--warning-color);
}

.auto-save-status.error {
    background-color: var(--danger-color);
}

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

.projects-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.header-actions .btn {
    flex: none;
    padding: 10px 20px;
    font-size: 0.9rem;
}

.filter-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

#searchInput,
#filterStatus {
    padding: 10px;
}

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.project-card {
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
    background-color: var(--card-bg);
}

.project-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.project-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.project-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
}

.badge-status {
    background-color: var(--primary-color);
    color: white;
}

.badge-status.planning {
    background-color: #6366f1;
}

.badge-status.development {
    background-color: #3b82f6;
}

.badge-status.testing {
    background-color: #f59e0b;
}

.badge-status.completed {
    background-color: #10b981;
}

.badge-status.paused {
    background-color: #64748b;
}

.badge-priority {
    background-color: var(--secondary-color);
    color: white;
}

.badge-priority.low {
    background-color: #10b981;
}

.badge-priority.medium {
    background-color: #f59e0b;
}

.badge-priority.high {
    background-color: #ef4444;
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.6;
}

.project-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.meta-item {
    display: flex;
    flex-direction: column;
}

.meta-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.meta-value {
    color: var(--text-primary);
}

.project-technologies {
    margin-bottom: 15px;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.tech-tag {
    background-color: #e0f2fe;
    color: #0369a1;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
}

.project-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.project-actions .btn {
    flex: 1;
    padding: 8px 16px;
    font-size: 0.9rem;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 1.1rem;
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--card-bg);
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.3s ease;
    overflow: hidden;
}

.modal-large {
    max-width: 900px;
}

.modal-compact {
    max-width: 600px;
}

.modal-compact .modal-header {
    padding: 20px 25px;
}

.modal-compact .modal-body {
    padding: 20px 25px;
}

.modal-compact .modal-footer {
    padding: 15px 25px;
}

.modal-compact .form-group {
    margin-bottom: 15px;
}

.modal-compact label {
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.modal-compact input,
.modal-compact textarea,
.modal-compact select {
    font-size: 0.9rem;
}

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

.modal-header {
    padding: 25px 30px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h2 {
    margin: 0;
    border: none;
    padding: 0;
}

.close-modal {
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.close-modal:hover {
    color: var(--danger-color);
}

.modal-body {
    padding: 25px 30px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.modal-footer .btn {
    flex: 0 0 auto;
}

.modal-footer .btn-primary {
    margin-left: auto;
}

/* Activities Styles */
.activities-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.activities-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.activity-input {
    flex: 1;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
}

.btn-sm {
    padding: 10px 20px;
    font-size: 0.9rem;
}

.activities-tree {
    min-height: 300px;
}

.empty-state-small {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.activity-item {
    margin-bottom: 8px;
}

.activity-content {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background-color: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.activity-content:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

.activity-content.mobile-selected {
    border-color: var(--primary-color);
    background-color: #f0f9ff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.activity-content.completed {
    opacity: 0.7;
    background-color: #f0fdf4;
    border-color: var(--success-color);
}

.activity-content.inactive {
    opacity: 0.5;
    background-color: #f3f4f6;
    border-color: #d1d5db;
    filter: grayscale(100%);
    pointer-events: auto;
}

.activity-content.inactive:hover {
    border-color: #9ca3af;
    box-shadow: none;
}

.activity-content.inactive .activity-name {
    color: #6b7280;
    text-decoration: line-through;
}

.activity-content.inactive .activity-like-btn i {
    color: #9ca3af !important;
}

.activity-toggle {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.activity-toggle:not(.empty) {
    width: 20px;
}

.activity-toggle.expanded {
    transform: rotate(90deg);
}

.activity-toggle.empty {
    width: 0;
    min-width: 0;
    opacity: 0;
    pointer-events: none;
}

.activity-like-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 1.2rem;
    color: #94a3b8;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
}

.activity-like-btn:hover {
    color: #3b82f6;
    transform: scale(1.1);
}

.activity-like-btn .bi-hand-thumbs-up-fill {
    color: #16a34a;
}

.activity-like-btn:hover .bi-hand-thumbs-up-fill {
    color: #15803d;
}

/* Estados de actividad */
.activity-like-btn .bi-clock {
    color: #94a3b8; /* Pendiente - gris */
}

.activity-like-btn .bi-gear-fill {
    color: #3b82f6; /* En proceso - azul */
    animation: spin 3s linear infinite;
}

.activity-like-btn .bi-pause-circle-fill {
    color: #f59e0b; /* Pausada - naranja */
}

.activity-like-btn:hover .bi-clock {
    color: #64748b;
}

.activity-like-btn:hover .bi-gear-fill {
    color: #2563eb;
}

.activity-like-btn:hover .bi-pause-circle-fill {
    color: #d97706;
}

/* Animación de rotación para el engrane */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Estilos para el modal de cambio de estado */
.status-change-info {
    margin-top: 15px;
    padding: 15px;
    background-color: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.status-change-info p {
    margin: 8px 0;
    font-size: 0.9rem;
}

.status-change-info strong {
    color: var(--primary-color);
}

.status-change-options {
    display: flex;
    gap: 15px;
    justify-content: center;
    padding: 20px 0;
}

.btn-status-option {
    flex: 1;
    max-width: 200px;
    padding: 20px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-status-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-status-option i {
    font-size: 1.2rem;
}

/* Confirmación de desactivar */
.deactivate-confirmation {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    animation: slideIn 0.2s ease;
}

.deactivate-confirmation i {
    color: #dc2626;
    font-size: 1.1rem;
}

.confirmation-text {
    font-size: 0.9rem;
    color: #991b1b;
    font-weight: 500;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.activity-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    user-select: none;
}

.activity-name {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
}

.activity-name.completed {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.activity-description {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.3;
    max-width: 600px;
}

.activity-actions {
    display: none;
    gap: 5px;
}

.activity-content.mobile-selected .activity-actions {
    display: flex;
}

.activity-btn {
    background: none;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    min-width: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.activity-btn i {
    font-size: 1rem;
}

.activity-btn-import {
    color: #7c3aed;
}

.activity-btn-import:hover {
    background-color: #ede9fe;
}

.activity-btn-add {
    color: var(--success-color);
}

.activity-btn-add:hover {
    background-color: #d1fae5;
}

.activity-btn-edit {
    color: var(--primary-color);
}

.activity-btn-edit:hover {
    background-color: #dbeafe;
}

.activity-btn-delete {
    color: var(--danger-color);
}

.activity-btn-delete:hover {
    background-color: #fee2e2;
}

.activity-children {
    margin-left: 30px;
    margin-top: 8px;
    border-left: 2px solid var(--border-color);
    padding-left: 15px;
    /* Hacer que el contenedor no capture eventos, solo los hijos */
    pointer-events: none;
}

/* Los activity-item dentro sí deben capturar eventos */
.activity-children .activity-item {
    pointer-events: auto;
}

.activity-children.collapsed {
    display: none;
}

.activity-edit-input {
    flex: 1;
    padding: 8px;
    border: 2px solid var(--primary-color);
    border-radius: 6px;
    font-size: 0.95rem;
}

.btn-activities {
    background-color: #8b5cf6;
    color: white;
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-activities:hover {
    background-color: #7c3aed;
}

.activities-summary {
    margin-top: 15px;
    padding: 12px;
    background-color: #f3f4f6;
    border-radius: 6px;
    font-size: 0.9rem;
}

.activities-summary-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.activity-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.activity-preview.completed {
    text-decoration: line-through;
}

.activity-preview-icon {
    color: var(--success-color);
}

.activity-badges {
    display: flex;
    gap: 5px;
    margin-left: 10px;
}

.badge-optional {
    background-color: #fef3c7;
    color: #92400e;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-effort {
    background-color: #dbeafe;
    color: #1e40af;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-days {
    background-color: #e9d5ff;
    color: #6b21a8;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-discount {
    background-color: #fee2e2;
    color: #991b1b;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-cost {
    background-color: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Ocultar badges cuando el árbol tiene la clase hide-badges */
#activitiesTree.hide-badges .badge-effort,
#activitiesTree.hide-badges .badge-days,
#activitiesTree.hide-badges .badge-cost,
#activitiesTree.hide-badges .badge-discount,
#activitiesTree.hide-badges .badge-optional {
    display: none;
}

.activity-content.optional {
    border-left: 3px solid #f59e0b;
}

/* Importación de actividades */
.import-activity-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.destination-info {
    padding: 12px;
    background-color: #f3f4f6;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
    font-weight: 500;
    color: #1f2937;
}

.import-source-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.import-tree {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 15px;
    background-color: #fafafa;
}

.import-tree .activity-item {
    cursor: pointer;
    transition: background-color 0.2s;
}

.import-tree .activity-item:hover {
    background-color: #f0f9ff;
}

.import-tree .activity-item.selected {
    background-color: #dbeafe;
    border-left: 4px solid #3b82f6;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 1rem;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Input monetario */
.input-currency {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-symbol {
    position: absolute;
    left: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: #64748b;
    pointer-events: none;
}

.currency-input {
    width: 100%;
    padding: 10px 12px 10px 28px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.currency-input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.numeric-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.numeric-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.numeric-input::placeholder {
    text-align: right;
    color: #94a3b8;
}

.numeric-input-center {
    text-align: center;
}

.numeric-input-center::placeholder {
    text-align: center;
}

@media (max-width: 768px) {
    .container {
        padding: 0;
        max-width: 100%;
    }

    .projects-list-view {
        padding: 12px;
    }

    .main-activities-view {
        padding: 12px;
        border-radius: 0;
    }

    .work-view-back-button {
        padding: 0 12px;
    }

    .project-card {
        border-radius: 0;
    }

    .activity-item {
        border-radius: 0;
    }

    .btn {
        border-radius: 6px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .form-row,
    .form-row-3 {
        grid-template-columns: 1fr;
    }

    .filter-section {
        grid-template-columns: 1fr;
    }

    .projects-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .header-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: space-between;
    }

    .header-actions .btn {
        flex: 1 1 auto;
        white-space: nowrap;
        font-size: 0.875rem;
        padding: 8px 12px;
        min-width: 0;
    }

    .project-meta {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .modal-header, .modal-body, .modal-footer {
        padding: 20px;
    }

    .history-modal-body {
        min-height: 300px;
        max-height: calc(90vh - 180px);
    }

    .activity-children {
        margin-left: 20px;
        padding-left: 10px;
    }

    .activities-toolbar {
        flex-direction: column;
    }

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

    .project-selector-wrapper {
        flex-direction: row;
        width: 100%;
        min-width: 0;
        flex-wrap: wrap;
        gap: 8px;
    }

    .project-selector-wrapper .btn {
        flex: 1 1 auto;
        font-size: 0.875rem;
        padding: 8px 12px;
        min-width: 0;
    }

    .project-selector {
        flex: 1 1 100%;
        min-width: 0;
    }

    .activities-actions-bar {
        flex-wrap: wrap;
    }

    /* Formato card para actividades en móvil */
    .activity-content {
        position: relative;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: 12px;
        padding-bottom: 2px;
        min-height: 0;
    }

    .activity-toggle {
        position: absolute;
        top: 12px;
        left: 12px;
    }

    .activity-like-btn {
        position: absolute;
        top: 12px;
        left: 12px;
    }

    .activity-content:has(.activity-toggle:not(.empty)) .activity-like-btn {
        left: 36px;
    }

    .activity-info {
        width: 100%;
        padding-left: 30px;
    }

    .activity-content:has(.activity-toggle:not(.empty)) .activity-info {
        padding-left: 50px;
    }

    .activity-name {
        font-size: 1rem;
        line-height: 1.4;
    }

    .activity-badges {
        flex-wrap: wrap;
        justify-content: flex-start;
        padding-left: 20px;
        gap: 6px;
        margin-top: 10px;
    }

    .activity-badges:empty {
        display: none;
        margin-top: 0;
    }

    .activity-content:has(.activity-toggle:not(.empty)) .activity-badges {
        padding-left: 40px;
    }

    .activity-actions {
        display: none;
        position: absolute;
        top: 3px;
        right: 3px;
        width: auto;
        justify-content: flex-end;
        gap: 6px;
        background: rgba(248, 250, 252, 0.95);
        backdrop-filter: blur(4px);
        padding: 6px 8px;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.05);
    }

    .activity-content.mobile-selected .activity-actions {
        display: flex;
    }

    .activity-children {
        margin-left: 10px;
        padding-left: 10px;
    }

    /* Resumen del proyecto en móvil - Ultra compacto sin bordes */
    .project-summary {
        display: flex;
        flex-direction: column;
        gap: 4px;
        padding: 8px;
        margin-top: 8px;
        background-color: transparent;
        border: none;
        line-height: 1.2;
    }

    .project-summary-row {
        display: flex;
        justify-content: space-between;
        gap: 8px;
        flex-wrap: nowrap;
        width: 100%;
    }

    .project-summary-activities {
        /* Primera línea: Completadas, Faltantes, Esfuerzo, Tiempo */
    }

    .project-summary-costs {
        /* Segunda línea: Subtotal, Descuento, Total */
    }

    .summary-item-small:not(:last-child)::after {
        content: '|';
        margin-left: 8px;
        color: var(--border-color);
        font-weight: 300;
    }

    .summary-item {
        padding: 0;
        background-color: transparent;
        border: none;
        flex-direction: row;
        align-items: center;
        gap: 4px;
    }

    .summary-item-small {
        flex-direction: row;
        padding: 0;
        gap: 4px;
        background-color: transparent;
        border: none;
        align-items: center;
        line-height: 1;
    }

    .summary-item-small .summary-label {
        font-size: 0.65rem;
        text-align: left;
        color: var(--text-secondary);
        white-space: nowrap;
        line-height: 1;
    }

    .summary-item-small .summary-value {
        font-size: 0.75rem;
        font-weight: normal;
        white-space: nowrap;
        line-height: 1;
    }

    .summary-label {
        font-size: 0.65rem;
        text-align: left;
        color: var(--text-secondary);
        white-space: nowrap;
    }

    .summary-value {
        font-size: 0.75rem;
        font-weight: normal;
        white-space: nowrap;
    }

    /* Tabs del modal - Iconos con texto debajo en mobile */
    .history-tab {
        padding: 12px 6px;
        flex-direction: column;
        gap: 6px;
    }

    .history-tab .tab-text {
        font-size: 0.75rem;
        line-height: 1;
    }

    .history-tab i {
        font-size: 1.5rem;
    }
}

/* ==================== MODAL DE DESARROLLO ==================== */

.history-modal-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: 85vh;
}

.history-modal-content .modal-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-modal-content .modal-header h2 i {
    color: #f59e0b;
    font-size: 1.3rem;
}

.history-modal-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

/* Tabs del historial */
.history-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    flex-shrink: 0;
}

.history-tab {
    flex: 1;
    padding: 12px 16px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.history-tab:hover {
    background-color: #f8fafc;
    color: var(--text-color);
}

.history-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: #f0f4ff;
}

.history-tab i {
    font-size: 1.1rem;
}

.history-tabs-content {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.history-tab-panel {
    display: none;
    flex: 1;
    overflow-y: auto;
}

.history-tab-panel.active {
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

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

/* El resumen de duración y timeline se mueven juntos con scroll */
.history-duration {
    flex-shrink: 0;
}

.history-timeline {
    flex-shrink: 0;
}

.timeline {
    position: relative;
    padding: 20px 0;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* Removemos el ::before global y usamos uno en cada item */

.timeline-item {
    position: relative;
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    align-items: flex-start;
}

.timeline-item::after {
    content: '';
    position: absolute;
    left: 20px;
    top: 40px;
    bottom: -30px;
    width: 2px;
    background: var(--border-color);
    z-index: 0;
}

.timeline-item:last-child::after {
    bottom: 0;
}

.timeline-item:last-child {
    margin-bottom: 20px;
}

.timeline-note {
    cursor: pointer;
}

.timeline-marker {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.timeline-marker i {
    color: white;
    font-size: 1.2rem;
}

.timeline-content {
    flex: 1;
    padding-top: 5px;
}

.timeline-label {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 5px;
}

.timeline-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.timeline-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-style: italic;
}

.duration-summary {
    margin-top: 30px;
    padding: 20px;
    background-color: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.duration-summary h4 {
    margin: 0 0 15px 0;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.duration-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.duration-item:last-child {
    border-bottom: none;
}

.duration-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.duration-value {
    font-weight: 600;
    color: var(--text-color);
    font-family: 'Courier New', monospace;
}

.duration-working {
    color: #16a34a;
}

.duration-paused {
    color: #f59e0b;
}

.activity-btn-history {
    color: #8b5cf6;
}

.activity-btn-history:hover {
    background-color: #f3e8ff;
}

/* History Modal Footer - Estructura Organizada */
.history-modal-footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 20px;
    flex-shrink: 0;
}

/* Área de Acumulación de Insumos */
.supplies-accumulation-area {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 12px;
    width: 100%;
    max-height: 20vh;
    display: flex;
    flex-direction: column;
    overflow: auto;
}

.supplies-accumulation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 600;
    color: #92400e;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.supplies-accumulation-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    padding-right: 4px;
    flex: 1 1 auto;
    min-height: 0;
}

.supplies-accumulation-list::-webkit-scrollbar {
    width: 6px;
}

.supplies-accumulation-list::-webkit-scrollbar-track {
    background: #fef3c7;
    border-radius: 3px;
}

.supplies-accumulation-list::-webkit-scrollbar-thumb {
    background: #fcd34d;
    border-radius: 3px;
}

.supplies-accumulation-list::-webkit-scrollbar-thumb:hover {
    background: #fbbf24;
}

.accumulated-supply-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: white;
    border-radius: 6px;
    border: 1px solid #fde68a;
}

.accumulated-supply-description {
    flex: 1;
    font-size: 0.85rem;
    color: #78350f;
    font-weight: 500;
}

.accumulated-supply-details {
    font-size: 0.75rem;
    color: #b45309;
}

.accumulated-supply-total {
    font-weight: 600;
    color: #d97706;
    font-size: 0.85rem;
    margin-right: 4px;
}

.accumulated-supplies-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 2px solid #fcd34d;
    font-weight: 700;
    color: #92400e;
    flex-shrink: 0;
}

/* Formulario de Captura de Insumos */
.supplies-form-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0px;
    border-radius: 8px;
    width: 100%;
}

.supplies-form-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background-color: #fffbeb;
    border-left: 3px solid #f59e0b;
    padding: 12px;
    border-radius: 8px;
}

.supplies-form-row-top {
    display: flex;
    gap: 8px;
    align-items: center;
}

.supplies-form-row-top input {
    width: 100%;
}

.supplies-form-row-bottom {
    display: flex;
    gap: 8px;
    align-items: center;
}

.supply-description-input {
    flex: 1;
    min-width: 0;
    font-size: 0.9rem;
    padding: 8px 12px;
    border: 1px solid #fcd34d;
    border-radius: 6px;
    background: white;
}

.supply-total-display {
    flex: 0 0 auto;
    font-size: 0.9rem;
    padding: 8px 12px;
    border: 1px solid #fcd34d;
    border-radius: 6px;
    background: #fef3c7;
    font-weight: 600;
    color: #92400e;
    text-align: right;
    white-space: nowrap;
    min-width: fit-content;
}

.supply-quantity-input {
    flex: 0 0 auto;
    width: 70px;
    font-size: 0.9rem;
    padding: 8px 12px;
    border: 1px solid #fcd34d;
    border-radius: 6px;
    background: white;
    -moz-appearance: textfield;
}

.supply-price-input {
    flex: 1 1 0;
    min-width: 0;
    max-width: 120px;
    font-size: 0.9rem;
    padding: 8px 12px;
    border: 1px solid #fcd34d;
    border-radius: 6px;
    background: white;
    -moz-appearance: textfield;
}

.supply-quantity-input::-webkit-outer-spin-button,
.supply-quantity-input::-webkit-inner-spin-button,
.supply-price-input::-webkit-outer-spin-button,
.supply-price-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Área de Previews */
.footer-previews-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

/* Área de Input - Siempre visible en la parte inferior */
.footer-input-area {
    display: flex;
    gap: 8px;
    align-items: center;
    width: 100%;
    background: white;
    padding: 12px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
}

.note-input {
    flex: 1 1 auto;
    padding: 10px 15px;
    border: none;
    background: transparent;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    min-width: 0;
}

.note-input:focus {
    outline: none;
}

.footer-input-area:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Note Options Menu */
.note-options-menu {
    position: relative;
}

.note-options-dropdown {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 8px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 1000;
    overflow: hidden;
}

.note-option-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: white;
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.note-option-item:hover {
    background: var(--hover-bg);
    color: var(--primary-color);
}

.note-option-item i {
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
}

.note-option-item:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

/* Supplies Control - Arriba del timeline */
.supplies-control {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 2px solid #10b981;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1);
}

.supplies-control-top {
    margin: 12px 0;
    animation: slideDown 0.3s ease-out;
}

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

.supplies-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.supplies-form-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.supplies-form-row .form-group {
    margin-bottom: 0;
}

.supplies-form-row-actions {
    align-items: center;
}

.supplies-description {
    flex: 1;
    min-width: 0;
}

.supplies-quantity {
    flex: 0 0 120px;
}

.supplies-unit-price {
    flex: 0 0 140px;
}

.supplies-total {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.supplies-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.supplies-control input.form-control {
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
}

.supplies-control input.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

.supplies-control input.form-control[readonly] {
    background-color: #e2e8f0;
    cursor: not-allowed;
    font-weight: 600;
    color: var(--success-color);
}

/* Remove number input step arrows */
.supplies-control input[type="number"] {
    -moz-appearance: textfield;
}

.supplies-control input[type="number"]::-webkit-outer-spin-button,
.supplies-control input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Responsive para el formulario de insumos */
@media (max-width: 768px) {
    .supplies-form-row {
        flex-wrap: wrap;
    }

    .supplies-description {
        flex: 1 1 100%;
        min-width: 100%;
        margin-bottom: 8px;
    }

    .supplies-quantity {
        flex: 1 1 calc(50% - 4px);
    }

    .supplies-unit-price {
        flex: 1 1 calc(50% - 4px);
    }

    .supplies-form-row-actions {
        flex-wrap: nowrap;
    }

    .supplies-total {
        flex: 1;
    }

    .footer-input-area {
        padding: 8px;
    }

    .note-input {
        font-size: 0.9rem;
        padding: 8px 12px;
    }
}

/* Supplies Group Card - Diseño limpio y minimalista con tonos amarillos */
.timeline-supplies .timeline-content {
    background-color: #fffbeb;
    padding: 0;
    border-radius: 8px;
    border-left: 3px solid #f59e0b;
    overflow: hidden;
}

.supplies-group-card {
    border: none;
    border-radius: 0;
}

.supplies-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #fef3c7;
    border-bottom: 1px solid #fde68a;
}

.supplies-group-card {
    cursor: pointer;
    transition: all 0.2s ease;
}

.supplies-group-card:hover {
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15);
}

.supplies-group-actions {
    display: none;
}

.supplies-group-card.active .supplies-group-actions {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.supplies-group-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.supplies-group-title h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #92400e;
}

.supplies-count {
    font-size: 0.8rem;
    color: #b45309;
    font-weight: 400;
}

.supplies-group-list {
    padding: 0;
}

.supply-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #fde68a;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.supply-item:hover {
    background-color: #fef3c7;
}

.supply-item:last-child {
    border-bottom: none;
}

.supply-item-info {
    flex: 1;
}

.supply-item-description {
    font-weight: 500;
    color: #78350f;
    font-size: 0.9rem;
}

.supply-item-details {
    font-size: 0.8rem;
    color: #b45309;
    margin-top: 2px;
}

.supply-item-total {
    font-weight: 600;
    color: #d97706;
    font-size: 0.95rem;
    margin-right: 12px;
}

.supply-item-actions {
    display: none;
    gap: 4px;
}

.supply-item.active .supply-item-actions {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.supplies-group-footer {
    padding: 12px 16px;
    background: #fef3c7;
    border-top: 1px solid #fde68a;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.supplies-footer-left {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.supplies-subtotal-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #b45309;
}

.supplies-subtotal-amount {
    font-weight: 700;
    font-size: 1.1rem;
    color: #d97706;
}

.supplies-footer-date {
    font-size: 0.75rem;
    color: #ca8a04;
    text-align: right;
}

.preview-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0px;
    border-radius: 8px;
    width: 100%;
}

.image-preview {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background-color: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid #6366f1;
}

.image-preview img {
    max-width: 150px;
    max-height: 100px;
    border-radius: 6px;
    object-fit: cover;
}

/* Timeline Note Styles */
.timeline-note .timeline-content {
    background-color: #faf5ff;
    padding: 15px;
    border-radius: 8px;
    border-left: 3px solid #8b5cf6;
}

.note-text {
    margin-top: 10px;
    color: var(--text-color);
    font-size: 0.95rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

.note-text-edit {
    margin-top: 10px;
    padding: 8px 12px;
    border: 2px solid var(--primary-color);
    border-radius: 6px;
    font-size: 0.95rem;
    width: 100%;
    font-family: inherit;
    color: var(--text-color);
    background-color: #f8fafc;
}

.note-text-edit:focus {
    outline: none;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.note-actions {
    margin-top: 12px;
    display: none;
    gap: 8px;
    justify-content: flex-end;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.2s ease;
}

.timeline-note.active .note-actions {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.btn-icon-small {
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    background-color: #f1f5f9;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-small:hover {
    background-color: #e2e8f0;
    color: var(--text-color);
    transform: translateY(-1px);
}

.btn-icon-small i {
    font-size: 0.9rem;
}

.note-image {
    margin-top: 12px;
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.note-image:hover {
    transform: scale(1.02);
}

.note-file {
    margin-top: 12px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background-color: #f1f5f9;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0;
}

.note-file:hover {
    background-color: #e2e8f0;
    border-color: #cbd5e1;
    transform: translateX(2px);
}

.note-file i {
    font-size: 1.3rem;
    color: #6366f1;
}

.note-file span {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Custom Audio Player - Minimalista */
.custom-audio-player {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 20px;
    max-width: 350px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.custom-audio-player:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.custom-audio-player audio {
    display: none;
}

.audio-play-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

.audio-play-btn:hover {
    background: #4f46e5;
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.4);
}

.audio-play-btn:active {
    transform: scale(0.95);
}

.audio-play-btn i {
    font-size: 1rem;
    margin-left: 2px;
}

.audio-play-btn i.bi-pause-fill {
    margin-left: 0;
}

.audio-progress-container {
    flex: 1;
    height: 6px;
    background-color: #dee2e6;
    border-radius: 3px;
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

.audio-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color) 0%, #818cf8 100%);
    border-radius: 3px;
    transition: width 0.1s linear;
}

.audio-time {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 600;
    min-width: 40px;
    text-align: right;
    flex-shrink: 0;
}

/* File Preview Section */
.file-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background-color: #f1f5f9;
    border-radius: 8px;
    border-left: 3px solid #6366f1;
}

.file-preview-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.file-preview-content i {
    font-size: 1.5rem;
    color: #6366f1;
}

.file-preview-content span {
    font-size: 0.9rem;
    color: var(--text-color);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Audio Preview Section */
.audio-preview {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 12px;
    background-color: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid #6366f1;
}

.custom-audio-player-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    padding: 8px 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.custom-audio-player-preview:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.custom-audio-player-preview audio {
    display: none;
}

/* Recording Indicator */
.recording-indicator {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 16px;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    animation: fadeIn 0.3s ease;
}

.recording-pulse {
    width: 12px;
    height: 12px;
    background-color: #dc2626;
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.recording-timer {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    color: #991b1b;
    min-width: 50px;
}

/* ===================================
   VISTAS DE NAVEGACIÓN
   =================================== */

/* Vista de Listado de Proyectos */
.projects-list-view {
    animation: fadeIn 0.3s ease;
}

/* Vista de Listado de Clientes */
.clients-list-view {
    animation: fadeIn 0.3s ease;
    padding: 20px;
    min-height: 400px;
}

.projects-list-header {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    justify-content: flex-end; /* Alineación a la derecha por defecto */
    flex-wrap: wrap;
    align-items: center;
}

/* Botón de navegación hacia atrás a la izquierda */
#backToClientsBtn {
    margin-right: auto; /* Empuja este botón a la izquierda y los demás a la derecha */
}

.projects-list-header .btn {
    padding: 10px 20px;
    font-size: 0.95rem;
}

.projects-cards-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.project-card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 16px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    gap: 16px;
}

.project-card:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.project-card-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), #1e40af);
    color: white;
    flex-shrink: 0;
}

.project-card-info {
    flex: 1;
    min-width: 0;
}

.project-card-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.project-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-card-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}

.project-card-description {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-card-stats {
    display: flex;
    gap: 20px;
    padding: 0 16px;
    border-left: 2px solid var(--border-color);
    border-right: 2px solid var(--border-color);
}

.project-card-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.project-card-stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.project-card-stat-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.project-card-stat-value.completed {
    color: var(--success-color);
}

.project-card-stat-value.in-progress {
    color: var(--primary-color);
}

.project-card-stat-value.pending {
    color: var(--warning-color);
}

.project-card-cost {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    min-width: 120px;
    padding-left: 16px;
}

.project-card-cost-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--success-color);
    line-height: 1;
}

.project-card-cost-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Estilos específicos para cards de clientes */
.client-card-email,
.client-card-phone {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.client-card-email i,
.client-card-phone i {
    font-size: 0.75rem;
    color: var(--primary-color);
}

.client-card-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

.client-card:hover .client-card-actions {
    transform: scale(1.05);
}

.projects-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.projects-empty i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

.projects-empty p {
    font-size: 1.1rem;
    margin-bottom: 24px;
}

/* Vista de Trabajo del Proyecto */
.project-work-view {
    animation: fadeIn 0.3s ease;
}

.work-view-back-button {
    margin-bottom: 20px;
}

.work-view-back-button .btn-ghost {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 16px;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
}

.work-view-back-button .btn-ghost:hover {
    background: var(--bg-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateX(-3px);
}

/* Responsive para cards */
@media (max-width: 1024px) {
    .project-card-stats {
        gap: 12px;
        padding: 0 12px;
    }

    .project-card-stat-value {
        font-size: 1.1rem;
    }

    .project-card-cost {
        min-width: 100px;
    }
}

@media (max-width: 768px) {
    .project-card {
        padding: 12px;
        gap: 12px;
        flex-wrap: wrap;
    }

    .project-card-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .project-card-info {
        flex: 1;
        min-width: 200px;
    }

    .project-card-title {
        font-size: 1rem;
    }

    .project-card-description {
        font-size: 0.8rem;
    }

    .project-card-stats {
        order: 3;
        width: 100%;
        justify-content: space-around;
        gap: 8px;
        padding: 12px 0;
        border-left: none;
        border-right: none;
        border-top: 1px solid var(--border-color);
        border-bottom: 1px solid var(--border-color);
    }

    .project-card-stat-value {
        font-size: 1.2rem;
    }

    .project-card-stat-label {
        font-size: 0.6rem;
    }

    .project-card-cost {
        order: 2;
        padding-left: 0;
        min-width: auto;
        align-items: flex-end;
    }

    .project-card-cost-value {
        font-size: 1.1rem;
    }

    .projects-list-header .btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .projects-cards-container {
        gap: 10px;
    }

    .project-card {
        padding: 10px;
        gap: 10px;
    }

    .project-card-icon {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }

    .project-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .project-card-title {
        font-size: 0.95rem;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    .project-card-date {
        font-size: 0.7rem;
    }

    .project-card-stats {
        gap: 4px;
        padding: 10px 0;
    }

    .project-card-stat-value {
        font-size: 1.1rem;
    }

    .project-card-stat-label {
        font-size: 0.55rem;
    }

    .project-card-cost-value {
        font-size: 1rem;
    }

    .project-card-cost-label {
        font-size: 0.6rem;
    }

    .projects-list-header {
        flex-direction: row;
        justify-content: flex-end; /* Alineación a la derecha por defecto */
        gap: 8px;
    }

    .projects-list-header .btn:not(.btn-icon) {
        width: 100%;
    }

    .projects-list-header .btn-icon {
        width: auto;
    }

    /* Resumen del proyecto ultra compacto para móviles pequeños */
    .project-summary {
        gap: 3px;
        padding: 6px 4px;
    }

    .project-summary-row {
        gap: 4px;
    }

    .summary-item-small .summary-label {
        font-size: 0.5rem;
    }

    .summary-item-small .summary-value {
        font-size: 0.75rem;
    }

    .activities-header h2 {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .project-actions-buttons {
        width: 100%;
        justify-content: flex-start;
    }
}

/* ===================================
   SPLASH SCREEN PWA
   =================================== */

#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.splash-content {
    text-align: center;
    color: white;
    animation: splashFadeIn 0.5s ease;
}

.splash-icon {
    margin-bottom: 30px;
    animation: splashBounce 1s infinite;
    position: relative;
    display: inline-block;
}

.splash-icon svg {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.splash-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: 1px;
    text-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.splash-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 40px;
    font-weight: 300;
}

.splash-loader {
    width: 50px;
    height: 50px;
    margin: 0 auto;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: splashSpin 1s linear infinite;
}

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

@keyframes splashBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes splashSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive para splash screen */
@media (max-width: 768px) {
    .splash-icon {
        font-size: 4rem;
    }

    .splash-title {
        font-size: 2rem;
    }

    .splash-subtitle {
        font-size: 1rem;
    }
}

/* ========================================
   LOGIN SCREEN
   ======================================== */

.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.login-container {
    background: white;
    border-radius: 16px;
    padding: 40px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 2.5rem;
    color: white;
}

.login-header h1 {
    font-size: 2rem;
    margin: 0 0 8px 0;
    color: #1f2937;
}

.login-header p {
    color: #6b7280;
    margin: 0;
    font-size: 0.95rem;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    color: #374151;
    font-weight: 500;
    font-size: 0.9rem;
}

.login-form .form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.login-form .form-control:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-block {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    font-weight: 600;
}

/* ========================================
   APP HEADER
   ======================================== */

.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: white;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 900;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #334155; /* Gris oscuro slate */
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-toggle:hover {
    background: #f1f5f9;
    color: #3b82f6; /* Azul primario al hover */
    transform: scale(1.1);
}

.app-title {
    font-size: 1.25rem;
    margin: 0;
    color: var(--primary-color);
    font-weight: 600;
}

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

.header-user span {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.btn-logout {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 1.2rem;
}

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

/* ========================================
   SIDEBAR OFFCANVAS (Desktop)
   ======================================== */

.sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar.open {
    left: 0;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: all;
}

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

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
}

.sidebar-brand i {
    font-size: 1.5rem;
}

.sidebar-close {
    display: none !important; /* Ocultar completamente */
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 500;
}

.sidebar-nav-item:hover {
    background: var(--bg-secondary);
    color: var(--text-color);
}

.sidebar-nav-item.active {
    background: var(--primary-light);
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
}

.sidebar-nav-item i {
    font-size: 1.25rem;
}

/* Divisor en el sidebar */
.sidebar-divider {
    height: 1px;
    background: var(--border-color);
    margin: 12px 20px;
}

/* Opción de utilidad/mantenimiento */
.sidebar-nav-item-utility {
    color: #f59e0b;
}

.sidebar-nav-item-utility:hover {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.sidebar-nav-item-utility.active {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
    border-left: 4px solid #f59e0b;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.sidebar-user i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.sidebar-user span {
    font-size: 0.9rem;
    color: var(--text-secondary);
    word-break: break-all;
}

/* ========================================
   BOTTOM BAR (Mobile)
   ======================================== */

.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: white;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 900;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.bottom-bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 1;
    height: 100%;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.75rem;
    line-height: 4px;
}

.bottom-bar-item i {
    font-size: 1.5rem;
}

.bottom-bar-item:hover {
    color: var(--primary-color);
    background: var(--bg-secondary);
}

.bottom-bar-item.active {
    color: var(--primary-color);
    font-weight: 600;
}

.bottom-bar-item.active i {
    transform: scale(1.1);
}

/* ========================================
   SECTION VIEWS
   ======================================== */

.section-view {
    min-height: 100vh;
    background: var(--bg-primary);
}

.section-view[style*="display: block"] {
    display: block !important;
}

.section-content {
    padding: 20px;
}

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

.section-header h2 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.account-statement-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

@media (max-width: 768px) {
    .section-view {
        padding-bottom: 60px;
    }
}

/* ========================================
   LAYOUT ADJUSTMENTS
   ======================================== */

/* Ajustar container para header y bottom bar en mobile */
@media (max-width: 768px) {
    body {
        padding-top: 60px;
        padding-bottom: 60px;
    }

    .container {
        padding-top: 0;
    }

    .app-header .header-user span {
        display: none;
    }

    .login-container {
        padding: 30px 20px;
    }

    .login-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }

    .login-header h1 {
        font-size: 1.5rem;
    }
}

/* Desktop: ocultar bottom bar, mostrar sidebar */
@media (min-width: 769px) {
    body {
        padding-top: 60px;
    }

    .bottom-bar {
        display: none;
    }

    /* Hamburguesa siempre visible en desktop */
    .app-header .menu-toggle {
        display: flex;
    }

    /* Sidebar visible por defecto en desktop */
    .sidebar {
        left: 0;
    }

    .sidebar.closed {
        left: -280px;
    }

    /* Ajustar contenedor principal para sidebar visible */
    .container {
        margin-left: 280px;
        transition: margin-left 0.3s ease;
    }


    /* Ajustar header para sidebar visible */
    .app-header {
        padding-left: calc(280px + 20px);
        transition: padding-left 0.3s ease;
    }

    body.sidebar-closed .app-header {
        padding-left: 20px;
    }

    /* No mostrar overlay en desktop */
    .sidebar-overlay {
        display: none;
    }
}

/* Ocultar elementos cuando no está logueado */
body.not-logged-in .app-header,
body.not-logged-in .sidebar,
body.not-logged-in .bottom-bar,
body.not-logged-in .container {
    display: none;
}

body.logged-in .login-screen {
    display: none;
}

/* Asegurar que header y bottom bar siempre estén visibles cuando está logueado */
body.logged-in .app-header {
    display: flex !important;
}

body.logged-in .bottom-bar {
    display: flex !important;
}

@media (min-width: 769px) {
    body.logged-in .bottom-bar {
        display: none !important;
    }
}

/* ==================== ESTADO DE CUENTA ==================== */

.account-summary {
    margin-bottom: 20px;
}

.account-summary h3 {
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 0.9rem;
    font-weight: 600;
}

.summary-box {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #cbd5e1;
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-row.summary-total {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 2px solid #3b82f6;
    border-bottom: none;
}

.summary-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.summary-total .summary-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}

.summary-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.summary-total .summary-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #3b82f6;
}

.summary-value.charges-total {
    color: #f59e0b;
}

.summary-value.payments-total {
    color: #10b981;
}

.account-actions {
    margin-bottom: 20px;
}

.payment-form-area {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.payment-form-area h4 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.account-movements {
    margin-top: 30px;
}

.account-movements h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.movement-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.filter-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.movements-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.movement-item {
    background: white;
    border-radius: 8px;
    padding: 16px;
    border-left: 4px solid #6366f1;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: all 0.2s ease;
    cursor: pointer;
}

.movement-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.movement-item.charge {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.movement-item.payment {
    border-left-color: #10b981;
    background: #f0fdf4;
}

.movement-info {
    flex: 1;
}

.movement-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.movement-type {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.movement-type.charge {
    background: #fed7aa;
    color: #92400e;
}

.movement-type.payment {
    background: #bbf7d0;
    color: #166534;
}

.movement-type.initial {
    background: #dbeafe;
    color: #1e40af;
}

.movement-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.movement-description {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.4;
}

.movement-reference {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
}

.movement-amount-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.movement-amount-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.movement-amount {
    font-size: 1.2rem;
    font-weight: 700;
}

.movement-amount.charge {
    color: #f59e0b;
}

.movement-amount.payment {
    color: #10b981;
}

.movement-amount.initial {
    color: #3b82f6;
}

.movement-item.initial {
    background: #f8fafc;
    border-left: 4px solid #3b82f6;
    cursor: default;
}

.movement-balance {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
}

.movement-actions {
    display: flex;
    gap: 8px;
}

/* Cliente Selection */
.client-selection-list {
    max-height: 400px;
    overflow-y: auto;
    margin-top: 12px;
}

.client-selection-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.client-selection-item:hover {
    background-color: #f8fafc;
    border-color: #3b82f6;
    transform: translateX(4px);
}

.client-selection-item:active {
    transform: scale(0.98);
}

.search-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ===================================
   DASHBOARD DE MÉTRICAS
   =================================== */

.dashboard-container {
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.dashboard-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.metric-card-highlight {
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    color: white;
    border: none;
}

.metric-card-highlight .metric-icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.metric-card-highlight .metric-value,
.metric-card-highlight .metric-label {
    color: white;
}

.metric-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
}

.metric-info {
    flex: 1;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 4px;
}

.metric-label {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.chart-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.chart-content {
    min-height: 200px;
}

.chart-bar-container {
    margin-bottom: 16px;
}

.chart-bar-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.chart-bar-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.chart-bar-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
}

.chart-bar {
    height: 32px;
    background: #f1f5f9;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.chart-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #1e40af);
    border-radius: 8px;
    transition: width 0.6s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 12px;
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
}

.summary-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.clients-summary-table {
    overflow-x: auto;
}

.clients-summary-table table {
    width: 100%;
    border-collapse: collapse;
}

.clients-summary-table th {
    background: #f8fafc;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid #e2e8f0;
    font-size: 0.9rem;
}

.clients-summary-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.9rem;
    color: #475569;
}

.clients-summary-table tr:hover {
    background: #f8fafc;
}

.clients-summary-table .client-name {
    font-weight: 600;
    color: var(--text-primary);
}

.clients-summary-table .cost-value {
    font-weight: 600;
    color: #3b82f6;
}

/* Responsive para dashboard */
@media (max-width: 768px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }

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

    .metric-value {
        font-size: 1.6rem;
    }

    .dashboard-title {
        font-size: 1.5rem;
    }
}

/* ===================================
   DRAG & DROP DE ACTIVIDADES
   =================================== */

.activity-item {
    cursor: grab;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.activity-item:active {
    cursor: grabbing;
}

/* Solo aplicar el efecto visual al contenido directo, no a los hijos */
.activity-item.dragging > .activity-content {
    opacity: 0.5;
    transform: scale(0.95);
}

.activity-item.dragging {
    cursor: grabbing;
}

/* Removido - ahora usamos indicadores más claros (línea y nodo iluminado) */
.activity-item.drag-over {
    /* Sin estilos - confundía al usuario */
}

/* Resaltar el nodo cuando se va a insertar como hijo */
.activity-content.drop-target-child {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(30, 64, 175, 0.15));
    border: 2px solid #3b82f6;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
    animation: glow-pulse 1s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
    }
    50% {
        box-shadow: 0 0 25px rgba(59, 130, 246, 0.6);
    }
}

/* Indicador visual cuando no se puede hacer drop (movimiento no permitido) */
.activity-content.drop-not-allowed {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(185, 28, 28, 0.15));
    border: 2px solid #ef4444;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.drop-indicator {
    position: absolute;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #1e40af);
    border-radius: 2px;
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
    /* Animación removida para mayor estabilidad visual */
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
    }
    50% {
        opacity: 0.7;
        box-shadow: 0 0 12px rgba(59, 130, 246, 0.8);
    }
}

/* Cursor personalizado durante drag */
.activity-item[draggable="true"] {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

/* Evitar que los botones dentro interfieran con el drag */
.activity-item .activity-toggle,
.activity-item .activity-like-btn,
.activity-item .activity-actions button {
    pointer-events: auto;
    cursor: pointer;
}
