body {
    font-family: -apple-system, BlinkMacSystemFont, "Karla", sans-serif, "Apple Color Emoji";
    background-color: #f8f9fa;
    color: #212529;
    margin: 0;
    padding: 2rem;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h2 {
    text-align: center;
    color: #343a40;
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

h2 img {
    width: 300px;
    height: 100px;
}

.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
}

.dark-mode h2 {
    color: #ffffff;
}

.filter-container {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
    margin-bottom: 2.5rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    background-color: rgba(255, 255, 255, 0.6);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
    backdrop-filter: blur(12px) saturate(150%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
}

.dark-mode .filter-container {
    border-color: rgba(255, 255, 255, 0.1);
    background-color: rgba(28, 28, 30, 0.65);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.filter-container label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
    display: block;
}

.dark-mode .filter-container label {
    color: #a0a0a0;
}

select,
input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    font-size: 1rem;
    background-color: rgba(248, 249, 250, 0.8);
    border: 1px solid #ced4da;
    border-radius: 8px;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dark-mode select,
.dark-mode input[type="text"] {
    background-color: rgba(44, 44, 46, 0.8);
    color: #e0e0e0;
    border-color: #444;
}

select {
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Cpath%20d%3D%22M5%208l5%205%205-5z%22%20fill%3D%22%236c757d%22/%3E%3C/svg%3E');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 1.1em;
}

.dark-mode select {
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Cpath%20d%3D%22M5%208l5%205%205-5z%22%20fill%3D%22%239e9e9e%22/%3E%3C/svg%3E');
}

select:focus,
input[type="text"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.table-container {
    overflow-x: auto;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
}

.dark-mode .table-container {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    position: sticky;
    top: 0;
    z-index: 5;
}

th {
    color: #343a40;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 16px 20px;
    text-align: left;
    background-color: rgba(255, 255, 255, 0.6);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
    backdrop-filter: blur(12px) saturate(150%);
}

.dark-mode th {
    color: #a0a0a0;
    border-bottom-color: rgba(255, 255, 255, 0.15);
    background-color: rgba(28, 28, 30, 0.65);
}

td {
    padding: 16px 20px;
    background-color: #ffffff;
    border-bottom: 1px solid #dee2e6;
}

.dark-mode td {
    background-color: #1e1e1e;
    border-bottom: 1px solid #333;
}

tr:last-child td {
    border-bottom: 0;
}

tr {
    transition: background-color 0.2s ease;
}

tr:hover td {
    background-color: #f1f3f5;
}

.dark-mode tr:hover td {
    background-color: #2a2a2a;
}

td {
    vertical-align: middle;
}

.status-cell {
    text-align: center;
    vertical-align: middle;
}

.status-cell span {
    display: inline-block;
    padding: 0.4em 0.8em;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 999px;
    min-width: 110px;
    box-sizing: border-box;
}

.inStock span { background-color: #6ff3b8; color: #1e6946; }
.outOfStock span { background-color: #f78787; color: #842029; }
.noNewRequests span { background-color: #fce084; color: #664d03; }
.comingSoon span { background-color: #cfe2ff; color: #084298; }


.dark-mode .inStock span { background-color: #0f5132; color: #d1e7dd; }
.dark-mode .outOfStock span { background-color: #842029; color: #f8d7da; }
.dark-mode .noNewRequests span { background-color: #664d03; color: #fff3cd; }
.dark-mode .comingSoon span { background-color: #084298; color: #cfe2ff; }

.mode-toggle {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    z-index: 20;
}

@media (max-width: 768px) {
    body { padding: 1rem; }
    .mode-toggle { top: 1rem; right: 1rem; }
}

th.sortable {
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s;
}

th.sortable:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.dark-mode th.sortable:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sort-icon::after {
    content: '↕';
    font-size: 0.8em;
    margin-left: 5px;
    opacity: 0.3;
}

th.sort-asc .sort-icon::after {
    content: '↑';
    opacity: 1;
}

th.sort-desc .sort-icon::after {
    content: '↓';
    opacity: 1;
}