/* Modern CS Reset and Base Styles */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary: #7c3aed;
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;
    --info: #0891b2;
    --light: #f8fafc;
    --dark: #1e293b;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --border-radius: 8px;
    --border-radius-sm: 6px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--gray-50);
    min-height: 100vh;
    font-size: 14px;
}

.container {
    max-width: 80%;
    margin: 0 auto;
    padding: 0 20px;
}

/* Professional Header Styles */
header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0 1rem 0 1rem;
    width: 100%;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: var(--transition);
}

.logo:hover {
    transform: translateY(-1px);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    box-shadow: var(--shadow);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.025em;
    display: block;
}

.logo-text span {
    /* background: linear-gradient(135deg, var(--primary), var(--secondary)); */
    -webkit-background-clip: text;
    /* -webkit-text-fill-color: transparent; */
    background-clip: text;
}

/* Professional Navigation */
nav {
    display: flex;
    align-items: center;
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 4px;
    background: var(--gray-50);
    padding: 4px;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--gray-200);
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    color: var(--gray-600);
    text-decoration: none;
    padding: 10px 16px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
}

.nav-menu a:hover {
    color: var(--primary);
    background: white;
    box-shadow: var(--shadow-sm);
}

.nav-menu a.active {
    color: var(--primary) !important;
    background: white !important;
    box-shadow: var(--shadow) !important;
    font-weight: 600 !important;
}

.nav-menu a.active::before {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 16px;
    right: 16px;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
}

.hamburger span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--gray-700);
    border-radius: 1px;
    transition: var(--transition);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Navigation */

/* Mobile Navigation */
@media (max-width: 1024px) {
    .hamburger {
        display: flex;
        flex-shrink: 0;
        position: absolute;
        z-index: 1002;
        right: 1rem;
    }

    nav {
        position: static;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        box-sizing: border-box;

        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;

        padding: 1rem;
        margin: 0;
        background: white;
        border-radius: 0;
        border: none;
        border-top: 1px solid var(--gray-200);
        box-shadow: var(--shadow-lg);

        transform: translateY(-10px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;

        transition:
            opacity 0.25s ease,
            transform 0.25s ease,
            visibility 0.25s ease;

        z-index: 1001;
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu a {
        display: flex;
        width: 100%;
        box-sizing: border-box;
        padding: 12px 16px;
        border-radius: var(--border-radius);
        justify-content: flex-start;
    }

    .nav-menu a.active::before {
        left: 0;
        right: auto;
        width: 3px;
        height: 100%;
        bottom: 0;
    }
}

/* @media (max-width: 1024px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 1rem;
        border-radius: 0;
        border: none;
        border-top: 1px solid var(--gray-200);
        box-shadow: var(--shadow-lg);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: var(--transition-slow);
        z-index: 999;
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu a {
        padding: 12px 16px;
        border-radius: var(--border-radius);
        justify-content: flex-start;
    }

    .nav-menu a.active::before {
        left: 0;
        right: auto;
        width: 3px;
        height: 100%;
        bottom: 0;
    }
} */
    
/* Main Content Area */
main {
    padding: 2rem 0;
    min-height: calc(100vh - 120px);
}

/* Professional Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 0;
}

.page-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.page-title i {
    color: var(--primary);
    font-size: 1.5rem;
}

.page-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Enhanced Card Styles */
.card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.card-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header h3 i {
    color: var(--primary);
}

/* Professional Dashboard Stats */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius);
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-icon.warning {
    background: linear-gradient(135deg, var(--warning), #ea580c);
}

.stat-icon.success {
    background: linear-gradient(135deg, var(--success), #16a34a);
}

.stat-icon.danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
}

.stat-info {
    flex: 1;
}

.stat-info h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
    line-height: 1;
}

.stat-info p {
    color: var(--gray-600);
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0;
}

.stat-trend {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: var(--border-radius-sm);
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.trend-up {
    background: rgba(5, 150, 105, 0.1);
    color: var(--success);
}

.trend-down {
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger);
}

/* Professional Table Styles */
.table-container {
    background: white;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.table-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
}

.table-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.table-search {
    position: relative;
    min-width: 250px;
}

.table-search input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    background: white;
}

.table-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

table th {
    background: var(--gray-50);
    padding: 1rem 1.5rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray-700);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
}

table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.9rem;
    color: var(--gray-700);
}

table tr:last-child td {
    border-bottom: none;
}

table tr:hover {
    background: var(--gray-50);
}

/* Status Badges */
.status-badge {
    padding: 4px 8px;
    border-radius: var(--border-radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-active {
    background: rgba(5, 150, 105, 0.1);
    color: var(--success);
}

.status-warning {
    background: rgba(217, 119, 6, 0.1);
    color: var(--warning);
}

.status-danger {
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger);
}

/* Professional Button Styles */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-200);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-info {
    background: var(--info);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-icon {
    padding: 8px;
    width: 32px;
    height: 32px;
    justify-content: center;
}

/* Actions Column */
.actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

/* Professional Form Styles */
.form-group {
    margin-bottom: 1.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--gray-700);
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    transition: var(--transition);
    background: white;
    color: var(--gray-800);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
    font-family: inherit;
}

.form-actions {
    display: flex;
    /* gap: 12px; */
    justify-content: space-between;
    margin: 2rem;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

/* Professional Alert Styles */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    font-weight: 500;
    border-left: 4px solid transparent;
    background: white;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.alert-success {
    border-left-color: var(--success);
    background: rgba(5, 150, 105, 0.05);
}

.alert-danger {
    border-left-color: var(--danger);
    background: rgba(220, 38, 38, 0.05);
}

.alert-warning {
    border-left-color: var(--warning);
    background: rgba(217, 119, 6, 0.05);
}

/* Professional Modal Styles */
.modal {
    display: none;
    position: absolute;
    z-index: 2000;
    left: 0;
    top: 0;
    min-width: 100%;
    min-height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    padding: 1% auto ;
    position:static;
    background: white;
    margin: 5% auto;
    border-radius: var(--border-radius-lg);
    max-width: 80%;
    /* max-width: 500px; */
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
}

.close {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-500);
    transition: var(--transition);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius);
}

.close:hover {
    color: var(--gray-700);
    background: var(--gray-100);
}

.modal-body {
    padding: 1.5rem;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .header-content {
        padding: 0.75rem 0;
    }

    .logo-text {
        font-size: 1.25rem;
    }

    .page-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .page-actions {
        width: 100%;
        justify-content: space-between;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .table-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .table-actions {
        width: 100%;
        justify-content: space-between;
    }

    .table-search {
        min-width: auto;
        flex: 1;
    }

    table {
        font-size: 0.8rem;
    }

    table th,
    table td {
        padding: 0.75rem 1rem;
    }

    .card {
        padding: 1.25rem;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
}

/* Utility Classes */
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--gray-500); }

.bg-success { background: var(--success); }
.bg-danger { background: var(--danger); }
.bg-warning { background: var(--warning); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

/* Loading Animation */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 0px;
}

::-webkit-scrollbar-track {
    /* background: var(--gray-100); */
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: transparent;
    /* background: var(--gray-400); */
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: transparent;
    /* background: var(--gray-500); */
}


/* UPDATES */
/* Add to existing style.css */
/* .active {
    background-color: #007bff !important;
    color: white !important;
} */

.invoice-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.invoice-header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #333;
    padding-bottom: 20px;
}

.invoice-details {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 30px;
    justify-items: space-between;
}

.customer-details, .invoice-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
}

.product-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.product-table th,
.product-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.product-table th {
    background-color: #f8f9fa;
}

.low-opacity {
    opacity: 0.6;
}

.invoice-summary {
    margin-top: 30px;
    text-align: right;
}

.summary-table {
    width: 300px;
    margin-left: auto;
    border-collapse: collapse;
}

.summary-table td {
    padding: 8px;
    border-bottom: 1px solid #ddd;
}

.summary-table tr:last-child {
    font-weight: bold;
    border-top: 2px solid #333;
}

.print-btn {
    justify-content: space-between;
    text-align: center;
    margin-top: 30px;
}

@media print {
    body * {
        visibility: hidden;
    }
    .invoice-container, .invoice-container * {
        visibility: visible;
    }
    .invoice-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    .no-print {
        display: none !important;
    }
}

.form-section {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
}

.form-section h3 {
    margin-bottom: 15px;
    color: #333;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
}

.product-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
    gap: 10px;
    align-items: end;
    margin-bottom: 10px;
}

.remove-product {
    background: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
}

/* Search Box */
.search-box {
    margin-bottom: 20px;
}

.search-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-form input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.search-form button {
    padding: 10px 15px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.summary-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    color: #666;
}

.summary-card .amount {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0;
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
        font-size: 12pt;
    }
    
    .container {
        max-width: none;
        margin: 0;
        padding: 0;
    }
    
    table {
        page-break-inside: auto;
    }
    
    tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }
}