/* --- Office Theme Variables (Ensure these match your main style) --- */
:root {
    --color-primary-accent: #3498db;   /* Calm Office Blue */
    --color-secondary-accent: #2980b9; /* Slightly darker blue */
    --color-bg-light: #f4f7f9;         /* Very Light Grey Background */
    --color-card-bg: #ffffff;          /* Pure White for card/form/table */
    --color-text-dark: #2c3e50;        /* Deep Navy main text */
    --color-text-light: #7f8c8d;       /* Secondary text */
    --color-input-border: #e0e6ec;     /* Subtle border */
    --color-success: #2ecc71;          /* Green for positive stock/inflow */
    
    --font-family-body: 'Inter', sans-serif;
    --font-family-heading: 'Montserrat', sans-serif;
    --border-radius-sm: 6px;
    --spacing-sm: 12px;
    --spacing-md: 20px;
    --spacing-lg: 30px;
}

body {
    background-color: var(--color-bg-light);
    font-family: var(--font-family-body);
    color: var(--color-text-dark);
    padding: var(--spacing-lg);
}

/* --- Main Headings --- */
h2 {
    font-family: var(--font-family-heading);
    color: var(--color-primary-accent);
    font-size: 2em;
    font-weight: 800;
    margin-bottom: var(--spacing-lg);
    border-bottom: 2px solid var(--color-input-border);
    padding-bottom: var(--spacing-sm);
    display: inline-block;
}

h3 {
    font-family: var(--font-family-body);
    color: var(--color-text-dark);
    font-size: 1.5em;
    font-weight: 700;
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

/* --- Stock In Form --- */
form {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
    padding: var(--spacing-md);
    background-color: var(--color-card-bg);
    border-radius: var(--border-radius-sm);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: var(--spacing-lg);
    max-width: 800px;
}

select,
input[type="number"] {
    padding: var(--spacing-sm);
    border: 1px solid var(--color-input-border);
    border-radius: var(--border-radius-sm);
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
    background-color: #fcfcfc;
}

select {
    flex-grow: 3; /* Product selection is the widest input */
    min-width: 250px;
}

input[type="number"] {
    flex-grow: 1; /* Quantity is narrower */
    max-width: 120px;
    text-align: center;
}

select:focus,
input[type="number"]:focus {
    border-color: var(--color-primary-accent);
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
    background-color: var(--color-card-bg);
}

button[type="submit"] {
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: var(--color-success); /* Use green for 'inflow' action */
    color: var(--color-card-bg); 
    border: none;
    border-radius: var(--border-radius-sm);
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    flex-shrink: 0;
}

button[type="submit"]:hover {
    background-color: #27ae60; /* Darker green on hover */
    transform: translateY(-1px);
}

/* --- Current Stock Table --- */
table {
    width: 100%;
    max-width: 900px;
    border-collapse: collapse;
    background-color: var(--color-card-bg);
    border-radius: var(--border-radius-sm);
    overflow: hidden; 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

table th, table td {
    padding: var(--spacing-sm) var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid #f0f0f0; 
    font-size: 0.95em;
}

/* Table Headers */
table th {
    background-color: var(--color-bg-light); 
    color: var(--color-text-dark);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.5px;
}

/* Table Rows */
table tr:nth-child(even) {
    background-color: #fcfcfc; 
}

table tr:hover {
    background-color: #f0f0f5; 
}

/* Numeric Columns Alignment & Styling */
table td:nth-child(3), /* Current Quantity */
table td:nth-child(4) { /* Total Stock In Quantity */
    text-align: center;
    font-weight: 700;
    width: 15%;
}

table td:nth-child(3) {
    color: var(--color-text-dark); /* Current quantity, standard color */
}

table td:nth-child(4) {
    color: var(--color-success); /* Highlight total stock in with green */
}

table td:nth-child(1) { /* PRO-ID column */
    font-family: 'Courier New', monospace;
    font-weight: 500;
    color: var(--color-primary-accent);
    width: 15%;
}

/* Media Query for smaller screens */
@media (max-width: 768px) {
    body {
        padding: var(--spacing-md);
    }
    
    /* Stack the form elements */
    form {
        flex-direction: column;
        align-items: stretch;
        max-width: 100%;
        padding: var(--spacing-sm);
    }

    select, 
    input[type="number"],
    button[type="submit"] {
        width: 100%;
        margin-bottom: var(--spacing-xs);
        max-width: unset;
    }
    
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        max-width: 100%;
    }
    
    /* Adjust padding for stacked mobile table headers */
    table th, table td {
        padding: var(--spacing-xs) var(--spacing-sm);
    }
}