/* --- Reset and Base Styles --- */
:root {
    --primary-color: #007bff;
    --primary-hover-color: #0056b3;
    --sidebar-bg: #2c3e50; /* Darker sidebar */
    --sidebar-text-color: #ecf0f1;
    --sidebar-link-hover-bg: #34495e;
    --sidebar-link-active-bg: #007bff; /* var(--primary-color); */
    --content-bg: #f4f7f6; /* Lighter content background */
    --text-color: #333;
    --border-color: #e0e0e0;
    --sidebar-width: 260px;
    --sidebar-width-collapsed: 60px; /* Width when collapsed for icons only */
    --header-height: 60px;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background-color: var(--content-bg);
    color: var(--text-color);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

.page-container {
    display: flex;
    flex-grow: 1;
    transition: margin-left 0.3s ease-in-out; /* For when sidebar state changes on desktop */
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
    transition: width 0.3s ease-in-out, transform 0.3s ease-in-out;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-header {
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid #4a627a;
}

.logo-container-sidebar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 40px; /* Ensure space even if no monogram */
}

.sidebar-monogram {
    max-height: 40px;
    transition: opacity 0.3s ease;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.4em;
    font-weight: 600;
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.2s ease 0.1s, transform 0.3s ease-in-out;
}

.sidebar-nav {
    flex-grow: 1;
}

.sidebar-nav ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav ul li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    text-decoration: none;
    color: var(--sidebar-text-color);
    white-space: nowrap;
    transition: background-color 0.2s ease, padding-left 0.3s ease, color 0.2s ease;
}

.sidebar-nav ul li a i {
    margin-right: 12px;
    font-size: 1.1em;
    width: 20px;
    text-align: center;
    transition: margin-right 0.3s ease, font-size 0.3s ease;
}

.sidebar-nav ul li a:hover {
    background-color: var(--sidebar-link-hover-bg);
    /* color: #fff; /* Optional: slightly brighter text on hover */
}

/* Active link styling */
.sidebar-nav ul li.active a {
    background-color: var(--sidebar-link-active-bg);
    color: #fff; /* White text on active primary color background */
    font-weight: 600;
    border-left: 3px solid #f39c12; /* Accent border */
    padding-left: 17px; /* Original padding 20px - 3px border */
}

.menu-divider hr {
    border: 0;
    height: 1px;
    background-color: #4a627a;
    margin: 10px 20px;
}

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid #4a627a;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 1;
    transition: opacity 0.2s ease 0.1s;
}
.sidebar-footer i {
    margin-right: 8px;
}

/* --- Collapsed Sidebar Styles (Desktop Icon-Only View) --- */
.sidebar.collapsed {
    width: var(--sidebar-width-collapsed);
}

.sidebar.collapsed .sidebar-header h3,
.sidebar.collapsed .sidebar-nav ul li a span, /* Assumes text is wrapped in <span> */
.sidebar.collapsed .sidebar-footer {
    opacity: 0;
    width: 0;
    overflow: hidden;
    pointer-events: none; /* Prevent interaction with hidden text parts */
    white-space: nowrap;
}

.sidebar.collapsed .sidebar-header {
    /* Optional: Adjust padding if needed when collapsed, or rely on logo-container behavior */
}
.sidebar.collapsed .logo-container-sidebar {
    justify-content: center; /* Ensure logo is centered */
}
.sidebar.collapsed .sidebar-header h3 {
    transform: translateX(-200%); /* Ensure text is far off-screen */
}

.sidebar.collapsed .sidebar-nav ul li a {
    justify-content: center; /* Center icon */
    padding: 12px 0; /* Remove side padding */
    /* Ensure pointer-events are re-enabled for the link itself if parent elements disable them */
    pointer-events: auto;
}
.sidebar.collapsed .sidebar-nav ul li a i {
    margin-right: 0; /* No margin for icon when text is hidden */
    font-size: 1.3em; /* Slightly larger icons */
}

/* Active link styling when collapsed */
.sidebar.collapsed .sidebar-nav ul li.active a {
    padding-left: 0; /* No padding adjustment needed */
    border-left: none; /* Remove border, or make it top/bottom if preferred */
    /* Optionally, a different visual cue for active icon */
}
.sidebar.collapsed .sidebar-nav ul li.active a i {
    color: #f39c12; /* Highlight icon color for active link */
}


/* --- Main Content Area --- */
.main-content {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s ease-in-out;
}

.page-container.sidebar-collapsed .main-content { /* When sidebar is collapsed on desktop */
    margin-left: var(--sidebar-width-collapsed);
}

.main-header {
    background-color: #fff;
    padding: 0 20px;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between; /* Key for distributing items */
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 900;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.5em;
    color: var(--text-color);
    cursor: pointer;
    margin-right: 15px; /* Space between toggle and app-info */
    padding: 5px;
    flex-shrink: 0; /* Prevent toggle from shrinking */
}

.header-app-info {
    display: flex;
    align-items: center;
    gap: 8px;
    /* This will be on the left, next to the toggle */
}
.header-main-monogram {
    max-height: 30px;
}
.header-app-name {
    font-size: 1.1em;
    font-weight: 500;
    color: var(--text-color);
}

.page-title-header {
    flex-grow: 1; /* Allow it to take up space */
    text-align: center; /* Center the H1 within this container */
    /* Or margin-left: 20px; margin-right: auto; as you had if you prefer left align after app-info */
}
.page-title-header h1 {
    font-size: 1.3em;
    margin: 0;
    color: var(--text-color);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* This was for on-screen address/phone. If not used, can be removed. */
.company-screen-details {
    font-size: 0.8em;
    color: #666;
    text-align: right;
    flex-shrink: 0; /* Prevent shrinking if used */
}

.content-area {
    padding: 25px;
    flex-grow: 1;
    background-color: var(--content-bg);
}

.main-footer {
    text-align: center;
    padding: 15px;
    background: #fff;
    border-top: 1px solid var(--border-color);
    font-size: 0.9em;
    color: #777;
}

/* --- Flashes --- */
.flashes {
    list-style-type: none;
    padding: 0;
    margin-bottom: 20px;
}
.flashes li {
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 5px;
    border: 1px solid transparent;
}
.flashes li.success { background-color: #d4edda; color: #155724; border-color: #c3e6cb; }
.flashes li.error   { background-color: #f8d7da; color: #721c24; border-color: #f5c6cb; }
.flashes li.info    { background-color: #d1ecf1; color: #0c5460; border-color: #bee5eb; }
.flashes li.warning { background-color: #fff3cd; color: #856404; border-color: #ffeeba; }

/* --- Forms, Tables, Buttons --- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
th, td {
    border: 1px solid var(--border-color);
    padding: 10px 12px;
    text-align: left;
}
th {
    background-color: #f8f9fa;
    font-weight: 600;
}

form div {
    margin-bottom: 15px;
}
label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}
input[type="text"], input[type="password"], input[type="number"], input[type="date"], input[type="email"], textarea, select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1em;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input[type="text"]:focus, input[type="password"]:focus, input[type="number"]:focus, input[type="date"]:focus, input[type="email"]:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

button, .button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 18px;
    text-decoration: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: background-color 0.2s ease;
    display: inline-flex; /* For icon alignment within button */
    align-items: center;
    gap: 8px; /* Space between icon and text in button */
}
button:hover, .button:hover {
    background: var(--primary-hover-color);
}
.button-small {
    padding: 6px 12px;
    font-size: 0.9em;
    gap: 5px;
}
/* Removed .button i { margin-right: 5px; } - using gap on button instead */

.link-button {
    background: none!important;
    border: none;
    padding: 0!important;
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
    font-size: 1em;
    font-family: inherit;
}
.link-button:hover {
    color: var(--primary-hover-color);
    text-decoration: underline;
}
.delete-button { color: #dc3545; }
.delete-button:hover { color: #c82333; }

/* --- Dashboard Specific Styles --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}
.summary-card { /* Base card style, also used by .chart-container and .list-section */
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.07);
    display: flex; /* Added for better internal alignment if needed */
    flex-direction: column; /* Stack title and content */
}
.summary-card h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
    font-size: 1.1em;
    font-weight: 600;
    flex-shrink: 0; /* Prevent title from shrinking */
}
.summary-card p.detail-value {
    font-size: 1.8em;
    color: var(--primary-color);
    margin: 5px 0 10px 0;
    font-weight: bold;
}
.summary-card .detail {
    font-size: 0.9em;
    color: #6c757d;
}

.chart-container { /* Specifics for chart cards if any, inherits .summary-card */
    height: 380px; /* Fixed height for chart card, includes title */
}
.chart-container canvas {
    flex-grow: 1; /* Canvas takes available space after title */
    max-width: 100%;
    max-height: 100%; /* Respect parent's flex distribution */
}

.list-section { /* Specifics for list cards, inherits .summary-card */
    /* No specific height, determined by content */
}
.list-section table {
    font-size: 0.9em;
    box-shadow: none;
    border: none;
    margin-bottom: 0; /* Table itself has no bottom margin within card */
    flex-grow: 1; /* If table is the main content of the card */
}
.list-section table th, .list-section table td {
    padding: 8px 10px;
    border-left: none;
    border-right: none;
    border-bottom: 1px solid var(--border-color); /* Separator for rows */
    border-top: none;
}
.list-section table thead th {
    border-bottom: 2px solid var(--border-color); /* Stronger separator for header */
}
.list-section table tbody tr:last-child td {
    border-bottom: none;
}

.negative-balance { color: #dc3545; font-weight: bold; }
.positive-balance { color: #28a745; font-weight: bold; }

/* --- Print Styles --- */
/* Default screen style for elements only meant for print */
.print-header, .print-footer {
    display: none;
}

@media print {
    body {
        font-family: 'Times New Roman', Times, serif; font-size: 13pt;
        color: black; background-color: white;
        margin: 15mm; width: auto; display: block;
    }
    .page-container { 
        display: block; 
        width: 210mm; /* A4 width */
        min-height: 297mm; /* A4 height */
        padding: 15mm;
        margin: 0 auto;
        box-sizing: border-box;
        display: block; 
    
    }

    .sidebar, .main-header, .main-footer.no-print, .flashes,
    button, .button, .sidebar-toggle, .report-actions, /* Added .report-actions here */
    .no-print {
        display: none !important;
    }

    .main-content { margin-left: 0 !important; min-height: auto; }
    .content-area { padding: 0; }
    .report-container { border: none; padding: 0; }

    .print-header { /* This is for REPORT print headers */
        display: block !important; width: 100%; text-align: center;
        margin-bottom: 10mm; page-break-after: auto;
    }
    .print-header img.monogram { max-height: 60px; margin-bottom: 0mm; } /* Slightly smaller monogram */
    .print-header h2 { font-size: 14pt; font-weight: bold; margin: 5px 0; }
    .print-header h3 { font-size: 12pt; font-weight: bold; margin: 4px 0; }
    .print-header p { font-size: 10pt; margin: 3px 0; }
    .print-header hr { border-top: 1px solid #666; margin: 5mm 0; }

    table { width: 100%; font-size: 12pt; border-collapse: collapse; page-break-inside: auto; }
    tr { page-break-inside: avoid; page-break-after: auto; }
    th, td { border: 1px solid #666 !important; padding: 4px; overflow-wrap: break-word; }
    th { background-color: #eee !important; font-weight: bold; }
    td[style*="text-align:right"] { text-align: right !important; }

    .print-footer { /* This is for REPORT print footers */
        display: block !important; position: fixed;
        bottom: 10mm; left: 15mm; right: 15mm;
        width: calc(100% - 30mm); text-align: center;
        font-size: 8pt; border-top: 1px solid #ccc; padding-top: 3mm;
    }

    a, a:visited { text-decoration: none !important; color: inherit !important; }
    a[href]::after { content: "" !important; } /* Avoid printing URLs for internal links */
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%); /* Initially hidden */
        box-shadow: 3px 0 15px rgba(0,0,0,0.2); /* Shadow when it slides in */
    }
    .sidebar.collapsed { /* On mobile, .collapsed means "visible and full width" */
        transform: translateX(0);
        width: var(--sidebar-width); /* Full width */
    }

    /* Ensure text and elements are visible when sidebar is 'collapsed' (shown) on mobile */
    .sidebar.collapsed .sidebar-header h3,
    .sidebar.collapsed .sidebar-nav ul li a span,
    .sidebar.collapsed .sidebar-footer {
        opacity: 1;
        width: auto; /* Allow natural width */
        overflow: visible;
        pointer-events: auto;
        transform: translateX(0); /* Reset any desktop collapse transforms */
    }
    .sidebar.collapsed .logo-container-sidebar { justify-content: flex-start; }
    .sidebar.collapsed .sidebar-nav ul li a {
        justify-content: flex-start; /* Align text to start */
        padding: 12px 20px; /* Restore original padding */
    }
    .sidebar.collapsed .sidebar-nav ul li a i {
        margin-right: 12px; /* Restore margin */
        font-size: 1.1em; /* Restore icon size */
    }
    .sidebar.collapsed .sidebar-nav ul li.active a {
        /* Ensure active styles for mobile are clear */
        border-left: 3px solid #f39c12;
        padding-left: 17px;
    }
    .sidebar.collapsed .sidebar-nav ul li.active a i {
        color: var(--sidebar-text-color); /* Reset icon color unless specifically overridden */
    }


    .main-content {
        margin-left: 0 !important; /* Full width when sidebar is hidden (default mobile state) */
    }
    .page-container.sidebar-collapsed .main-content {
        /* On mobile, when sidebar is shown, main content does NOT get a margin.
           The sidebar overlays or pushes content if not handled by JS to add a class for that.
           For simplicity, sidebar will overlay. If push is desired, JS needs to add a class to .page-container
           that applies a margin-left to .main-content equal to var(--sidebar-width).
           Current JS toggles .sidebar-collapsed on .page-container, which is used for desktop.
           We could add specific logic for mobile if needed.
        */
    }

    .dashboard-grid { grid-template-columns: 1fr; } /* Stack cards */
    .content-area { padding: 15px; }
    .page-title-header h1 { font-size: 1.2em; } /* Slightly smaller for mobile */
    .header-app-name { font-size: 1em; }
}
.form-grid-2col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Responsive 2-column */
    gap: 15px 20px; /* row-gap column-gap */
}
.filter-form {
    /* ... existing styles like background, border, padding ... */
    display: flex; /* Use flexbox for alignment */
    flex-wrap: wrap; /* Allow items to wrap on smaller screens */
    gap: 15px; /* Space between filter items */
    align-items: flex-end; /* Align items to the bottom (useful if labels make some taller) */
    margin-bottom: 20px; /* Space below filter form */
}

.filter-form div { /* If you wrapped each label-input pair in a div */
    display: flex;
    flex-direction: column; /* Stack label on top of input */
    margin-bottom: 0; /* Remove default div margin if using gap on parent */
}
.filter-form label {
    margin-bottom: 3px; /* Smaller margin for labels in filter */
    font-size: 0.9em;
}
.filter-form input[type="date"],
.filter-form select,
.filter-form input[type="text"] {
    padding: 8px; /* Slightly smaller padding for filter inputs */
    font-size: 0.9em;
    min-width: 150px; /* Give them some minimum width */
}
.filter-form .button, .filter-form .button-small {
    margin-left: 5px; /* Space before buttons if they are not wrapped in their own div */
    margin-top: 8px;
}

.stock-list .item-qty.low-stock { color: orange; } /* Or a different shade of red if preferred */
.stock-list .item-qty.no-stock { color: red; }

.filter-section h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.1em;
    font-weight: 600;
}
.button-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}
.button-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

/* --- Authentication Page Specific Styles --- */
body.auth-page { /* Add this class to <body> in login.html and register.html */
    /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */ /* Example Gradient */
    background: linear-gradient(to right top, #051937, #004d7a, #008793, #00bf72, #a8eb12); /* Another example */
    /* Or a subtle background image: */
    /* background-image: url('../img/auth_background.jpg'); */
    /* background-size: cover; */
    /* background-position: center; */
    display: flex;
    align-items: center; /* Vertically center the card */
    justify-content: center; /* Horizontally center the card */
    min-height: 100vh; /* Ensure it takes full viewport height */
    padding: 20px; /* Padding for smaller screens */
}

.auth-card {
    background-color: rgba(255, 255, 255, 0.95); /* Slightly transparent white */
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 450px; /* Control max width */
    text-align: center; /* Center text and inline elements within card */
}

.auth-card .app-title-auth {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--primary-color); /* Or a darker color from your palette */
    margin-bottom: 5px;
    letter-spacing: -0.5px;
}
.auth-card .app-subtitle-auth {
    font-size: 1em;
    color: #555;
    margin-bottom: 25px;
}


.auth-card h3 { /* Title like "Login" or "Register" */
    font-size: 1.5em;
    color: var(--text-color);
    margin-bottom: 20px;
    font-weight: 600;
}

.auth-card form div {
    margin-bottom: 20px; /* More spacing between form fields */
    text-align: left; /* Align labels and inputs left */
}

.auth-card label {
    font-weight: 500;
    font-size: 0.95em;
    color: #444;
}

.auth-card input[type="text"],
.auth-card input[type="password"],
.auth-card input[type="email"] { /* If you add email */
    background-color: #f7f7f7; /* Slightly off-white background for inputs */
    border: 1px solid #ddd;
    padding: 12px 15px; /* Larger padding */
}
.auth-card input[type="text"]:focus,
.auth-card input[type="password"]:focus {
    background-color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-color-rgb, 0,123,255),.25); /* Use RGB version of primary color for box-shadow */
}


.auth-card .button { /* Main action button */
    width: 100%;
    padding: 12px;
    font-size: 1.1em;
    letter-spacing: 0.5px;
    /* Gradient button example - can be complex */
    /* background-image: linear-gradient(to right, #6a11cb 0%, #2575fc 100%); */
    /* transition: all 0.4s ease; */
    /* background-size: 200% auto; */
}
/* Hover effect for gradient button */
/* .auth-card .button:hover {
    background-position: right center; 
    color: #fff;
    text-decoration: none;
} */


.auth-card .auth-links {
    margin-top: 25px;
    font-size: 0.9em;
}
.auth-card .auth-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}
.auth-card .auth-links a:hover {
    text-decoration: underline;
    color: var(--primary-hover-color);
}

/* For the developer details section */
.developer-details-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 0.85em;
    color: #666;
}
.developer-details-section p {
    margin-bottom: 8px;
}
.developer-details-section button {
    font-size: 0.9em;
    padding: 6px 12px;
    background-color: #6c757d; /* Muted button */
    margin-bottom: 10px;
}
.developer-details-section button:hover {
    background-color: #5a6268;
}
.developer-details-content { /* Initially hidden */
    display: none;
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 6px;
    margin-top: 10px;
    text-align: left; /* Details text align left */
}
.developer-details-content.visible {
    display: block;
}

/* Dynamic Gradient Background on Hover (for the entire page or specific elements) */
/* This is a bit tricky for the whole page body on hover, usually applied to smaller elements */
/* Example for a button if you want a gradient background shift: */
/* .auth-card .button.gradient-hover {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color, #someOtherColor));
    background-size: 200% 200%;
    transition: background-position 0.8s ease-out;
}
.auth-card .button.gradient-hover:hover {
    background-position: 100% 100%;
} */

/* Add --primary-color-rgb to :root for the box-shadow if not already there */
/* :root {
    --primary-color: #007bff;
    --primary-color-rgb: 0,123,255; // Add this
    ...
} */

/* ... At the end of your CSS or in a relevant section ... */
.auth-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 0.85em;
    color: #888; /* Lighter color for footer */
}
.auth-footer p {
    margin-bottom: 5px;
}
.auth-footer .developer-credit {
    font-size: 0.9em; /* Slightly larger for emphasis */
    color: #666;
}
.auth-footer .developer-credit a {
    color: var(--primary-color);
    text-decoration: none;
}
.auth-footer .developer-credit a:hover {
    text-decoration: underline;
    color: var(--primary-hover-color);
}
.auth-card .auth-logo {
    max-height: 60px; /* Adjust as needed */
    max-width: 180px; /* Adjust as needed */
    margin-bottom: 15px;
    display: block; /* If you want it on its own line */
    margin-left: auto; /* Center if block */
    margin-right: auto; /* Center if block */
}

/* --- Dropdown Styles --- */
.dropdown {
    position: relative;
    display: inline-block;
}
.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 4px;
    padding: 5px 0;
}
.dropdown-menu a.dropdown-item {
    color: black;
    padding: 10px 15px;
    text-decoration: none;
    display: block;
    font-size: 0.9em;
}
.dropdown-menu a.dropdown-item:hover {
    background-color: #f1f1f1;
}
.dropdown:hover .dropdown-menu {
    display: block;
}

/* --- Modal Styles --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}
.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px 30px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
    text-align: center;
}
.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}
.close-button:hover, .close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}
.modal-actions {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* --- Styles for Web View vs. Print View --- */

/* ডিফল্টভাবে, শুধুমাত্র web-view দেখা যাবে */
.print-view {
    display: none;
}

@media print {
    /* প্রিন্ট করার সময়, web-view এবং অন্যান্য no-print এলিমেন্ট লুকিয়ে রাখুন */
    .web-view, .no-print, .sidebar, .main-header, .main-footer {
        display: none !important;
    }

    /* প্রিন্ট করার সময়, print-view এবং এর ভেতরের print-header/footer দেখান */
    .print-view {
        display: block !important;
    }
    
    .summary-card {
        border: none;
        box-shadow: none;
        padding: 0;
        margin: 0;
    }

    body, .content-area {
        padding: 0;
        margin: 0;
        background-color: #fff;
    }
    
    /* প্রিন্ট টেবিলের জন্য অতিরিক্ত স্টাইল */
    .print-view table {
        width: 100%;
        font-size: 9pt;
        border-collapse: collapse;
    }
    .print-view th, .print-view td {
        border: 1px solid #333;
        padding: 4px 6px;
    }
    .print-view th {
        background-color: #eee;
    }
    .print-summary-header {
        text-align: center;
        margin-bottom: 10px;
        padding: 5px;
        border: 1px solid #ccc;
        border-radius: 5px;
    }
    .print-summary-header p {
        margin: 2px 0;
        font-size: 1.1em;
    }
}
/* --- Styles for Horizontal Filter Forms --- */
.filter-form.horizontal-filters {
    display: flex;
    flex-wrap: wrap; /* ছোট স্ক্রিনে নিচে নিচে চলে আসবে */
    gap: 15px; /* আইটেমগুলোর মধ্যে ফাঁকা জায়গা */
    align-items: flex-end; /* সব আইটেমকে নিচে অ্যালাইন করবে */
}
.filter-form.horizontal-filters > div {
    flex-grow: 1; /* প্রতিটি ফিল্টারকে জায়গা নিতে সাহায্য করবে */
    min-width: 180px; /* প্রতিটি ফিল্টারের জন্য সর্বনিম্ন প্রস্থ */
}
.filter-form.horizontal-filters .filter-buttons {
    flex-grow: 0;
    min-width: auto;
}
.filter-form.horizontal-filters label {
    font-size: 0.9em;
    margin-bottom: 3px;
}
.filter-form.horizontal-filters input,
.filter-form.horizontal-filters select {
    padding: 8px;
    font-size: 0.9em;
}
.summary-container-row {
    display: flex;
    justify-content: space-between; /* কার্ডগুলোর মধ্যে সমান ফাঁকা জায়গা তৈরি করে */
    gap: 20px; /* কার্ডগুলোর মধ্যে ন্যূনতম ফাঁকা জায়গা */
    margin-bottom: 20px;
}

.summary-card-small {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
    flex-grow: 1; /* প্রতিটি কার্ডকে সমান জায়গা নিতে সাহায্য করে */
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out; /* ট্রানজিশন ইফেক্ট */
}

.summary-card-small:hover {
    transform: translateY(-5px); /* মাউস রাখলে কার্ডটি সামান্য উপরে উঠবে */
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15); /* শ্যাডো আরও স্পষ্ট হবে */
}

.summary-card-small h4 {
    margin: 0 0 10px 0;
    color: #555;
    font-size: 1em;
}

.summary-card-small p {
    margin: 0;
    font-size: 1.8em;
    font-weight: bold;
    color: #333;
}

/* static/css/style.css ফাইলে যোগ করুন */

/* ফিল্টার ফর্মের কন্টেইনার */
.filter-container {
    background-color: #f8f9fa; /* হালকা ধূসর ব্যাকগ্রাউন্ড */
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 1px solid #dee2e6;
}

/* ফর্মটিকে Flexbox দিয়ে এক সারিতে আনা হচ্ছে */
.filter-form-row {
    display: flex;
    flex-wrap: wrap; /* ছোট স্ক্রিনে যেন নিচে নেমে আসে */
    align-items: flex-end; /* সব আইটেমকে নিচে অ্যালাইন করা */
    gap: 20px; /* আইটেমগুলোর মধ্যে ফাঁকা জায়গা */
}

/* প্রতিটি লেবেল এবং ইনপুটের গ্রুপ */
.filter-group {
    display: flex;
    flex-direction: column; /* লেবেল উপরে, ইনপুট নিচে */
}

.filter-group label {
    margin-bottom: 5px;
    font-size: 0.85em;
    font-weight: 600;
    color: #495057;
}

/* ইনপুট এবং সিলেক্ট ফিল্ডের জন্য সাধারণ স্টাইল */
.filter-group input,
.filter-group select {
    padding: 8px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9em;
    min-width: 180px; /* একটি ন্যূনতম প্রস্থ */
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* ইনপুট ফিল্ডে ক্লিক করলে সুন্দর ইফেক্ট */
.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* বাটনগুলোর জন্য আলাদা স্টাইল */
.filter-actions {
    margin-bottom: 2px; /* ইনপুট ফিল্ডের সাথে বাটনগুলোকে সঠিকভাবে অ্যালাইন করার জন্য */
}
/* static/css/style.css ফাইলে যোগ করুন */

/* Create/Edit Invoice Form Styles */
.invoice-header-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.header-item label {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 5px;
}

.header-item p {
    margin: 0;
    font-size: 1.2em;
}

.form-grid-3col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.form-divider {
    border: 0;
    border-top: 1px solid #eee;
    margin: 30px 0;
}

.section-title {
    margin-top: 0;
    margin-bottom: 15px;
}

/* Styled Table for Invoice Items */
.styled-table {
    width: 100%;
    border-collapse: collapse;
}

.styled-table th,
.styled-table td {
    padding: 12px 15px;
    border: 1px solid #ddd;
    text-align: left;
}

.styled-table thead {
    background-color: #f8f9fa;
}

.styled-table tbody tr:nth-of-type(even) {
    background-color: #f9f9f9;
}

.styled-table select,
.styled-table input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.remove-btn {
    background-color: #dc3545 !important;
    color: white;
    border: none;
    padding: 8px 12px;
}

/* Invoice Totals Section */
.invoice-totals {
    float: right;
    width: 100%;
    max-width: 400px;
    margin-top: 20px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.total-row label {
    font-weight: 600;
    color: #555;
}

.total-row input {
    max-width: 120px;
    text-align: right;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.total-row strong {
    font-size: 1.2em;
}

.grand-total {
    font-size: 1.3em;
    font-weight: bold;
    border-top: 2px solid #333;
    border-bottom: none;
    margin-top: 10px;
}

.grand-total strong {
    color: #dc3545;
}

/* Form Actions (Cancel/Submit buttons) */
.form-actions {
    margin-top: 25px;
    text-align: right;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.form-actions .button {
    margin-left: 10px;
}
/* static/css/style.css ফাইলে যোগ করুন */

/* Manage Inventory Page Styles */
.form-inline {
    display: flex;
    align-items: flex-end;
    gap: 15px;
}

.product-type-section {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 25px;
    overflow: hidden; /* ensures child elements respect the border radius */
}

.product-type-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f1f1f1;
    padding: 10px 15px;
    border-bottom: 1px solid #e0e0e0;
}

.product-type-header h4 {
    margin: 0;
    font-size: 1.3em;
}

.product-type-section .styled-table {
    border: none; /* remove outer border as section has it */
}
.stock-info-box {
    background-color: #e7f3fe;
    border-left: 5px solid #2196F3;
    padding: 10px 15px;
    margin-bottom: 15px;
    font-size: 0.9em;
}
.details-box {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 15px;
    margin-top: 15px;
    border-radius: 5px;
    font-size: 0.9em;
}
.details-box p { margin: 0 0 5px 0; }

.product-type-header .header-actions { display: flex; align-items: center; }
