/* Reset và base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    color: #333;
    line-height: 1.6;
}

header {
    background-color: #00b8ce;
    color: white;
    padding: 1rem;
    position: relative;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

h1, h2 {
    margin-bottom: 1rem;
}

main {
    padding: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.tabs {
    display: flex;
    margin-bottom: 1rem;
}

.tab-button {
    flex: 1;
    padding: 0.75rem;
    background-color: #e9ecef;
    border: none;
    border-radius: 8px 8px 0 0;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.tab-button.active {
    background-color: white;
    border-bottom: 3px solid #00b8ce;
    font-weight: 600;
    color: #00b8ce;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 184, 206, 0.2);
}

.tab-content {
    display: none;
    background-color: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tab-content.active {
    display: block;
}

.search-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: white;
}

.search-input:focus {
    outline: none;
    border-color: #00b8ce;
    box-shadow: 0 0 0 2px rgba(0, 184, 206, 0.1);
}

/* Filter panel styles */
.filter-panel {
    margin-bottom: 1rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.filter-panel-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s ease;
}

.filter-panel-header:hover {
    background-color: #e9ecef;
}

.filter-panel-icon {
    font-size: 1.2rem;
    margin-right: 0.75rem;
    color: #00b8ce;
}

.filter-panel-title {
    flex: 1;
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

.filter-panel-toggle {
    font-size: 0.8rem;
    color: #666;
    transition: transform 0.3s ease;
}

.filter-panel.collapsed .filter-panel-toggle {
    transform: rotate(-90deg);
}

.filter-panel-content {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.filter-panel.collapsed .filter-panel-content {
    max-height: 0;
}

.filters-container {
    padding: 1rem;
    background-color: #f8f9fa;
}

.filter-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 150px;
    flex: 1;
}

.filter-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #555;
    margin-bottom: 0.25rem;
}

.filter-input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: white;
    box-sizing: border-box;
}

.filter-input:focus {
    outline: none;
    border-color: #00b8ce;
    box-shadow: 0 0 0 2px rgba(0, 184, 206, 0.1);
}

.filter-input[type="text"] {
    width: 100%;
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.apply-btn {
    background-color: #00b8ce;
    color: white;
}

.apply-btn:hover {
    background-color: #0099b3;
}

.clear-btn {
    background-color: #6c757d;
    color: white;
}

.clear-btn:hover {
    background-color: #5a6268;
}

ul {
    list-style: none;
}

.order-item {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.3s;
}

.order-item:hover {
    background-color: #f8f9fa;
}

.order-item:last-child {
    border-bottom: none;
}

.order-info {
    display: flex;
    flex-direction: column;
}

.order-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.order-id {
    font-weight: bold;
    flex: 1;
}

.order-details {
    font-size: 0.9rem;
    color: #666;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.customer-info {
    font-weight: 500;
    color: #333;
    font-size: 0.85rem;
}

.order-meta {
    font-size: 0.8rem;
    color: #666;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 2rem;
}

.action-buttons button {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

#accept-button {
    background-color: #fd7e14;
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(253, 126, 20, 0.3);
}

#accept-button:hover {
    background-color: #e8690b;
    box-shadow: 0 4px 8px rgba(253, 126, 20, 0.4);
}

#start-button {
    background-color: #00b8ce;
    color: white;
}

#start-button:hover {
    background-color: #0099b3;
}

#fail-button {
    background-color: #dc3545;
    color: white;
}

#fail-button:hover {
    background-color: #c82333;
}

#complete-button {
    background-color: #28a745;
    color: white;
}

#complete-button:hover {
    background-color: #218838;
}

#back-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#back-button:hover {
    background-color: #5a6268;
}

.hidden {
    display: none;
}

/* Login page styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f4f4f4;
}

.login-form {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.logo-container {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    max-width: 200px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #00b8ce;
}

.login-btn {
    width: 100%;
    padding: 0.75rem;
    background-color: #00b8ce;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.login-btn:hover {
    background-color: #0099b3;
}

.login-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px; /* Ensure consistent button height */
}

.btn-text {
    transition: opacity 0.3s ease;
}

.spinner {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.login-btn.loading .btn-text {
    opacity: 0;
}

.login-btn.loading .spinner {
    opacity: 1;
}

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

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

#login-message {
    margin-top: 1rem;
    text-align: center;
    font-weight: 500;
}

/* User menu styles */
.user-menu {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.user-info:hover {
    background-color: rgba(255,255,255,0.1);
}

.user-icon {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

.user-name {
    margin-right: 0.5rem;
    font-weight: 500;
}

.dropdown-arrow {
    font-size: 0.8rem;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: none;
    min-width: 150px;
    z-index: 1000;
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
    transition: background-color 0.3s;
}

.dropdown-menu a:hover {
    background-color: #f8f9fa;
}

.dropdown-menu.show {
    display: block;
}

/* New header layout */
.back-btn {
    position: absolute;
    left: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.back-btn:hover {
    background-color: rgba(255,255,255,0.1);
}

.logout-btn {
    position: absolute;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.logout-btn:hover {
    background-color: rgba(255,255,255,0.1);
}

.user-name-center {
    font-size: 1.2rem;
    font-weight: 500;
    text-align: center;
}

/* Skeleton loaders */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-item {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.skeleton-item:last-child {
    border-bottom: none;
}

.skeleton-line {
    height: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    display: inline-block;
    min-width: 2rem;
    vertical-align: middle;
}

.skeleton-line.short {
    width: 4rem;
}

.skeleton-line.medium {
    width: 8rem;
}

.skeleton-line.full {
    width: 12rem;
}

.skeleton .customer-info {
    height: 0.8rem;
    margin-bottom: 0.25rem;
    border-radius: 4px;
    display: block;
}

.skeleton .order-meta {
    height: 0.7rem;
    margin-bottom: 0.25rem;
    border-radius: 4px;
    display: block;
}

.skeleton .order-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.skeleton .label {
    height: 1.2rem;
    width: 4rem;
    border-radius: 12px;
    display: block;
}

.skeleton-details {
    padding: 1rem;
}

.skeleton-details h2 {
    height: 2rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.skeleton-details p {
    height: 1.2rem;
    margin-bottom: 0.75rem;
    border-radius: 4px;
}

.skeleton-details p:last-child {
    width: 70%;
}

/* Label classes */
.label {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
    border: 1px solid transparent;
}

/* Empty message styling */
.empty-message {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
}

.label-default {
    background-color: #6c757d;
    color: white;
}

.label-primary {
    background-color: #00b8ce;
    color: white;
}

.label-success {
    background-color: #28a745;
    color: white;
}

.label-info {
    background-color: #17a2b8;
    color: white;
}

.label-warning {
    background-color: #ffc107;
    color: #212529;
    border-color: #ffc107;
}

.label-danger {
    background-color: #dc3545;
    color: white;
}

.flex {
    display: flex;
}
.align-center{
    align-items: center;
}
.text-uppercase{
    text-transform: uppercase;
}

/* Order details page styles */
.order-detail-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.order-detail-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.customer-section, .order-section, .products-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #00b8ce;
}

.customer-section h3, .order-section h3, .products-section h3 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: #333;
    font-weight: 600;
}

.customer-info-detail {
    margin-bottom: 0.75rem;
}

.customer-info-detail > div {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.address-info {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #555;
}

.order-info-detail > div {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.products-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.product-item {
    padding: 0.75rem;
    background-color: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.product-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.product-details {
    font-size: 0.9rem;
    color: #666;
}

.product-text {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.5;
    white-space: pre-wrap;
}

/* Skeleton styles for order details */
.skeleton-details {
    padding: 1rem;
}

.skeleton-details h2 {
    height: 2rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.skeleton-details h3 {
    height: 1.5rem;
    margin-bottom: 0.75rem;
    border-radius: 4px;
    width: 60%;
}

.skeleton-details p {
    height: 1.2rem;
    margin-bottom: 0.75rem;
    border-radius: 4px;
}

.skeleton-details .customer-info-detail,
.skeleton-details .order-info-detail {
    margin-bottom: 1rem;
}

.skeleton-details .address-info,
.skeleton-details .product-text {
    height: 3rem;
    margin-bottom: 0.75rem;
    border-radius: 4px;
}

.skeleton-details .product-item {
    height: 4rem;
    margin-bottom: 0.75rem;
    border-radius: 4px;
}

/* Mobile responsive */
@media (max-width: 480px) {
    main {
        padding: 0.5rem;
    }

    .tab-button {
        padding: 0.6rem;
        font-size: 0.9rem;
    }

    .tab-button.active {
        border-bottom: 3px solid #00b8ce;
        transform: translateY(-1px);
    }

    .tab-content {
        padding: 0.5rem;
    }

    .order-item {
        padding: 0.75rem;
    }

    .action-buttons {
        flex-direction: column;
        gap: 0.25rem;
    }

    #back-button {
        position: static;
        margin-bottom: 1rem;
        width: 100%;
    }

    .filter-panel-header {
        padding: 0.75rem;
    }

    .filter-panel-title {
        font-size: 0.9rem;
    }

    .filter-panel-icon {
        font-size: 1rem;
        margin-right: 0.5rem;
    }

    .filter-row {
        flex-direction: column;
        gap: 0.75rem;
    }

    .filter-group {
        min-width: auto;
        width: 100%;
    }

    .filter-buttons {
        justify-content: center;
    }

    .filter-btn {
        flex: 1;
        max-width: 120px;
    }

    .order-header {
        align-items: flex-start;
        gap: 0.25rem;
    }

    .customer-info {
        font-size: 0.8rem;
    }

    .order-meta {
        font-size: 0.75rem;
    }

    .order-details {
        gap: 0.2rem;
    }

    /* Order details mobile styles */
    .order-detail-header {
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
    }

    .order-detail-header h2 {
        font-size: 1.3rem;
    }

    .customer-section, .order-section, .products-section {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }

    .customer-section h3, .order-section h3, .products-section h3 {
        font-size: 1rem;
    }

    .product-item {
        padding: 0.5rem;
    }

    .product-name {
        font-size: 0.9rem;
    }

    .product-details {
        font-size: 0.85rem;
    }
}