/* Full-screen layout improvements */
body, html {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    background: #f4f6fa;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.admin-header {
    width: 100vw;
    background: #263238;
    color: #fff;
    font-size: 1.5em;
    font-weight: 700;
    padding: 18px 32px;
    letter-spacing: 1px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 220px;
    background: #37474f;
    color: #fff;
    padding: 32px 0 0 0;
    min-height: 100vh;
    box-shadow: 2px 0 8px rgba(0,0,0,0.04);
    position: relative;
}
.admin-sidebar nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.admin-sidebar nav ul li {
    margin-bottom: 18px;
}
.admin-sidebar nav ul li a {
    color: #b0bec5;
    text-decoration: none;
    font-size: 1.1em;
    padding: 10px 32px;
    display: block;
    border-left: 4px solid transparent;
    transition: background 0.2s, color 0.2s, border 0.2s;
}
.admin-sidebar nav ul li a.active, .admin-sidebar nav ul li a:hover {
    background: #263238;
    color: #fff;
    border-left: 4px solid #4CAF50;
}

.main-content {
    flex: 1 1 auto;
    padding: 40px 32px 32px 32px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.container {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
    padding: 32px 32px 24px 32px;
    margin: 0 auto;
    max-width: 1400px;
    width: 100%;
}

/* Two-column layout */
.two-column-layout {
    display: flex;
    gap: 24px;
    margin-top: 20px;
    min-height: 600px;
}

.left-column {
    flex: 1;
    min-width: 0;
}

.right-column {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.file-details-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    border: 1px solid #e0e0e0;
    padding: 20px;
   
    overflow-y: auto;
}

h1 {
    color: #333;
    text-align: center;
    margin: 10px 0 20px;
    padding: 0;
}

h2 {
    color: #444;
    font-size: 1.3em;
    margin: 20px 0 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

h3 {
    color: #555;
    font-size: 1.1em;
    margin: 15px 0 8px;
}

/* Sticky header for search */
.search-container {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
    padding: 16px 0 8px 0;
    border-bottom: 1px solid #eee;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    }
    
    .push-to-shipmozo-btn {
        padding: 10px 24px;
        background: linear-gradient(90deg, #FF9800 60%, #F57C00 100%);
        color: #fff;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        font-weight: 600;
        font-size: 1em;
        transition: background 0.2s, box-shadow 0.2s;
        box-shadow: 0 2px 8px rgba(255, 152, 0, 0.08);
        outline: none;
        margin: 20px 0;
    }
    
    .push-to-shipmozo-btn:hover, .push-to-shipmozo-btn:focus {
        background: linear-gradient(90deg, #F57C00 60%, #EF6C00 100%);
        box-shadow: 0 4px 16px rgba(255, 152, 0, 0.12);
    }
    
    .button-container {
        text-align: center;
    }

#orderId {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Enhanced button styles */
#searchBtn, .preview-btn {
    padding: 10px 24px;
    background: linear-gradient(90deg, #4CAF50 60%, #43a047 100%);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1em;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(76,175,80,0.08);
    outline: none;
}
#searchBtn:hover, .preview-btn:hover, #searchBtn:focus, .preview-btn:focus {
    background: linear-gradient(90deg, #43a047 60%, #388e3c 100%);
    box-shadow: 0 4px 16px rgba(76,175,80,0.12);
}

.details-container {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

/* Card-like order items */
.order-item {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    border: 1px solid #e0e0e0;
    margin-bottom: 20px;
    padding: 20px 18px 16px 18px;
    transition: box-shadow 0.2s, border 0.2s;
    position: relative;
}
.order-item:hover {
    box-shadow: 0 6px 24px rgba(76,175,80,0.10);
    border: 1.5px solid #4CAF50;
}

.item-name {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 8px;
    color: #222;
}
.item-details {
    display: flex;
    gap: 18px;
    align-items: center;
    margin-top: 6px;
    flex-wrap: wrap;
}

.order-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.detail-row {
    display: flex;
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.detail-row:last-child {
    border-bottom: none;
}

a {
    color: #4CAF50;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.label {
    font-weight: bold;
    width: 150px;
}

.value {
    flex: 1;
}

/* Preview container/modal styles */
#previewContainer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.25s;
}
#previewContainer.active {
    display: flex;
}
#previewContent {
    background: #fff;
    padding: 24px;
    border-radius: 8px;
    max-width: 98vw;
    max-height: 98vh;
    overflow: auto;
    box-shadow: 0 4px 32px rgba(0,0,0,0.2);
    position: relative;
    width: 100%;
    height: auto;
}
#closePreviewBtn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #d32f2f;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 1.2em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal fade-in animation */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive modal */
#previewContent {
    max-width: 98vw;
    max-height: 98vh;
    width: 100%;
    height: auto;
}

/* Accessibility focus */
#closePreviewBtn:focus {
    outline: 2px solid #4CAF50;
}

/* Loading spinner */
#loadingSpinner {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
}
.spinner {
    border: 6px solid #eee;
    border-top: 6px solid #4CAF50;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error message improvements */
.error {
    color: #d32f2f;
    background: #fff0f0;
    border: 1px solid #ffcdd2;
    border-radius: 4px;
    padding: 12px 18px;
    margin: 18px auto;
    max-width: 400px;
    font-size: 1.1em;
    text-align: center;
    box-shadow: 0 2px 8px rgba(211,47,47,0.04);
}

/* Success message improvements */
.success {
    color: #4CAF50;
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
    border-radius: 4px;
    padding: 12px 18px;
    margin: 18px auto;
    max-width: 400px;
    font-size: 1.1em;
    text-align: center;
    box-shadow: 0 2px 8px rgba(76,175,80,0.04);
}



/* Section headings */
.detail-table h3, .main-content h3 {
    font-size: 1.2em;
    color: #263238;
    margin: 24px 0 10px 0;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.detail-table {
    margin-bottom: 18px;
    background: #f8fafc;
    border-radius: 6px;
    padding: 12px 18px 8px 18px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}

.detail-row {
    display: flex;
    margin-bottom: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
    align-items: center;
}
.detail-row:last-child {
    border-bottom: none;
}
.label {
    font-weight: 500;
    width: 180px;
    color: #37474f;
}
.value {
    flex: 1;
    color: #263238;
}
.show-more-btn {
    background: #4CAF50;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 8px 18px;
    font-size: 1em;
    margin: 18px 0 12px 0;
    cursor: pointer;
    transition: background 0.2s;
}
.show-more-btn:hover {
    background: #388e3c;
}

.printing-settings {
    margin: 10px 0 0 0;
    padding: 8px 0 4px 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.settings-title {
    font-weight: 500;
    color: #388e3c;
    margin-right: 8px;
    font-size: 1em;
}
.setting-badge {
    background: #e8f5e9;
    color: #263238;
    border-radius: 16px;
    padding: 4px 14px;
    font-size: 0.98em;
    font-weight: 500;
    margin: 2px 0;
    border: 1px solid #c8e6c9;
    box-shadow: 0 1px 2px rgba(76,175,80,0.06);
    transition: background 0.2s, color 0.2s;
    cursor: default;
}
.setting-badge[title]:hover {
    background: #c8e6c9;
    color: #222;
}

/* File preview sections */
.file-preview-section {
    margin: 15px 0 10px 0;
    padding: 15px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}




.image-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.file-image {
    max-width: 100%;
    max-height: 200px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.file-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.file-placeholder {
    width: 120px;
    height: 120px;
    background: #f5f5f5;
    border: 2px dashed #bdbdbd;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #757575;
    font-size: 0.9em;
    font-weight: 500;
}

.file-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
}

.file-name {
    font-weight: 500;
    color: #263238;
    font-size: 0.95em;
}

.file-size {
    font-size: 0.85em;
    color: #757575;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .two-column-layout {
        flex-direction: column;
    }
    .left-column, .right-column {
        flex: none;
    }
    .file-details-container {
        max-height: 250px;
    }
    #filePreviewPanel {
        min-height: 300px;
    }
}

@media (max-width: 900px) {
    .admin-layout {
        flex-direction: column;
    }
    .admin-sidebar {
        width: 100vw;
        min-height: 0;
        padding: 0;
        box-shadow: none;
        display: flex;
        flex-direction: row;
        overflow-x: auto;
    }
    .admin-sidebar nav ul {
        display: flex;
        flex-direction: row;
        width: 100vw;
    }
    .admin-sidebar nav ul li {
        margin: 0 8px 0 0;
    }
    .main-content {
        padding: 16px 4vw;
    }
    .container {
        padding: 16px 8px;
    }
    .file-details-container {
        max-height: 200px;
    }
    #filePreviewPanel {
        min-height: 250px;
    }
    .file-preview-section {
        padding: 12px;
    }
    .file-image {
        max-height: 150px;
    }
}

/* File preview popup styles */
.file-preview-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease-out;
}

.file-preview-popup-content {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 90vw;
    max-height: 90vh;
    width: 800px;
    height: 600px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.file-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8fafc;
}

.file-preview-header h3 {
    margin: 0;
    color: #263238;
    font-size: 1.3em;
    font-weight: 600;
}

.close-popup-btn {
    background: #d32f2f;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 1.2em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.close-popup-btn:hover {
    background: #b71c1c;
}

.file-preview-body {
    flex: 1;
    padding: 20px;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-preview-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.file-preview-pdf {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}

.file-preview-download {
    text-align: center;
    padding: 40px;
}

.file-preview-download .file-icon {
    font-size: 4em;
    margin-bottom: 20px;
    color: #757575;
}

.file-preview-download p {
    margin: 20px 0;
    color: #666;
    font-size: 1.1em;
}

.file-preview-download .preview-btn {
    display: inline-block;
    padding: 12px 24px;
    background: #4CAF50;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: background 0.2s;
}

.file-preview-download .preview-btn:hover {
    background: #388e3c;
}

/* Responsive adjustments for popup */
@media (max-width: 768px) {
    .file-preview-popup-content {
        width: 95vw;
        height: 95vh;
        max-width: none;
        max-height: none;
    }
    
    .file-preview-header {
        padding: 16px 20px;
    }
    
    .file-preview-body {
        padding: 16px;
    }
}


/* Shipping table styles */
.shipping-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0 25px 0;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.shipping-table th {
    background: #4CAF50;
    color: white;
    text-align: left;
    padding: 12px 15px;
    font-weight: 600;
}

.shipping-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #f0f0f0;
}

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

.shipping-table tr:nth-child(even) {
    background-color: #f8fafc;
}

.shipping-table tr:hover {
    background-color: #e8f5e9;
}

/* Horizontal table styles */
.horizontal-table-container {
    overflow-x: auto;
    margin: 15px 0 25px 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

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

.horizontal-table th {
    background: #4CAF50;
    color: white;
    text-align: left;
    padding: 12px 15px;
    font-weight: 600;
    white-space: nowrap;
}

.horizontal-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #f0f0f0;
    min-width: 150px;
}

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

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

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

.login-form h2 {
    text-align: center;
    margin-bottom: 10px;
    color: #333;
}

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

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

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

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

.form-group input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

#loginBtn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(90deg, #4CAF50 60%, #43a047 100%);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.08);
}

#loginBtn:hover {
    background: linear-gradient(90deg, #43a047 60%, #388e3c 100%);
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.12);
}

#loginBtn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Logout button styles */
.logout-btn {
    float: right;
    background: #f44336;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-top: -5px;
}

.logout-btn:hover {
    background: #d32f2f;
}

.horizontal-table tr:nth-child(even) {
    background-color: #f8fafc;
}

.horizontal-table tr:hover {
    background-color: #e8f5e9;
}

@media (max-width: 768px) {
    .horizontal-table th,
    .horizontal-table td {
        padding: 8px 10px;
        font-size: 0.9em;
    }
}