* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    min-height: 100vh;
    background: linear-gradient(45deg, #4b6cb7, #182848);
}

.dashboard-container {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    margin-bottom: 20px;
}

.header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 20px;
}

.logo {
    height: 40px;
}

#logoutBtn {
    padding: 8px 16px;
    background-color: #4b6cb7;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#logoutBtn:hover {
    background-color: #182848;
}

main {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 20px;
}

h2 {
    color: #333;
    margin-bottom: 20px;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

th {
    background-color: #4b6cb7;
    color: white;
    font-weight: 600;
}

.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.sortable:hover {
    background-color: #3a5a9f;
}

.sort-icon {
    font-size: 0.8em;
    margin-left: 5px;
    opacity: 0.7;
}

tr:nth-child(even) {
    background-color: #f8f9fa;
}

tr:hover {
    background-color: #f2f2f2;
}

td:nth-child(2) {
    font-weight: 600;
    color: #4b6cb7;
}

td:last-child {
    color: #666;
}

td:nth-child(5) {
    text-align: right;
    font-family: monospace;
    font-size: 14px;
    color: #2c5282;
    font-weight: 600;
}

th:nth-child(5) {
    text-align: right;
}

/* Checkbox styling */
input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    border: 2px solid #4b6cb7;
    border-radius: 3px;
}

input[type="checkbox"]:checked {
    background-color: #4b6cb7;
    border-color: #4b6cb7;
}

th:first-child {
    width: 40px;
    text-align: center;
}

td:first-child {
    text-align: center;
}

/* Filters styling */
.filters {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 250px;
    display: flex;
    gap: 10px;
}

.search-box input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.search-box input:focus {
    border-color: #4b6cb7;
    outline: none;
}

.search-box button {
    padding: 8px 16px;
    background-color: #4b6cb7;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-box button:hover {
    background-color: #3a5a9f;
}

.category-filter select {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    min-width: 200px;
    cursor: pointer;
    background-color: white;
    transition: border-color 0.3s;
}

.category-filter select:focus {
    border-color: #4b6cb7;
    outline: none;
}

.date-filter {
    display: flex;
    gap: 10px;
    align-items: center;
}

.date-filter input[type="date"] {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    background-color: white;
    transition: border-color 0.3s;
}

.date-filter input[type="date"]:focus {
    border-color: #4b6cb7;
    outline: none;
}

.date-filter button {
    padding: 8px 16px;
    background-color: #4b6cb7;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.date-filter button:hover {
    background-color: #3a5a9f;
}

/* Hide rows when filtered */
tr.hidden {
    display: none;
}

/* Row highlighting */
tr.selected {
    background-color: #e8f5e9 !important; /* Light green color */
}

tr.selected:hover {
    background-color: #c8e6c9 !important; /* Slightly darker green on hover */
}

.table-section {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 20px;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.print-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: #4b6cb7;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.print-button:hover {
    background-color: #3a5a9f;
}

.print-button svg {
    width: 20px;
    height: 20px;
}

.button-group {
    display: flex;
    gap: 10px;
}

.price-tag-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: #4b6cb7;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.price-tag-button:hover {
    background-color: #3a5a9f;
}

.price-tag-button svg {
    width: 20px;
    height: 20px;
}

.generate-tags-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: #4b6cb7;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.generate-tags-btn:hover {
    background-color: #3a5a9f;
}

.generate-tags-btn svg {
    width: 20px;
    height: 20px;
}

.table-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.return-button {
    background-color: transparent;
    color: #4CAF50;
    width: 40px;
    height: 40px;
    border: 2px solid #4CAF50;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
}

.return-button:hover {
    background-color: #4CAF50;
    color: white;
    transform: scale(1.05);
}

.return-button i {
    line-height: 1;
}

/* Product image styles */
.product-image {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.product-image:hover {
    transform: scale(2.5);
    z-index: 100;
}

/* Image placeholder */
.image-placeholder {
    width: 40px;
    height: 40px;
    background-color: #f0f0f0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #999;
}

/* Loader styles */
.loader-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.loader {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-radius: 50%;
    border-top: 5px solid #3498db;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-container.show {
    display: flex;
}

/* Error message styles */
.error-message {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #ff5252;
    color: white;
    padding: 15px 25px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 1001;
    animation: slideIn 0.3s ease-out;
}

.error-message.show {
    display: block;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
        padding: 0;
        margin: 0;
    }

    header, 
    .filters, 
    .print-button,
    #logoutBtn,
    input[type="checkbox"],
    th:first-child,
    td:first-child {
        display: none;
    }

    .table-section {
        background: white;
        padding: 0;
        margin: 0;
    }

    .table-header h2 {
        text-align: center;
        margin-bottom: 20px;
    }

    table {
        width: 100%;
        border-collapse: collapse;
        box-shadow: none;
    }

    th {
        background-color: white !important;
        color: black;
        border-bottom: 2px solid #333;
    }

    td {
        border-bottom: 1px solid #ddd;
    }

    tr:nth-child(even) {
        background-color: #f8f9fa !important;
    }
}
