/* General Body & Theme Styles */
html {
    box-sizing: border-box;
}
*, *:before, *:after {
    box-sizing: inherit;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f0f4f8;
    color: #333;
    margin: 0;
    padding: 1rem;
    line-height: 1.6;
}
.container {
    max-width: 960px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
h1, h2 {
    color: #004d40; /* Dark Teal */
    margin-top: 0;
    margin-bottom: 1rem;
}
a {
    color: #00796b; /* Teal */
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}
button, input[type="submit"], .button-link {
    background-color: #00796b; /* Teal */
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: background-color 0.2s;
    display: inline-block;
    width: auto;
    overflow: hidden; 
    text-align: center;
}
button:hover, input[type="submit"]:hover, .button-link:hover {
    background-color: #004d40; /* Darker Teal */
    color: white;
    text-decoration: none;
}
input[type="text"],
input[type="password"],
input[type="number"],
input[type="file"],
select {
    width: 100%;
    padding: 10px;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 1rem;
}
.table-wrapper {
    overflow-x: auto;
    width: 100%;
}
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
}
th, td {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: left;
    vertical-align: middle;
}
th {
    background-color: #e0f2f1; /* Light Teal */
    color: #004d40; /* Dark Teal */
}
tbody tr:nth-child(even) {
    background-color: #f7f9fa;
}
.login-container {
    max-width: 400px;
    margin: 5rem auto;
    padding: 2rem;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}
.login-logo {
    max-width: 150px;
    margin-bottom: 1.5rem;
}
.login-container h1 {
    margin-bottom: 1.5rem;
}
.login-container input[type="submit"] {
    width: 100%;
}
.flash-message, .flash-success, .flash-error {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 5px;
    border: 1px solid transparent;
    text-align: center;
}
.flash-message, .flash-error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}
.flash-success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}
.actions a {
    margin-right: 10px;
}
.search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 1.5rem;
}
.search-form input {
    margin-bottom: 0;
}
.filter-form-container {
    display: flex;
    flex-wrap: wrap; /* Allow items to wrap to the next line */
    gap: 10px;
    align-items: center;
    margin-bottom: 1.5rem;
}
.filter-form-container input,
.filter-form-container select {
    flex-grow: 1; /* Allow inputs and selects to grow */
    margin-bottom: 0;
    min-width: 150px; /* Give a minimum width */
}
.filter-form-container button {
    flex-shrink: 0; /* Prevent button from shrinking */
}

@media (max-width: 768px) {
    body {
        padding: 0.5rem;
    }
    .container, .login-container {
        margin: 1rem auto;
        padding: 1rem;
    }
    h1 {
        font-size: 1.5rem;
    }
    button, input[type="submit"], .button-link {
        width: 100%;
        padding: 14px;
    }
    .filter-form-container {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-form-container input, 
    .filter-form-container select, 
    .filter-form-container button {
        width: 100%;
        margin-bottom: 10px;
    }
    /* Styles to make table fit on mobile */
    table {
        min-width: 600px; /* Set a minimum width for the table */
    }
    th, td {
        padding: 8px 5px;
        font-size: 0.9rem; /* Slightly larger font */
        white-space: nowrap; /* Prevent text from wrapping */
    }
    td:first-child {
        white-space: normal; /* Allow the first column (item name) to wrap if needed */
    }
    td button {
        width: auto;
        padding: 8px 10px;
        font-size: 0.8rem;
    }
}
