/* Modern styling for the dashboard */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f7fa;
    min-height: 100vh;
    color: #2d3748;
}

.container {
    width: 95%;
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
}

h1 {
    color: #1a202c;
    margin: 2rem 0;
    text-align: center;
    font-weight: 700;
    font-size: 2.2rem;
}

/* Enhanced KPI Section styling */
.kpi-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.kpi-card {
    background: linear-gradient(145deg, #ffffff, #f5f7fa);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 
                0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
                0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.kpi-card h3 {
    margin: 0 0 0.8rem 0;
    color: #4a5568;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: #2b6cb0;
    line-height: 1.2;
}

/* Modernized Control section */
.control-section {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin: 2rem 0;
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-form {
    display: flex;
    gap: 1rem;
    flex: 1;
    min-width: 280px;
}

input[type="text"], select {
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s;
    background-color: #f8fafc;
}

input[type="text"]:focus, select:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

input[type="text"] {
    flex: 1;
}

.btn {
    padding: 0.75rem 1.5rem;
    background-color: #3182ce;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.btn:hover {
    background-color: #2c5282;
    transform: translateY(-1px);
}

/* Enhanced Table styling */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin: 2rem 0;
    font-size: 0.85rem; /* Reduced base font size */
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th {
    background-color: #2b6cb0;
    color: white;
    font-weight: 600;
    padding: 0.5rem 0.75rem; /* Reduced padding */
    text-align: left;
    font-size: 0.85rem; /* Smaller header font */
}

td {
    padding: 0.5rem 0.75rem; /* Reduced padding */
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.85rem; /* Smaller cell font */
    line-height: 1.2; /* Tighter line height */
}

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

tr:hover td {
    background-color: #f7fafc;
}

/* Updated date cell styling */
.date-cell.urgent {
    animation: pulse 2s infinite;
}

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

.date-cell.today { background-color: #fc8181; color: white; }
.date-cell.tomorrow { background-color: #f6ad55; color: white; }
.date-cell.two-days { background-color: #fbd38d; }
.date-cell.three-days { background-color: #faf089; }
.date-cell.four-days { background-color: #68d391; color: white; }
.date-cell.past { background-color: #a0aec0; color: white; }

/* Responsive improvements */
@media (max-width: 1024px) {
    .container {
        width: 98%;
        padding: 0 0.5rem;
    }
    
    .control-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-form {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .kpi-section {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    th, td {
        padding: 0.4rem 0.6rem; /* Even smaller padding on mobile */
        font-size: 0.8rem;
    }
}

/* Add these styles at the end of the file */
.htmx-indicator {
    display: none;
}
.htmx-request .htmx-indicator {
    display: inline-block;
}
.htmx-request.table-container {
    opacity: 0.5;
    transition: opacity 200ms ease-in;
}
