/* Content Area */
.content-wrapper {
    padding: 2.25rem;
}

.page-header {
    margin-bottom: 2.25rem;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--text-dark);
    margin-bottom: 0.625rem;
    letter-spacing: -1px;
}

.page-subtitle {
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 400;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 1.75rem;
    margin-bottom: 2.25rem;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    border: 2px solid var(--border);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: var(--primary);
}

.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(220, 38, 38, 0.15);
    border-color: var(--primary);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.stat-title {
    font-size: 0.875rem;
    color: var(--text);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    padding: 8px;
    overflow: hidden;
    background: #ffffff;
}

.stat-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.stat-card.primary .stat-icon {
    background: #ffffff;
}

.stat-card.success .stat-icon {
    background: #ffffff;
}

.stat-card.warning .stat-icon {
    background: #ffffff;
}

.stat-card.danger .stat-icon {
    background: #ffffff;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--text-dark);
    margin-bottom: 0.625rem;
    letter-spacing: -1.5px;
}

.stat-change {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.9rem;
    font-weight: 700;
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--danger);
}

/* Charts Section */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.75rem;
    margin-bottom: 2.25rem;
}

.chart-card {
    background: white;
    border-radius: 20px;
    padding: 24px;
    border: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    background-image: linear-gradient(to right bottom, #ffffff, #f8fafc);
    transition: transform 0.2s, box-shadow 0.2s;
}

.chart-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
}

.chart-card canvas {
    touch-action: pan-y;
    display: block;
}

.chart-container {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.chart-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #1e293b;
}

/* Quick Actions */
.quick-actions {
    margin-bottom: 2.25rem;
}

.quick-actions-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
}

.quick-actions-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.quick-action-tile {
    flex: 1;
    min-width: 200px;
    background: white;
    padding: 30px 24px;
    border-radius: 20px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid #f8fafc;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    cursor: pointer;
    text-decoration: none;
    display: block;
}

.quick-action-tile i {
    font-size: 2rem;
    margin-bottom: 20px;
    display: inline-block;
    background: -webkit-linear-gradient(45deg, #f59e0b, #ef4444);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: transform 0.3s;
}

.quick-action-tile h4 {
    margin: 0;
    color: #334155;
    font-size: 1rem;
    font-weight: 700;
}

.quick-action-tile:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.06);
}

.quick-action-tile:hover i {
    transform: scale(1.2) rotate(5deg);
}

/* Recent Activity */
.activity-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 2px solid var(--border);
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1.125rem;
    padding: 1.25rem 0;
    border-bottom: 2px solid var(--border);
    transition: all 0.2s ease;
}

.activity-item:hover {
    background: var(--light);
    margin: 0 -2rem;
    padding-left: 2rem;
    padding-right: 2rem;
    border-radius: 12px;
}

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

.activity-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.activity-icon.success {
    background: linear-gradient(135deg, var(--success) 0%, #f87171 100%);
}

.activity-icon.warning {
    background: linear-gradient(135deg, var(--warning) 0%, #fbbf24 100%);
}

.activity-icon.danger {
    background: linear-gradient(135deg, var(--danger) 0%, #fb7185 100%);
}

.activity-icon.info {
    background: linear-gradient(135deg, var(--info) 0%, #f87171 100%);
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.375rem;
    font-size: 0.95rem;
}

.activity-time {
    font-size: 0.8rem;
    color: var(--text);
}

/* Responsive */
@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {

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

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

    .content-wrapper {
        padding: 1.5rem;
    }
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

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

/* Design 62: Circle Progress Card (Design G) */
/* Design 62: Circle Progress Card (Design G) */
/* --- DESIGN 1: Reference (Clean White with Ring) --- */
.card-d1 {
    background: white;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
    min-height: 160px;
    /* Kept from previous design for consistency */
}

.card-d1:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.d1-ring {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    position: relative;
    flex-shrink: 0;
}

.d1-ring::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 4px solid currentColor;
    opacity: 0.2;
}

.d1-ring::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 4px solid currentColor;
    border-right-color: transparent;
    border-bottom-color: transparent;
    transform: rotate(-45deg);
}

.d1-content {
    flex: 1;
}

.d1-content h3 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text-dark);
}

.d1-content p {
    margin: 4px 0 0 0;
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
}

.d1-change {
    font-size: 0.8rem;
    margin-top: 5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.d1-change.positive {
    color: #10b981;
}

.d1-change.negative {
    color: #ef4444;
}

.d1-change.neutral {
    color: #94a3b8;
}

/* Loading Overlay */
.page-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
    color: #333;
}

.logo-container {
    margin-bottom: 3rem;
}

.logo-container img {
    max-width: 200px;
    height: auto;
}

/* Modern Spinner */
.modern-spinner {
    position: relative;
    width: 60px;
    height: 60px;
    margin: 0 auto 2rem auto;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top: 3px solid #dc3545;
    border-radius: 50%;
    animation: spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.spinner-ring:nth-child(1) {
    animation-delay: -0.45s;
    border-top-color: #dc3545;
}

.spinner-ring:nth-child(2) {
    animation-delay: -0.3s;
    border-top-color: #28a745;
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
}

.spinner-ring:nth-child(3) {
    animation-delay: -0.15s;
    border-top-color: #007bff;
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
}

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

    100% {
        transform: rotate(360deg);
    }
}

.loading-content h4 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 0.5rem;
    font-weight: 600;
}