:root {
    /* CHANGE: Strong Black (Pure) */
    --primary: #000000;
    
    /* Dark gray for hover interactions */
    --secondary: #333333;
    
    /* Functional Colors */
    --accent: #e67e22;     /* Orange highlight */
    --bg: #f4f6f7;         /* Page background */
    --white: #ffffff;
    --success: #27ae60;    /* Green */
    --warning: #f1c40f;    /* Yellow */
    --danger: #c0392b;     /* Red */
    --text: #333333;       /* General text color */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text);
    padding-bottom: 80px; /* Space for fixed footer */
}

/* --- HEADER --- */
header {
    background-color: var(--primary); /* Strong black */
    color: var(--white);
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3); /* Stronger shadow */
    position: sticky;
    top: 0;
    z-index: 100;
}

/* --- MAIN LAYOUT --- */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    flex-direction: column; 
    gap: 2rem;
}

/* --- FORM (CARD) --- */
.card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.card h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--bg);
    padding-bottom: 0.5rem;
}

.input-group {
    margin-bottom: 1rem;
}

.row {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
}

.col {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #555;
}

input, select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border 0.3s;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent);
}

/* Main Button */
button#btnAdd {
    width: 100%;
    padding: 14px;
    background-color: var(--primary); /* Strong black */
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

button#btnAdd:hover {
    background-color: var(--secondary); /* Dark gray on hover */
}

/* --- STOCK LIST --- */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

ul#stockList {
    list-style: none;
}

.stock-item {
    background: var(--white);
    padding: 1rem;
    margin-bottom: 10px;
    border-radius: 8px;
    border-left: 6px solid var(--success); /* Default green border */
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Important for mobile */
    gap: 10px;
}

/* Status Colors (Alerts) */
.stock-item.low {
    border-left-color: var(--warning);
    background-color: #fffcf0;
}

.stock-item.critical {
    border-left-color: var(--danger);
    background-color: #fff5f5;
}

.item-info h4 {
    font-size: 1.1rem;
    color: var(--primary);
}

.item-info span {
    font-size: 0.85rem;
    color: lab(10.38% 0.48 0.17); /* Neutral gray tone */
    background: #eee;
    padding: 2px 6px;
    border-radius: 4px;
}

.item-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qty-badge {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary);
    margin-right: 10px;
}

.qty-badge small {
    font-size: 0.8rem;
    font-weight: normal;
    color: #0a0a0a;
}

.btn-move {
    background: var(--accent);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
}

.btn-del {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.btn-del:hover {
    opacity: 1;
    color: var(--danger);
}

/* --- MODAL (POP-UP WINDOW) --- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7); /* Darker background */
    backdrop-filter: blur(2px);
    justify-content: center;
    align-items: center;
    z-index: 200;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    animation: slideUp 0.3s;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.big-input {
    font-size: 1.5rem;
    text-align: center;
    margin: 1.5rem 0;
    padding: 10px;
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
}

.btn-in, .btn-out {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: bold;
    cursor: pointer;
}

.btn-in { background: var(--success); } /* Green for stock entry */
.btn-out { background: var(--danger); } /* Red for stock exit */

.btn-close {
    background: transparent;
    border: 1px solid #ddd;
    padding: 8px;
    width: 100%;
    cursor: pointer;
    border-radius: 6px;
    color: hsl(0, 3%, 8%);
}

.btn-close:hover {
    background-color: #f0f0f0;
    color: #000;
}

/* --- FOOTER (STATUS BAR) --- */
.status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    text-align: center;
    font-weight: bold;
    color: white;
    background: var(--primary); /* Strong black */
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 100;
}

/* --- RESPONSIVENESS (TABLET & LAPTOP) --- */
@media (min-width: 1024px) {
    .main-container {
        display: grid;
        grid-template-columns: 350px 1fr; /* Fixed left column, flexible right */
        align-items: start;
    }
    
    /* Keeps form section sticky while scrolling */
    .form-section {
        position: sticky;
        top: 100px; 
    }
}
