
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');
:root {
    --primary-purple: #4B00B3; /* Main purple from the design */
    --light-gray: #f8f9fa;
    --text-dark: #333;
    --text-muted-light: #6c757d;
    --input-border: #ced4da;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


 body {
      font-family: 'Poppins', sans-serif;
      background-color: #f8f9fa;
    }

    .vh-100 {
    min-height: 100vh;
}

/* --- Left Panel --- */
.purple-panel {
    background-color: var(--primary-purple);
}

.logo {
    font-weight: 700;
    font-size: 1.5rem; /* 24px */
}

/* --- Right Panel (Login Form) --- */
.login-form {
    width: 100%;
    max-width: 400px;
    padding: 1.5rem;
}

.form-title {
    color: var(--primary-purple);
    font-weight: 700;
    font-size: 1.1rem; /* 18px */
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.form-label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem; /* 14px */
}

.form-control {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    border: 1px solid var(--input-border);
    border-radius: 0.5rem; /* 8px - slightly more rounded */
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 0.25rem rgba(75, 0, 179, 0.25);
}

.forgot-link {
    color: var(--text-muted-light);
    font-size: 0.8rem; /* 13px */
    text-decoration: none;
}

.forgot-link:hover {
    color: var(--primary-purple);
    text-decoration: underline;
}

.btn-login {
    background-color: var(--primary-purple);
    color: white;
    padding: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    border-radius: 0.5rem; /* 8px */
    transition: background-color 0.2s ease;
}

.btn-login:hover {
    background-color: #3a008a; /* A slightly darker purple */
    color: white;
}

/* On small screens, the form takes up more space */
@media (max-width: 767.98px) {
    .login-form {
        max-width: 100%;
        padding: 1.5rem;
    }
}

    /* Sidebar styling */
    .sidebar {
      min-height: 100vh;
      background-color: #49029F;
      color: white;
    }

    .sidebar .nav-link {
      color: rgba(255, 255, 255, 0.8);
      font-weight: 500;
      border-radius: 0.375rem;
      margin: 4px 0;
    }

    .sidebar .nav-link:hover,
    .sidebar .nav-link.active {
      color: #fff;
      border: 1px solid #fff;
      background-color: rgba(255, 255, 255, 0.1);
    }

    .sidebar .nav-link i {
      width: 20px;
    }

    .brand {
      font-size: 1.25rem;
      font-weight: 600;
      letter-spacing: 0.5px;
    }

     .rounded-4 {
            border-radius: 1rem !important;
        }

        /* --- Top Navigation --- */
        .search-bar .form-control {
            border-left: 0;
            box-shadow: none;
        }
        .search-bar .input-group-text {
            background-color: white;
            border-right: 0;
        }
        .search-bar .input-group {
            border: 1px solid #dee2e6;
            border-radius: 2rem; /* .rounded-pill */
            overflow: hidden;
            box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
        }
        .profile-pic {
            width: 40px;
            height: 40px;
            object-fit: cover;
        }
        .icon-bell {
            font-size: 1.25rem;
            color: #6c757d;
        }

        /* --- Stat Cards --- */
        .stat-card-icon {
            width: 50px;
            height: 50px;
            display: grid;
            place-items: center;
            border-radius: 0.75rem; /* rounded-3 */
        }
        .stat-card-icon svg {
            width: 24px;
            height: 24px;
        }
        
        /* Icon Colors */
        .bg-orange-light {
            background-color: #fff0e1;
            color: #ff8c1a;
        }
        .bg-green-light {
            background-color: #e6f8f0;
            color: #00b371;
        }
        .bg-blue-light {
            background-color: #e7f0ff;
            color: #4d8fff;
        }
        .bg-purple-light {
            background-color: #f3e7ff;
            color: #8e4dff;
        }

        /* --- Growth Chart Card --- */
        .chart-container {
            width: 100%;
            overflow: hidden;
        }
        .chart-line {
            fill: none;
            stroke: #8e4dff;
            stroke-width: 3;
            stroke-linecap: round;
            stroke-linejoin: round;
        }
        .chart-dots {
            fill: #8e4dff;
            stroke: white;
            stroke-width: 2;
        }
        .x-axis-labels text {
            font-size: 12px;
            fill: #6c757d;
            text-anchor: middle;
        }

        /* --- Calendar Card --- */
        .calendar-table {
            table-layout: fixed;
        }
        .calendar-table thead th {
            font-weight: 500;
            font-size: 0.8rem;
            color: #adb5bd; /* Lighter text for day names */
            padding-bottom: 0.75rem;
        }
        .calendar-table td {
            font-size: 0.9rem;
            font-weight: 500;
            padding: 0.25rem;
            height: 38px;
            vertical-align: middle;
        }
        .date-active {
            background-color: #ff8c1a;
            color: white;
            border-radius: 50%;
            width: 34px;
            height: 34px;
            display: inline-grid;
            place-items: center;
            line-height: 1;
        }

        /* --- Statistics Donut Chart --- */
        .donut-chart-container {
            position: relative;
            display: grid;
            place-items: center;
            margin: 1.5rem 0;
        }
        .donut-chart {
            width: 160px;
            height: 160px;
            border-radius: 50%;
            /* 70% purple, 30% grey */
            background: conic-gradient(#8e4dff 0% 70%, #f1f3f5 70% 100%);
        }
        .donut-chart-center {
            position: absolute;
            width: 120px;
            height: 120px;
            background: white;
            border-radius: 50%;
            display: grid;
            place-items: center;
            text-align: center;
            line-height: 1.2;
        }
        .donut-chart-center .percentage {
            font-size: 1.75rem;
            font-weight: 700;
            color: #8e4dff;
            display: block;
        }
        .donut-chart-center .label {
            font-size: 0.9rem;
            font-weight: 500;
            color: #6c757d;
        }

        /* Legend */
        .legend-dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            display: inline-block;
            margin-right: 8px;
        }
        .dot-profit {
            background-color: #8e4dff;
        }
        .dot-expense {
            background-color: #f1f3f5;
        }
        .legend-text {
            font-size: 0.9rem;
            font-weight: 500;
            color: #6c757d;
        }
        .legend-value {
            font-weight: 600;
            color: #212529;
        }

        /* --- Loading Spinner for Proceed Button --- */
        #btnProceed {
            position: relative;
            transition: all 0.3s ease;
        }
        
        #btnProceed:disabled {
            opacity: 0.8;
            cursor: not-allowed;
        }
        
        #proceedSpinner {
            margin-left: 8px;
            animation: spin 1s linear infinite;
        }
        
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        
        #proceedBtnText {
            display: inline-block;
            transition: all 0.3s ease;
        }

        /* --- Responsive Design Fixes --- */
        
        /* Mobile sidebar improvements */
        @media (max-width: 768px) {
            .sidebar {
                min-height: auto;
                position: fixed;
                top: 0;
                left: 0;
                z-index: 1050;
                transform: translateX(-100%);
                transition: transform 0.3s ease;
                width: 280px;
            }
            
            .sidebar.show {
                transform: translateX(0);
            }
            
            .sidebar-overlay {
                position: fixed;
                top: 0;
                left: 0;
                width: 100%;
                height: 100%;
                background: rgba(0,0,0,0.5);
                z-index: 1049;
                display: none;
            }
            
            .sidebar-overlay.show {
                display: block;
            }
            
            /* Main content adjustments */
            .container-fluid > .row {
                margin: 0;
            }
            
            .col.py-3 {
                padding-left: 15px !important;
                padding-right: 15px !important;
            }
            
            /* Header adjustments */
            header.d-flex {
                flex-direction: column;
                gap: 1rem;
                align-items: stretch !important;
            }
            
            .search-bar {
                width: 100%;
                margin-right: 0 !important;
                margin-bottom: 0.5rem;
            }
            
            /* Show search bar on mobile */
            .search-bar.d-none {
                display: block !important;
            }
            
            /* Stat cards responsive */
            .row.g-4.mb-4 > .col-md-6 {
                margin-bottom: 1rem;
            }
            
            /* Chart container responsive */
            .chart-container svg {
                width: 100%;
                height: auto;
                max-height: 300px;
            }
            
            /* Calendar responsive */
            .calendar-table {
                font-size: 0.8rem;
            }
            
            .calendar-table td {
                height: 30px;
                padding: 0.15rem;
            }
            
            .date-active {
                width: 28px;
                height: 28px;
            }
            
            /* Donut chart responsive */
            .donut-chart {
                width: 140px;
                height: 140px;
            }
            
            .donut-chart-center {
                width: 100px;
                height: 100px;
            }
            
            .donut-chart-center .percentage {
                font-size: 1.5rem;
            }
            
            /* Table responsive */
            .table-responsive {
                margin: 0 -15px;
                padding: 0 15px;
            }
            
            /* Customer/Item/Order sections */
            .d-flex.justify-content-between {
                flex-direction: column;
                gap: 1rem;
            }
            
            .d-flex.gap-2 {
                flex-direction: column;
                width: 100%;
            }
            
            .d-flex.gap-2 input {
                width: 100%;
            }
            
            /* Order form responsive */
            .row.g-3 > div,
            .row.g-3.mt-4 > div {
                margin-bottom: 1rem;
            }
            
            /* Modal responsive */
            .modal-dialog {
                margin: 0.5rem;
            }
            
            /* Mobile menu toggle button */
            .mobile-menu-toggle {
                position: fixed;
                top: 1rem;
                left: 1rem;
                z-index: 1051;
                background: #49029F;
                color: white;
                border: none;
                border-radius: 0.375rem;
                padding: 0.5rem;
                box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            }
        }
        
        /* Tablet adjustments */
        @media (max-width: 992px) and (min-width: 769px) {
            .sidebar {
                width: 80px;
            }
            
            .sidebar .brand,
            .sidebar .nav-link span,
            .sidebar .dropdown span {
                display: none !important;
            }
            
            .sidebar .nav-link {
                justify-content: center;
                padding-left: 0.5rem;
                padding-right: 0.5rem;
            }
            
            .sidebar .dropdown {
                text-align: center;
            }
            
            .col-md-3.col-xl-2 {
                flex: 0 0 80px;
                max-width: 80px;
            }
            
            .col-lg-8,
            .col-lg-4 {
                flex: 0 0 100%;
                max-width: 100%;
            }
        }
        
        /* Small mobile adjustments */
        @media (max-width: 576px) {
            .stat-card-icon {
                width: 40px;
                height: 40px;
            }
            
            .stat-card-icon i {
                font-size: 1rem;
            }
            
            .card .h4 {
                font-size: 1.25rem;
            }
            
            .donut-chart {
                width: 120px;
                height: 120px;
            }
            
            .donut-chart-center {
                width: 80px;
                height: 80px;
            }
            
            .donut-chart-center .percentage {
                font-size: 1.25rem;
            }
            
            .calendar-table {
                font-size: 0.7rem;
            }
            
            .calendar-table td {
                height: 25px;
                padding: 0.1rem;
            }
            
            .date-active {
                width: 24px;
                height: 24px;
            }
        }
        
        /* Ensure proper word wrapping */
        .text-wrap {
            word-wrap: break-word;
            overflow-wrap: break-word;
        }
        
        /* Improve touch targets on mobile */
        @media (max-width: 768px) {
            .nav-link,
            .btn,
            .dropdown-item {
                min-height: 44px;
                display: flex;
                align-items: center;
            }
            
            .table .btn {
                min-height: auto;
                padding: 0.25rem 0.5rem;
                font-size: 0.875rem;
            }
        }
        
        /* Additional responsive utilities */
        .overflow-hidden {
            overflow: hidden !important;
        }
        
        /* Fix for chart SVG scaling */
        .chart-container svg {
            max-width: 100%;
            height: auto;
            display: block;
        }
        
        /* Chart container improvements */
        .chart-container {
            position: relative;
            overflow: hidden;
        }
        
        @media (max-width: 768px) {
            .chart-container {
                margin: 0 -1rem;
                padding: 0 1rem;
            }
        }
        
        /* Improve table scrolling on mobile */
        .table-responsive {
            border: 1px solid #dee2e6;
            border-radius: 0.375rem;
        }
        
        /* Better spacing for mobile forms */
        @media (max-width: 768px) {
            .form-control,
            .form-select {
                font-size: 16px; /* Prevents zoom on iOS */
            }
            
            .modal-body {
                padding: 1rem;
            }
            
            .card {
                margin-bottom: 1rem;
            }
        }
        
        /* Ensure proper column stacking */
        @media (max-width: 768px) {
            .row > [class*="col-"] {
                padding-left: 0.75rem;
                padding-right: 0.75rem;
            }
            
            .g-4 {
                --bs-gutter-x: 1rem;
                --bs-gutter-y: 1rem;
            }
        }
        
        /* Fix for very small screens */
        @media (max-width: 360px) {
            .mobile-menu-toggle {
                top: 0.5rem;
                left: 0.5rem;
            }
            
            .container-fluid > .row > .col.py-3 {
                padding-top: 0.5rem !important;
                padding-bottom: 0.5rem !important;
            }
            
            .h1, .h3, h1, h3 {
                font-size: 1.5rem;
            }
            
            .h4, h4 {
                font-size: 1.25rem;
            }
        }
        
        /* Modal improvements for mobile */
        @media (max-width: 768px) {
            .modal-dialog {
                margin: 0.5rem;
                max-width: calc(100% - 1rem);
            }
            
            .modal-content {
                border-radius: 0.5rem;
            }
            
            .modal-header {
                padding: 1rem;
            }
            
            .modal-body {
                padding: 1rem;
            }
            
            .modal-footer {
                padding: 1rem;
                flex-wrap: wrap;
                gap: 0.5rem;
            }
        }
        
        /* Form improvements for mobile */
        @media (max-width: 768px) {
            .form-label {
                font-size: 0.875rem;
                margin-bottom: 0.25rem;
            }
            
            .form-control,
            .form-select {
                padding: 0.5rem;
                font-size: 16px;
            }
            
            .btn {
                padding: 0.5rem 1rem;
                font-size: 0.875rem;
            }
            
            .btn-lg {
                padding: 0.75rem 1.25rem;
                font-size: 1rem;
            }
        }
        
        /* Loading spinner improvements */
        .spinner-border {
            width: 1rem;
            height: 1rem;
            border-width: 0.15em;
        }
        
        @media (max-width: 768px) {
            .spinner-border {
                width: 0.875rem;
                height: 0.875rem;
            }
        }