/* Fuentes con respaldo */
/* @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap'); */

:root {
            --primary-color: #4A90E2;
            --secondary-color: #F5A623;
            --background-color: #F7F8FC;
            --sidebar-bg: #FFFFFF;
            --text-color: #333333;
            --text-muted: #8A8A8A;
            --card-bg: #FFFFFF;
            --border-color: #EAEAEA;
            --green-light: #E0F5F2;
            --green-dark: #1ABC9C;
            --red-light: #FDEDED;
            --red-dark: #E74C3C;
            --purple-light: #E8EAF6;
            --purple-dark: #5C6BC0;
            --blue-light: #E3F2FD;
            --blue-dark: #42A5F5;
        }

        body {
            font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
            background-color: var(--background-color);
            color: var(--text-color);
            margin: 0;
            display: flex;
            height: 100vh;
            overflow: hidden;
        }

        .sidebar {
            width: 260px;
            background-color: var(--sidebar-bg);
            padding: 20px;
            display: flex;
            flex-direction: column;
            border-right: 1px solid var(--border-color);
            transition: width 0.3s, padding 0.3s;
            position: relative;
        }

        .sidebar.collapsed {
            width: 70px;
            padding: 20px 10px;
        }

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

        .sidebar.collapsed .logo-full {
            display: none;
        }

        .sidebar.collapsed .logo-mini {
            display: block !important;
        }

        .sidebar.collapsed .menu-header {
            display: none;
        }

        /* Ocultar texto completo de spans en menús principales cuando está colapsado */
        .sidebar.collapsed .main-menu li a span,
        .sidebar.collapsed .account-menu li a span {
            display: none;
        }

        /* Ocultar submenu por defecto cuando está colapsado */
        .sidebar.collapsed .submenu {
            display: none;
        }

        /* Mostrar submenu cuando está colapsado Y el menú está abierto */
        .sidebar.collapsed .has-submenu.open .submenu {
            display: block !important;
            position: relative;
            left: 0;
            background: transparent;
            padding-left: 0;
            margin-top: 5px;
        }

        /* Estilo de los items del submenu cuando sidebar está colapsado */
        .sidebar.collapsed .submenu li {
            margin: 5px 0;
        }

        .sidebar.collapsed .submenu li a {
            padding: 10px;
            text-align: center;
            justify-content: center;
            font-weight: 600;
            font-size: 13px;
            min-height: 36px;
            display: flex;
            align-items: center;
        }

        /* Mostrar solo iniciales en submenu cuando está colapsado */
        .sidebar.collapsed .submenu li a span {
            display: none;
        }

        .sidebar.collapsed .submenu li a::before {
            content: attr(data-team-initial);
            display: inline-block;
            font-weight: 600;
            font-size: 13px;
            color: var(--text-color);
        }

        .sidebar.collapsed .main-menu li a,
        .sidebar.collapsed .account-menu li a {
            justify-content: center;
            padding: 12px 10px;
        }

        .sidebar.collapsed .main-menu li a i,
        .sidebar.collapsed .account-menu li a i {
            margin-right: 0;
        }

        .sidebar.collapsed .has-submenu > a .arrow {
            display: none;
        }

        .logo-mini {
            display: none !important;
            max-width: 40px;
            height: auto;
        }

        .logo-full {
            display: block;
        }

        .sidebar.collapsed .logo-full {
            display: none !important;
        }

        .toggle-sidebar-btn {
            position: absolute;
            top: 20px;
            right: -15px;
            width: 30px;
            height: 30px;
            background-color: var(--primary-color);
            color: white;
            border: none;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            transition: transform 0.3s;
            z-index: 1000;
        }

        .toggle-sidebar-btn:hover {
            transform: scale(1.1);
            background-color: var(--primary-color-dark, #2563EB);
        }

        .toggle-sidebar-btn i {
            font-size: 14px;
        }

        .sidebar-header {
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 30px;
            padding: 0 10px;
        }

        .sidebar-header img {
            max-width: 100%;
            height: auto;
            display: block;
        }

        .logo-link {
            display: block;
            text-decoration: none;
            transition: opacity 0.2s ease;
        }

        .logo-link:hover {
            opacity: 0.8;
        }
        
        .sidebar-header .logo-icon {
            font-size: 28px;
            color: var(--primary-color);
            margin-right: 10px;
        }

        .sidebar-header h1 {
            font-size: 24px;
            font-weight: 600;
            color: var(--text-color);
        }

        .main-menu, .account-menu {
            list-style: none;
            padding: 0;
            margin: 0;
        }
        
        .main-menu .menu-header {
            font-size: 12px;
            text-transform: uppercase;
            color: var(--text-muted);
            font-weight: 500;
            margin: 20px 0 10px 10px;
        }

        .main-menu li a, .account-menu li a {
            display: flex;
            align-items: center;
            padding: 12px 15px;
            border-radius: 8px;
            text-decoration: none;
            color: var(--text-muted);
            font-weight: 500;
            transition: all 0.2s ease;
        }

        .main-menu li a i, .account-menu li a i {
            margin-right: 15px;
            font-size: 18px;
            width: 20px;
            text-align: center;
        }

        .main-menu li a:hover, .main-menu li.active a {
            background-color: var(--primary-color);
            color: white;
        }
        
        .submenu {
            list-style: none;
            padding-left: 35px; /* Indent sub-items */
            display: none;
        }
        
        .submenu li a {
            padding: 8px 15px;
            font-size: 14px;
        }
        
        .has-submenu.open > .submenu {
            display: block;
        }

        .has-submenu > a {
            position: relative;
        }
        
        .has-submenu > a .arrow {
            position: absolute;
            right: 15px;
            transition: transform 0.3s;
        }
        
        .has-submenu.open > a .arrow {
            transform: rotate(90deg);
        }

        .account-menu {
            margin-top: auto;
        }


        .main-content {
            flex-grow: 1;
            padding: 20px 30px;
            overflow-y: auto;
        }

        .header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }
        
        .header h2 {
            font-size: 28px;
            font-weight: 600;
        }

        .header-actions {
            display: flex;
            align-items: center;
        }
        
        .search-bar {
            position: relative;
        }

        .search-bar input {
            padding: 10px 40px 10px 15px;
            border-radius: 8px;
            border: 1px solid var(--border-color);
            width: 300px;
            font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
        }
        
        .search-bar i {
            position: absolute;
            right: 15px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-muted);
        }

        .user-profile {
            display: flex;
            align-items: center;
            margin-left: 20px;
            padding: 8px 12px;
            border-radius: 8px;
            transition: background-color 0.2s;
        }

        .user-profile:hover {
            background-color: rgba(0, 0, 0, 0.05);
        }

        .user-profile img {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            margin-right: 12px;
        }

        .user-profile div {
            line-height: 1.3;
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        .user-profile .name {
            font-weight: 600;
            font-size: 14px;
            color: var(--text-color);
        }

        .user-profile .role {
            font-size: 12px;
            color: var(--text-muted);
            font-weight: 400;
        }

        .notification-banner {
            background-color: var(--green-light);
            color: var(--green-dark);
            padding: 15px;
            border-radius: 8px;
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            font-weight: 500;
        }

        .summary-cards {
            display: grid;
            grid-template-columns: repeat(6, 1fr);
            gap: 20px;
            margin-bottom: 20px;
        }

        .card {
            background-color: var(--card-bg);
            padding: 20px;
            border-radius: 12px;
            border: 1px solid var(--border-color);
        }

        /* Cost Summary Cards */
        .cost-summary-container {
            margin-bottom: 20px;
        }

        .cost-summary-card {
            background-color: var(--card-bg);
            padding: 20px;
            border-radius: 12px;
            border: 1px solid var(--border-color);
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }

        .cost-summary-card h4 {
            margin: 0 0 15px 0;
            color: var(--text-color);
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .cost-summary-card h4 i {
            color: var(--primary-color);
        }

        .cost-summary-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 15px;
        }

        .cost-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 8px 12px;
            background-color: var(--background-color);
            border-radius: 6px;
            border: 1px solid var(--border-color);
        }

        .cost-item.total-cost {
            background-color: var(--primary-color);
            color: white;
            font-weight: 600;
            border-color: var(--primary-color);
        }

        .cost-item.total-cost .cost-label,
        .cost-item.total-cost .cost-value {
            color: white;
        }

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

        .cost-value {
            font-weight: 600;
            color: var(--primary-color);
        }

        .card-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
        }
        
        .card-header h3 {
            margin: 0;
            font-size: 16px;
            font-weight: 500;
        }

        .card-icon {
            padding: 10px;
            border-radius: 8px;
            font-size: 20px;
        }
        
        .icon-purple { background-color: var(--purple-light); color: var(--purple-dark); }
        .icon-red { background-color: var(--red-light); color: var(--red-dark); }
        .icon-blue { background-color: var(--blue-light); color: var(--blue-dark); }
        .icon-green { background-color: var(--green-light); color: var(--green-dark); }
        .icon-orange { background-color: #fff3cd; color: #856404; }
        .icon-gray { background-color: #f8f9fa; color: #6c757d; }

        .card-value {
            font-size: 28px;
            font-weight: 600;
            margin-bottom: 10px;
        }

        .card-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 14px;
            color: var(--text-muted);
        }

        /* Individual SP Costs Summary Styles */
        .sp-costs-summary-card {
            background: linear-gradient(135deg, #f8fbff 0%, #e3f2fd 100%);
            border: 1px solid #bbdefb;
            border-radius: 12px;
            padding: 20px;
            margin: 15px 0;
            box-shadow: 0 2px 8px rgba(0,0,0,0.08);
            grid-column: 1 / -1; /* Make it span all columns in the summary grid */
        }

        .sp-costs-summary-card h4 {
            margin: 0 0 15px 0;
            color: var(--primary-color);
            font-size: 16px;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .sp-costs-summary-card h4 i {
            font-size: 18px;
        }

        .sp-description-section {
            margin: 15px 0;
            padding: 15px;
            background: rgba(255, 255, 255, 0.6);
            border-radius: 8px;
            border-left: 3px solid var(--secondary-color);
        }

        .sp-description-content {
            display: flex;
            align-items: flex-start;
            gap: 10px;
        }

        .sp-description-content i {
            color: var(--secondary-color);
            margin-top: 2px;
            flex-shrink: 0;
        }

        .sp-description-content .description-display {
            flex: 1;
            color: var(--text-color);
            line-height: 1.4;
            font-style: italic;
        }

        .sp-description-content .description-edit {
            flex: 1;
            border: 1px solid #ddd;
            border-radius: 4px;
            padding: 8px;
            font-family: inherit;
            resize: vertical;
            min-height: 60px;
        }

        .sp-costs-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 12px;
            margin-bottom: 15px;
        }

        .sp-cost-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 15px;
            background: rgba(255, 255, 255, 0.8);
            border-radius: 8px;
            border-left: 3px solid var(--primary-color);
            transition: all 0.3s ease;
        }

        .sp-cost-item:hover {
            background: rgba(255, 255, 255, 1);
            transform: translateY(-1px);
            box-shadow: 0 3px 6px rgba(0,0,0,0.1);
        }

        .sp-cost-item .cost-label {
            font-weight: 500;
            color: var(--text-color);
            font-size: 14px;
        }

        .sp-cost-item .cost-value {
            font-weight: 600;
            color: var(--primary-color);
            font-size: 14px;
        }

        .sp-grand-total {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 15px 20px;
            background: linear-gradient(135deg, var(--primary-color) 0%, #1976d2 100%);
            color: white;
            border-radius: 10px;
            margin-top: 10px;
            box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
        }

        .sp-grand-total .cost-label {
            font-weight: 600;
            font-size: 16px;
            color: white;
        }

        .sp-grand-total .cost-value {
            font-weight: 700;
            font-size: 18px;
            color: white;
        }

        /* Consolidated SPs Section Styles */
        .sp-consolidated-section {
            background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
            border: 1px solid #ffcc02;
            border-radius: 12px;
            padding: 20px;
            margin: 15px 0;
            box-shadow: 0 2px 8px rgba(0,0,0,0.08);
            grid-column: 1 / -1;
        }

        .sp-consolidated-section h4 {
            margin: 0 0 15px 0;
            color: #e65100;
            font-size: 16px;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .sp-consolidated-section h4 i {
            font-size: 18px;
        }

        .plans-grid, .current-plans-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 10px;
            margin: 15px 0;
        }

        .consolidated-plan-chip, .editable-plan-chip {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 15px;
            background: rgba(255, 255, 255, 0.9);
            border-radius: 20px;
            border: 1px solid #ffb74d;
            font-size: 14px;
            font-weight: 500;
            color: #e65100;
            transition: all 0.3s ease;
        }

        .consolidated-plan-chip:hover, .editable-plan-chip:hover {
            background: rgba(255, 255, 255, 1);
            transform: translateY(-1px);
            box-shadow: 0 3px 8px rgba(230, 81, 0, 0.2);
        }

        .consolidated-plan-chip i, .editable-plan-chip i {
            color: #ff9800;
        }

        .editable-plan-chip {
            justify-content: space-between;
        }

        .editable-plan-chip .plan-id {
            flex: 1;
        }

        .remove-plan-btn {
            background: none;
            border: none;
            color: #f44336;
            cursor: pointer;
            padding: 4px;
            border-radius: 50%;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .remove-plan-btn:hover {
            background: #f44336;
            color: white;
            transform: scale(1.1);
        }

        .add-plan-section {
            margin-top: 15px;
            text-align: center;
        }

        .add-plans-btn {
            background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
            color: white;
            border: none;
            padding: 12px 20px;
            border-radius: 25px;
            cursor: pointer;
            font-weight: 500;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            transition: all 0.3s ease;
            box-shadow: 0 2px 6px rgba(76, 175, 80, 0.3);
        }

        .add-plans-btn:hover {
            background: linear-gradient(135deg, #45a049 0%, #388e3c 100%);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
        }
        
        .percentage {
            font-weight: 500;
        }
        
        .percentage.increase { color: var(--green-dark); }
        .percentage.decrease { color: var(--red-dark); }

        .charts-section {
            display: grid;
            grid-template-columns: repeat(6, 1fr);
            gap: 20px;
            margin-bottom: 20px;
        }

        /* Gráficos: Evolución 4 columnas, Distribución 2 columnas */
        .chart-container:first-child {
            grid-column: span 4;
        }

        .chart-container:last-child {
            grid-column: span 2;
        }

        /* Tablas: 3 columnas cada una para equilibrio 50/50 */
        .charts-section .card:first-child {
            grid-column: span 3;
        }

        .charts-section .card:last-child {
            grid-column: span 3;
        }

        /* Responsividad para pantallas medianas */
        @media (max-width: 1400px) {
            .summary-cards {
                grid-template-columns: repeat(3, 1fr);
            }

            .charts-section {
                grid-template-columns: repeat(3, 1fr);
            }

            .chart-container:first-child {
                grid-column: span 2;
            }

            .chart-container:last-child {
                grid-column: span 1;
            }

            .charts-section .card:first-child,
            .charts-section .card:last-child {
                grid-column: span 3;
            }
        }

        /* Responsividad para pantallas pequeñas */
        @media (max-width: 900px) {
            .summary-cards {
                grid-template-columns: repeat(2, 1fr);
            }

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

            .chart-container:first-child,
            .chart-container:last-child,
            .charts-section .card:first-child,
            .charts-section .card:last-child {
                grid-column: span 1;
            }
        }
        
        .chart-container {
            background-color: var(--card-bg);
            padding: 20px;
            border-radius: 12px;
            border: 1px solid var(--border-color);
            position: relative; 
            height: 350px;
            display: flex;
            flex-direction: column;
        }

        .chart-canvas-wrapper {
            position: relative;
            flex-grow: 1;
            min-height: 0;
        }

        .chart-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }
        
        .chart-header h3 {
            margin: 0;
            font-size: 18px;
            font-weight: 600;
        }
        
        table {
            width: 100%;
            border-collapse: collapse;
        }
        
        th, td {
            padding: 15px;
            text-align: left;
            border-bottom: 1px solid var(--border-color);
            font-size: 14px;
        }
        
        th {
            font-weight: 500;
            color: var(--text-muted);
        }
        
        .status {
            padding: 5px 10px;
            border-radius: 15px;
            font-weight: 500;
            font-size: 12px;
        }
        
        .status-completed {
            background-color: var(--green-light);
            color: var(--green-dark);
        }
        
        .action-icons i {
            margin: 0 5px;
            cursor: pointer;
            color: var(--text-muted);
            transition: color 0.2s;
        }
        
        .action-icons i:hover {
            color: var(--primary-color);
        }
.activity-container {
    margin-top: 20px;
}

.activity-header {
    margin-bottom: 20px;
}

.activity-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.activity-list li {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.activity-list li:last-child {
    border-bottom: none;
}

.activity-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
}

.activity-icon i {
    font-size: 16px;
}

.activity-text {
    flex-grow: 1;
    font-size: 14px;
}

.activity-time {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
}
.submenu .active-submenu a {
    color: var(--primary-color);
    font-weight: 700;
}
.submenu .active-submenu a:hover {
    color: white; 
}

.form-header-info {
    display: grid;
    grid-template-columns: repeat(5, 1fr); 
    gap: 20px;
    margin-bottom: 20px;
    align-items: end; 
}

#travel-form-header-info {
    grid-template-columns: repeat(3, 1fr); 
}

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

.info-item label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 500;
}

.info-item span {
    font-size: 14px;
    padding-top: 8px; 
}

.info-item textarea, .info-item input, .info-item select {
    font-size: 14px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: #fdfdfd;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif; 
}

.info-item textarea {
    height: 60px;
    resize: vertical;
}

.info-item .status {
    width: fit-content;
}

.status-in-review {
    background-color: var(--purple-light);
    color: var(--purple-dark);
}

.cost-table-container {
    padding-bottom: 20px;
}

.table-wrapper {
    overflow-x: auto; 
    margin-bottom: 20px;
}

.cost-table {
    width: 100%;
    min-width: 1200px; 
    border-collapse: collapse;
}

.cost-table th, .cost-table td {
    border: 1px solid var(--border-color);
    padding: 8px;
    text-align: center;
    vertical-align: middle;
}

.cost-table th {
    background-color: #f9fafb;
    font-size: 13px;
    font-weight: 600;
}

.cost-table td {
    background-color: white;
}

.cost-table input, .cost-table select {
    width: 100%;
    border: 2px solid transparent;
    padding: 6px 8px;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    background-color: transparent;
    text-align: left;
    box-sizing: border-box; 
}

.cost-table input:focus, .cost-table select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}
.btn-primary {
    background-color: var(--primary-color);
    color: white;
}
.btn-primary:hover {
    opacity: 0.9;
}
.btn-secondary {
    background-color: var(--green-light);
    color: var(--green-dark);
}
.btn-secondary:hover {
    background-color: var(--green-dark);
    color: white;
}
.btn-danger {
    background-color: transparent;
    color: var(--red-dark);
    font-size: 16px;
    padding: 8px 12px;
    border: 1px solid var(--red-dark);
    transition: all 0.2s ease;
}
.btn-danger:hover {
    background-color: var(--red-dark);
    color: white;
    border-color: var(--red-dark);
}

/* Delete button in tables - Enhanced visibility */
.delete-row-btn {
    min-width: 80px;
    font-size: 18px;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.delete-row-btn i {
    font-size: 18px;
    display: inline-block;
}

.delete-row-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

/* Tooltip for delete buttons */
.delete-row-btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    margin-bottom: 5px;
    z-index: 1000;
}

.form-actions {
    margin-top: 20px;
    text-align: right;
}
.hidden {
    display: none !important;
}

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

.list-header h3 {
    margin: 0;
}

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

.history-table th, .history-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.history-table th {
    background-color: #f9fafb;
    font-weight: 600;
}

.history-table td .btn {
    margin-right: 5px;
}

/* Updated Status Colors - Workflow States */
.status-draft {
    background-color: #F3F4F6;
    color: #6B7280;
    border: 1px solid #D1D5DB;
}

.status-pending.review,
.status-pending-review {
    background-color: #DBEAFE;
    color: #3B82F6;
    border: 1px solid #93C5FD;
}

.status-under.review,
.status-under-review {
    background-color: #FEF3C7;
    color: #F59E0B;
    border: 1px solid #FCD34D;
}

.status-changes.requested,
.status-changes-requested {
    background-color: #FEF08A;
    color: #EAB308;
    border: 1px solid #FDE047;
}

.status-approved {
    background-color: #D1FAE5;
    color: #10B981;
    border: 1px solid #6EE7B7;
}

.status-rejected {
    background-color: #FEE2E2;
    color: #EF4444;
    border: 1px solid #FECACA;
}

/* Status Dropdown Selector */
.status-select {
    padding: 6px 10px;
    border: 1px solid #D1D5DB;
    border-radius: 15px;
    font-weight: 500;
    font-size: 12px;
    background: white;
    color: var(--text-color);
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    min-width: 120px;
}

.status-select:hover {
    border-color: var(--primary-color);
    background: #F8FAFC;
}

.status-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

/* Status dropdown options styling */
.status-select option {
    padding: 8px 12px;
    background: white;
    color: var(--text-color);
}

.status-select option:hover {
    background: var(--blue-light);
}

/* Legacy support - to be removed later */
.status-borrador {
    background-color: #F3F4F6;
    color: #6B7280;
}
.status-en-revisión {
    background-color: #FEF3C7;
    color: #F59E0B;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.modal-content h3 {
    margin-top: 0;
}

.modal-content p {
    margin-bottom: 20px;
}

.modal-content input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.btn-danger[disabled] {
    background-color: #ccc;
    cursor: not-allowed;
}
.activity-log-title {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
}

.activity-item {
    display: flex;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}
.activity-item:last-child {
    border-bottom: none;
}

.activity-item .checkbox-container {
    flex-shrink: 0;
    margin-right: 15px;
    padding-top: 2px;
}
.activity-item .checkbox-container input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.activity-item-content {
    flex-grow: 1;
}

.activity-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.activity-item-author {
    font-weight: 600;
}

.activity-item-timestamp {
    font-size: 12px;
    color: var(--text-muted);
}

.activity-item-text {
    font-size: 14px;
}

.reply-container {
    margin-top: 10px;
    padding-left: 33px; 
}
.reply-container textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    resize: vertical;
    min-height: 50px;
    margin-bottom: 5px;
}
.reply-actions {
    text-align: right;
}
.user-reply {
    background-color: #f9f9f9;
    padding: 10px;
    border-radius: 6px;
    margin-top: 10px;
}

.global-total-container {
    text-align: right;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 18px;
    font-weight: 600;
}
.global-total-container span {
    color: var(--primary-color);
    margin-left: 10px;
    font-size: 22px;
}

#costing-activity-log .activity-item, #service-plan-activity-log .activity-item {
    display: flex;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}
#costing-activity-log .activity-item:last-child, #service-plan-activity-log .activity-item:last-child {
    border-bottom: none;
}
#costing-activity-log .checkbox-container, #service-plan-activity-log .checkbox-container {
    flex-shrink: 0;
    margin-right: 15px;
    padding-top: 2px;
}
#costing-activity-log .task-checkbox, #service-plan-activity-log .task-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}
#costing-activity-log .activity-content, #service-plan-activity-log .activity-content {
    flex-grow: 1;
}
#costing-activity-log .activity-header, #service-plan-activity-log .activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}
#costing-activity-log .activity-author, #service-plan-activity-log .activity-author {
    font-weight: 600;
}
#costing-activity-log .activity-timestamp, #service-plan-activity-log .activity-timestamp {
    font-size: 12px;
    color: var(--text-muted);
}
#costing-activity-log .activity-text, #service-plan-activity-log .activity-text {
    font-size: 14px;
}
#costing-activity-log .completed .activity-text, #service-plan-activity-log .completed .activity-text {
    text-decoration: line-through;
    color: var(--text-muted);
}
#costing-activity-log .activity-actions, #service-plan-activity-log .activity-actions {
    margin-top: 8px;
    font-size: 12px;
}
#costing-activity-log .reply-link, #service-plan-activity-log .reply-link {
    color: var(--primary-color);
    cursor: pointer;
    font-weight: 500;
}
#costing-activity-log .replies-container, #service-plan-activity-log .replies-container {
    padding-left: 20px;
    margin-top: 10px;
    border-left: 2px solid var(--border-color);
}
#costing-activity-log .reply, #service-plan-activity-log .reply {
    margin-top: 10px;
}
#costing-activity-log .reply-form, #service-plan-activity-log .reply-form {
    margin-top: 10px;
}
#costing-activity-log .reply-textarea, #service-plan-activity-log .reply-textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    resize: vertical;
    min-height: 60px;
    margin-bottom: 5px;
}
#costing-activity-log .reply-actions, #service-plan-activity-log .reply-actions {
    text-align: right;
}

.travel-summary {
    width: 300px;
    margin-left: auto;
    margin-top: 20px;
    font-size: 14px;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.summary-label {
    color: var(--text-muted);
    font-weight: 500;
}

.summary-input {
    width: 120px;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-align: right;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
}

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

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 16px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

#total-travel-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

.mission-period-display {
    display: flex;
    flex-direction: column; 
    align-items: flex-start; 
    gap: 4px; 
    padding-top: 8px; 
    font-size: 14px;
}

.mission-total-days {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.tabs-container {
    margin-top: 20px;
}

.tab-headers {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: -1px; 
}

.tab-link {
    padding: 12px 25px;
    cursor: pointer;
    border: none;
    background-color: transparent;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.tab-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

.tab-content {
    display: none;
    border-top: 1px solid var(--border-color);
    padding-top: 0;
}

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

.tab-content .card {
    border-top-left-radius: 0;
}

.service-plan-summary {
    margin-bottom: 20px;
}

/* service-plan-summary now uses sp-costs-summary-card styles */

/* Legacy summary styles - kept for backward compatibility in other pages */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.summary-item {
    background-color: #f9fafb;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-item strong {
    color: var(--text-muted);
}

.summary-item span {
    font-weight: 600;
    font-size: 18px;
    color: var(--text-color);
}

.summary-item.grand-total {
    grid-column: 1 / -1;
    background-color: var(--blue-light);
    border: 1px solid var(--blue-dark);
    padding: 20px;
}

.summary-item.grand-total strong {
    color: var(--blue-dark);
    font-size: 18px;
}

.summary-item.grand-total span {
    color: var(--blue-dark);
    font-size: 22px;
}

.mission-card {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 20px;
    padding: 20px;
}

.mission-header {
    display: grid;
    grid-template-columns: 3fr 2fr 2fr 1fr;
    gap: 20px;
    align-items: end;
    margin-bottom: 20px;
}

.mission-header .info-item {
    display: flex;
    flex-direction: column;
}

.mission-header .delete-mission-btn {
    justify-self: end;
    align-self: center;
    background: var(--red-light);
    color: var(--red-dark);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
}
.mission-header .delete-mission-btn:hover {
    background: var(--red-dark);
    color: white;
}

.toolbar {
    margin-bottom: 20px;
}

.history-table .actions .btn-action {
    background-color: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0 4px;
    transition: background-color 0.2s ease-in-out;
}

.history-table .actions .btn-action i {
    font-size: 16px;
}

.history-table .actions .btn-action.view-summary-btn i {
    color: var(--blue-dark);
}

.history-table .actions .btn-action.view-summary-btn:hover {
    background-color: var(--blue-light);
}

.history-table .actions .btn-action.edit-plan-btn i {
    color: var(--green-dark);
}

.history-table .actions .btn-action.edit-plan-btn:hover {
    background-color: var(--green-light);
}

.history-table .actions .btn-action.delete-plan-btn i {
    color: var(--red-dark);
}

.history-table .actions .btn-action.delete-plan-btn:hover {
    background-color: var(--red-light);
}

/* --- Settings Page Styles --- */

.profile-form-container {
    display: flex;
    align-items: flex-start; /* Align items to the top */
    gap: 30px;
}

.profile-avatar-section {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover; /* Ensures the image covers the area without distortion */
    border: 4px solid var(--border-color);
}

.profile-details-section {
    flex-grow: 1;
}

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

.form-group label {
    display: block;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-size: 14px;
}

/* Use a more standard input style for form pages */
.form-view .cost-input, .form-view select.cost-input {
    width: 100%;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: #fff;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.form-view .cost-input:focus, .form-view select.cost-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-view .cost-input[readonly] {
    background-color: var(--background-color);
    cursor: not-allowed;
}

/* Date inputs in tables - make them visible and styled like date-input-compact */
.cost-table input[type="date"].cost-input,
.travel-table input[type="date"].date-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: white;
    color: #2d3748;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    box-sizing: border-box;
    min-width: 130px;
}

.cost-table input[type="date"].cost-input:focus,
.travel-table input[type="date"].date-input:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.25);
    background: white;
}

.cost-table input[type="date"].cost-input:hover,
.travel-table input[type="date"].date-input:hover {
    border-color: #999;
}

/* Calendar icon styling */
.cost-table input[type="date"].cost-input::-webkit-calendar-picker-indicator,
.travel-table input[type="date"].date-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
    background: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%234a90e2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>') no-repeat center;
    background-size: 18px 18px;
    width: 24px;
    height: 24px;
    opacity: 0.8;
}

.cost-table input[type="date"].cost-input::-webkit-calendar-picker-indicator:hover,
.travel-table input[type="date"].date-input::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    background-color: rgba(74, 144, 226, 0.1);
    border-radius: 3px;
}

/* For Firefox */
.cost-table input[type="date"].cost-input::-moz-calendar-picker-indicator,
.travel-table input[type="date"].date-input::-moz-calendar-picker-indicator {
    cursor: pointer;
}

.list-header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-bar.small input {
    width: 250px;
}

.team-tag {
    padding: 4px 10px;
    border-radius: 15px;
    font-weight: 500;
    font-size: 12px;
    text-transform: capitalize;
    /* Unified neutral styling for all teams */
    background-color: #F5F5F5;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.consolidated-child-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    background-color: #fdfdfd;
}

.consolidated-child-card .child-card-header {
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.consolidated-child-card .child-card-body {
    font-size: 14px;
    color: var(--text-muted);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.consolidated-child-card .child-card-footer {
    text-align: right;
}

/* Consolidated Service Plan Table Rows */
.consolidated-sp-row {
    background-color: #f8f9fa;
    border-left: 4px solid var(--blue-main);
}

.consolidated-sp-row:hover {
    background-color: #e9ecef;
}

.individual-consolidated-row {
    background-color: #fff3cd;
    border-left: 4px solid var(--yellow-main);
    opacity: 0.85;
}

.individual-consolidated-row:hover {
    background-color: #ffeaa7;
}

/* Highlighting for individual SPs when hovering over their consolidated SP */
.highlighted-individual-sp {
    background-color: #fff3cd !important;
    border-left: 4px solid #ffc107 !important;
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
    transform: translateX(2px);
    transition: all 0.2s ease-in-out;
}

.consolidated-sp-row .fa-folder-plus {
    color: var(--blue-main);
    margin-right: 5px;
}

.individual-consolidated-row .fa-link {
    color: var(--yellow-dark);
    margin-right: 5px;
}

.user-profile-link {
    text-decoration: none;
    color: inherit; /* Inherit color from parent */
}

/* Login Page Styles */
body.login-page-body { /* Add a class to the body for specific login page styles */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: var(--background-color);
}
.login-container {
    padding: 40px 60px;
    background-color: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 400px;
    text-align: center;
}
.login-container img {
    width: 150px;
    margin-bottom: 20px;
}
.login-container h2 {
    margin-bottom: 20px;
}
.login-container .form-group {
    text-align: left;
    margin-bottom: 15px;
}
.login-container .btn {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
}
.error-message {
    color: var(--red-dark);
    margin-top: 15px;
    display: none; /* Hidden by default */
}

/* Description field styles for service plan summary */
.summary-description {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.summary-description label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.9em;
}

.description-textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    resize: vertical;
    min-height: 80px;
    background-color: var(--card-bg);
    color: var(--text-color);
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.description-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.description-textarea::placeholder {
    color: var(--text-muted);
}

.description-actions {
    margin-top: 10px;
    text-align: right;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
}

/* Styles for edit form header info */
.form-header-info .info-item.full-width {
    grid-column: 1 / -1; /* Span full width of grid */
}

.form-header-info .info-item.full-width .description-textarea {
    margin-top: 5px;
}

/* Description display in summary (read-only) */
.description-display {
    display: block;
    margin-top: 4px;
    padding: 6px 0;
    font-weight: 400;
    font-size: 0.9em;
    line-height: 1.4;
    color: var(--text-color);
    white-space: pre-wrap; /* Preserve line breaks */
    word-wrap: break-word;
}

/* Compact Date Range - Optimized for single row layout */
.compact-date-range {
    grid-column: span 1; /* Takes only 1 column, fits in the same row */
}

.date-range-compact {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f8f9fa;
    padding: 2px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.date-range-compact:hover {
    border-color: var(--primary-color);
    background: white;
}

.date-range-compact:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
    background: white;
}

.date-input-compact {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-color);
    text-align: center;
    min-width: 0;
    transition: all 0.2s ease;
    cursor: pointer;
}

.date-input-compact:focus {
    outline: none;
    background: #f0f7ff;
    border-color: #4299e1;
    box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.1);
}

.date-input-compact:hover {
    border-color: #9ca3af;
    background: #fafafa;
}

.date-input-compact::placeholder {
    color: #a0aec0;
    font-weight: 400;
    font-size: 12px;
}

/* Usar los mismos estilos que los campos de fecha en notificaciones */
.date-input-compact[type="date"] {
    /* Copiar estilos del datepicker-fallback.css */
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: white;
    transition: all 0.2s ease;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
}

.date-input-compact[type="date"]:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.25);
    background: white;
}

.date-input-compact[type="date"]:hover {
    border-color: #999;
}

/* Estilo del icono de calendario (webkit) */
.date-input-compact[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    background: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>') no-repeat center;
    background-size: 16px 16px;
    width: 20px;
    height: 20px;
    color: transparent;
    opacity: 0.7;
}

.date-input-compact[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    background-color: rgba(74, 144, 226, 0.1);
    border-radius: 3px;
}

/* Para Firefox */
.date-input-compact[type="date"]::-moz-calendar-picker-indicator {
    cursor: pointer;
}

/* Asegurar que los campos siempre se vean editables */
.date-input-compact[type="date"]:not(:disabled):not([readonly]) {
    background: white !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.date-separator-compact {
    color: var(--text-muted);
    font-size: 14px;
    padding: 0 2px;
    user-select: none;
}

/* Keep old styles for backwards compatibility */
.date-range-container {
    grid-column: span 2; /* Takes 2 columns in the grid */
}

.date-range-inputs {
    display: flex;
    flex-direction: row; /* Explicitly set to row for horizontal layout */
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
    padding: 8px;
    border-radius: 10px;
    border: 2px solid #e1e8ed;
    transition: all 0.3s ease;
}

.date-range-inputs:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.15);
}

.date-range-inputs:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 4px 20px rgba(74, 144, 226, 0.2);
    background: white;
}

.date-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 0; /* Prevent flex items from overflowing */
}

.date-input {
    width: 100%;
    padding: 10px 38px 10px 12px;
    border: none;
    background: white;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    transition: all 0.2s ease;
    cursor: pointer;
    box-sizing: border-box; /* Ensure padding is included in width */
}

.date-input:focus {
    outline: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.date-input::placeholder {
    color: #a0aec0;
    font-weight: 400;
}

.date-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    font-size: 16px;
    pointer-events: none;
    transition: all 0.2s ease;
}

.date-input:focus + .date-icon {
    color: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}

.date-separator {
    font-size: 20px;
    color: var(--primary-color);
    font-weight: 300;
    padding: 0 8px;
    user-select: none;
    animation: pulse 2s infinite;
    flex-shrink: 0; /* Prevent separator from shrinking */
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.date-range-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
    display: block;
    font-style: italic;
    opacity: 0.8;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .date-range-container {
        grid-column: 1 / -1; /* Full width on mobile */
    }

    .date-range-inputs {
        flex-direction: column;
        gap: 8px;
        padding: 12px;
    }

    .date-separator {
        transform: rotate(90deg);
        margin: -4px 0;
    }

    .date-input-wrapper {
        width: 100%;
    }
}

/* Consolidated SP Edit Styles */
.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

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

.summary-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

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

.btn-save-summary {
    background-color: var(--green-dark);
    color: white;
}

.btn-cancel-summary {
    background-color: var(--text-muted);
    color: white;
}

.btn-edit-summary:hover,
.btn-save-summary:hover,
.btn-cancel-summary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.consolidated-plans-edit {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
    background-color: var(--background-color);
}

.current-plans {
    margin-bottom: 12px;
}

.plan-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 6px;
}

.plan-item span {
    font-weight: 500;
    color: var(--text-color);
}

.remove-plan-btn {
    background: none;
    border: none;
    color: var(--red-dark);
    cursor: pointer;
    padding: 4px;
    border-radius: 2px;
    font-size: 12px;
    transition: background-color 0.2s ease;
}

.remove-plan-btn:hover {
    background-color: var(--red-light);
}

.add-plan-section {
    display: flex;
    gap: 8px;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.available-plans-select {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 12px;
    background-color: white;
}

.add-plan-btn {
    padding: 6px 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.add-plan-btn:hover {
    background-color: #357ABD;
}

.description-edit {
    width: 100%;
    min-height: 60px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 13px;
    resize: vertical;
    margin-top: 6px;
}

.description-edit:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.hidden {
    display: none !important;
}

/* Updated Consolidated Plans Section Styles */
.consolidated-plans-section {
    margin: 16px 0;
}

.consolidated-plans-header {
    margin-bottom: 12px;
}

.plans-list-display {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.plan-display-item {
    background-color: var(--blue-light);
    color: var(--blue-dark);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.plan-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 6px;
}

.plan-item .plan-id {
    font-weight: 500;
    color: var(--text-color);
    flex-grow: 1;
}

.add-plans-btn {
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.add-plans-btn:hover {
    background-color: #357ABD;
}

.add-plans-btn i {
    font-size: 12px;
}

/* Add SP Modal Styles */
.add-sp-modal-content {
    max-width: 600px;
    width: 90%;
}

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

.modal-header h3 {
    margin: 0;
    color: var(--text-color);
    font-size: 18px;
}

.close-modal-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.close-modal-btn:hover {
    background-color: var(--background-color);
    color: var(--text-color);
}

.modal-body {
    padding: 0 20px;
    max-height: 400px;
    overflow-y: auto;
}

.modal-body p {
    margin-bottom: 16px;
    color: var(--text-muted);
}

.available-sp-list {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    max-height: 300px;
    overflow-y: auto;
}

.sp-item {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

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

.sp-item:hover {
    background-color: var(--background-color);
    border-left: 3px solid var(--primary-color);
    padding-left: 13px;
}

.sp-item:has(.sp-checkbox:checked) {
    background-color: var(--blue-light);
    border-left: 3px solid var(--primary-color);
    padding-left: 13px;
}

.sp-item:has(.sp-checkbox:checked) .sp-id {
    color: var(--primary-color);
    font-weight: 600;
}

.sp-item:has(.sp-checkbox:checked) .sp-team {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.sp-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    width: 100%;
    gap: 0;
}

.checkbox-container {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    padding-right: 16px;
}

.sp-checkbox {
    margin: 0;
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.sp-info {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.sp-id {
    font-weight: 500;
    color: var(--text-color);
    font-size: 14px;
    flex: 0 0 auto;
}

.sp-team {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    flex: 0 0 auto;
    text-align: right;
    background-color: var(--background-color);
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.no-plans-message {
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
    font-style: italic;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
}

/* Validation styles */
.cost-input.required-field {
    border: 2px solid var(--secondary-color);
    background-color: #FFF9E6;
}

.cost-input.invalid-field {
    border: 2px solid var(--red-dark);
    background-color: var(--red-light);
}

.cost-input.valid-field {
    border: 2px solid var(--green-dark);
    background-color: var(--green-light);
}

.validation-message {
    font-size: 12px;
    margin-top: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    display: none;
}

.validation-message.error {
    color: var(--red-dark);
    background-color: var(--red-light);
    display: block;
}

.validation-message.info {
    color: var(--secondary-color);
    background-color: #FFF9E6;
    display: block;
}

/* Required field indicators */
.required-indicator {
    color: var(--red-dark);
    font-weight: bold;
    margin-left: 2px;
}

/* Delete confirmation modal */
.delete-confirmation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.delete-confirmation-modal.hidden {
    display: none;
}

.delete-confirmation-content {
    background: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    width: 90%;
}

.delete-confirmation-content h3 {
    margin: 0 0 16px 0;
    color: var(--red-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.delete-confirmation-content p {
    margin: 0 0 20px 0;
    color: var(--text-color);
}

.delete-confirmation-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Total consolidation styling */
.total-consolidation {
    background: linear-gradient(135deg, var(--blue-light), var(--purple-light));
    border: 2px solid var(--blue-dark);
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
    text-align: center;
}

.total-consolidation h4 {
    margin: 0 0 8px 0;
    color: var(--blue-dark);
    font-weight: 600;
}

.total-consolidation .total-amount {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
}

/* ==========================================
   COMMENTS SYSTEM STYLES
   ========================================== */

.activity-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.activity-log-card {
    display: none;
}

.communication-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

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

.communication-header h3 {
    margin: 0;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.unread-indicator {
    background: var(--red-primary);
    color: white;
    border-radius: 12px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.comments-container {
    max-height: 400px;
    overflow-y: auto;
    padding: 0;
    background: white;
}

.comments-loading {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

.comment-item {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    position: relative;
}

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

.comment-item.own-comment {
    background: var(--blue-lightest);
    border-left: 4px solid var(--blue-primary);
}

.comment-item.admin-comment {
    background: var(--purple-lightest);
    border-left: 4px solid var(--purple-primary);
}

.comment-item.status-change {
    background: var(--yellow-lightest);
    border-left: 4px solid var(--yellow-primary);
}

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

.comment-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-color);
}

.comment-role-badge {
    background: var(--bg-secondary);
    color: var(--text-muted);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

.comment-role-badge.admin {
    background: var(--purple-light);
    color: var(--purple-dark);
}

.comment-timestamp {
    color: var(--text-muted);
    font-size: 12px;
}

.comment-text {
    color: var(--text-color);
    line-height: 1.5;
    margin: 0;
    white-space: pre-wrap;
}

.status-action-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--yellow-light);
    color: var(--yellow-dark);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
}

.status-action-badge.approved {
    background: var(--green-light);
    color: var(--green-dark);
}

.status-action-badge.changes_requested {
    background: var(--yellow-light);
    color: var(--yellow-dark);
}

.status-action-badge.rejected {
    background: var(--red-light);
    color: var(--red-dark);
}

.comment-input-section {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-light);
}

.comment-input-section textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    background: white;
}

.comment-input-section textarea:focus {
    outline: none;
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 2px var(--blue-light);
}

.comment-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
}

.admin-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.review-action-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    font-size: 14px;
    min-width: 180px;
}

.review-action-select:focus {
    outline: none;
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 2px var(--blue-light);
}

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

.empty-comments i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Responsive design */
@media (max-width: 768px) {
    .comment-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-actions {
        flex-direction: column;
    }

    .review-action-select {
        min-width: auto;
    }
}

/* Comment editing and deleting styles */
.btn-edit-comment,
.btn-delete-comment {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 4px 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 8px;
    transition: all 0.2s ease;
}

.btn-edit-comment:hover {
    background: var(--bg-secondary);
    color: var(--text-color);
}

.btn-delete-comment:hover {
    background: var(--red-light);
    color: var(--red-dark);
}

.comment-content {
    position: relative;
}

.comment-edit-text {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    background: white;
}

.comment-edit-text:focus {
    outline: none;
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 2px var(--blue-light);
}

.comment-edit-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
    line-height: 1.4;
}

.comment-timestamp {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* Color variables for comment system */
:root {
    --blue-lightest: #f8fbff;
    --purple-lightest: #faf9ff;
    --yellow-lightest: #fffcf5;
    --green-light: #d4edda;
    --green-dark: #155724;
    --yellow-light: #fff3cd;
    --yellow-dark: #856404;
    --red-light: #f8d7da;
    --red-dark: #721c24;
    --purple-light: #e7e3ff;
    --purple-dark: #4c1d95;
}

/* Service ID Link Styles */
.service-id-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.service-id-link:hover {
    color: var(--blue-dark);
    text-decoration: underline;
}

/* Avatar Crop Modal Styles */
.avatar-crop-modal {
    max-width: 700px;
    width: 90vw;
}

.crop-container {
    display: flex;
    gap: 20px;
    max-height: 500px;
}

.crop-preview-area {
    flex: 2;
    position: relative;
    background: #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crop-preview-area img {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

.crop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.crop-selection {
    position: absolute;
    border: 2px solid var(--primary-color);
    background: transparent;
    cursor: move;
    min-width: 100px;
    min-height: 100px;
}

.crop-selection::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
}

.crop-handle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border: 2px solid white;
    border-radius: 50%;
}

.crop-handle.nw { top: -6px; left: -6px; cursor: nw-resize; }
.crop-handle.ne { top: -6px; right: -6px; cursor: ne-resize; }
.crop-handle.sw { bottom: -6px; left: -6px; cursor: sw-resize; }
.crop-handle.se { bottom: -6px; right: -6px; cursor: se-resize; }

.crop-sidebar {
    flex: 1;
    padding: 20px;
    background: var(--background-color);
    border-radius: 8px;
    text-align: center;
}

.crop-sidebar h4 {
    margin: 0 0 15px 0;
    color: var(--text-color);
}

.avatar-preview {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 20px;
    border: 3px solid var(--border-color);
    background: white;
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.crop-info p {
    margin: 5px 0;
    font-size: 14px;
    color: var(--text-muted);
}

.crop-hint {
    font-style: italic;
    font-size: 12px !important;
}

/* Upload Progress Modal */
.upload-progress-modal {
    max-width: 400px;
}

.upload-progress-content {
    text-align: center;
    padding: 40px 20px;
}

.upload-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#upload-status {
    margin: 0 0 10px 0;
    color: var(--text-color);
}

#upload-substatus {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .crop-container {
        flex-direction: column;
        max-height: none;
    }

    .crop-preview-area {
        min-height: 300px;
    }

    .avatar-crop-modal {
        width: 95vw;
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* Travel Table - Transportation Column Width Optimization (60/40 ratio) */
.travel-table .transport-type-cell {
    width: 120px;
    min-width: 120px;
    max-width: 120px;
}

.travel-table .transport-cost-cell {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
}

.travel-table .transport-type-input,
.travel-table .transport-cost-input {
    width: 100%;
    padding: 6px 8px;
    font-size: 14px;
}

.travel-table .transport-cost-input {
    text-align: right;
}

