:root {
    --primary-color: #2a776f;
    --primary-dark: #1e554f;
    --primary-light: #3d9b93;
    --secondary-color: #f0f7f6;
    --accent-color: #ff6b6b;
    --text-color: #333;
    --text-light: #ffffff;
    --bg-light: #f8f9fa;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 15px 35px rgba(0, 0, 0, 0.15);
    --border-radius: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --chart-height: 220px;
    --gradient-primary: linear-gradient(135deg, #2a776f 0%, #1e554f 100%);
    --gradient-accent: linear-gradient(135deg, #3d9b93 0%, #2a776f 100%);
    --gradient-success: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-warning: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --gradient-info: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-dark: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

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

body {
    background-color: var(--bg-light);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(42, 119, 111, 0.05) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(61, 155, 147, 0.05) 0%, transparent 20%);
    background-attachment: fixed;
}

/* Loading Animation */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loader {
    width: 60px;
    height: 60px;
    border: 5px solid var(--secondary-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--primary-dark);
}

h1 {
    font-size: 2.5rem;
    letter-spacing: -0.5px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: 1.8rem;
    position: relative;
    padding-bottom: 0.75rem;
    letter-spacing: -0.3px;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

h3 {
    font-size: 1.3rem;
    letter-spacing: -0.2px;
}

/* Header */
header {
    background: var(--gradient-primary);
    color: var(--text-light);
    padding: 1rem 0;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    z-index: 1;
}

header .container {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

header .logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

header .logo-circle {
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

header img {
    width: 35px;
    height: 35px;
}

header h1 {
    color: var(--text-light);
    margin-bottom: 0;
    font-size: 1.8rem;
    background: none;
    -webkit-text-fill-color: white;
}

header p {
    font-size: 0.9rem;
    opacity: 0.9;
    max-width: 300px;
    margin: 0;
    text-align: left;
}

/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: inline-block;
    text-align: center;
    text-decoration: none;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-100%);
    transition: transform 0.5s;
    z-index: -1;
}

.btn:hover::before {
    transform: translateX(0);
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--text-light);
    box-shadow: 0 4px 15px rgba(42, 119, 111, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 20px rgba(42, 119, 111, 0.4);
    color: var(--text-light);
}

.btn-outline-light {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.25);
    color: var(--text-light);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

/* Cards */
.dashboard-card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    overflow: hidden;
    height: 100%;
    position: relative;
    background: white;
    display: flex;
    flex-direction: column;
    padding: 1.2rem;
    border-top: 4px solid transparent;
}

.dashboard-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.dashboard-card a {
    color: inherit;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
}

.dashboard-card h5 {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dashboard-card h3 {
    font-weight: 700;
    margin: 0;
    color: var(--primary-color);
    font-size: 1.6rem;
}

.dashboard-card:nth-child(1) {
    border-top-color: #2a776f;
}

.dashboard-card:nth-child(2) {
    border-top-color: #3d9b93;
}

.dashboard-card:nth-child(3) {
    border-top-color: #4facfe;
}

.dashboard-card:nth-child(4) {
    border-top-color: #43e97b;
}

.dashboard-card:nth-child(5) {
    border-top-color: #667eea;
}

.dashboard-card:nth-child(6) {
    border-top-color: #fa709a;
}

/* Chart Cards */
.chart-card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    overflow: hidden;
    height: 100%;
    position: relative;
    background: white;
    padding: 1rem;
}

.chart-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.chart-card h5 {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
    font-size: 0.9rem;
    position: relative;
    padding-bottom: 0.3rem;
}

.chart-card h5::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.chart-container {
    position: relative;
    height: var(--chart-height);
    width: 100%;
}

/* Tables */
.table-container {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table {
    margin: 0;
    width: 100%;
}

.table thead {
    background: var(--gradient-primary);
    color: var(--text-light);
}

.table thead th {
    padding: 0.8rem;
    font-weight: 600;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.75rem;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:nth-child(even) {
    background-color: var(--secondary-color);
}

.table tbody tr:hover {
    background-color: rgba(42, 119, 111, 0.1);
}

.table tbody td {
    padding: 0.8rem;
    vertical-align: middle;
    border: none;
    font-size: 0.85rem;
}

/* Forms */
.form-control {
    border-radius: 50px;
    border: 1px solid #ddd;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(42, 119, 111, 0.2);
}

/* Login Page */
.login-container {
    max-width: 400px;
    margin: 5rem auto;
    padding: 2rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: var(--gradient-primary);
    border-radius: 50%;
    opacity: 0.1;
}

.login-container .text-center {
    position: relative;
    z-index: 1;
}

.login-container .logo-circle {
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: 0 5px 15px rgba(42, 119, 111, 0.3);
}

.login-container img {
    width: 30px;
    height: 30px;
}

.login-container h2 {
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.login-container .form-label {
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

/* Dashboard Sections */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 charts per row in desktop */
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.dashboard-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-light);
    position: relative;
}

.dashboard-section-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--gradient-primary);
}

/* Options Section */
.options-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* Card Details */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.2rem;
    overflow: hidden;
}

.card-body {
    padding: 1.2rem;
}

.card-title {
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 1rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.card-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

/* Responsive */
@media (max-width: 992px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    header p {
        font-size: 0.8rem;
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .chart-grid {
        grid-template-columns: 1fr; /* 1 chart per row in smaller screens */
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .table thead th {
        padding: 0.6rem 0.4rem;
        font-size: 0.7rem;
    }
    
    .table tbody td {
        padding: 0.6rem 0.4rem;
        font-size: 0.8rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.8rem;
    }
    
    .chart-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        height: 200px;
    }
    
    /* Mobile Header Adjustments */
    header .container {
        flex-direction: column;
        text-align: center;
        padding: 1rem 0;
    }
    
    header .logo-container {
        flex-direction: column;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
    
    header p {
        text-align: center;
        max-width: 100%;
        margin-bottom: 1rem;
    }
    
    header .btn {
        width: 100%;
        max-width: 200px;
    }
}

@media (max-width: 576px) {
    .login-container {
        margin: 2rem 1rem;
        padding: 1.5rem;
    }
    
    header .container {
        padding: 0.5rem 0;
    }
    
    header .logo-circle {
        width: 40px;
        height: 40px;
    }
    
    header img {
        width: 28px;
        height: 28px;
    }
    
    header h1 {
        font-size: 1.3rem;
    }
    
    header p {
        font-size: 0.75rem;
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.8rem;
    }
    
    .dashboard-card h5 {
        font-size: 0.75rem;
    }
    
    .dashboard-card h3 {
        font-size: 1.3rem;
    }
    
    .chart-container {
        height: 180px;
    }
    
    .options-container {
        flex-direction: column;
        align-items: center;
    }
    
    .options-container .btn {
        width: 100%;
        max-width: 300px;
    }
}

/* Premium Login Page Styles */
.input-group-text {
    border-right: none;
    background: white;
}

.input-group .form-control {
    border-left: none;
}

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

.input-group-text:focus {
    border-color: var(--primary-color);
    border-right: none;
}

.alert-danger {
    border-radius: 50px;
    border: none;
    background-color: rgba(42, 119, 111, 0.1);
    color: var(--accent-color);
    padding: 0.6rem 1.2rem;
}

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

.dashboard-card, .chart-card, .table-container, .card {
    animation: fadeIn 0.5s ease-out;
}

/* Glassmorphism effect */
.glass-effect {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Floating action button */
.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    cursor: pointer;
    z-index: 100;
    transition: var(--transition);
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-hover);
}
