/* ZOLD "Prodify" Style - Clean & Pro Theme */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Brand Colors */
    --primary: #6366F1;
    --primary-hover: #4F46E5;
    --primary-light: #E0E7FF;
    --primary-gradient: linear-gradient(135deg, #8B5CF6 0%, #6366F1 100%);

    /* Neutral / Surface */
    --bg-body: #F9FAFB;
    --bg-surface: #FFFFFF;
    --text-main: #111827;
    --text-muted: #6B7280;
    --border-color: #E5E7EB;

    /* Status Colors */
    --status-success: #10B981;
    --status-warning: #F59E0B;
    --status-danger: #EF4444;

    /* Design Tokens */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
    --card-shadow-hover: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);

    --font-main: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-body);
    font-family: var(--font-main);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

/* --- Layout --- */
.main-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.main-content {
    flex: 1;
    /* padding and margin-left are handled by base.html */
}

/* Sidebar Styling */
.sidebar {
    width: 260px;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    padding: 0 0.75rem 2rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-brand img {
    height: 32px;
    width: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 0.25rem;
    text-decoration: none;
}

.nav-link i {
    width: 20px;
    margin-right: 12px;
    font-size: 1.1em;
}

.nav-link:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.nav-link.active {
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 600;
}

/* Sidebar Footer */
.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-profile:hover {
    background-color: var(--bg-body);
}

.avatar {
    width: 36px;
    height: 36px;
    background: var(--primary-gradient);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* --- Components --- */
.btn {
    border-radius: 50px;
    padding: 0.5rem 1rem;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary-gradient);
    border: none;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.3);
    color: white;
}

.btn-primary:hover {
    box-shadow: 0 6px 8px -1px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
    color: white;
}

.btn-light {
    background: #fff;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

.btn-light:hover {
    background: #F9FAFB;
    color: var(--text-main);
}


/* --- Dashboard Target Match Styles --- */

/* 1. Stats Cards Target */
.stat-card-target {
    background: #FFFFFF;
    border: 1px solid #F3F4F6;
    border-radius: 12px;
    padding: 1.5rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    transition: all 0.2s;
}

.stat-card-target:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.stat-content-left {
    display: flex;
    flex-direction: column;
}

.stat-number-target {
    font-size: 1.875rem;
    /* 30px */
    font-weight: 800;
    color: #111827;
    /* Dark almost black */
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.stat-label-target {
    font-size: 0.7rem;
    /* 11px */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6B7280;
    /* Cool Gray */
}

/* Boxed Icons */
.icon-box-target {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.icon-box-target.purple {
    background: #F3E8FF;
    color: #7E22CE;
}

.icon-box-target.blue {
    background: #E0F2FE;
    color: #0284C7;
}

.icon-box-target.yellow {
    background: #FEF3C7;
    color: #D97706;
}

.icon-box-target.green {
    background: #DCFCE7;
    color: #166534;
}

/* 2. Recent Activity Table Styles */
.table-card-target {
    background: #FFFFFF;
    border: 1px solid #F3F4F6;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    overflow: hidden;
}

.table-card-target .card-header {
    background: #fff;
    border-bottom: 1px solid #F3F4F6;
}

.table-card-target .table thead th {
    background-color: #F9FAFB;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    color: #6B7280;
    font-weight: 600;
    border-bottom: 1px solid #E5E7EB;
    padding: 0.75rem 1.5rem;
}

.table-card-target .table tbody td {
    padding: 1rem 1.5rem;
    vertical-align: middle;
    color: #111827;
    border-bottom: 1px solid #F3F4F6;
}

/* Progress Bar */
.progress-slim {
    height: 6px;
    border-radius: 99px;
    background-color: #F3F4F6;
    overflow: hidden;
    width: 100%;
    min-width: 100px;
}

/* Mobile Responsive */
@media (max-width: 991.98px) {
    .main-content {
        padding: 1rem;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }
}/* Collapsible Sidebar Styles */

/* Base transition for smooth toggling */
.sidebar, .main-content {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar .nav-link span,
.sidebar .nav-label,
.sidebar .user-profile span,
.sidebar .user-profile i.fa-chevron-up,
.sidebar .sidebar-brand img,
.sidebar .sidebar-brand .logo-icon {
    transition: all 0.2s ease;
}

/* Collapsed State */
body.sidebar-collapsed .sidebar {
    width: 80px;
    padding: 1.5rem 0.5rem;
}

/* Sidebar collapse logic handled by base.html hover logic */
/* body.sidebar-collapsed .main-content {
    margin-left: 80px;
} */

/* Hide text elements */
body.sidebar-collapsed .sidebar .nav-label,
body.sidebar-collapsed .sidebar .nav-link span,
body.sidebar-collapsed .sidebar .user-profile span,
body.sidebar-collapsed .sidebar .user-profile i.fa-chevron-up,
body.sidebar-collapsed .sidebar .sidebar-brand .logo-full {
    display: none !important;
}

/* Show Icon Logo */
body.sidebar-collapsed .sidebar .sidebar-brand .logo-icon {
    display: block !important;
    margin: 0 auto;
}

/* Center Navigation Icons */
body.sidebar-collapsed .sidebar .nav-link {
    justify-content: center;
    padding: 0.75rem 0;
}

body.sidebar-collapsed .sidebar .nav-link i {
    margin-right: 0;
    font-size: 1.25rem;
}

/* Adjust User Profile */
body.sidebar-collapsed .sidebar .user-profile {
    justify-content: center;
    padding: 0.5rem;
}

body.sidebar-collapsed .sidebar .user-profile .avatar {
    margin: 0;
    width: 40px;
    height: 40px;
}

/* Adjust Sidebar Header */
body.sidebar-collapsed .sidebar-header {
    flex-direction: column;
    gap: 1rem;
    padding: 0 0 1rem 0;
    justify-content: center;
}

body.sidebar-collapsed .sidebar-brand {
    padding: 0;
    justify-content: center;
}

/* Toggle Button Adjustment */
#sidebarCollapseBtn {
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

#sidebarCollapseBtn:hover {
    color: var(--primary);
}

/* Mobile: Collapse state shouldn't affect mobile overlay layout */
@media (max-width: 991.98px) {
    body.sidebar-collapsed .main-content {
        margin-left: 0; /* Reset margin for mobile */
    }
    
    .sidebar {
        width: 260px !important; /* Force full width on mobile when active */
    }
    
    /* Ensure elements are visible on mobile even if body has collapsed class */
    body.sidebar-collapsed .sidebar .nav-label,
    body.sidebar-collapsed .sidebar .nav-link span,
    body.sidebar-collapsed .sidebar .user-profile span,
    body.sidebar-collapsed .sidebar .sidebar-brand .logo-full {
        display: block !important;
    }
    
    body.sidebar-collapsed .sidebar .sidebar-brand .logo-icon {
        display: none !important;
    }
    
    body.sidebar-collapsed .sidebar .nav-link {
        justify-content: flex-start;
        padding: 0.75rem 1rem;
    }
    
    body.sidebar-collapsed .sidebar .nav-link i {
        margin-right: 12px;
    }

    /* Hide desktop collapse button on mobile */
    #sidebarCollapseBtn {
        display: none !important;
    }
}

/* New Collapse Button Positioning */
.collapse-btn-wrapper button {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.collapse-btn-wrapper button:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

/* Collapsed state adjustments for button */
body.sidebar-collapsed .collapse-btn-wrapper {
    text-align: center !important;
    padding-right: 0 !important;
    display: flex;
    justify-content: center;
    margin-bottom: 0.5rem;
}

/* Fix logo icon centering */
body.sidebar-collapsed .sidebar-brand .logo-icon {
    display: block !important;
    margin: 0 auto;
}

/* Improved Sidebar Toggle Button */
.sidebar-toggle-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: white;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
    margin-left: auto; /* Push to right in expanded mode */
}

.sidebar-toggle-btn:hover {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: scale(1.05);
    box-shadow: 0 4px 6px rgba(99, 102, 241, 0.2);
}

.sidebar-toggle-btn:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Ensure centering in collapsed mode */
body.sidebar-collapsed .sidebar-toggle-btn {
    margin: 0 auto;
}

/* Custom Dropup styling */
.sidebar-footer .dropdown-menu .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Dropup Menu Speech Bubble Arrow */
.sidebar-footer .dropup .dropdown-menu {
    overflow: visible; /* Allow arrow to stick out */
    margin-bottom: 12px; /* Space for the arrow */
}

.sidebar-footer .dropup .dropdown-menu::after {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 24px; /* Center with avatar approx */
    border-width: 6px 6px 0;
    border-style: solid;
    border-color: #2D3748 transparent;
    display: block;
    width: 0;
    height: 0;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.1));
}

/* Update Sidebar Toggle to Rounded Square */
.sidebar-toggle-btn {
    border-radius: 8px !important; /* Changed from 50% circle */
    width: 32px;
    height: 32px;
    background-color: white;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.sidebar-toggle-btn:hover {
    background-color: #F3F4F6; /* Light gray hover instead of primary for this style */
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transform: none; /* Removed scale effect for cleaner look */
}

/* Harmonize Sidebar Toggle Button */
.sidebar-toggle-btn {
    color: var(--primary) !important; /* Always show brand color for icon */
    background-color: white;
}

/* Ensure Dropup Arrow is on top */
.sidebar-footer .dropup .dropdown-menu {
    overflow: visible !important;
}

.sidebar-footer .dropup .dropdown-menu::after {
    z-index: 10000;
    /* Ensure border color matches the dark menu exactly */
    border-top-color: #2D3748; 
}

/* Professional Sidebar Footer Polish */

/* Refined Toggle Button */
.sidebar-toggle-btn {
    width: 36px !important; /* Slightly larger for touch */
    height: 36px !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important; /* Softer corners */
    color: var(--primary) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    margin-left: auto;
}

.sidebar-toggle-btn:hover {
    background: #f8fafc !important;
    border-color: var(--primary) !important;
    color: var(--primary) !important;
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.15), 0 4px 6px -2px rgba(99, 102, 241, 0.1) !important;
    transform: translateY(-1px);
}

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

/* Footer Container Spacing */
.sidebar-footer {
    padding: 0 0.5rem;
}

.collapse-btn-wrapper {
    margin-bottom: 0.75rem !important; /* More space between button and profile */
}

/* User Profile Refinement */
.user-profile {
    border-radius: 12px !important; /* Match button radius */
    padding: 0.5rem 0.75rem !important;
    transition: background-color 0.2s ease;
}

.user-profile:hover {
    background-color: #f8fafc;
}

/* Collapsed State Tweaks */
body.sidebar-collapsed .sidebar-toggle-btn {
    margin: 0 auto;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important; /* Slightly stronger shadow when isolated */
}
