/* ==================== MODERN DESIGN SYSTEM ==================== */
/*
   Color Palette (Luxury SaaS):
   - Primary: #4F46E5 (Indigo)
   - Secondary: #0EA5E9 (Sky Blue)
   - Success: #10B981 (Emerald)
   - Warning: #F59E0B (Amber)
   - Error: #EF4444 (Red)
   - Background: #F8FAFC (Slate 50)
   - Surface: #FFFFFF
   - Text Primary: #0F172A (Slate 900)
   - Text Secondary: #64748B (Slate 500)
   - Border: #E2E8F0 (Slate 200)

   Typography: Inter, system-ui, sans-serif
   Spacing Scale: 4, 8, 12, 16, 20, 24, 32, 40, 48, 64
   Border Radius: 6, 8, 12, 16, 24
   Shadows: Soft, diffused, layered
*/

/* ==================== RESET & BASE ==================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

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

:root {
    /* Primary Colors */
    --primary-50: #EEF2FF;
    --primary-100: #E0E7FF;
    --primary-200: #C7D2FE;
    --primary-500: #6366F1;
    --primary-600: #4F46E5;
    --primary-700: #4338CA;

    /* Accent Colors */
    --accent-sky: #0EA5E9;
    --accent-emerald: #10B981;
    --accent-amber: #F59E0B;
    --accent-rose: #F43F5E;

    /* Neutrals */
    --slate-50: #F8FAFC;
    --slate-100: #F1F5F9;
    --slate-200: #E2E8F0;
    --slate-300: #CBD5E1;
    --slate-400: #94A3B8;
    --slate-500: #64748B;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1E293B;
    --slate-900: #0F172A;

    /* Shadows */
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-soft: 0 2px 8px -2px rgb(0 0 0 / 0.08), 0 4px 16px -4px rgb(0 0 0 / 0.12);
    --shadow-glow: 0 0 20px -5px rgb(79 70 229 / 0.4);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 24px;
}

/* ==================== GLOBAL TOOLTIP ==================== */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: #1e293b;
    color: white;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 6px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    pointer-events: none;
}

[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e293b;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 9999;
    pointer-events: none;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Tooltip position variants */
[data-tooltip-pos="bottom"]::before {
    bottom: auto;
    top: calc(100% + 8px);
}

[data-tooltip-pos="bottom"]::after {
    bottom: auto;
    top: calc(100% + 2px);
    border-top-color: transparent;
    border-bottom-color: #1e293b;
}

[data-tooltip-pos="left"]::before {
    bottom: auto;
    left: auto;
    right: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
}

[data-tooltip-pos="left"]::after {
    bottom: auto;
    left: auto;
    right: calc(100% + 2px);
    top: 50%;
    transform: translateY(-50%);
    border-top-color: transparent;
    border-left-color: #1e293b;
}

[data-tooltip-pos="right"]::before {
    bottom: auto;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
}

[data-tooltip-pos="right"]::after {
    bottom: auto;
    left: calc(100% + 2px);
    top: 50%;
    transform: translateY(-50%);
    border-top-color: transparent;
    border-right-color: #1e293b;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--slate-50) 0%, #EEF2FF 100%);
    min-height: 100vh;
    display: flex;
    color: var(--slate-800);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Global focus styles for accessibility */
*:focus-visible {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection styling */
::selection {
    background: rgba(99, 102, 241, 0.2);
    color: var(--slate-900);
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    width: 240px;
    min-width: 240px;
    background: linear-gradient(180deg, #1e3a5f 0%, #0d2137 100%);
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.sidebar-logo {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo h1 {
    font-size: 26px;
    font-weight: 800;
    color: white;
    letter-spacing: -0.5px;
}

.sidebar-nav {
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

/* ==================== MAIN WRAPPER ==================== */
.main-wrapper {
    margin-left: 240px;
    flex: 1;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--slate-50) 0%, #EEF2FF 50%, var(--slate-50) 100%);
    position: relative;
}

/* Subtle background pattern */
.main-wrapper::before {
    content: '';
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 240px;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(14, 165, 233, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(16, 185, 129, 0.02) 0%, transparent 30%);
    pointer-events: none;
    z-index: 0;
}

.main-wrapper > * {
    position: relative;
    z-index: 1;
}

/* ==================== TOP HEADER ==================== */
.top-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 14px 24px;
    box-shadow: var(--shadow-xs);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.breadcrumb {
    color: var(--slate-500);
    font-size: 13px;
    font-weight: 500;
}

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

.user-balance {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    border-radius: 8px;
    color: white;
}

.balance-label {
    font-size: 12px;
    font-weight: 500;
    opacity: 0.9;
}

.balance-amount {
    font-size: 16px;
    font-weight: 700;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--slate-700);
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--slate-100);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--slate-600);
}

.btn-logout:hover {
    background: var(--accent-rose);
    color: white;
}

.breadcrumb a {
    color: var(--primary-600);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-fast);
}

.breadcrumb a:hover {
    color: var(--primary-700);
    text-decoration: none;
}

/* ==================== LEGACY HEADER (hidden) ==================== */
.header {
    display: none;
}

.header h1 {
    font-size: 20px;
    color: #2c3e50;
}

/* ==================== UPLOAD PAGE ==================== */
#uploadPage {
    max-width: 100%;
    margin: 0;
    padding: 32px 40px;
    min-height: calc(100vh - 60px);
}

/* Page Header - Modern Luxury Style */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.page-header h2 {
    font-size: 28px;
    font-weight: 800;
    color: var(--slate-900);
    margin: 0;
    letter-spacing: -0.75px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-header h2::before {
    content: '';
    width: 4px;
    height: 28px;
    background: linear-gradient(180deg, var(--primary-500) 0%, var(--accent-sky) 100%);
    border-radius: 2px;
}

.header-breadcrumb {
    color: var(--slate-500);
    font-size: 13px;
    font-weight: 500;
}

.header-breadcrumb a {
    color: var(--primary-600);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-fast);
}

.header-breadcrumb a:hover {
    color: var(--primary-700);
    text-decoration: none;
}

.export-btn {
    margin-left: auto;
    background: linear-gradient(135deg, var(--accent-emerald) 0%, #059669 100%) !important;
    border: none !important;
    padding: 12px 24px !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25), 0 1px 2px rgba(16, 185, 129, 0.1);
    transition: all var(--transition-base) !important;
}

.export-btn:hover {
    background: linear-gradient(135deg, #34d399 0%, var(--accent-emerald) 100%) !important;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.35), 0 2px 4px rgba(16, 185, 129, 0.15);
    transform: translateY(-2px);
}

/* Class Dropdown */
.class-dropdown {
    margin-bottom: 20px;
}

.class-dropdown select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    color: #2c3e50;
    background: white;
    cursor: pointer;
}

.class-dropdown select:focus {
    outline: none;
    border-color: #3498db;
}

/* Main Selection Grid with Preview */
.selection-main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.selection-lists {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.selection-column {
    background: white;
}

.selection-title {
    font-size: 14px;
    color: #3498db;
    font-weight: 600;
    margin-bottom: 10px;
}

/* Multi-Select Dropdowns */
.multi-select {
    width: 100%;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    padding: 5px;
}

.multi-select option {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
}

.multi-select option:hover {
    background: #f0f8ff;
}

.multi-select option:checked {
    background: #3498db linear-gradient(0deg, #3498db 0%, #3498db 100%);
    color: white;
}

.select-hint {
    font-size: 12px;
    color: #95a5a6;
    margin-top: 8px;
}

/* Label Preview */
.label-preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.label-preview {
    width: 100%;
    max-width: 280px;
    min-height: 380px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.label-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.preview-placeholder {
    text-align: center;
    color: #95a5a6;
    padding: 20px;
}

.preview-placeholder p {
    font-size: 14px;
}

/* Preview Label Card */
.preview-label-card {
    width: 100%;
    padding: 15px;
    font-size: 10px;
    color: #333;
}

.preview-header {
    text-align: right;
    margin-bottom: 10px;
}

.preview-usps-logo {
    font-weight: bold;
    font-size: 12px;
    color: #333;
}

.preview-postage {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 15px;
}

.preview-p-box {
    width: 40px;
    height: 40px;
    border: 2px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
}

.preview-postage-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.preview-postage-info small {
    font-size: 8px;
    color: #666;
}

.preview-service-name {
    font-size: 11px;
    font-weight: bold;
    text-align: center;
    padding: 8px;
    border: 1px solid #ddd;
    margin-bottom: 10px;
}

.preview-address-section {
    padding: 10px 0;
    border-top: 1px solid #ddd;
}

.preview-tracking-section {
    text-align: center;
    padding: 10px 0;
    border-top: 1px solid #ddd;
}

.preview-tracking-section small {
    display: block;
    margin-bottom: 5px;
    font-size: 8px;
}

.preview-barcode {
    height: 30px;
    background: repeating-linear-gradient(
        90deg,
        #000 0px,
        #000 2px,
        #fff 2px,
        #fff 4px
    );
    margin: 8px auto;
    width: 80%;
}

.preview-qr {
    width: 40px;
    height: 40px;
    background: #f0f0f0;
    margin: 10px auto 0;
    border: 1px solid #ddd;
}

/* File Input Row */
.file-input-row {
    margin-top: 16px;
}

/* File Drop Zone - Elegant Upload Area */
.file-drop-zone {
    display: flex;
    gap: 16px;
    align-items: center;
    transition: all var(--transition-base);
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--slate-50) 0%, var(--primary-50) 100%);
    border: 2px dashed var(--slate-300);
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
}

.file-drop-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(14, 165, 233, 0.05) 100%);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.file-drop-zone:hover::before {
    opacity: 1;
}

.file-drop-zone.drag-over {
    background: linear-gradient(135deg, var(--primary-50) 0%, #E0F2FE 100%);
    border-color: var(--primary-500);
    border-style: dashed;
    transform: scale(1.01);
}

.file-drop-zone.drag-over::before {
    opacity: 1;
}

.file-drop-zone input[type="text"] {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid var(--slate-200);
    border-radius: var(--radius-lg);
    font-size: 14px;
    background: white;
    color: var(--slate-700);
    font-weight: 500;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-xs);
}

.file-drop-zone input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.file-drop-zone input[type="text"]::placeholder {
    color: var(--slate-400);
}

.file-drop-zone.drag-over input[type="text"] {
    border-color: var(--primary-500);
    background: white;
}

.btn-browse {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
    position: relative;
    overflow: hidden;
}

.btn-browse::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 100%);
}

.btn-browse:hover {
    background: linear-gradient(135deg, #818CF8 0%, var(--primary-500) 100%);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.45);
    transform: translateY(-2px);
}

/* Toggle Options */
.toggle-options {
    display: flex;
    gap: 40px;
    padding: 20px 0;
    flex-wrap: wrap;
}

.toggle-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-label {
    font-size: 14px;
    color: #2c3e50;
    font-weight: 500;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #3498db;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* Action Right */
.action-right {
    justify-content: flex-end;
}

/* Config Display - Modern Card Layout */
.config-display {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}

.config-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    border-left: none;
}

.config-label {
    font-size: 11px;
    color: var(--slate-500);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.config-value {
    font-size: 14px;
    color: var(--slate-900);
    font-weight: 600;
}

.config-select {
    padding: 12px 16px;
    font-size: 14px;
    border: 2px solid var(--slate-200);
    border-radius: var(--radius-lg);
    background: white;
    color: var(--slate-800);
    font-weight: 500;
    cursor: pointer;
    min-width: 200px;
    transition: all var(--transition-base);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236366F1' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 44px;
    box-shadow: var(--shadow-xs);
}

.config-select:hover {
    border-color: var(--primary-300);
    background-color: var(--slate-50);
    box-shadow: var(--shadow-sm);
}

.config-select:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

/* Step Cards - Luxury Glass Morphism Style */
.step-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 28px 32px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.step-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-500), var(--accent-sky), var(--accent-emerald));
    opacity: 0;
    transition: opacity var(--transition-base);
}

.step-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--slate-300);
    transform: translateY(-2px);
}

.step-card:hover::before {
    opacity: 1;
}

.step-header {
    font-size: 16px;
    font-weight: 700;
    color: var(--slate-900);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    letter-spacing: -0.4px;
}

.step-number {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
    position: relative;
}

.step-number::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-500), var(--accent-sky));
    opacity: 0.2;
    z-index: -1;
}

/* ==================== SELECTION GRID ==================== */
.selection-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.selection-box {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
}

.selection-box h4 {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.option-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.option-item {
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.option-item:hover {
    border-color: #3498db;
    background: #f0f8ff;
}

.option-item.selected {
    border-color: #3498db;
    background: #e3f2fd;
    color: #1976d2;
    font-weight: 500;
}

/* ==================== FILE UPLOAD ==================== */
.upload-section {
    margin-top: 20px;
}

.file-upload-box {
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #f8fafc;
}

.file-upload-box:hover {
    border-color: #3498db;
    background: #f0f8ff;
}

.file-upload-box.dragover {
    border-color: #2ecc71;
    background: #e8f5e9;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.upload-text {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 5px;
}

.upload-hint {
    font-size: 14px;
    color: #95a5a6;
}

.file-info-box {
    background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
    padding: 18px 22px;
    border-radius: var(--radius-lg);
    margin-top: 18px;
    display: none;
    border: 1px solid #A7F3D0;
    position: relative;
    overflow: hidden;
}

.file-info-box::before {
    content: '✓';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent-emerald) 0%, #059669 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.file-info-box p {
    margin: 5px 0;
    font-size: 14px;
    color: #065F46;
    font-weight: 500;
    padding-right: 50px;
}

.file-info-box p strong {
    color: #047857;
    font-weight: 600;
}

/* ==================== BUTTONS - Luxury Modern Style ==================== */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    letter-spacing: -0.2px;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 50%);
    pointer-events: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35), inset 0 1px 0 rgba(255,255,255,0.15);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #818CF8 0%, var(--primary-500) 100%);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.45), inset 0 1px 0 rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.btn-primary:disabled {
    background: linear-gradient(135deg, var(--slate-300) 0%, var(--slate-400) 100%);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    opacity: 0.7;
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-emerald) 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35), inset 0 1px 0 rgba(255,255,255,0.15);
}

.btn-success:hover {
    background: linear-gradient(135deg, #34d399 0%, var(--accent-emerald) 100%);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.45), inset 0 1px 0 rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.btn-success:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.action-buttons {
    margin-top: 24px;
    display: flex;
    gap: 14px;
    justify-content: flex-end;
}

/* ==================== ALERTS - Soft Notification Style ==================== */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    margin-top: 16px;
    display: none;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.alert::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.alert-success {
    background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
    color: #065F46;
    border: 1px solid #A7F3D0;
    padding-left: 24px;
}

.alert-success::before {
    background: linear-gradient(180deg, var(--accent-emerald) 0%, #059669 100%);
}

.alert-error {
    background: linear-gradient(135deg, #FEF2F2 0%, #FEE2E2 100%);
    color: #991B1B;
    border: 1px solid #FECACA;
    padding-left: 24px;
    max-height: 300px;
    overflow-y: auto;
}

.alert-error::before {
    background: linear-gradient(180deg, #EF4444 0%, #DC2626 100%);
}

/* ==================== PROGRESS OVERLAY ==================== */
.progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.progress-card {
    background: white;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    min-width: 400px;
}

.progress-bar-container {
    width: 100%;
    height: 30px;
    background: #ecf0f1;
    border-radius: 15px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db 0%, #2ecc71 100%);
    width: 0%;
    transition: width 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

/* ==================== DASHBOARD PAGE ==================== */
#dashboardPage {
    display: none;
    max-width: 1800px;
    margin: 20px auto;
    padding: 0 20px;
}

/* Batch Header Card */
.batch-header-card {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    padding: 20px 32px;
    margin-bottom: 0;
}

.batch-title-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.batch-title {
    font-size: 22px;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: -0.3px;
}

.batch-breadcrumb {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.batch-breadcrumb a {
    color: #ffffff;
    text-decoration: none;
}

.batch-breadcrumb a:hover {
    text-decoration: underline;
}

/* Batch Info Bar */
.batch-info-bar {
    background: #ffffff;
    padding: 20px 32px;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.batch-stat-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: #f0f9ff;
    border-radius: 10px;
    border: 1px solid #bae6fd;
}

.batch-stat-box:last-child {
    border-right: none;
}

.batch-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #0369a1;
    line-height: 1;
}

.batch-stat-label {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.batch-id {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 13px;
    color: #475569;
    font-weight: 600;
    background: #f1f5f9;
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

/* Batch Actions Row */
.batch-actions-row {
    background: #ffffff;
    padding: 16px 32px;
    margin-bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    border-bottom: 1px solid #e5e7eb;
}

.batch-actions-left,
.batch-actions-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.batch-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #3b82f6;
}

/* Batch Buttons */
.batch-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.batch-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* SVG Icons in Batch Buttons */
.btn-svg-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.1));
}

.batch-btn-red {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.35);
}

.batch-btn-red:hover {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.45);
}

.batch-btn-orange {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

.batch-btn-orange:hover {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.45);
}

.batch-btn-teal {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

.batch-btn-teal:hover {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.45);
}

.batch-btn-green {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);
}

.batch-btn-green:hover {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.45);
}

.batch-btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.batch-btn-primary:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.45);
}

.batch-btn-danger {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.35);
}

.batch-btn-outline {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.batch-btn-outline:hover {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.45);
    transform: translateY(-1px);
}

.batch-btn-teal-outline {
    background: white;
    border: 1px solid #14b8a6;
    color: #0d9488;
}

.batch-btn-teal-outline:hover {
    background: #f0fdfa;
    transform: none;
    box-shadow: none;
}

.batch-btn-red-outline {
    background: white;
    border: 1px solid #ef4444;
    color: #dc2626;
}

.batch-btn-red-outline:hover {
    background: #fef2f2;
    transform: none;
    box-shadow: none;
}

.btn-icon-img {
    background: rgba(255, 255, 255, 0.25);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
}

.barcode-icon, .truck-icon, .refresh-icon {
    font-size: 14px;
}

/* Secondary Actions - hidden by default */
.batch-secondary-actions {
    display: none;
}

/* ==================== BATCH TABLE ==================== */
.batch-table-container {
    background: white;
    margin: 20px 32px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    overflow: visible;
}

.batch-table-container .batch-table-header {
    border-radius: 12px 12px 0 0;
}

.batch-table-container .batch-row {
    overflow: visible;
}

.batch-table-container .batch-row .col-actions {
    overflow: visible;
}

.batch-table-header {
    display: flex;
    background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
    color: #ffffff;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 14px 24px;
    align-items: center;
}

.batch-table-header > div {
    color: #ffffff !important;
}

.batch-row {
    display: flex;
    align-items: center;
    padding: 14px 24px;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.15s;
}

.batch-row:hover {
    background: #f8fafc;
}

.batch-row:nth-child(even) {
    background: #fcfdfe;
}

.batch-row:nth-child(even):hover {
    background: #f1f5f9;
}

.batch-row.selected {
    background: #eff6ff;
    border-left: 3px solid #3b82f6;
}

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

/* Shared column styles */
.batch-table-header > div,
.batch-row > div {
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 12px;
}

/* Flexible widths - columns expand to fill full width */
.col-check    { flex: 0 0 50px;  }
.col-num      { flex: 0 0 55px;  }
.col-type     { flex: 1.3;       }
.col-from     { flex: 1.5;       }
.col-to       { flex: 1.5;       }
.col-trackid  { flex: 2;         }
.col-status   { flex: 1;         }
.col-added    { flex: 1.1;       }
.col-actions  { flex: 0 0 120px; }

/* Column styles */
.col-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #3b82f6;
    border-radius: 4px;
}

.batch-row .col-num {
    font-weight: 600;
    color: #475569;
    font-size: 12px;
}

.col-type .type-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    background: #eff6ff;
    color: #1e40af;
    line-height: 1.4;
    border: 1px solid #dbeafe;
}

.col-type .type-badge small {
    font-weight: 400;
    opacity: 0.85;
}

.col-from, .col-to {
    font-size: 13px;
    color: #374151;
    font-weight: 400;
    line-height: 1.4;
}

.col-trackid {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 11px;
}

.col-trackid a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.col-trackid a:hover {
    text-decoration: underline;
}

.col-status .status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.col-status .status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.col-status .status-success {
    background: #dcfce7;
    color: #166534;
}

.col-status .status-success::before {
    background: #22c55e;
}

.col-status .status-pending {
    background: #fef9c3;
    color: #854d0e;
}

.col-status .status-pending::before {
    background: #eab308;
}

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

.col-status .status-failed::before {
    background: #ef4444;
}

.col-added {
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
    font-weight: 400;
}

.col-added small {
    color: #94a3b8;
    font-size: 11px;
    display: block;
}

.col-actions .action-btn {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 14px;
    margin: 0 3px;
    position: relative;
    background: transparent;
}

/* Tooltip for action buttons */
.col-actions .action-btn[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: #1e293b;
    color: white;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 6px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.15s ease;
    z-index: 99999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    pointer-events: none;
}

.col-actions .action-btn[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e293b;
    opacity: 0;
    visibility: hidden;
    transition: all 0.15s ease;
    z-index: 99999;
    pointer-events: none;
}

.col-actions .action-btn[data-tooltip]:hover::before,
.col-actions .action-btn[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

.col-actions .action-btn:hover {
    transform: scale(1.15);
}

/* Download Button - Blue */
.col-actions .btn-download-action {
    background: transparent;
    color: #3b82f6;
}

.col-actions .btn-download-action:hover {
    color: #1d4ed8;
    background: rgba(59, 130, 246, 0.1);
}

/* Info Button - Purple */
.col-actions .btn-info-action {
    background: transparent;
    color: #8b5cf6;
}

.col-actions .btn-info-action:hover {
    color: #7c3aed;
    background: rgba(139, 92, 246, 0.1);
}

/* Duplicate Button - Orange */
.col-actions .btn-duplicate-action {
    background: transparent;
    color: #f59e0b;
}

.col-actions .btn-duplicate-action:hover {
    color: #d97706;
    background: rgba(245, 158, 11, 0.1);
}

/* Action button SVG icons */
.col-actions .action-btn svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-width: 2;
    flex-shrink: 0;
}

/* Batch Stats Summary */
.batch-stats-summary {
    background: #f8fafc;
    padding: 16px 32px;
    margin: 0 32px 20px 32px;
    text-align: center;
    border-radius: 0 0 12px 12px;
    border: 1px solid #e5e7eb;
    border-top: none;
    margin-top: -20px;
}

.stat-item-inline {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.stat-item-inline strong {
    color: #1e40af;
    font-size: 15px;
    font-weight: 600;
}

/* Legacy support - keep old classes working */
.dashboard-header {
    display: none;
}

.stats {
    display: flex;
    gap: 30px;
}

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

.stat-value {
    font-size: 28px;
    font-weight: bold;
    color: #2c3e50;
}

.stat-label {
    font-size: 13px;
    color: #7f8c8d;
    margin-top: 5px;
}

.dashboard-actions {
    display: flex;
    gap: 10px;
}

/* ==================== LABELS TABLE (Legacy) ==================== */
.labels-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.labels-header {
    background: #2c3e50;
    color: white;
    padding: 15px 20px;
    display: grid;
    grid-template-columns: 50px 80px 2fr 2fr 200px 150px 100px;
    gap: 15px;
    font-weight: 600;
    font-size: 13px;
}

.label-row {
    border-bottom: 1px solid #ecf0f1;
    transition: background 0.2s;
}

.label-row:hover {
    background: #f8f9fa;
}

.label-row.selected {
    background: #e3f2fd;
}

.label-summary {
    padding: 15px 20px;
    display: grid;
    grid-template-columns: 50px 80px 2fr 2fr 200px 150px 100px;
    gap: 15px;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
}

/* Batch Table Responsive */
@media (max-width: 1200px) {
    .batch-table-header,
    .batch-row {
        padding: 12px 16px;
    }

    .col-trackid { min-width: 140px; }

    .batch-table-container {
        margin: 16px 20px;
    }

    .col-actions .action-btn {
        width: 26px;
        height: 26px;
    }
}

@media (max-width: 992px) {
    .batch-actions-row {
        flex-direction: column;
        align-items: stretch;
    }

    .batch-actions-left,
    .batch-actions-right {
        justify-content: center;
    }

    .col-type, .col-added {
        display: none;
    }

    .batch-table-container {
        margin: 12px 16px;
    }
}

@media (max-width: 768px) {
    .batch-btn {
        width: 100%;
        justify-content: center;
        padding: 10px 14px;
    }

    .col-num, .col-from, .col-type, .col-added {
        display: none;
    }

    .batch-table-container {
        margin: 10px 12px;
        border-radius: 8px;
    }
}

/* ==================== LABEL DETAILS ==================== */
.label-details {
    display: none;
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.label-details.expanded {
    display: block;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.detail-section {
    background: white;
    padding: 15px;
    border-radius: 6px;
}

.detail-section h4 {
    font-size: 14px;
    color: #2c3e50;
    margin-bottom: 10px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 5px;
}

.detail-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    padding: 8px 0;
    font-size: 13px;
}

.detail-label {
    color: #7f8c8d;
    font-weight: 500;
}

.detail-value {
    color: #2c3e50;
}

/* ==================== FORM ELEMENTS ==================== */
.checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

input[type="file"] {
    display: none;
}

/* ==================== BADGES ==================== */
.badge {
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

/* ==================== ACTION ICONS ==================== */
.action-icons {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 16px;
}

.icon-btn:hover {
    transform: translateY(-2px);
}

.btn-expand {
    background: #3498db;
    color: white;
}

.btn-download {
    background: #2ecc71;
    color: white;
}

.btn-view {
    background: #9b59b6;
    color: white;
}

/* ==================== UTILITY CLASSES ==================== */
.hidden {
    display: none !important;
}

/* ==================== STORAGE INDICATOR ==================== */
.storage-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #2ecc71;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    display: none;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

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

/* ==================== HISTORY PAGE ==================== */
#historyPage {
    display: none;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 20px 24px;
}

.history-header {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: 25px 35px;
    border-radius: 16px;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
}

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

.history-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1a202c;
    letter-spacing: -0.5px;
}

.history-stats {
    display: flex;
    gap: 30px;
    padding: 15px 0;
    border-top: 1px solid #ecf0f1;
    border-bottom: 1px solid #ecf0f1;
    margin-bottom: 15px;
}

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

.history-stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #3498db;
}

.history-stat-label {
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 3px;
}

.history-toolbar {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 200px;
}

.search-box input {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.search-box input:focus {
    outline: none;
    border-color: #3498db;
    background: white;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.15);
}

.search-box input::placeholder {
    color: #a0aec0;
}

.history-actions {
    display: flex;
    gap: 10px;
}

/* History Table */
.history-container {
    background: white;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
}

.history-table-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 18px 25px;
    display: grid;
    grid-template-columns: 60px 160px 140px 100px 160px 120px;
    gap: 15px;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.history-row {
    padding: 18px 25px;
    display: grid;
    grid-template-columns: 60px 160px 140px 100px 160px 120px;
    gap: 15px;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
}

.history-row:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
    transform: scale(1.002);
}

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

.history-cell {
    font-size: 14px;
    color: #2d3748;
}

.date-primary {
    font-weight: 600;
    color: #1a202c;
}

.date-secondary {
    font-size: 12px;
    color: #718096;
    margin-top: 2px;
}

.label-count {
    font-weight: 700;
    color: #3498db;
    font-size: 20px;
}

.badge-series {
    background: linear-gradient(135deg, #e8f4fd, #dbeafe);
    color: #1e40af;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 12px;
}

.badge-type {
    background: linear-gradient(135deg, #fef3e2, #fde68a);
    color: #b45309;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 11px;
}

.badge-frozen {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
    font-size: 10px;
    padding: 4px 8px;
    margin-left: 8px;
    border-radius: 12px;
    font-weight: 600;
}

.badge-legacy {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    font-size: 10px;
    padding: 4px 8px;
    margin-left: 8px;
    border-radius: 12px;
    font-weight: 600;
}

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

.btn-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 18px;
}

.btn-icon:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.btn-load {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.btn-load:hover {
    background: linear-gradient(135deg, #2980b9, #1a5276);
}

.btn-export {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
}

.btn-export:hover {
    background: linear-gradient(135deg, #27ae60, #1e8449);
}

.btn-delete {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.btn-delete:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
}

.empty-history {
    text-align: center;
    padding: 80px 20px;
    color: #718096;
}

.empty-icon {
    font-size: 72px;
    margin-bottom: 25px;
    opacity: 0.8;
}

.empty-history h3 {
    font-size: 22px;
    margin-bottom: 12px;
    color: #2d3748;
    font-weight: 600;
}

.empty-history p {
    color: #a0aec0;
    font-size: 15px;
}

/* History Pagination */
.history-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 20px;
    background: white;
    border-radius: 0 0 12px 12px;
    margin-top: -8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.pagination-btn:hover:not(.disabled) {
    background: linear-gradient(135deg, #2980b9, #1a5276);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

.pagination-btn.disabled {
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.pagination-numbers {
    display: flex;
    align-items: center;
    gap: 5px;
}

.pagination-num {
    width: 40px;
    height: 40px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    color: #2c3e50;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.pagination-num:hover {
    border-color: #3498db;
    color: #3498db;
    background: #f0f8ff;
}

.pagination-num.active {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border-color: #3498db;
}

.pagination-ellipsis {
    padding: 0 8px;
    color: #7f8c8d;
    font-weight: bold;
}

.pagination-info {
    color: #7f8c8d;
    font-size: 13px;
    padding: 8px 16px;
    background: #f8f9fa;
    border-radius: 20px;
    margin-left: 10px;
}

/* Import File Input */
.import-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.import-section input[type="file"] {
    display: block;
    padding: 8px;
    border: 2px dashed #cbd5e0;
    border-radius: 6px;
    background: #f8fafc;
    cursor: pointer;
}

/* Nav Buttons - Sidebar Style */
.nav-btn {
    background: transparent;
    color: rgba(255,255,255,0.6);
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
    width: 100%;
    position: relative;
}

.nav-btn .nav-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-btn .nav-icon svg {
    width: 20px;
    height: 20px;
}

.nav-btn .nav-text {
    flex: 1;
    font-size: 15px;
    letter-spacing: 0.3px;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.9);
}

.nav-btn.active {
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    color: white;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
    transform: translateX(4px);
    border-left: 3px solid #7dd3fc;
}

.nav-btn.active .nav-icon svg {
    stroke-width: 2.5;
}

.nav-btn.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: #38bdf8;
    border-radius: 0 4px 4px 0;
}

/* Sidebar Footer - Logout */
.sidebar-footer {
    margin-top: auto;
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.nav-btn.nav-logout {
    color: rgba(255,255,255,0.6);
}

.nav-btn.nav-logout:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

/* ==================== BALANCE HISTORY PAGE ==================== */
#balanceHistoryPage {
    display: none;
    padding: 24px;
}

.balance-history-header {
    background: white;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.balance-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.balance-title-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.balance-title-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.balance-title-section h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--slate-800);
    margin: 0;
}

.balance-subtitle {
    font-size: 14px;
    color: var(--slate-500);
    margin: 4px 0 0 0;
}

.balance-current {
    text-align: right;
}

.balance-current-label {
    display: block;
    font-size: 12px;
    color: var(--slate-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.balance-current-amount {
    font-size: 32px;
    font-weight: 700;
    color: #10B981;
}

/* Balance Stats Row */
.balance-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.balance-stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.balance-stat-card .stat-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.balance-stat-card.stat-credit .stat-icon-box {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
}

.balance-stat-card.stat-debit .stat-icon-box {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

.balance-stat-card.stat-transactions .stat-icon-box {
    background: rgba(99, 102, 241, 0.1);
    color: #6366F1;
}

.balance-stat-card .stat-info {
    display: flex;
    flex-direction: column;
}

.balance-stat-card .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--slate-800);
}

.balance-stat-card .stat-label {
    font-size: 13px;
    color: var(--slate-500);
}

/* Balance Table */
.balance-table-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.balance-table-header {
    display: grid;
    grid-template-columns: 150px 100px 120px 120px 1fr;
    padding: 16px 20px;
    background: var(--slate-50);
    border-bottom: 1px solid var(--slate-200);
    font-weight: 600;
    font-size: 13px;
    color: var(--slate-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.balance-table-row {
    display: grid;
    grid-template-columns: 150px 100px 120px 120px 1fr;
    padding: 16px 20px;
    border-bottom: 1px solid var(--slate-100);
    align-items: center;
    transition: background 0.15s ease;
}

.balance-table-row:hover {
    background: var(--slate-50);
}

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

.balance-table-row .col-date {
    color: var(--slate-600);
    font-size: 13px;
}

.balance-table-row .col-type {
    display: flex;
    align-items: center;
}

.balance-table-row .type-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.balance-table-row .type-badge.credit {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.balance-table-row .type-badge.debit {
    background: rgba(239, 68, 68, 0.1);
    color: #DC2626;
}

.balance-table-row .col-amount {
    font-weight: 600;
    font-size: 14px;
}

.balance-table-row .col-amount.credit {
    color: #10B981;
}

.balance-table-row .col-amount.debit {
    color: #EF4444;
}

.balance-table-row .col-balance {
    font-weight: 500;
    color: var(--slate-700);
}

.balance-table-row .col-description {
    color: var(--slate-600);
    font-size: 13px;
}

/* Balance Loading */
.balance-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 48px 20px;
    color: var(--slate-500);
}

.balance-loading .spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--slate-200);
    border-top-color: var(--primary-500);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Balance Empty State */
.balance-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--slate-500);
}

.balance-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Balance Pagination */
.balance-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    margin-top: 16px;
}

.balance-pagination .pagination-info {
    font-size: 13px;
    color: var(--slate-500);
}

.balance-pagination .pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.balance-pagination .page-number {
    padding: 0 16px;
    font-weight: 500;
    color: var(--slate-700);
}

/* ==================== SINGLE LABEL PAGE ==================== */
#singleLabelPage {
    display: none;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 20px;
    min-height: calc(100vh - 80px);
    background: #f5f7fa;
    box-sizing: border-box;
}

.single-label-container {
    background: white;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    overflow: hidden;
}

.single-label-header {
    text-align: center;
    padding: 28px 30px;
    background: linear-gradient(135deg, #1a365d 0%, #2c5282 50%, #2b6cb0 100%);
    position: relative;
    overflow: hidden;
}

.single-label-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: shimmer 15s linear infinite;
}

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

.single-label-header h2 {
    font-size: 26px;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
    position: relative;
}

.single-label-header p {
    color: rgba(255,255,255,0.85);
    font-size: 15px;
    position: relative;
}

/* Main Content Area */
.sl-main-content {
    padding: 25px 30px;
}

/* Section Styles */
.sl-section {
    background: #ffffff;
    border-radius: 8px;
    padding: 22px 26px;
    margin-bottom: 20px;
    border: 1px solid #e0e4e8;
}

.sl-section-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a365d;
    margin: 0 0 18px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e4e8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Label Configuration Section */
.sl-config-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.sl-config-item {
    display: flex;
    flex-direction: column;
}

.sl-config-item label {
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 10px;
}

.sl-select,
.sl-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    background: white;
    transition: border-color 0.2s;
}

.sl-select:hover,
.sl-input:hover {
    border-color: #9ca3af;
}

.sl-select:focus,
.sl-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.sl-select:disabled {
    background: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
}

.sl-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

/* Package Details Section */
.sl-package-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 18px;
}

.sl-description-row {
    display: flex;
    flex-direction: column;
}

.sl-description-row label {
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 10px;
}

.sl-description-row .sl-input {
    width: 100%;
}

/* Address Container - Side by Side */
.sl-address-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    margin-bottom: 20px;
}

.sl-address-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e0e4e8;
}

.sl-address-header {
    padding: 16px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.sl-address-header h3 {
    font-size: 17px;
    font-weight: 700;
    margin: 0;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sl-from-header {
    background: linear-gradient(135deg, #2c5282 0%, #1a365d 100%);
}

.sl-to-header {
    background: linear-gradient(135deg, #38a169 0%, #276749 100%);
}

.sl-saved-address {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sl-saved-address select {
    padding: 9px 14px;
    border-radius: 5px;
    border: none;
    font-size: 13px;
    font-weight: 500;
    min-width: 160px;
    background: rgba(255,255,255,0.95);
    cursor: pointer;
}

.sl-save-check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: white;
    cursor: pointer;
    white-space: nowrap;
}

.sl-save-check input {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.sl-address-body {
    padding: 22px;
    background: #fafbfc;
}

/* Form Row Styles */
.sl-form-row {
    margin-bottom: 16px;
}

.sl-form-row:last-child {
    margin-bottom: 0;
}

.sl-form-row.sl-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.sl-form-row.sl-three-col {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 16px;
}

.sl-form-group {
    display: flex;
    flex-direction: column;
}

.sl-form-group.sl-full {
    width: 100%;
}

.sl-form-group label {
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
}

.sl-form-group label .required {
    color: #dc2626;
}

.sl-form-group input,
.sl-form-group select {
    width: 100%;
    padding: 13px 15px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    background: white;
    transition: border-color 0.2s;
}

.sl-form-group input:hover,
.sl-form-group select:hover {
    border-color: #9ca3af;
}

.sl-form-group input:focus,
.sl-form-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.sl-form-group input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

/* Generate Button Section */
.sl-generate-section {
    display: flex;
    justify-content: center;
    padding: 24px 30px 35px;
    background: #fafbfc;
}

.sl-generate-btn {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    color: white;
    border: none;
    padding: 18px 80px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(56, 161, 105, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sl-generate-btn:hover {
    background: linear-gradient(135deg, #2f855a 0%, #276749 100%);
    box-shadow: 0 6px 20px rgba(56, 161, 105, 0.4);
    transform: translateY(-1px);
}

.sl-generate-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(56, 161, 105, 0.3);
}

/* Legacy support - keep old classes working */
.address-forms {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 25px;
}

.address-card {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.address-card-header {
    background: #2c3e50;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.address-card-header h3 {
    font-size: 16px;
    margin: 0;
}

.saved-address-select {
    display: flex;
    align-items: center;
    gap: 15px;
}

.saved-address-select select {
    padding: 6px 10px;
    border-radius: 4px;
    border: none;
    font-size: 13px;
    min-width: 180px;
}

.save-checkbox {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    cursor: pointer;
}

.save-checkbox input {
    cursor: pointer;
}

.address-form {
    padding: 20px;
}

/* Form Elements */
.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-row:last-child {
    margin-bottom: 0;
}

.form-row.three-col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
}

.form-group {
    flex: 1;
}

.form-group.full {
    flex: 1;
    width: 100%;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 6px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
}

.form-group input::placeholder {
    color: #bdc3c7;
}

/* Package Details - Legacy */
.package-details-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.package-details-card h3 {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 15px;
}

/* Action Buttons - Legacy */
.single-label-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

/* Result Section */
.single-label-result {
    background: #d4edda;
    border: 2px solid #28a745;
    border-radius: 8px;
    padding: 25px;
    text-align: center;
}

.result-header h3 {
    color: #155724;
    font-size: 20px;
    margin-bottom: 10px;
}

.result-header p {
    color: #155724;
    font-size: 14px;
}

.result-header code {
    background: rgba(0,0,0,0.1);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
}

.result-actions {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* Single Label Page Responsive */
@media (max-width: 1200px) {
    .sl-address-container {
        gap: 20px;
    }
}

@media (max-width: 992px) {
    #singleLabelPage {
        padding: 15px 20px;
    }

    .single-label-header {
        padding: 20px;
    }

    .single-label-header h2 {
        font-size: 22px;
    }

    .sl-section {
        padding: 18px;
        margin-bottom: 16px;
    }

    .sl-address-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .sl-package-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .sl-generate-btn {
        padding: 14px 50px;
    }
}

@media (max-width: 768px) {
    #singleLabelPage {
        padding: 10px 15px;
    }

    .single-label-header {
        padding: 18px 15px;
    }

    .single-label-header h2 {
        font-size: 20px;
    }

    .sl-config-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .sl-package-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .sl-section {
        padding: 16px;
    }

    .sl-form-row.sl-two-col,
    .sl-form-row.sl-three-col {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .sl-address-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px 16px;
    }

    .sl-address-body {
        padding: 16px;
    }

    .sl-saved-address {
        width: 100%;
        justify-content: space-between;
    }

    .sl-generate-btn {
        width: 100%;
        padding: 14px 20px;
    }
}

@media (max-width: 480px) {
    #singleLabelPage {
        padding: 8px 10px;
    }

    .single-label-container {
        border-radius: 8px;
    }

    .single-label-header {
        padding: 16px 12px;
    }

    .single-label-header h2 {
        font-size: 18px;
    }

    .sl-section {
        padding: 14px;
        margin-bottom: 12px;
    }

    .sl-section-title {
        font-size: 13px;
        margin-bottom: 12px;
        padding-bottom: 10px;
    }

    .sl-package-grid {
        grid-template-columns: 1fr;
    }

    .sl-address-card {
        border-radius: 12px;
    }

    .sl-address-body {
        padding: 16px;
    }

    .sl-generate-section {
        padding: 12px 16px 28px;
    }

    .sl-generate-btn {
        font-size: 16px;
        padding: 16px 24px;
    }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .selection-main-grid {
        grid-template-columns: 1fr;
    }

    .label-preview-container {
        order: -1;
        margin-bottom: 20px;
    }
}

@media (max-width: 768px) {
    .selection-grid {
        grid-template-columns: 1fr;
    }

    .selection-lists {
        grid-template-columns: 1fr;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 20px;
    }

    .dashboard-actions {
        flex-wrap: wrap;
        justify-content: center;
    }

    .labels-header,
    .label-summary {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .history-table-header,
    .history-row {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .history-toolbar {
        flex-direction: column;
    }

    .search-box {
        width: 100%;
    }

    /* Toggle Options Responsive */
    .toggle-options {
        flex-direction: column;
        gap: 15px;
    }

    .file-input-field {
        flex-direction: column;
    }

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

    .page-header {
        flex-direction: column;
        text-align: center;
    }

    .export-btn {
        margin-left: 0;
    }

    /* Single Label Responsive */
    .address-forms {
        grid-template-columns: 1fr;
    }

    .form-row.three-col {
        grid-template-columns: 1fr;
    }

    .options-row {
        flex-direction: column;
    }

    .address-card-header {
        flex-direction: column;
        text-align: center;
    }

    .saved-address-select {
        flex-direction: column;
        width: 100%;
    }

    .saved-address-select select {
        width: 100%;
    }

    .single-label-actions,
    .result-actions {
        flex-direction: column;
    }
}

/* ==================== ORDERS HISTORY PAGE ==================== */
#ordersHistoryPage {
    max-width: 100%;
    margin: 0;
    padding: 0;
    background: #f8fafc;
    min-height: calc(100vh - 60px);
}

/* Page Title Bar */
.orders-history-header {
    background: white;
    padding: 20px 32px;
    margin-bottom: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid #e5e7eb;
    border-radius: 0;
}

.orders-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.orders-title-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.orders-title-icon {
    width: 40px;
    height: 40px;
    background: #3b82f6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.orders-title-icon svg {
    width: 20px;
    height: 20px;
}

.orders-history-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin: 0;
    line-height: 1.3;
}

.orders-subtitle {
    font-size: 13px;
    color: #6b7280;
    margin: 2px 0 0 0;
    font-weight: 400;
}

.btn-back {
    padding: 8px 16px;
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-back:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.btn-back svg {
    width: 14px;
    height: 14px;
}

/* Toolbar Section */
.orders-filters {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    padding: 20px 32px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    margin: 0;
    align-items: flex-end;
    border-radius: 0;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group.filter-search {
    flex: 1;
    min-width: 320px;
    max-width: 480px;
}

.filter-group label {
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.filter-group label svg {
    width: 12px;
    height: 12px;
    color: #64748b;
}

.filter-group input[type="text"],
.filter-group input[type="date"],
.filter-group select {
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    min-width: 130px;
    background: #f8fafc;
    color: #1e293b;
    transition: all 0.2s ease;
    font-weight: 500;
}

.filter-group input[type="text"]:hover,
.filter-group input[type="date"]:hover,
.filter-group select:hover {
    border-color: #cbd5e1;
    background: white;
}

.filter-group input[type="text"]:focus,
.filter-group input[type="date"]:focus,
.filter-group select:focus {
    outline: none;
    border-color: #3b82f6;
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Search Input - Stylish */
.search-input-wrapper {
    display: flex;
    gap: 0;
    position: relative;
}

.search-input-wrapper input {
    flex: 1;
    border-radius: 8px 0 0 8px;
    border-right: none;
    padding-left: 16px;
}

.search-input-wrapper input:focus {
    border-right: none;
}

.btn-search {
    padding: 10px 18px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 500;
    font-size: 13px;
}

.btn-search:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.btn-search svg {
    width: 16px;
    height: 16px;
}

/* Action Buttons Bar */
.orders-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 16px 32px;
    margin: 0;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.btn-action {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-action svg {
    width: 15px;
    height: 15px;
}

.btn-merge {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

.btn-merge:hover {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-zip {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
}

.btn-zip:hover {
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.4);
}

.btn-export {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-export:hover {
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* Orders Table */
.orders-table-container {
    background: white;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    border: none;
    border-bottom: 1px solid #e5e7eb;
}

.orders-table-header {
    display: grid;
    grid-template-columns: 40px 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
    align-items: center;
    padding: 18px 28px;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: #ffffff;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: none;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.4);
}

.orders-table-header > div {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
}

.orders-table-header svg {
    width: 15px;
    height: 15px;
    color: #ffffff !important;
    stroke: #ffffff !important;
}

/* Header Checkbox - white style for dark header */
.orders-table-header .custom-checkbox .checkmark {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.orders-table-header .custom-checkbox:hover .checkmark {
    border-color: #ffffff;
}

.orders-table-header .custom-checkbox input:checked ~ .checkmark {
    background: #ffffff;
    border-color: #ffffff;
}

.orders-table-header .custom-checkbox input:checked ~ .checkmark:after {
    border-color: #0f172a;
}

/* Custom Checkbox */
.custom-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.custom-checkbox .checkmark {
    width: 18px;
    height: 18px;
    background: white;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-checkbox:hover .checkmark {
    border-color: #3b82f6;
}

.custom-checkbox input:checked ~ .checkmark {
    background: #3b82f6;
    border-color: #3b82f6;
}

.custom-checkbox .checkmark:after {
    content: "";
    display: none;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.custom-checkbox input:checked ~ .checkmark:after {
    display: block;
}

.orders-row {
    display: grid;
    grid-template-columns: 40px 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s ease;
    gap: 12px;
    background: white;
}

.orders-row:hover {
    background: #f9fafb;
}

.orders-row.selected {
    background: #eff6ff;
    border-left: 3px solid #3b82f6;
}

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

/* Row Checkbox */
.orders-row .col-checkbox .custom-checkbox .checkmark {
    background: white;
    border: 2px solid #d1d5db;
}

.orders-row .col-checkbox .custom-checkbox:hover .checkmark {
    border-color: #3b82f6;
}

.orders-row .col-checkbox .custom-checkbox input:checked ~ .checkmark {
    background: #3b82f6;
    border-color: #3b82f6;
}

/* Column styles */
.col-checkbox {
    display: flex;
    justify-content: center;
}

.col-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #3b82f6;
}

.col-id {
    font-weight: 600;
    font-size: 13px;
    color: #6b7280;
}

.col-type {
    overflow: visible;
}

/* Simple Clean Badge */
.col-type .badge {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 6px 10px;
    border-radius: 6px;
    line-height: 1.2;
}

.col-type .badge .tracking-series {
    font-weight: 700;
    font-size: 13px;
}

.col-type .badge .label-type {
    font-weight: 500;
    font-size: 10px;
    opacity: 0.8;
    margin-top: 2px;
    white-space: nowrap;
}

.badge-bulk {
    background: #dbeafe;
    color: #1e40af;
}

.badge-single {
    background: #fef3c7;
    color: #92400e;
}

.col-from, .col-to {
    font-size: 13px;
    min-width: 0;
}

.col-from .name, .col-to .name {
    font-weight: 600;
    color: #111827;
    margin-bottom: 2px;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.col-from .location, .col-to .location {
    font-size: 12px;
    color: #6b7280;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.col-tracking {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 12px;
    color: #2563eb;
    word-break: break-all;
    font-weight: 500;
}

.col-tracking a {
    color: #2563eb;
    text-decoration: none;
}

.col-tracking a:hover {
    text-decoration: underline;
}

.col-status .badge-success {
    background: #d1fae5;
    color: #065f46;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.col-status .badge-success::before {
    content: "";
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
}

.col-date {
    font-size: 13px;
    color: #374151;
}

.col-date .date-primary {
    font-weight: 500;
    color: #111827;
    font-size: 13px;
}

.col-date .date-secondary {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 400;
}

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

.col-actions .btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
    background: transparent;
}

.col-actions .btn-icon svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

/* Tooltip */
.col-actions .btn-icon::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.15s ease;
    z-index: 99999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

.col-actions .btn-icon::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e293b;
    opacity: 0;
    visibility: hidden;
    transition: all 0.15s ease;
    z-index: 99999;
    pointer-events: none;
}

.col-actions .btn-icon:hover::before,
.col-actions .btn-icon:hover::after {
    opacity: 1;
    visibility: visible;
}

.col-actions .btn-icon:hover {
    transform: scale(1.15);
}

/* View Button - Blue */
.col-actions .btn-view {
    background: transparent;
    color: #3b82f6;
}

.col-actions .btn-view:hover {
    color: #1d4ed8;
    background: rgba(59, 130, 246, 0.1);
}

/* Duplicate Button - Orange */
.col-actions .btn-duplicate {
    background: transparent;
    color: #f59e0b;
}

.col-actions .btn-duplicate:hover {
    color: #d97706;
    background: rgba(245, 158, 11, 0.1);
}

/* Return Button - Purple */
.col-actions .btn-return {
    background: transparent;
    color: #8b5cf6;
}

.col-actions .btn-return:hover {
    color: #7c3aed;
    background: rgba(139, 92, 246, 0.1);
}

/* Download Button - Green */
.col-actions .btn-download {
    background: transparent;
    color: #10b981;
}

.col-actions .btn-download:hover {
    color: #059669;
    background: rgba(16, 185, 129, 0.1);
}

/* Orders Pagination */
.orders-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 28px;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
    margin-top: 0;
    border-radius: 0 0 16px 16px;
}

.pagination-info {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-page {
    padding: 8px 14px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-page:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.btn-page:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-page:disabled:hover {
    background: white;
    border-color: #d1d5db;
}

.page-number, #ordersPageInfo {
    font-size: 13px;
    color: #374151;
    min-width: 80px;
    text-align: center;
    font-weight: 600;
    padding: 8px 12px;
    background: #f3f4f6;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

/* Empty State */
.orders-empty {
    text-align: center;
    padding: 60px 40px;
    color: #6b7280;
}

.orders-empty .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.orders-empty h3 {
    font-size: 18px;
    color: #111827;
    margin-bottom: 8px;
    font-weight: 600;
}

.orders-empty p {
    font-size: 14px;
    color: #6b7280;
    max-width: 360px;
    margin: 0 auto;
}


/* Orders History Responsive */
@media (max-width: 1400px) {
    .orders-table-header,
    .orders-row {
        grid-template-columns: 40px 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
        gap: 10px;
    }
}

@media (max-width: 1200px) {
    #ordersHistoryPage {
        padding: 20px 24px;
    }

    .orders-table-header,
    .orders-row {
        grid-template-columns: 40px 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
        padding: 12px 16px;
        gap: 8px;
    }

    .col-tracking {
        font-size: 11px;
    }
}

@media (max-width: 992px) {
    #ordersHistoryPage {
        padding: 16px 20px;
    }

    .orders-filters {
        flex-direction: column;
        padding: 16px;
    }

    .filter-group {
        width: 100%;
    }

    .filter-group.filter-search {
        min-width: unset;
    }

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

    .search-input-wrapper {
        flex-direction: column;
    }

    .search-input-wrapper input {
        min-width: unset;
    }

    .orders-table-header,
    .orders-row {
        grid-template-columns: 40px 1fr 1fr 120px 80px;
        gap: 10px;
    }

    .col-type,
    .col-id,
    .col-status,
    .col-date {
        display: none;
    }

    .orders-pagination {
        flex-direction: column;
        gap: 12px;
    }
}

@media (max-width: 600px) {
    #ordersHistoryPage {
        padding: 12px 16px;
    }

    .orders-history-header {
        padding: 16px;
        border-radius: 10px;
    }

    .orders-header-top {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .orders-title-icon {
        width: 40px;
        height: 40px;
    }

    .orders-history-header h2 {
        font-size: 18px;
    }

    .btn-back {
        width: 100%;
        justify-content: center;
    }

    .orders-table-header,
    .orders-row {
        grid-template-columns: 36px 1fr 100px 70px;
        padding: 10px 12px;
    }

    .col-from {
        display: none;
    }

    .orders-actions {
        flex-direction: column;
    }

    .btn-action {
        width: 100%;
        justify-content: center;
    }

    .orders-table-container {
        border-radius: 10px;
    }

    .col-actions {
        flex-direction: column;
        gap: 4px;
    }

    .col-actions .btn-icon {
        width: 26px;
        height: 26px;
    }
}

/* ==================== ORDER DETAILS PAGE ==================== */
#orderDetailsPage {
    max-width: 100%;
    margin: 0;
    padding: 24px 32px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    min-height: calc(100vh - 60px);
}

.order-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
    background: white;
    padding: 20px 28px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.order-details-header h2 {
    font-size: 22px;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin: 0;
}

.order-details-header h2::before {
    content: "";
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cline x1='16' y1='13' x2='8' y2='13'/%3E%3Cline x1='16' y1='17' x2='8' y2='17'/%3E%3Cpolyline points='10 9 9 9 8 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

.order-details-breadcrumb {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.order-details-breadcrumb a {
    color: #3b82f6;
    text-decoration: none;
    transition: color 0.2s ease;
    font-weight: 500;
}

.order-details-breadcrumb a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.order-details-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

.order-details-left {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
}

.order-info-card, .address-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
    margin-bottom: 0;
    border: 1px solid rgba(226, 232, 240, 0.8);
}

/* ORDER INFORMATION Header - Dark Blue Gradient */
.order-info-card .card-header.info-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
    padding: 18px 24px;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 14px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.order-info-card .card-header.info-header::before {
    content: "";
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='16' x2='12' y2='12'/%3E%3Cline x1='12' y1='8' x2='12.01' y2='8'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

/* From Address Header - Dark Navy */
.address-card .card-header {
    padding: 16px 24px;
    font-weight: 700;
    font-size: 13px;
    color: white;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.address-card .card-header.from-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
}

/* To Address Header - Purple Gradient */
.address-card .card-header.to-header {
    background: linear-gradient(135deg, #4c1d95 0%, #7c3aed 100%);
}

.order-info-card .card-body,
.address-card .card-body {
    padding: 0;
    background: white;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #f1f5f9;
    background: white;
    transition: all 0.15s ease;
}

.info-row:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #fafbfc 100%);
}

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

.info-label {
    font-weight: 600;
    color: #475569;
    font-size: 13px;
    min-width: 120px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.info-value {
    color: #0f172a;
    font-size: 14px;
    text-align: right;
    font-weight: 600;
    flex: 1;
    word-break: break-word;
}

.info-value .tracking-link {
    color: #2563eb;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    font-size: 13px;
    text-decoration: none;
    font-weight: 600;
    padding: 6px 12px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.info-value .tracking-link:hover {
    color: #1d4ed8;
    background: #eff6ff;
    border-color: #bfdbfe;
}

/* Copy Button - Styled like reference */
.btn-copy {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    margin-left: 12px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.btn-copy:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

/* Action Buttons Container */
.order-detail-actions {
    display: flex;
    gap: 10px;
    padding: 20px 24px;
    border-top: 2px solid #f1f5f9;
    flex-wrap: wrap;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 0 0 16px 16px;
}

/* Action Buttons - Styled like reference */
.order-detail-actions .btn-outline {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.order-detail-actions .btn-outline:hover {
    background: #f9fafb;
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Track button with icon */
.order-detail-actions .btn-outline:first-child::before {
    content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%233b82f6' stroke-width='2'%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3Cpath d='M12 21.7C17.3 17 20 13 20 10a8 8 0 1 0-16 0c0 3 2.7 7 8 11.7z'/%3E%3C/svg%3E");
}

/* Download button with icon */
.order-detail-actions .btn-outline:nth-child(2)::before {
    content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2310b981' stroke-width='2'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='7 10 12 15 17 10'/%3E%3Cline x1='12' y1='15' x2='12' y2='3'/%3E%3C/svg%3E");
}

/* Copy Tracking ID button with icon */
.order-detail-actions .btn-outline:nth-child(3)::before {
    content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238b5cf6' stroke-width='2'%3E%3Crect x='9' y='9' width='13' height='13' rx='2' ry='2'/%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'/%3E%3C/svg%3E");
}

/* Order Duplicate button with icon - Orange accent */
.order-detail-actions .btn-outline:nth-child(4) {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: none;
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

.order-detail-actions .btn-outline:nth-child(4)::before {
    content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Crect x='9' y='9' width='13' height='13' rx='2' ry='2'/%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'/%3E%3C/svg%3E");
}

.order-detail-actions .btn-outline:nth-child(4):hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

/* Order Return button with icon - Pink accent */
.order-detail-actions .btn-outline:nth-child(5) {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
    border: none;
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.25);
}

.order-detail-actions .btn-outline:nth-child(5)::before {
    content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpolyline points='1 4 1 10 7 10'/%3E%3Cpath d='M3.51 15a9 9 0 1 0 2.13-9.36L1 10'/%3E%3C/svg%3E");
}

.order-detail-actions .btn-outline:nth-child(5):hover {
    background: linear-gradient(135deg, #db2777 0%, #be185d 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.35);
}

/* PDF Preview Container */
.order-details-right {
    position: sticky;
    top: 20px;
    min-height: 650px;
}

.pdf-preview-container {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    height: 100%;
    border: 1px solid rgba(226, 232, 240, 0.1);
}

.pdf-preview-container iframe {
    border-radius: 0;
    background: #0f172a;
    border: none;
    min-height: 650px;
}

/* Badge styles for Order Details - Success badge */
.info-value .badge-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

/* Address Cards Row - Side by Side Layout */
.address-cards-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 24px;
    padding: 0;
}

.address-cards-row .address-card {
    margin-bottom: 0;
}

/* Order Details Responsive */
@media (max-width: 1200px) {
    #orderDetailsPage {
        padding: 20px 24px;
    }

    .order-details-content {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
}

@media (max-width: 992px) {
    #orderDetailsPage {
        padding: 16px 20px;
    }

    .order-details-header {
        padding: 16px 20px;
        border-radius: 12px;
    }

    .order-details-content {
        grid-template-columns: 1fr;
    }

    .order-details-right {
        position: static;
        min-height: auto;
    }

    .pdf-preview-container iframe {
        height: 500px !important;
        min-height: 500px;
    }

    .address-cards-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

@media (max-width: 600px) {
    #orderDetailsPage {
        padding: 12px 16px;
    }

    .order-details-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px 20px;
    }

    .order-details-header h2 {
        font-size: 18px;
    }

    .order-detail-actions {
        flex-direction: column;
        padding: 16px 20px;
    }

    .order-detail-actions .btn-outline {
        width: 100%;
        justify-content: center;
    }

    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 14px 20px;
    }

    .info-label {
        min-width: auto;
    }

    .info-value {
        text-align: left;
    }

    .order-info-card, .address-card {
        border-radius: 12px;
    }
}

/* ==================== DATA PREVIEW TABLE ==================== */
#dataPreviewSection {
    margin-top: 24px;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    border: 1px solid var(--slate-200);
}

.preview-header {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
    padding: 16px 20px;
    border-bottom: none;
}

.preview-total {
    display: flex;
    align-items: center;
    gap: 10px;
}

.preview-icon {
    font-size: 20px;
    filter: brightness(0) invert(1);
}

.preview-total-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.preview-total-text strong {
    color: #a5f3fc;
    font-weight: 700;
    font-size: 16px;
}

.preview-table-container {
    overflow-x: auto;
    max-height: 450px;
    overflow-y: auto;
    border: none;
    border-radius: 0;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.preview-table thead {
    background: linear-gradient(135deg, var(--slate-800) 0%, var(--slate-900) 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: none;
}

.preview-table th {
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(255, 255, 255, 0.9);
}

.preview-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.1s;
}

.preview-table tbody tr:hover {
    background: #f8fafc;
}

.preview-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.preview-table tbody tr:nth-child(even):hover {
    background: #f1f5f9;
}

.preview-table td {
    padding: 8px 12px;
    color: #334155;
    vertical-align: middle;
}

.preview-table td:first-child {
    font-weight: 500;
    color: #94a3b8;
    text-align: center;
    width: 40px;
}

.preview-table .error-cell {
    color: #dc2626;
    font-weight: 500;
}

.preview-table .error-cell:empty::after {
    content: '-';
    color: #cbd5e1;
}

.preview-table .label-type-cell {
    color: #3b82f6;
    font-weight: 500;
}

.preview-table .tracking-series-cell {
    font-family: 'SF Mono', Monaco, monospace;
    background: #eff6ff;
    padding: 2px 6px;
    border-radius: 3px;
    color: #2563eb;
    font-size: 11px;
}

.preview-table .weight-cell {
    text-align: center;
    font-weight: 500;
}

/* Row with error */
.preview-table tbody tr.has-error {
    background: #fef2f2;
}

.preview-table tbody tr.has-error:hover {
    background: #fee2e2;
}

/* ==================== TOAST NOTIFICATION ==================== */
.toast-notification {
    position: absolute;
    background: #10b981;
    color: white;
    padding: 8px 14px 8px 10px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
    z-index: 10000;
    transform: translateY(10px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.25s ease;
    pointer-events: none;
    white-space: nowrap;
    font-size: 13px;
}

.toast-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-notification.hide {
    transform: translateY(-10px);
    opacity: 0;
}

.toast-icon {
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-icon svg {
    width: 11px;
    height: 11px;
    stroke: #10b981;
    stroke-width: 3;
    fill: none;
}

.toast-icon svg .checkmark {
    stroke-dasharray: 20;
    stroke-dashoffset: 20;
    animation: checkmark-draw 0.3s ease forwards 0.15s;
}

@keyframes checkmark-draw {
    to {
        stroke-dashoffset: 0;
    }
}

.toast-message {
    font-size: 13px;
    font-weight: 500;
}

/* ==================== BATCHES PAGE ==================== */
.batches-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    padding: 20px 30px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.batches-page-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.batches-breadcrumb {
    font-size: 13px;
    color: #64748b;
}

.batches-breadcrumb a {
    color: #3b82f6;
    text-decoration: none;
}

.batches-breadcrumb a:hover {
    text-decoration: underline;
}

/* Stats Cards Row */
.batches-stats-row {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.batch-stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    padding: 20px 28px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border-left: 4px solid #e2e8f0;
    transition: all 0.2s ease;
}

.batch-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Total - Blue */
.batch-stat-card.stat-total {
    border-left-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
}
.batch-stat-card.stat-total .stat-number {
    color: #2563eb;
}

/* Done/Success - Green */
.batch-stat-card.stat-done {
    border-left-color: #22c55e;
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
}
.batch-stat-card.stat-done .stat-number {
    color: #16a34a;
}

/* Processing - Amber/Orange */
.batch-stat-card.stat-processing {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%);
}
.batch-stat-card.stat-processing .stat-number {
    color: #d97706;
}

/* Fail - Red */
.batch-stat-card.stat-fail {
    border-left-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2 0%, #ffffff 100%);
}
.batch-stat-card.stat-fail .stat-number {
    color: #dc2626;
}

/* Merging - Purple */
.batch-stat-card.stat-merging {
    border-left-color: #8b5cf6;
    background: linear-gradient(135deg, #f5f3ff 0%, #ffffff 100%);
}
.batch-stat-card.stat-merging .stat-number {
    color: #7c3aed;
}

.batch-stat-card .stat-number {
    font-size: 36px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
}

.batch-stat-card .stat-label {
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    margin-top: 8px;
    text-transform: capitalize;
}

/* Action Row */
.batches-action-row {
    margin-bottom: 20px;
}

.btn-merge-batches {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    transition: all 0.2s ease;
}

.btn-merge-batches:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
    transform: translateY(-1px);
}

.btn-merge-batches:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-merge-batches svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
}

/* Section Title */
.batches-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 12px;
}

/* Batches Table */
.batches-table-container {
    background: white;
    border-radius: 8px;
    overflow: visible;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    width: 100%;
}

.batches-table-container .batches-table-header {
    border-radius: 8px 8px 0 0;
}

.batches-table-header {
    display: grid;
    grid-template-columns: 50px 50px minmax(200px, 1.5fr) 100px 120px 100px 80px 80px minmax(160px, 1fr) minmax(180px, 1fr) minmax(200px, 1fr);
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 40%, #0f3460 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 14px;
    padding: 16px 24px;
    gap: 16px;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.4);
    letter-spacing: 0.5px;
}

.batches-table-header > div {
    display: flex;
    align-items: center;
}

/* Batches page rows - uses grid to match batches-table-header */
.batches-table-container .batch-row {
    display: grid;
    grid-template-columns: 50px 50px minmax(200px, 1.5fr) 100px 120px 100px 80px 80px minmax(160px, 1fr) minmax(180px, 1fr) minmax(200px, 1fr);
    padding: 18px 24px;
    gap: 16px;
    border-bottom: 1px solid #f1f5f9;
    align-items: center;
    font-size: 14px;
    transition: background 0.15s;
}

.batches-table-container .batch-row:hover {
    background: #f8fafc;
}

/* Latest Batch Highlight - Professional yellow/gold */
.batch-row.latest-batch {
    background: #fef3c7;
    border-left: 5px solid #f59e0b;
    position: relative;
}

.batch-row.latest-batch:hover {
    background: #fde68a;
}

/* NEW Badge - inline next to label type */
.batch-row.latest-batch .col-type {
    position: relative;
}

.new-badge {
    display: inline-block;
    background: #22c55e;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    margin-left: 8px;
    vertical-align: middle;
}

.batch-row .col-check input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.batch-row .col-num {
    color: #64748b;
    font-weight: 600;
    font-size: 14px;
}

.batch-row .col-type {
    color: #1e293b;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.batch-row .col-pending,
.batch-row .col-processing,
.batch-row .col-success,
.batch-row .col-fail,
.batch-row .col-total {
    text-align: center;
    font-size: 15px;
    font-weight: 600;
}

/* Tracking Status Badges */
.tracking-status-badges {
    display: flex;
    gap: 8px;
}

.tracking-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    color: white;
}

.tracking-badge.success {
    background: #3b82f6;
}

.tracking-badge.pending {
    background: #22c55e;
}

.tracking-badge.failed {
    background: #ef4444;
}

/* Added Date */
.batch-row .col-added {
    color: #475569;
    font-size: 13px;
    font-weight: 500;
}

/* Action Buttons */
.batch-actions {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    overflow: visible;
}

/* Ensure tooltip shows above row */
.batches-table-container .batch-row {
    overflow: visible;
}

.batches-table-container .batch-row .col-actions {
    overflow: visible;
}

.batch-action-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
    padding: 2px;
    border-radius: 4px;
    flex-shrink: 0;
}

.batch-action-btn svg {
    width: 18px;
    height: 18px;
}

.batch-action-btn:hover {
    transform: scale(1.15);
    background: rgba(0,0,0,0.05);
}

.batch-action-btn:active {
    transform: scale(1);
}

.batch-action-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.batch-action-btn:disabled:hover {
    transform: none;
    background: transparent;
}

/* Professional Tooltip for batch buttons */
.batch-action-btn[data-tooltip] {
    position: relative;
}

.batch-action-btn[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 14px;
    background: #1e293b;
    color: white;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 6px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.15s ease;
    z-index: 99999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    pointer-events: none;
}

.batch-action-btn[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e293b;
    opacity: 0;
    visibility: hidden;
    transition: all 0.15s ease;
    z-index: 99999;
    pointer-events: none;
}

.batch-action-btn[data-tooltip]:hover::before,
.batch-action-btn[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

.batch-action-btn[data-tooltip]:disabled::before,
.batch-action-btn[data-tooltip]:disabled::after {
    display: none;
}

/* View Button - Blue icon */
.batch-action-btn.view {
    color: #3b82f6;
}

.batch-action-btn.view:hover {
    color: #1d4ed8;
    background: rgba(59, 130, 246, 0.1);
}

/* PDF Button - Red icon */
.batch-action-btn.pdf {
    color: #ef4444;
}

.batch-action-btn.pdf:hover {
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.1);
}

/* Excel/XLSX Button - Green icon (Microsoft Excel color) */
.batch-action-btn.xlsx,
.batch-action-btn.csv {
    color: #217346;
}

.batch-action-btn.xlsx:hover,
.batch-action-btn.csv:hover {
    color: #0f4229;
    background: rgba(33, 115, 70, 0.1);
}

/* ZIP Button - Orange/Gold icon */
.batch-action-btn.zip {
    color: #d97706;
}

.batch-action-btn.zip:hover {
    color: #b45309;
    background: rgba(217, 119, 6, 0.1);
}

/* Track Button - Green icon */
.batch-action-btn.track {
    color: #16a34a;
}

.batch-action-btn.track:hover {
    color: #15803d;
    background: rgba(22, 163, 74, 0.1);
}

.batch-action-btn img,
.batch-action-btn svg {
    width: 24px;
    height: 24px;
}

/* Processing Animation */
.batch-row.processing {
    background: linear-gradient(90deg, #f0f9ff 0%, #e0f2fe 50%, #f0f9ff 100%);
    background-size: 200% 100%;
    animation: processing-shimmer 1.5s ease-in-out infinite;
}

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

/* ==================== HOME PAGE ==================== */
#homePage {
    padding: 30px 32px;
    position: relative;
    min-height: calc(100vh - 60px);
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

/* Animated Background Pattern */
#homePage::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(16, 185, 129, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(139, 92, 246, 0.03) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

#homePage > * {
    position: relative;
    z-index: 1;
}

/* Welcome Section */
.home-welcome-section {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d4a6f 50%, #3d5a80 100%);
    border-radius: 20px;
    padding: 40px 44px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 10px 40px rgba(30, 58, 95, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.1);
}

.home-welcome-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 60%);
    transform: rotate(-15deg);
    pointer-events: none;
}

.home-welcome-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 40%;
    height: 150%;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 60%);
    pointer-events: none;
}

.welcome-content {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.welcome-text h1 {
    font-size: 36px;
    font-weight: 800;
    color: white;
    margin: 0 0 10px 0;
    letter-spacing: -0.5px;
}

.welcome-text p {
    font-size: 17px;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    font-weight: 400;
    line-height: 1.6;
}

.welcome-icon {
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    animation: float 3s ease-in-out infinite;
}

.welcome-icon svg {
    width: 60px;
    height: 60px;
    color: white;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.home-page-header {
    margin-bottom: 28px;
}

.home-page-header h2 {
    margin: 0 0 5px 0;
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
}

.home-breadcrumb {
    color: #64748b;
    font-size: 14px;
}

/* Stats Grid - 3 cards in a row */
.home-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 28px;
}

/* Individual Stat Card - Modern Glassmorphism Design */
.home-stat-card {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #4facfe 100%);
    border-radius: 20px;
    padding: 32px 32px 24px 32px;
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 180px;
    overflow: hidden;
    box-shadow:
        0 10px 40px rgba(30, 60, 114, 0.25),
        0 4px 12px rgba(30, 60, 114, 0.15);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Decorative circles on cards */
.home-stat-card::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 180px;
    height: 180px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    pointer-events: none;
}

.home-stat-card::after {
    content: '';
    position: absolute;
    bottom: -50%;
    left: -20%;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    pointer-events: none;
}

.home-stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        0 20px 50px rgba(30, 60, 114, 0.35),
        0 8px 20px rgba(30, 60, 114, 0.2);
}

/* Stat Left Content */
.home-stat-card .stat-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    z-index: 2;
}

.home-stat-card .stat-number {
    font-size: 56px;
    font-weight: 800;
    color: white;
    line-height: 1;
    margin-bottom: 8px;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    letter-spacing: -2px;
}

.home-stat-card .stat-label {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* Stat Icon - positioned right - MORE VISIBLE */
.home-stat-card .stat-icon {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    width: 90px;
    height: 90px;
    color: rgba(255, 255, 255, 0.25);
    z-index: 1;
    transition: all 0.4s ease;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 18px;
    backdrop-filter: blur(5px);
}

.home-stat-card:hover .stat-icon {
    color: rgba(255, 255, 255, 0.4);
    transform: translateY(-50%) scale(1.1) rotate(5deg);
    background: rgba(255, 255, 255, 0.15);
}

.home-stat-card .stat-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

/* More Info Link - IMPROVED */
.home-stat-card .stat-more-info {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
}

.home-stat-card .stat-more-info:hover {
    color: white;
    gap: 14px;
}

.home-stat-card .stat-more-info span {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.home-stat-card .stat-more-info:hover span {
    transform: translateX(5px);
}

/* Card Color Variations - Unique gradients */
.home-stat-card.stat-today {
    background: linear-gradient(135deg, #1a237e 0%, #303f9f 40%, #5c6bc0 100%);
}

.home-stat-card.stat-yesterday {
    background: linear-gradient(135deg, #0d47a1 0%, #1976d2 40%, #42a5f5 100%);
}

.home-stat-card.stat-total {
    background: linear-gradient(135deg, #004d40 0%, #00796b 40%, #26a69a 100%);
}

/* Quick Actions Section */
.home-quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.quick-action-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    color: inherit;
}

.quick-action-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-color: #3b82f6;
}

.quick-action-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    transition: all 0.3s ease;
}

.quick-action-card:hover .quick-action-icon {
    transform: scale(1.1);
}

.quick-action-icon svg {
    width: 28px;
    height: 28px;
    color: white;
}

.quick-action-icon.bulk { background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%); }
.quick-action-icon.single { background: linear-gradient(135deg, #10b981 0%, #34d399 100%); }
.quick-action-icon.orders { background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%); }
.quick-action-icon.batches { background: linear-gradient(135deg, #ef4444 0%, #f87171 100%); }

.quick-action-card h4 {
    margin: 0 0 6px 0;
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
}

.quick-action-card p {
    margin: 0;
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
}

/* Date Time Card - Full Width - IMPROVED */
.home-datetime-card {
    background: linear-gradient(135deg, #06b6d4 0%, #22d3ee 50%, #67e8f9 100%);
    border-radius: 20px;
    padding: 36px 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 10px 40px rgba(6, 182, 212, 0.3),
        0 4px 12px rgba(6, 182, 212, 0.15);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.home-datetime-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    pointer-events: none;
}

.home-datetime-card:hover {
    transform: translateY(-3px);
    box-shadow:
        0 15px 50px rgba(6, 182, 212, 0.4),
        0 8px 20px rgba(6, 182, 212, 0.2);
}

.home-datetime-card .datetime-left {
    display: flex;
    flex-direction: column;
    z-index: 2;
}

.home-datetime-card .datetime-value {
    font-size: 44px;
    font-weight: 800;
    color: white;
    line-height: 1.2;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    margin-bottom: 6px;
    letter-spacing: -1px;
}

.home-datetime-card .datetime-label {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.home-datetime-card .datetime-icon {
    width: 110px;
    height: 110px;
    color: rgba(255, 255, 255, 0.3);
    z-index: 1;
    animation: pulse-clock 2s ease-in-out infinite;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.home-datetime-card .datetime-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
}

/* Clock pulse animation */
@keyframes pulse-clock {
    0%, 100% {
        transform: scale(1);
        opacity: 0.9;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 1200px) {
    .home-quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .home-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .home-stat-card .stat-number {
        font-size: 48px;
    }

    .welcome-text h1 {
        font-size: 30px;
    }

    .welcome-icon {
        width: 100px;
        height: 100px;
    }

    .welcome-icon svg {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 768px) {
    #homePage {
        padding: 20px;
    }

    .home-stats-grid {
        grid-template-columns: 1fr;
    }

    .home-stat-card {
        min-height: 150px;
        padding: 24px;
    }

    .home-stat-card .stat-number {
        font-size: 42px;
    }

    .home-stat-card .stat-icon {
        width: 70px;
        height: 70px;
        padding: 14px;
    }

    .home-datetime-card {
        padding: 28px 32px;
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .home-datetime-card .datetime-value {
        font-size: 32px;
    }

    .home-datetime-card .datetime-icon {
        width: 80px;
        height: 80px;
    }

    .home-welcome-section {
        padding: 28px;
    }

    .welcome-content {
        flex-direction: column;
        text-align: center;
        gap: 24px;
    }

    .welcome-text h1 {
        font-size: 26px;
    }

    .welcome-icon {
        width: 90px;
        height: 90px;
    }

    .home-quick-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .quick-action-card {
        padding: 18px;
    }

    .quick-action-icon {
        width: 48px;
        height: 48px;
    }

    .quick-action-icon svg {
        width: 24px;
        height: 24px;
    }
}

/* ==================== RETRY BUTTON & FAILED LABELS ==================== */

/* Retry button in batch actions */
.batch-action-btn.retry {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
}

.batch-action-btn.retry:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
}

.batch-action-btn.retry svg {
    width: 14px;
    height: 14px;
}

.batch-action-btn.retry .retry-count {
    background: rgba(255,255,255,0.3);
    padding: 1px 5px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
}

/* Failed Labels Section in Dashboard */
.failed-labels-section {
    margin-top: 20px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    overflow: hidden;
}

.failed-labels-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-bottom: 1px solid #fecaca;
}

.failed-labels-header h3 {
    color: #991b1b;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.retry-all-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.retry-all-btn:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
}

.retry-all-btn svg {
    width: 14px;
    height: 14px;
}

.failed-labels-list {
    max-height: 300px;
    overflow-y: auto;
}

.failed-label-row {
    display: grid;
    grid-template-columns: 50px 1fr 1.5fr 80px 70px;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid #fecaca;
    gap: 12px;
    transition: background 0.15s;
}

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

.failed-label-row:hover {
    background: #fee2e2;
}

.failed-label-row.retrying {
    opacity: 0.6;
    pointer-events: none;
}

.failed-label-num {
    font-weight: 700;
    color: #991b1b;
    font-size: 13px;
}

.failed-label-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.failed-label-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 13px;
}

.failed-label-address {
    color: #6b7280;
    font-size: 11px;
}

.failed-label-error {
    color: #dc2626;
    font-size: 11px;
    background: rgba(220, 38, 38, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.failed-label-retry-count {
    color: #6b7280;
    font-size: 11px;
    text-align: center;
}

.failed-label-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.failed-label-actions .action-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-retry-single {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.btn-retry-single:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.btn-edit-failed {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.btn-edit-failed:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

/* Responsive for failed labels */
@media (max-width: 768px) {
    .failed-label-row {
        grid-template-columns: 40px 1fr 60px;
    }

    .failed-label-error,
    .failed-label-retry-count {
        display: none;
    }
}

/* ==================== TOAST NOTIFICATIONS ==================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 12px;
    background: white;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.05);
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 320px;
    max-width: 450px;
    pointer-events: auto;
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    border-left: 4px solid #10b981;
}

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

.toast-error {
    border-left: 4px solid #ef4444;
}

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

.toast-warning {
    border-left: 4px solid #f59e0b;
}

.toast-warning .toast-icon {
    color: #f59e0b;
}

.toast-info {
    border-left: 4px solid #3b82f6;
}

.toast-info .toast-icon {
    color: #3b82f6;
}

.toast-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
}

.toast-icon svg {
    width: 100%;
    height: 100%;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    color: #334155;
    font-weight: 500;
    line-height: 1.4;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    width: 24px;
    height: 24px;
    padding: 4px;
    cursor: pointer;
    color: #94a3b8;
    border-radius: 6px;
    transition: all 0.15s;
}

.toast-close:hover {
    background: #f1f5f9;
    color: #475569;
}

.toast-close svg {
    width: 100%;
    height: 100%;
}

/* ==================== CUSTOM MODAL ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
}

.modal-dialog {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.modal-overlay.show .modal-dialog {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 24px 24px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.modal-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.modal-icon svg {
    width: 24px;
    height: 24px;
}

.modal-default .modal-icon {
    background: #e0f2fe;
    color: #0284c7;
}

.modal-warning .modal-icon {
    background: #fef3c7;
    color: #d97706;
}

.modal-danger .modal-icon {
    background: #fee2e2;
    color: #dc2626;
}

.modal-info .modal-icon {
    background: #e0f2fe;
    color: #0284c7;
}

.modal-success .modal-icon {
    background: #d1fae5;
    color: #059669;
}

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

.modal-body {
    padding: 0 24px 24px;
}

.modal-body p {
    margin: 0;
    color: #64748b;
    line-height: 1.6;
    font-size: 14px;
}

.modal-footer {
    padding: 16px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.modal-footer .btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
}

.modal-footer .btn-secondary {
    background: white;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.modal-footer .btn-secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.modal-footer .btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.modal-footer .btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.modal-danger .modal-footer .btn-primary {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.modal-danger .modal-footer .btn-primary:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* ==================== SKELETON LOADERS ==================== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 6px;
}

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

.skeleton-row {
    height: 52px;
    margin-bottom: 8px;
    border-radius: 8px;
}

.skeleton-card {
    height: 120px;
    border-radius: 12px;
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-text.medium {
    width: 80%;
}

/* Skeleton for orders table */
.orders-skeleton {
    padding: 16px;
}

.orders-skeleton .skeleton-row {
    display: grid;
    grid-template-columns: 40px 60px 1fr 1fr 200px 80px 120px 120px;
    gap: 12px;
    align-items: center;
    background: #fafafa;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.orders-skeleton .skeleton-cell {
    height: 16px;
    border-radius: 4px;
}

/* Skeleton elements for tables */
.skeleton-row td {
    padding: 12px 8px;
}

.skeleton-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 4px;
}

.skeleton-text {
    width: 80%;
    height: 14px;
    min-height: 14px;
}

.skeleton-text-short {
    width: 50%;
    height: 14px;
    min-height: 14px;
}

.skeleton-actions {
    width: 100px;
    height: 28px;
    border-radius: 6px;
}

/* Skeleton for batch rows */
.skeleton-batch-row {
    opacity: 0.7;
}

.skeleton-batch-row .skeleton {
    margin: auto;
}

/* ==================== BUTTON LOADING STATE ==================== */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.85;
}

.btn-loading .btn-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: btn-spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

.btn-loading span {
    vertical-align: middle;
}

/* Generate Label button specific */
#generateSingleBtn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

#generateSingleBtn.btn-loading {
    background: linear-gradient(135deg, #3d6b4f 0%, #2d5a3f 100%);
}

/* ==================== FORM VALIDATION STYLES ==================== */
.form-group {
    position: relative;
    margin-bottom: 16px;
}

.form-group input.error,
.form-group select.error,
.form-group textarea.error {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-group input.error:focus,
.form-group select.error:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.form-group input.valid,
.form-group select.valid {
    border-color: #10b981 !important;
    background-color: #f0fdf4 !important;
}

.error-message {
    color: #ef4444;
    font-size: 12px;
    margin-top: 4px;
    display: none;
    align-items: center;
    gap: 4px;
}

.error-message::before {
    content: '';
    width: 12px;
    height: 12px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ef4444' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='15' y1='9' x2='9' y2='15'/%3E%3Cline x1='9' y1='9' x2='15' y2='15'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
}

.form-group input.error ~ .error-message,
.form-group select.error ~ .error-message {
    display: flex;
}

/* Responsive toast */
@media (max-width: 480px) {
    .toast-container {
        left: 16px;
        right: 16px;
    }

    .toast {
        min-width: auto;
        max-width: none;
    }

    .modal-dialog {
        width: 95%;
        margin: 16px;
    }
}

/* ==================== API PAGE STYLES ==================== */
#apiPage {
    display: none;
}

.api-endpoint {
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.api-endpoint h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.endpoint-url {
    font-family: 'Courier New', Consolas, monospace;
    font-size: 14px;
    background: #e9ecef;
    padding: 8px 12px;
    border-radius: 4px;
    display: inline-block;
    color: #2563eb;
}

.api-section {
    margin-bottom: 25px;
}

.api-section h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.api-section ul {
    margin: 10px 0;
    padding-left: 20px;
}

.api-section li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.api-section code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 12px;
}

.code-block {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 400px;
}

.copy-btn {
    margin-top: 10px;
    padding: 8px 16px;
    font-size: 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: #e9ecef;
}

.api-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.api-table th,
.api-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.api-table th {
    background: #f8f9fa;
    font-weight: 600;
}

.api-table tbody tr:hover {
    background: #f8f9fa;
}

/* Label Types Table */
.label-types-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-top: 15px;
}

.label-types-table th,
.label-types-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.label-types-table th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    color: #6c757d;
}

.label-types-table tbody tr:hover {
    background: #f8f9fa;
}

.label-type-id {
    background: #e8f4fd;
    color: #1a73e8;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
}

.section-description {
    color: #6c757d;
    font-size: 14px;
    margin-bottom: 15px;
}

.api-keys-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.api-keys-table th,
.api-keys-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.api-keys-table th {
    background: #f8f9fa;
    font-weight: 600;
}

.api-keys-table tbody tr:hover {
    background: #f8f9fa;
}

.api-keys-table code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    font-family: 'Courier New', Consolas, monospace;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-revoked {
    background: #f8d7da;
    color: #721c24;
}

/* ==================== API AUTHENTICATION STYLES ==================== */
.auth-section-header {
    border-left: 4px solid #3b82f6;
    padding-left: 12px;
    margin-bottom: 16px;
}

.auth-section-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.auth-description {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 16px;
}

.api-key-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.api-key-display-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.api-key-value {
    flex: 1;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 14px;
    color: #1e293b;
    word-break: break-all;
    background: transparent;
    padding: 0;
}

.copy-key-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.copy-key-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
}

.copy-key-btn svg {
    width: 16px;
    height: 16px;
}

.btn-renew {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 20px;
}

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

.btn-renew svg {
    width: 16px;
    height: 16px;
}

.auth-note {
    color: #64748b;
    font-size: 14px;
    margin: 0;
}

.header-format {
    background: #fce7f3;
    color: #be185d;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 13px;
}

/* Legacy styles kept for compatibility */
.api-note {
    margin-top: 15px;
    padding: 12px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
    font-size: 13px;
    color: #856404;
}

.empty-state,
.error-state {
    padding: 30px;
    text-align: center;
    background: #f8f9fa;
    border-radius: 8px;
}

.empty-state p,
.error-state p {
    margin: 0 0 5px 0;
}

.help-text {
    color: #6c757d;
    font-size: 13px;
    margin-top: 5px;
}

.loading-text {
    color: #6c757d;
    font-style: italic;
}

.error-text {
    color: #dc3545;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ==================== NEW API PAGE STYLES (Reference Portal Style) ==================== */
.api-page-container {
    display: flex;
    min-height: calc(100vh - 60px);
    background: #fff;
    margin: -20px -20px -20px -20px;
}

/* API Sidebar - Sticky with Dark Theme */
.api-sidebar {
    width: 220px;
    background: #1e2328;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.api-nav {
    padding: 20px 0;
}

.api-nav-item {
    display: block;
    padding: 12px 24px;
    color: #8b949e;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease;
    cursor: pointer;
    border-left: 3px solid transparent;
}

.api-nav-item:hover {
    color: #fff;
    background: rgba(255,255,255,0.05);
}

.api-nav-item.active {
    color: #fff;
    background: #4f46e5;
    border-left-color: #818cf8;
}

/* API Content Area - Scrollable */
.api-content {
    flex: 1;
    padding: 40px 50px;
    overflow-y: auto;
    max-height: 100vh;
    background: #fafbfc;
}

/* All sections visible (scroll-based navigation) */
.api-section {
    margin-bottom: 60px;
    padding-bottom: 40px;
    border-bottom: 1px solid #e5e7eb;
}

.api-section:last-child {
    border-bottom: none;
    margin-bottom: 40px;
}

.api-section h2 {
    margin: 0 0 12px 0;
    font-size: 26px;
    font-weight: 600;
    color: #1f2937;
}

.api-description {
    color: #6b7280;
    font-size: 15px;
    margin-bottom: 28px;
    line-height: 1.6;
    max-width: 700px;
}

/* API Labels */
.api-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* API Key Section */
.api-key-section {
    margin-bottom: 28px;
}

/* API Endpoint Section */
.api-endpoint-section {
    margin: 28px 0;
}

/* API Errors Section */
.api-errors-section {
    margin-top: 32px;
}

.api-errors-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 16px 0;
}

/* API Input Row */
.api-input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.api-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    background: #fff;
    color: #1f2937;
}

.api-input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

/* API Copy Button - Simple Style */
.api-copy-btn {
    padding: 10px 16px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.api-copy-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

/* API Renew Button */
.api-renew-btn {
    display: inline-block;
    padding: 10px 20px;
    background: #ef4444;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-top: 12px;
}

.api-renew-btn:hover {
    background: #dc2626;
}

/* API Info Box */
.api-info-box {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    padding: 14px 18px;
    margin-bottom: 28px;
}

.api-info-box strong {
    color: #0369a1;
    font-size: 13px;
}

.api-code-inline {
    display: inline-block;
    background: #fff;
    border: 1px solid #bae6fd;
    border-radius: 4px;
    padding: 4px 10px;
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    color: #0369a1;
    margin-left: 8px;
}

/* API Code Block (Dark Theme - Professional) */
.api-code-block {
    background: #1e2328;
    border-radius: 8px;
    overflow: hidden;
    margin: 16px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.api-code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: #282d34;
    border-bottom: 1px solid #383d46;
}

.api-code-header span {
    font-size: 11px;
    font-weight: 600;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.api-code-copy-btn {
    padding: 5px 12px;
    background: transparent;
    border: 1px solid #484f58;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    color: #8b949e;
    cursor: pointer;
    transition: all 0.15s ease;
}

.api-code-copy-btn:hover {
    background: #383d46;
    border-color: #6e7681;
    color: #c9d1d9;
}

.api-code-block pre {
    margin: 0;
    padding: 18px 20px;
    font-family: 'SF Mono', 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.7;
    color: #c9d1d9;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* API Label Types Table */
.api-label-types-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.api-label-types-table th,
.api-label-types-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.api-label-types-table th {
    background: #f9fafb;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.api-label-types-table tbody tr:hover {
    background: #f9fafb;
}

.api-label-types-table tbody tr:last-child td {
    border-bottom: none;
}

.api-label-id {
    display: inline-block;
    background: #eef2ff;
    color: #4f46e5;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    font-weight: 600;
}

/* API Errors Table */
.api-errors-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.api-errors-table th,
.api-errors-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    font-size: 13px;
}

.api-errors-table th {
    background: #f9fafb;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
}

.api-errors-table td code {
    background: #fef2f2;
    color: #dc2626;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

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

/* API Empty State */
.api-empty-state {
    padding: 40px;
    text-align: center;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.api-empty-state p {
    margin: 0 0 8px 0;
    color: #374151;
}

.api-help-text {
    color: #6b7280;
    font-size: 14px;
}

.api-loading {
    color: #6b7280;
    font-style: italic;
}

.api-error {
    color: #dc2626;
}

/* API Copy Toast */
.api-copy-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1f2937;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.api-copy-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Responsive API Page */
@media (max-width: 900px) {
    .api-page-container {
        flex-direction: column;
    }

    .api-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        overflow-x: auto;
    }

    .api-nav {
        display: flex;
        padding: 0;
        white-space: nowrap;
    }

    .api-nav-item {
        padding: 14px 20px;
        border-left: none;
        border-bottom: 3px solid transparent;
    }

    .api-nav-item.active {
        border-left: none;
        border-bottom-color: #818cf8;
    }

    .api-content {
        padding: 24px 20px;
        max-height: none;
    }

    .api-section {
        margin-bottom: 40px;
        padding-bottom: 30px;
    }

    .api-section h2 {
        font-size: 22px;
    }
}
