/* Global Styles */
body {
    background-color: #f4f6f9;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #333;
    margin: 0;
}

/* App Layout */
.app-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Sidebar Styles - Modern (Dark) */
.sidebar-column {
    background: #2c3e50;
    min-height: 100vh;
    color: #ecf0f1;
    width: 250px;
    flex-shrink: 0;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    position: relative;
}

.sidebar-column.collapsed {
    width: 60px;
}

.sidebar-column.collapsed .sidebar-title,
.sidebar-column.collapsed .sidebar-links,
.sidebar-column.collapsed .sidebar-header-pc span,
.sidebar-column.collapsed .btn-sidebar-toggle-pc {
    display: none !important;
    opacity: 0;
}

.sidebar-column.collapsed .sidebar-header-pc {
    justify-content: center;
    padding: 10px 0;
}

/* Legacy Sidebar Container - Adapted */
.sidebar-container {
    width: 100%;
    background-color: transparent;
    border-right: none;
    min-height: auto;
    padding: 20px 10px 10px 10px;
    z-index: 1000;
}

.sidebar-group {
    margin-bottom: 15px;
}

.sidebar-title {
    font-weight: bold;
    color: #bdc3c7;
    padding: 8px 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    margin-bottom: 5px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: background-color 0.2s;
}

.sidebar-title:hover {
    background-color: rgba(255,255,255,0.2);
    color: #fff;
}

.sidebar-title::after {
    content: '▼';
    font-size: 10px;
    transition: transform 0.3s;
}

.sidebar-group.collapsed .sidebar-title::after {
    transform: rotate(-90deg);
}

.sidebar-links {
    transition: max-height 0.3s ease-out;
    overflow: hidden;
}

.sidebar-group.collapsed .sidebar-links {
    display: none;
}

.sidebar-link {
    display: block;
    padding: 8px 10px;
    color: #bdc3c7;
    text-decoration: none;
    border-radius: 4px;
    margin-bottom: 2px;
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background-color: #34495e;
    color: #fff;
    text-decoration: none;
    border-left-color: #3498db;
}

.sidebar-link.active {
    background-color: #34495e;
    color: #fff;
    border-left-color: #3498db;
    font-weight: 500;
}

/* PC Sidebar Header & Toggle */
.sidebar-header-pc {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    margin-bottom: 15px;
    border-bottom: 1px solid #34495e;
}

.sidebar-header-pc span {
    color: #ecf0f1 !important;
}

.btn-sidebar-toggle-pc {
    background: transparent;
    border: 1px solid #4a6278;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    color: #bdc3c7;
    padding: 4px 8px;
    transition: all 0.2s;
}

.btn-sidebar-toggle-pc:hover {
    background-color: #34495e;
    color: #fff;
    border-color: #3498db;
}

/* Floating expand button for PC */
.btn-sidebar-expand-pc {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: #3498db;
    color: white;
    border: none;
    border-radius: 0 6px 6px 0;
    padding: 15px 6px;
    cursor: pointer;
    z-index: 999;
    display: none;
    box-shadow: 2px 0 8px rgba(0,0,0,0.15);
    font-size: 13px;
    line-height: 1.4;
    transition: background-color 0.2s, padding 0.2s;
}

.sidebar-column.collapsed .btn-sidebar-expand-pc {
    display: block;
}

/* Main Column */
.main-column {
    padding: 20px;
    flex-grow: 1;
    min-width: 0;
    transition: all 0.3s ease;
    background-color: #f4f6f9;
}

/* Mobile Header */
.mobile-header {
    display: none;
    padding: 10px 15px;
    background: #fff;
    border-bottom: 1px solid #ddd;
    margin-bottom: 15px;
    align-items: center;
    justify-content: space-between;
}

.btn-toggle-sidebar {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 5px 12px;
    font-size: 16px;
    cursor: pointer;
    color: #333;
}

/* Responsive */
@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }
    
    /* Mobile Layout Fixes */
    .main-column {
        padding: 0 !important;
    }
    
    .main-content-inner > .mobile-header {
        margin: 0 0 10px 0;
        border-left: none;
        border-right: none;
        border-top: none;
        border-radius: 0;
    }
    
    .main-content-inner > *:not(.mobile-header) {
        margin-left: 10px;
        margin-right: 10px;
    }
    
    .sidebar-column {
        position: fixed;
        z-index: 1000;
        top: 0;
        left: 0;
        height: 100vh;
        width: 250px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar-column.active {
        transform: translateX(0);
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
    }
    
    .sidebar-header-pc, .btn-sidebar-expand-pc {
        display: none !important;
    }
    
    /* Overlay */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    
    .sidebar-column.active + .sidebar-overlay,
    .sidebar-overlay.active {
        display: block;
    }
    
    .sidebar-container {
        padding: 10px;
    }
}

/* Search Panel & Forms */
.search-panel {
    background: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
}

.search-form-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.search-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.form-label {
    font-weight: 600;
    color: #606266;
    margin-right: 5px;
}

.form-input, .form-select {
    padding: 6px 12px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    color: #606266;
    height: 34px;
    background-color: #fff;
}

/* Buttons */
.btn-primary {
    background-color: #409eff;
    color: white;
    border: none;
    padding: 6px 15px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-primary:hover {
    background-color: #66b1ff;
}

.btn-secondary {
    background-color: #fff;
    border: 1px solid #dcdfe6;
    color: #606266;
    padding: 6px 15px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-secondary:hover {
    color: #409eff;
    border-color: #c6e2ff;
    background-color: #ecf5ff;
}

/* Table Styles */
.table-list {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    font-size: 14px;
    border: 1px solid #dee2e6;
}

.table-list th {
    background-color: #f8f9fa;
    color: #495057;
    font-weight: 600;
    padding: 12px 10px;
    text-align: left;
    border-bottom: 2px solid #dee2e6;
}

.table-list td {
    padding: 10px;
    vertical-align: middle;
    border-bottom: 1px solid #dee2e6;
}

/* Status & Row Colors (Legacy) */
.status-warn { color: red; background-color: yellow; padding: 2px 4px; border-radius: 3px; }
.status-ok { color: green; }
.row-header { background-color: #aaaaff !important; }
.row-error { background-color: #FFFF00 !important; }
.row-sent { background-color: #FFaaFF !important; }

/* Utilities */
.hilite { background: #fda; }
.text-nowrap { white-space: nowrap; overflow: hidden; }
.p-0 { padding: 0 !important; }

/* Order List Layout */
.order-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Order Card */
.order-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.order-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.card-header-custom {
    background: #f8f9fa;
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.order-id {
    font-weight: bold;
    color: #2c3e50;
    font-size: 1.1em;
}

.time-info {
    color: #888;
    font-size: 0.9em;
    margin-left: 15px;
}

.card-body-custom {
    padding: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.info-col {
    flex: 1;
    min-width: 250px;
    border-right: 1px solid #f0f0f0;
    padding-right: 15px;
}

.info-col:last-child {
    border-right: none;
}

.info-col h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 14px;
    color: #909399;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.field-row {
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
    font-size: 13px;
    line-height: 1.5;
}

.field-label {
    width: 60px;
    color: #606266;
    flex-shrink: 0;
}

.field-val {
    color: #303133;
    word-break: break-all;
}

/* Logistics Tags */
.wuliu-block {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    color: #fff;
    font-size: 12px;
    margin-right: 5px;
    font-weight: bold;
    text-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

/* Status Tags */
.status-tag {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    border: 1px solid #ddd;
}

.tag-green { background: #e1f3d8; color: #67c23a; border-color: #e1f3d8; }
.tag-blue { background: #ecf5ff; color: #409eff; border-color: #d9ecff; }
.tag-gray { background: #f4f4f5; color: #909399; border-color: #e9e9eb; }

/* Summary Bar */
.summary-bar {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    border-top: 3px solid #409eff;
}

.summary-item {
    background: #f9fafc;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    color: #606266;
    border: 1px solid #ebeef5;
}

.summary-val {
    font-weight: bold;
    color: #303133;
    margin-left: 5px;
}

/* Page Foot */
#div_Page {
    text-align: center;
    padding: 20px 0;
}

