* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.loading-screen:not(.active) {
    display: none;
}

.loading-container {
    text-align: center;
}

.spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top: 5px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    color: white;
    font-size: 18px;
    font-weight: 500;
}

/* Login Screen */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    color: #333;
    margin-bottom: 10px;
    font-size: 32px;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.form-group input.password-match {
    border-color: #10b981 !important;
}

.form-group input.password-mismatch {
    border-color: #ef4444 !important;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-success {
    background: #10b981;
    color: white;
    width: 100%;
    margin-top: 20px;
}

.btn-success:hover {
    background: #059669;
}

/* Logout button is now styled in navbar section above */

.test-accounts {
    margin-top: 30px;
    padding: 15px;
    background: #f3f4f6;
    border-radius: 8px;
    font-size: 13px;
    color: #666;
}

.test-accounts p {
    margin: 5px 0;
}

.remember-me {
    margin-bottom: 15px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 0;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
}

.checkbox-label span {
    color: #666;
    font-size: 14px;
}

/* Navbar */
.navbar {
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin-right: 28px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-right: 2px solid #f0f0f0;
    padding-right: 28px;
}

.btn-nav {
    background: #f5f5f5;
    color: #333;
    padding: 8px 14px;
    margin: 0 2px;
    border-radius: 6px;
    border: 1px solid #e8e8e8;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.btn-nav:hover {
    background: #efefef;
    border-color: #d0d0d0;
    color: #1a1a1a;
}

.btn-nav.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
    font-weight: 600;
}

.btn-nav.active:hover {
    background: #5568d3;
    border-color: #5568d3;
}

.btn-logout {
    background: #ef4444;
    color: white;
    padding: 8px 16px;
    margin-left: 12px;
    border-radius: 6px;
    border: none;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.btn-logout:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

/* Spacing for user name display */
.nav-right {
    margin-left: auto;
    gap: 20px;
    padding-left: 40px;
    border-left: 1px solid #f0f0f0;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 24px;
}

/* User name in navbar */
#adminName, #adminName2, #adminName3, #adminName4, #adminName5, #adminName6, #adminName7 {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
}

/* Client Order Screen */
.main-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.items-section, .cart-section {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.cart-section {
    position: sticky;
    top: 30px;
    height: fit-content;
}

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

h3 {
    color: #333;
    font-size: 18px;
    margin-bottom: 15px;
}

/* Category Navigation */
.category-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.category-btn {
    padding: 10px 20px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    transition: all 0.3s;
}

.category-btn:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
}

.category-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.items-display {
    min-height: 200px;
}

.category-section {
    margin-bottom: 40px;
}

.category-title {
    color: #667eea;
    font-size: 20px;
    font-weight: bold;
    padding-bottom: 10px;
    border-bottom: 3px solid #667eea;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.category-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.items-grid {
    display: block;
}

.no-items-message {
    text-align: center;
    color: #999;
    padding: 40px;
    font-size: 16px;
}

.item-card {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s;
}

.item-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #667eea;
}

.item-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.item-category {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.item-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
}

.quantity-input-wrapper {
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 300px;
}

.quantity-input {
    width: 60px;
    padding: 8px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    transition: border-color 0.3s;
}

.quantity-input:focus {
    outline: none;
    border-color: #667eea;
}

.quantity-input::-webkit-inner-spin-button,
.quantity-input::-webkit-outer-spin-button {
    opacity: 1;
}

.btn-add {
    background: #667eea;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    flex: 1;
    transition: background 0.3s;
}

.btn-add:hover {
    background: #5568d3;
}

.btn-delete {
    background: #ef4444;
    color: white;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.btn-delete:hover {
    background: #dc2626;
}

/* Cart */
.cart-empty {
    text-align: center;
    color: #999;
    padding: 40px 0;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #e0e0e0;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.cart-item-price {
    font-size: 13px;
    color: #666;
}

.cart-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    background: #e0e0e0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.qty-btn:hover {
    background: #d0d0d0;
}

.btn-remove-item {
    width: 28px;
    height: 28px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.btn-remove-item:hover {
    background: #dc2626;
}

.qty-value {
    width: 30px;
    text-align: center;
    font-weight: 600;
}

.cart-total {
    border-top: 2px solid #e0e0e0;
    padding-top: 20px;
    margin-top: 20px;
}

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

.total-label {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.total-amount {
    font-size: 28px;
    font-weight: bold;
    color: #667eea;
}

/* Admin Screens */
.admin-content {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.admin-header {
    margin-bottom: 30px;
}

.admin-header h2 {
    margin-bottom: 20px;
}

.status-filter {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.status-filter label {
    font-weight: 600;
    color: #333;
    margin-right: 10px;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s;
}

.filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.filter-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.bulk-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-bulk-print {
    background: #10b981;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-bulk-print:hover {
    background: #059669;
}

.btn-bulk-print:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

.admin-items-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
}

.add-item-section, .inventory-section {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.add-item-section {
    height: fit-content;
}

.order-card {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    transition: box-shadow 0.3s;
}

.order-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.order-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-print {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}

.btn-print:hover {
    background: #2563eb;
}

.btn-delete-order {
    background: #ef4444;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}

.btn-delete-order:hover {
    background: #dc2626;
}

.btn-cancel-order {
    background: #ef4444;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-cancel-order:hover {
    background: #dc2626;
}

.order-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.order-info {
    font-size: 13px;
    color: #666;
}

.status-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
}

.status-select {
    padding: 8px 12px;
    border-radius: 20px;
    border: none;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}

.status-pending {
    background: #dbeafe;
    color: #1e40af;
}

.status-in_progress {
    background: #fed7aa;
    color: #c2410c;
}

.status-completed {
    background: #d1fae5;
    color: #065f46;
}

.status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.order-items {
    background: #f9fafb;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.order-items-title {
    font-weight: 600;
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}

.order-item-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #666;
    margin: 5px 0;
}

.order-total {
    text-align: right;
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

/* User Management Styles */
.user-card {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: box-shadow 0.3s;
}

.user-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.user-info {
    flex: 1;
}

.user-name {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.user-username {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.user-location {
    font-size: 13px;
    color: #888;
    margin-bottom: 8px;
}

.user-role {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.role-admin {
    background: #fef3c7;
    color: #92400e;
}

.role-client {
    background: #dbeafe;
    color: #1e40af;
}

.user-actions {
    display: flex;
    gap: 8px;
}

/* Settings Styles */
.settings-section {
    margin-bottom: 30px;
}

.settings-section h3 {
    color: #667eea;
    font-size: 18px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.setting-item {
    background: #f9fafb;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.setting-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    margin-bottom: 0;
}

.setting-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}

.setting-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
}

.setting-description {
    margin-top: 10px;
    margin-left: 32px;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

#newUserRole {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
    background: white;
}

#newUserRole:focus {
    outline: none;
    border-color: #667eea;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content, .admin-items-content {
        grid-template-columns: 1fr;
    }

    .cart-section {
        position: static;
    }
    
    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .category-items {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .category-nav {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .nav-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-left, .nav-right {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .login-box {
        padding: 30px 20px;
    }
    
    .container {
        padding: 20px 15px;
    }
    
    .items-grid {
        grid-template-columns: 1fr;
    }
    
    .category-items {
        grid-template-columns: 1fr;
    }
    
    .status-filter {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .status-filter label {
        margin-bottom: 10px;
    }
}

/* Reports Styles */
.reports-section {
    margin-top: 20px;
}

.report-type-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    padding: 5px;
    background: #f9fafb;
    border-radius: 8px;
    width: fit-content;
}

.report-type-btn {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    transition: all 0.3s;
}

.report-type-btn:hover {
    background: #e5e7eb;
    color: #333;
}

.report-type-btn.active {
    background: #667eea;
    color: white;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.reports-view {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.report-filters {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.report-filters .form-group {
    margin-bottom: 0;
}

.report-filters label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.report-filters select {
    width: 100%;
    max-width: 400px;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
    background: white;
}

.report-filters select:focus {
    outline: none;
    border-color: #667eea;
}

.report-content {
    display: grid;
    gap: 30px;
}

.report-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.report-title {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid #667eea;
}

.chart-container {
    position: relative;
    height: 400px;
    margin-bottom: 20px;
}

.report-summary {
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
}

.report-summary p {
    font-size: 16px;
    color: #333;
    margin-bottom: 15px;
}

.product-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
}

.product-item {
    padding: 10px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    font-size: 14px;
    color: #666;
}

.product-item strong {
    color: #667eea;
    font-size: 16px;
}

.no-report-data {
    background: white;
    padding: 60px 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.no-report-data p {
    font-size: 18px;
    color: #999;
}

.general-report-header {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    text-align: center;
}

.general-report-header h3 {
    font-size: 24px;
    color: #667eea;
    margin-bottom: 10px;
}

.report-subtitle {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.general-report-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.chart-pie {
    height: 500px;
}

@media (max-width: 1200px) {
    .general-report-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .nav-title {
        font-size: 16px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    h2 {
        font-size: 20px;
    }
    
    .item-card {
        padding: 15px;
    }
    
    .order-card {
        padding: 15px;
    }
    
    .chart-container {
        height: 300px;
    }
    
    .product-list {
        grid-template-columns: 1fr;
    }
}

/* Popup System */
.popup-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.popup {
    background: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
    border-left: 5px solid;
    min-width: 320px;
}

.popup.success {
    border-left-color: #10b981;
}

.popup.error {
    border-left-color: #ef4444;
}

.popup-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.popup.success .popup-icon {
    color: #10b981;
}

.popup.error .popup-icon {
    color: #ef4444;
}

.popup-content {
    flex: 1;
}

.popup-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
}

.popup.success .popup-title {
    color: #065f46;
}

.popup.error .popup-title {
    color: #991b1b;
}

.popup-message {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

.popup-close {
    background: transparent;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.popup-close:hover {
    background: #f3f4f6;
    color: #333;
}

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

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.popup.slide-out {
    animation: slideOut 0.3s ease-out forwards;
}

/* Responsive Popup */
@media (max-width: 480px) {
    .popup-container {
        left: 10px;
        right: 10px;
        max-width: none;
    }
    
    .popup {
        min-width: auto;
        width: 100%;
    }
}

/* Report Tables */
.report-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.report-table th {
    background: #667eea;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #5568d3;
}

.report-table td {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.report-table tr:hover {
    background: #f5f5f5;
}

.report-table tr:last-child td {
    border-bottom: none;
}

/* Data Tables - Advanced Reports */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.data-table thead {
    background: linear-gradient(135deg, #667eea 0%, #5568d3 100%);
    color: white;
    font-weight: 600;
}

.data-table th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 3px solid #5568d3;
    white-space: nowrap;
}

.data-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #e8e8e8;
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background-color 0.2s ease;
}

.data-table tbody tr:nth-child(odd) {
    background: #fafafa;
}

.data-table tbody tr:nth-child(even) {
    background: white;
}

.data-table tbody tr:hover {
    background: #f0f4ff;
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* Audit Logs Styling */
.audit-filters {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
}

.filter-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-end;
}

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

.filter-group label {
    font-weight: 600;
    color: #333;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group input,
.filter-group select {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Audit Stats */
.audit-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.audit-stats .stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
}

.audit-stats .stat-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 32px;
    min-width: 45px;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #667eea;
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    color: #999;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Audit Actions */
.audit-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

/* Audit Table */
.audit-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
}

.audit-table thead {
    background: linear-gradient(135deg, #667eea 0%, #5568d3 100%);
    color: white;
}

.audit-table th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 3px solid #5568d3;
    white-space: nowrap;
}

.audit-table td {
    padding: 12px;
    border-bottom: 1px solid #e8e8e8;
    vertical-align: middle;
    font-size: 14px;
}

.audit-table tbody tr {
    transition: background-color 0.2s ease;
}

.audit-table tbody tr:nth-child(odd) {
    background: #fafafa;
}

.audit-table tbody tr:nth-child(even) {
    background: white;
}

.audit-table tbody tr:hover {
    background: #f0f4ff;
}

.audit-table tbody tr:last-child td {
    border-bottom: none;
}

/* Status badges in audit table */
.action-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.action-CREATE {
    background: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
}

.action-UPDATE {
    background: rgba(255, 193, 7, 0.15);
    color: #FFC107;
}

.action-DELETE {
    background: rgba(244, 67, 54, 0.15);
    color: #F44336;
}

.action-LOGIN {
    background: rgba(3, 155, 229, 0.15);
    color: #039BE5;
}

/* Audit Pagination */
.audit-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

#auditPageInfo {
    font-weight: 600;
    color: #333;
    min-width: 120px;
    text-align: center;
}

/* Table Responsive */
.table-responsive {
    border-radius: 12px;
    overflow: hidden;
    background: white;
}

/* No Data Message */
.no-data-message {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 16px;
}

.no-data-message p {
    margin: 0;
}

.text-center {
    text-align: center;
}

/* Number columns in tables - right align */
.data-table td:not(:first-child) {
    text-align: right;
    font-weight: 500;
}

.data-table th:not(:first-child) {
    text-align: right;
}

/* Report Stats */
.report-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.stat-card {
    flex: 1;
    min-width: 200px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
    border-left: 4px solid #667eea;
}

.stat-card h4 {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-number {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    color: #667eea;
}

/* Summary Cards - Advanced Reports */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 16px;
}

.summary-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
    border-color: #667eea;
}

.summary-icon {
    font-size: 40px;
    min-width: 50px;
    text-align: center;
}

.summary-content {
    flex: 1;
}

.summary-label {
    color: #666;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.summary-value {
    font-size: 36px;
    font-weight: 700;
    color: #667eea;
    line-height: 1;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.close-modal {
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-modal:hover {
    color: #333;
}

.modal-body {
    padding: 24px;
}

.modal-body dl {
    margin: 0;
}

.modal-body dt {
    font-weight: 600;
    color: #333;
    margin-top: 12px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-body dt:first-child {
    margin-top: 0;
}

.modal-body dd {
    margin: 6px 0 0 0;
    color: #666;
    font-size: 14px;
    padding-left: 0;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #f0f0f0;
    text-align: right;
}

.modal-footer .btn {
    margin-left: 8px;
}

/* Product Monthly Matrix Table */
.matrix-container {
    margin: 30px 0;
    padding: 20px;
    background: white;
    border-radius: 8px;
    overflow-x: auto;
}

.matrix-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border: 1px solid #ddd;
}

.matrix-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.matrix-table th {
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    border: 1px solid #ddd;
    white-space: nowrap;
    font-size: 12px;
}

.matrix-table th:first-child {
    text-align: left;
    min-width: 150px;
}

.matrix-table td {
    padding: 10px 8px;
    border: 1px solid #eee;
    text-align: center;
    font-size: 13px;
}

.matrix-table td:first-child {
    text-align: left;
    font-weight: 500;
    min-width: 150px;
}

.matrix-table tbody tr:hover {
    background-color: #f5f5f5 !important;
}

.matrix-table tbody tr:last-child {
    background-color: #667eea !important;
    color: white;
    font-weight: bold;
}

.matrix-table tbody tr:last-child td {
    background-color: #667eea !important;
    color: white;
    border-color: #5568d3;
}

.matrix-table tbody tr:last-child td:first-child {
    text-align: left;
}

/* Client Orders List Card */
.order-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.order-item:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    border-color: #667eea;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 16px;
}

.order-header-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.order-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.order-id {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.order-date {
    font-size: 13px;
    color: #6b7280;
}

.order-status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.order-status.status-pending {
    background: #dbeafe;
    color: #1e40af;
}

.order-status.status-in_progress {
    background: #fed7aa;
    color: #c2410c;
}

.order-status.status-completed {
    background: #d1fae5;
    color: #065f46;
}

.order-status.status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.order-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

.order-item-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #374151;
}

.item-name {
    flex: 1;
}

.item-qty {
    font-weight: 500;
    color: #667eea;
    padding-left: 12px;
}

.btn-cancel-small {
    background: #ef4444;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel-small:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-cancel-small:active {
    transform: translateY(0);
}


