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

:root {
    --primary-gradient: linear-gradient(135deg, #2dd4bf 0%, #0d9488 100%);
    /* Teal Gradient */
    --primary-color: #0d9488;
    --secondary-color: #fcd34d;
    --success-color: #84cc16;
    /* Lime/Light Green */
    --warning-color: #fbbf24;
    --card-bg: #ffffff;
    --bg-body: #fdfbf7;
    /* Soft Cream */
    --text-main: #334155;
    /* Slate 700 - Softer than pure black */
    --text-muted: #94a3b8;
    --shadow-sm: 0 1px 2px 0 rgba(13, 148, 136, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(13, 148, 136, 0.1), 0 2px 4px -1px rgba(13, 148, 136, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(13, 148, 136, 0.1), 0 4px 6px -2px rgba(13, 148, 136, 0.05);
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --transition-fast: 0.2s ease;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    overflow-x: hidden;
}

/* Navbar */
.navbar {
    background: var(--card-bg);
    border-bottom: 1px solid rgba(13, 148, 136, 0.1);
    box-shadow: var(--shadow-sm);
    padding: 1rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand {
    font-weight: 700;
    color: var(--primary-color) !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge-last-updated {
    font-weight: 500;
    font-size: 0.8rem;
    background-color: #f0fdfa;
    /* Light Teal bg */
    color: var(--primary-color);
    padding: 0.35em 0.8em;
    border-radius: 20px;
    border: 1px solid rgba(13, 148, 136, 0.2);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-refresh {
    background: var(--primary-gradient);
    color: white;
    border: none;
    box-shadow: 0 4px 6px -1px rgba(45, 212, 191, 0.3);
    transition: var(--transition-fast);
}

.btn-refresh:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(45, 212, 191, 0.4);
    color: white;
}

.btn-refresh:active {
    transform: translateY(0);
}

/* KPI Cards */
.kpi-card {
    background: var(--card-bg);
    border: 1px solid rgba(13, 148, 136, 0.05);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
    height: 100%;
    position: relative;
    overflow: hidden;
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: rgba(13, 148, 136, 0.2);
}

.kpi-card .card-body {
    padding: 1.5rem;
    position: relative;
    z-index: 1;
}

.kpi-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

/* Decorative stripes for cards */
.kpi-strip {
    height: 4px;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.kpi-strip-primary {
    background-color: var(--primary-color);
}

/* Teal */
.kpi-strip-success {
    background-color: var(--success-color);
}

/* Light Green */
.kpi-strip-warning {
    background-color: var(--warning-color);
}

/* Yellow */
.kpi-strip-info {
    background-color: #38bdf8;
}

/* Keep blue for info if needed, or change to lighter teal */
.kpi-strip-dark {
    background-color: #475569;
}

/* Filters */
.filter-section {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    padding: 1.25rem;
}

.form-select,
.form-control {
    border-color: #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.9rem;
}

.form-select:focus,
.form-control:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Charts */
.chart-container {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    height: 400px;
    position: relative;
}

/* Table */
.table-container {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 0;
    overflow: hidden;
    margin-bottom: 2rem;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background-color: #f9fafb;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 1.5rem;
    cursor: pointer;
    user-select: none;
}

.table thead th:hover {
    background-color: #f3f4f6;
    color: #111827;
}

.table tbody td {
    padding: 1rem 1.5rem;
    vertical-align: middle;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.9rem;
    color: #374151;
}

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

.table tbody tr:hover {
    background-color: #f9fafb;
}

/* Badges */
.badge-final {
    background-color: #def7ec;
    color: #03543f;
    padding: 0.35em 0.8em;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.75rem;
}

.badge-pending {
    background-color: #fef3c7;
    color: #92400e;
    padding: 0.35em 0.8em;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.75rem;
}

/* Pagination */
.pagination-container {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
}

.page-btn {
    border: 1px solid #e5e7eb;
    background: white;
    color: #374151;
    padding: 0.4rem 0.8rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: var(--transition-fast);
}

.page-btn:hover:not(:disabled) {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
    display: inline-block;
}

.skeleton-text {
    height: 1rem;
    width: 60%;
    margin-top: 0.5rem;
}

.skeleton-number {
    height: 2.5rem;
    width: 40%;
    margin-top: 0.5rem;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Alert */
#alert-container {
    position: fixed;
    top: 5rem;
    right: 1.5rem;
    z-index: 1050;
    max-width: 400px;
}